:root {
  color-scheme: light dark;
  --radius: 14px;
  --transition: 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #161616;
  --text: #ededed;
  --muted: #8a8a8a;
  --accent: #d4d4d4;
  --border: rgba(255, 255, 255, 0.08);
  --divider: rgba(255, 255, 255, 0.18);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --line: rgba(255, 255, 255, 0.07);
}

[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #0a0a0a;
  --muted: #666666;
  --accent: #404040;
  --border: rgba(0, 0, 0, 0.08);
  --divider: rgba(0, 0, 0, 0.2);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --line: rgba(0, 0, 0, 0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16.5px;
}

html {
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: transparent;
}

.fog-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1400ms ease;
}
html.name-fog-active .fog-bg {
  opacity: 0.9;
  transition-delay: 200ms;
}

.topnav {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topnav-links {
  list-style: none;
  padding: 0;
  margin: 0 0 0 -14px;
  display: flex;
  gap: 0;
  position: relative;
}
.topnav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  padding: 8px 14px;
  display: inline-block;
  transition: color 180ms ease;
}
.topnav-links a[aria-current="page"] {
  color: var(--text);
}
.topnav-links a:hover {
  color: var(--text);
}
.topnav-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1), width 240ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 150ms ease;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 120px;
}

.reveal {
  opacity: 0;
}
html.animations-ready .reveal {
  animation: fadeIn 900ms ease-out var(--delay, 0ms) forwards;
}
html[data-returning] .topnav.reveal {
  opacity: 1;
  animation: none;
}
.name {
  font-size: clamp(1.875rem, 4.2vw, 2.625rem);
  line-height: normal;
  letter-spacing: -0.022em;
  margin: 0 0 6px;
  font-weight: 600;
  display: inline-block;
  background-image: linear-gradient(to right, #7f36d1 50%, var(--text) 50%);
  background-size: 200% 100%;
  background-position: right;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.4s ease;
}
.name:hover,
.name:focus-visible {
  background-position: left;
}
.tagline {
  color: var(--muted);
  margin: 0 0 16px;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
}
.bio {
  color: var(--text);
  margin: 0 0 22px;
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 58ch;
  letter-spacing: -0.005em;
}
.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.icon-link {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  padding: 0 8px;
  gap: 0;
  overflow: hidden;
  transition: color 180ms ease;
}
.icon-link svg {
  flex: 0 0 auto;
}
.icon-link:hover {
  color: var(--text);
}
.icon-label {
  display: inline-block;
  max-width: 0;
  margin-left: 0;
  transform: translateX(-8px);
  opacity: 0;
  color: var(--text);
  font-size: 0.75rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
  pointer-events: none;
  overflow: hidden;
  transition: max-width 260ms cubic-bezier(0.2, 0.7, 0.2, 1), margin-left 260ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 260ms ease, transform 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.icon-link:hover .icon-label,
.icon-link:focus-visible .icon-label {
  max-width: 72px;
  margin-left: 6px;
  opacity: 1;
  transform: translateX(0);
}
.text-link {
  color: var(--text);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: -0.005em;
}

.experience {
  margin-top: 50px;
}
.experience h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 22px;
}
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 28px 0;
}
.card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.card-main {
  flex: 1;
  min-width: 0;
}
.card-logo-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  flex: 0 0 auto;
}
.card-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(0.9);
  transform-origin: center;
  border-radius: 10px;
  filter: none;
  transition: filter 280ms ease;
}
.card-logo-td {
  object-fit: cover;
  transform: scale(0.9);
}
html.name-fog-active .card-logo {
  filter: grayscale(1);
}
.card-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.card-outline-base,
.card-outline-segment {
  fill: none;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.card-outline-base {
  stroke: var(--border);
}
.card-outline-segment {
  stroke: var(--company-color, var(--text));
  stroke-dasharray: 0 var(--seg-len, 1);
  transition: stroke-dasharray 520ms cubic-bezier(0.22, 1, 0.36, 1);
}
.card:hover .card-outline-segment,
.card:focus-within .card-outline-segment {
  stroke-dasharray: var(--seg-len, 1) var(--seg-len, 1);
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.company {
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 260ms ease;
}
.dates {
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  transition: color 260ms ease;
}
.role {
  margin: 3px 0 6px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8125rem;
  transition: color 260ms ease;
}
.description {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.8125rem;
  transition: color 260ms ease;
}

html.name-fog-active .card:hover .company,
html.name-fog-active .card:focus-within .company,
html.name-fog-active .card:hover .dates,
html.name-fog-active .card:focus-within .dates,
html.name-fog-active .card:hover .role,
html.name-fog-active .card:focus-within .role,
html.name-fog-active .card:hover .description,
html.name-fog-active .card:focus-within .description {
  color: #7f36d1;
}

.bottom-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.bottom-divider::before,
.bottom-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--divider);
}
.bottom-divider span {
  color: var(--muted);
  font-weight: 500;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .icon-sun { display: inline-block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: inline-block; }

@keyframes fadeIn {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .name { transition: none; }
  .card-outline-segment { transition: none; }
  .fog-bg { transition: none; }
}

@media (max-width: 480px) {
  .topnav { padding: 22px 20px 0; }
  .container { padding: 32px 20px 96px; }
  .text-link { padding: 6px 11px; font-size: 0.75rem; }
  .icon-link { width: 34px; height: 34px; }
  .theme-toggle { width: 32px; height: 32px; }
}
