/* ==========================================================================
   Hassam Shah — AI Engineer · shahh19.online
   Design system + layout. Sections:
   1. Fonts  2. Tokens  3. Reset/base  4. Layout primitives  5. Components
   6. Navigation  7. Hero  8. Sections (About → Footer)  9. Motion  10. Utilities
   ========================================================================== */

/* 1. Fonts (self-hosted variable fonts) ----------------------------------- */
@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/geist-latin-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../assets/fonts/geist-mono-latin-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* 2. Design tokens --------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Surfaces */
  --bg-0: #060709;
  --bg-1: #0a0c10;
  --bg-2: #0f1218;
  --surface-1: rgba(255, 255, 255, 0.022);
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-3: rgba(255, 255, 255, 0.07);
  --line-1: rgba(255, 255, 255, 0.065);
  --line-2: rgba(255, 255, 255, 0.11);
  --line-3: rgba(255, 255, 255, 0.18);

  /* Text (all ≥ 4.5:1 on --bg-0 / --bg-2) */
  --text-1: #eceef3;
  --text-2: #a6adbd;
  --text-3: #7f879a;

  /* Accents */
  --blue: #6e8bff;
  --violet: #9b87ff;
  --cyan: #67e3e9;
  --green: #5ee2a0;
  --red: #ff7a85;
  --amber: #f2c46d;
  --grad-accent: linear-gradient(115deg, #86a6ff 0%, #9b87ff 50%, #c3a3ff 100%);
  --grad-line: linear-gradient(90deg, transparent, rgba(110, 139, 255, 0.55), rgba(155, 135, 255, 0.55), transparent);

  /* Glow — kept low on purpose */
  --glow-1: 0 0 0 1px rgba(110, 139, 255, 0.18), 0 10px 40px -18px rgba(110, 139, 255, 0.45);
  --glow-2: 0 0 0 1px rgba(155, 135, 255, 0.3), 0 18px 60px -20px rgba(110, 139, 255, 0.55);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -30px rgba(0, 0, 0, 0.8);

  /* Type */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --fs-display: clamp(3rem, 1.7rem + 5.6vw, 6.5rem);
  --fs-h2: clamp(2rem, 1.35rem + 2.5vw, 3.4rem);
  --fs-h3: clamp(1.125rem, 1.02rem + 0.4vw, 1.375rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;
  --lh-tight: 1.04;
  --lh-snug: 1.25;
  --lh-body: 1.65;
  --tracking-tight: -0.035em;
  --tracking-mono: 0.12em;

  /* Spacing (4px base) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;
  --section-y: clamp(5rem, 3rem + 7vw, 9rem);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);
  --nav-h: 64px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 150ms;
  --dur-2: 260ms;
  --dur-3: 480ms;
  --dur-4: 900ms;

  /* Layers */
  --z-bg: -1;
  --z-nav: 50;
  --z-menu: 60;
  --z-modal: 80;
}
/* Breakpoints (mobile-first, min-width): 30em 480 · 48em 768 · 64em 1024 · 72em 1152 · 90em 1440 */

/* 3. Reset / base ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-locked {
  overflow: hidden;
}
img,
svg,
canvas {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}
ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
::selection {
  background: rgba(110, 139, 255, 0.35);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--text-1);
  color: var(--bg-0);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus {
  transform: none;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ambient background: soft grid + static blurred light (no animation cost) */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: hidden;
}
.backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.backdrop::after {
  content: '';
  position: absolute;
  inset: -20% -10% auto;
  height: 120vh;
  background:
    radial-gradient(40% 35% at 78% 22%, rgba(110, 139, 255, 0.16), transparent 70%),
    radial-gradient(30% 30% at 62% 8%, rgba(155, 135, 255, 0.12), transparent 70%),
    radial-gradient(35% 30% at 10% 60%, rgba(103, 227, 233, 0.045), transparent 70%);
}

/* 4. Layout primitives ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  position: relative;
  padding-block: var(--section-y);
}
.section + .section::before {
  /* hairline divider between sections */
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: min(var(--container), calc(100% - var(--gutter) * 2));
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
.section__head {
  display: grid;
  gap: var(--s-4);
  max-width: 760px;
  margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
}
.section__head--split {
  max-width: none;
}
@media (min-width: 64em) {
  .section__head--split {
    grid-template-columns: 1fr minmax(0, 420px);
    align-items: end;
    gap: var(--s-7);
  }
}
.section__title {
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
  text-wrap: balance;
}
.section__lead {
  color: var(--text-2);
  font-size: var(--fs-lead);
  line-height: 1.6;
  text-wrap: pretty;
}

/* Eyebrow: mono index + label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow__index {
  color: var(--cyan);
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.text-gradient {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mono {
  font-family: var(--font-mono);
}

/* 5. Components --------------------------------------------------------------- */

/* Icons (inline SVG sprite, Lucide-style strokes) */
.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Buttons */
.btn {
  --btn-h: 46px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--btn-h);
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    transform var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out);
}
.btn .icon {
  transition: transform var(--dur-2) var(--ease-out);
}
.btn:hover .icon--shift {
  transform: translate(2px, -2px);
}
.btn:active {
  transform: scale(0.98);
}
.btn--primary {
  background: var(--text-1);
  color: #0a0c10;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 10px 30px -12px rgba(134, 166, 255, 0.55);
}
.btn--primary:hover {
  background: #fff;
  box-shadow:
    0 0 0 1px #fff inset,
    0 14px 40px -12px rgba(134, 166, 255, 0.75);
}
.btn--ghost {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text-1);
}
.btn--ghost:hover {
  background: var(--surface-3);
  border-color: var(--line-3);
}
.btn--sm {
  --btn-h: 38px;
  padding: 0 14px;
  font-size: var(--fs-sm);
}
.btn[aria-disabled='true'],
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  color: var(--text-2);
  transition:
    color var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
}
.icon-btn:hover {
  color: var(--text-1);
  background: var(--surface-3);
}
.icon-btn .icon {
  width: 18px;
  height: 18px;
}

/* Chips / tags */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.3;
  white-space: nowrap;
  transition:
    border-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
}
.chip--mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Status dot */
.dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}
.dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--green);
  opacity: 0.5;
  animation: ping 2.4s var(--ease-out) infinite;
}
.dot--violet {
  background: var(--violet);
}
.dot--violet::after {
  border-color: var(--violet);
}
.dot--cyan {
  background: var(--cyan);
}
.dot--cyan::after {
  border-color: var(--cyan);
}
.dot--static::after {
  display: none;
}
@keyframes ping {
  0% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  80%,
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Card system: base surface + optional cursor spotlight ([data-spotlight]) */
.card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line-1);
  box-shadow: var(--shadow-1);
  isolation: isolate;
  transition:
    border-color var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out);
}
.card[data-spotlight]::before {
  /* inner light following the cursor */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(110, 139, 255, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
}
.card[data-spotlight]::after {
  /* border light following the cursor (masked to the 1px ring) */
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(155, 135, 255, 0.55), transparent 65%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-3) var(--ease-out);
}
.card[data-spotlight]:hover::before,
.card[data-spotlight]:hover::after,
.card[data-spotlight]:focus-within::after {
  opacity: 1;
}
.card--pad {
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
}
.glass {
  background: rgba(14, 17, 24, 0.6);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

/* Template marker: shows the owner where real content must be added */
.tpl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px dashed rgba(242, 196, 109, 0.45);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.is-placeholder {
  color: var(--text-3);
  font-style: italic;
}

/* Terminal / code window */
.term {
  border-radius: var(--r-lg);
  background: #080a0e;
  border: 1px solid var(--line-2);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.75;
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-3);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.term__lights {
  display: flex;
  gap: 6px;
  margin-right: 6px;
}
.term__lights i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-3);
}
.term__body {
  padding: 16px 18px 18px;
  overflow-x: auto;
  color: var(--text-2);
  white-space: pre;
  tab-size: 2;
}
.tk-key {
  color: #9fb4ff;
}
.tk-str {
  color: #9be8d8;
}
.tk-bool {
  color: #d0b8ff;
}
.tk-dim {
  color: #6e768a;
}
.tk-prompt {
  color: var(--cyan);
}

/* Forms */
.field {
  display: grid;
  gap: 8px;
}
.field__label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-1);
}
.field__label span {
  color: var(--text-3);
  font-weight: 400;
}
.field__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-1);
  font-size: 1rem;
  transition:
    border-color var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}
.field__input::placeholder {
  color: #6c7386;
}
.field__input:hover {
  border-color: var(--line-3);
}
.field__input:focus {
  outline: none;
  border-color: rgba(110, 139, 255, 0.7);
  background: rgba(110, 139, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(110, 139, 255, 0.14);
}
textarea.field__input {
  min-height: 150px;
  resize: vertical;
}
.field__error {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--red);
  font-size: var(--fs-sm);
}
.field.is-invalid .field__input {
  border-color: rgba(255, 122, 133, 0.7);
}
.field.is-invalid .field__error {
  display: flex;
}

/* 6. Navigation ---------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: var(--z-nav);
  width: min(calc(100% - 24px), 1240px);
  transform: translateX(-50%);
  transition: top var(--dur-3) var(--ease-out);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: var(--nav-h);
  padding: 0 10px 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition:
    background-color var(--dur-3) var(--ease-out),
    border-color var(--dur-3) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out),
    height var(--dur-3) var(--ease-out);
}
.nav.is-scrolled {
  top: 10px;
}
.nav.is-scrolled .nav__inner {
  --nav-h: 56px;
  background: rgba(10, 12, 16, 0.72);
  border-color: var(--line-2);
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex: none;
  min-height: 44px;
}
.brand__mark {
  width: 30px;
  height: 30px;
}
.brand__text {
  display: grid;
  line-height: 1.1;
}
.brand__text small {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.nav__links {
  display: none;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 0.875rem;
  transition:
    color var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
}
.nav__link:hover {
  color: var(--text-1);
}
.nav__link[aria-current='true'] {
  color: var(--text-1);
  background: var(--surface-3);
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav__social {
  display: none;
}
.nav__resume {
  display: none;
}
.nav__toggle {
  display: inline-grid;
}
.nav__progress {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
  background: var(--grad-line);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
}
.nav.is-scrolled .nav__progress {
  opacity: 1;
}
@media (min-width: 30em) {
  .nav__resume {
    display: inline-flex;
  }
}
@media (min-width: 72em) {
  .nav__links {
    display: flex;
  }
  .nav__actions {
    margin-left: 0;
  }
  .nav__social {
    display: inline-grid;
  }
  .nav__toggle {
    display: none;
  }
}

/* Mobile menu sheet */
.menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background: rgba(6, 7, 9, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--dur-3) var(--ease-out),
    visibility 0s linear var(--dur-3);
}
.menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-3) var(--ease-out);
}
.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.menu__list {
  align-self: center;
  display: grid;
  gap: 4px;
  padding: 0;
  list-style: none;
}
.menu__link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: clamp(4px, 1.2vh, 10px) 0;
  font-size: clamp(1.6rem, 1rem + 2.6vw, 2.25rem);
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  color: var(--text-2);
  transform: translateY(12px);
  opacity: 0;
  transition:
    color var(--dur-2) var(--ease-out),
    transform var(--dur-3) var(--ease-out),
    opacity var(--dur-3) var(--ease-out);
}
.menu__link small {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
}
.menu.is-open .menu__link {
  transform: none;
  opacity: 1;
}
.menu.is-open li:nth-child(2) .menu__link { transition-delay: 30ms; }
.menu.is-open li:nth-child(3) .menu__link { transition-delay: 60ms; }
.menu.is-open li:nth-child(4) .menu__link { transition-delay: 90ms; }
.menu.is-open li:nth-child(5) .menu__link { transition-delay: 120ms; }
.menu.is-open li:nth-child(6) .menu__link { transition-delay: 150ms; }
.menu.is-open li:nth-child(7) .menu__link { transition-delay: 180ms; }
.menu__link:hover,
.menu__link[aria-current='true'] {
  color: var(--text-1);
}
.menu__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* 7. Hero ------------------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: max(640px, 100svh);
  display: flex;
  align-items: flex-end;
  padding-top: calc(var(--nav-h) + 40px);
  padding-bottom: clamp(3rem, 2rem + 4vw, 5rem);
  overflow: hidden;
}
.hero__visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero__poster,
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__poster {
  /* sized/positioned to match where the 3D sphere renders, so the cross-fade doesn't jump */
  top: -6%;
  left: 18%;
  width: 100%;
  height: 58%;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 1.2s var(--ease-out);
}
.hero__canvas {
  opacity: 0;
  transition: opacity 1.4s var(--ease-out);
}
.hero.is-3d-ready .hero__canvas {
  opacity: 1;
}
.hero.is-3d-ready .hero__poster {
  opacity: 0;
}
.hero__visual {
  /* fade the scene out at the bottom with a mask (no opaque seam against the page glow) */
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 96%);
}
.hero__visual::after {
  /* scrim so text stays readable over the scene */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 7, 9, 0) 0%, rgba(6, 7, 9, 0.25) 22%, rgba(6, 7, 9, 0.7) 46%, rgba(6, 7, 9, 0.88) 75%);
}
.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--s-6);
}
.hero__intro {
  display: grid;
  gap: var(--s-5);
  max-width: 720px;
}
.hero__title {
  display: grid;
  gap: 0.1em;
  font-size: var(--fs-display);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 600;
}
.hero__role {
  font-weight: 500;
}
.hero__headline {
  max-width: 34ch;
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-wrap: balance;
}
.hero__copy {
  max-width: 58ch;
  color: var(--text-2);
  font-size: var(--fs-body);
  text-wrap: pretty;
}
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero__domains {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hero__status {
  display: grid;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 14px 18px;
  border-radius: var(--r-md);
}
.hero__status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
}
@media (max-width: 25em) {
  .hero__status-row {
    letter-spacing: 0.07em;
  }
}
.hero__status strong {
  font-weight: 500;
  font-size: 0.9375rem;
}
.hero__status span {
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.hero__meta {
  display: none;
  position: absolute;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.8;
}
.hero__meta--tr {
  top: calc(var(--nav-h) + 48px);
  right: var(--gutter);
  text-align: right;
}
.hero__meta b {
  font-weight: 400;
  color: var(--text-2);
}
.hero__scroll {
  display: none;
  position: absolute;
  z-index: 1;
  right: var(--gutter);
  bottom: clamp(3rem, 2rem + 4vw, 5rem);
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hero__scroll i {
  position: relative;
  width: 1px;
  height: 44px;
  overflow: hidden;
  background: var(--line-2);
}
.hero__scroll i::after {
  content: '';
  position: absolute;
  left: 0;
  top: -40%;
  width: 1px;
  height: 40%;
  background: var(--cyan);
  animation: scrollcue 2.4s var(--ease-in-out) infinite;
}
@keyframes scrollcue {
  to {
    top: 100%;
  }
}
@media (min-width: 48em) {
  .hero__visual::after {
    background: linear-gradient(180deg, rgba(6, 7, 9, 0) 20%, rgba(6, 7, 9, 0.55) 45%, rgba(6, 7, 9, 0.8) 80%);
  }
}
@media (min-width: 64em) {
  .hero {
    align-items: center;
    padding-bottom: 6rem;
  }
  .hero__poster {
    top: 0;
    left: 44%;
    width: 56%;
    height: 100%;
  }
  .hero__visual {
    -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  }
  .hero__visual::after {
    background: linear-gradient(90deg, rgba(6, 7, 9, 0.7) 0%, rgba(6, 7, 9, 0.5) 32%, rgba(6, 7, 9, 0) 58%);
  }
  .hero__meta,
  .hero__scroll {
    display: flex;
    flex-direction: column;
  }
  .hero__scroll {
    flex-direction: row;
  }
}

/* 8. Sections ------------------------------------------------------------------- */

/* About */
.about {
  display: grid;
  gap: var(--s-7);
}
.about__text {
  display: grid;
  gap: var(--s-5);
  align-content: start;
}
.about__text p {
  color: var(--text-2);
  font-size: var(--fs-lead);
  line-height: 1.7;
  text-wrap: pretty;
}
.about__text p strong {
  color: var(--text-1);
  font-weight: 500;
}
.about__aside {
  display: grid;
  gap: var(--s-4);
  align-content: start;
}
.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.focus {
  display: grid;
  gap: 10px;
  padding: 18px;
}
.focus .icon {
  width: 22px;
  height: 22px;
  color: var(--violet);
}
.focus h3 {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.focus p {
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
@media (min-width: 64em) {
  .about {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--s-8);
  }
}

/* ML lifecycle pipeline */
.pipeline {
  margin-top: clamp(3rem, 2rem + 3vw, 5rem);
}
.pipeline__label {
  margin-bottom: var(--s-5);
}
.pipeline__track {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
  counter-reset: stage;
}
.pipeline__stage {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  padding: 18px 20px;
  counter-increment: stage;
}
.pipeline__stage::before {
  content: '0' counter(stage);
  grid-row: span 2;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
  padding-top: 3px;
}
.pipeline__stage h3 {
  font-size: 1rem;
  font-weight: 500;
}
.pipeline__stage p {
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
@media (min-width: 48em) {
  .pipeline__track {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }
  .pipeline__track::before {
    content: '';
    position: absolute;
    top: 27px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: var(--grad-line);
  }
  .pipeline__stage {
    grid-template-columns: 1fr;
    padding: 0 18px 0 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .pipeline__stage::before {
    grid-row: auto;
    width: fit-content;
    margin-bottom: 18px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--line-2);
    background: var(--bg-0);
  }
}

/* Skills */
.skills {
  display: grid;
  gap: 14px;
}
.skill {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: var(--s-4);
  padding: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
  min-height: 240px;
}
.skill__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.skill__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: radial-gradient(circle at 30% 20%, rgba(110, 139, 255, 0.18), transparent 70%), var(--surface-1);
  color: var(--text-1);
}
.skill__icon .icon {
  width: 20px;
  height: 20px;
}
.skill__index {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-3);
}
.skill__title {
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: var(--lh-snug);
}
.skill__desc {
  margin-top: 6px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.skill .chip-list {
  align-self: end;
}
.skill:hover .chip {
  border-color: var(--line-3);
  color: var(--text-1);
}
.skill__graph {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 104px;
  height: 72px;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity var(--dur-3) var(--ease-out);
}
.skill:hover .skill__graph {
  opacity: 0.8;
}
@media (min-width: 48em) {
  .skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64em) {
  .skills {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .skill {
    grid-column: span 2;
  }
  .skill:nth-child(1),
  .skill:nth-child(2) {
    grid-column: span 3;
  }
}

/* Experience timeline */
.timeline {
  position: relative;
  display: grid;
  gap: var(--s-5);
  padding: 0 0 0 28px;
  list-style: none;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--blue), rgba(155, 135, 255, 0.4) 60%, transparent);
}
.xp {
  position: relative;
}
.xp::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 30px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 4px rgba(110, 139, 255, 0.12);
}
.xp__card {
  display: grid;
  gap: var(--s-5);
}
.xp__top {
  display: grid;
  gap: 6px;
}
.xp__role {
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.xp__company {
  color: var(--text-2);
}
.xp__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.xp__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.xp__cols {
  display: grid;
  gap: var(--s-5);
}
.xp__block h4 {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-3);
}
.xp__list {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}
.xp__list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.xp__list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 1px;
  background: var(--cyan);
}
@media (min-width: 48em) {
  .xp__top {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .xp__cols {
    grid-template-columns: 1.4fr 1fr;
  }
}
@media (min-width: 64em) {
  .timeline {
    padding-left: 0;
    gap: var(--s-6);
  }
  .timeline::before {
    left: 200px;
  }
  .xp {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 60px;
  }
  .xp::before {
    left: 195px;
  }
  .xp__aside {
    padding-top: 26px;
    text-align: right;
  }
}
.xp__aside {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
@media (min-width: 64em) {
  .xp__aside {
    display: block;
  }
}

/* Projects */
.filters {
  display: flex;
  gap: 6px;
  margin-bottom: var(--s-6);
  padding: 5px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-1);
  background: var(--surface-1);
}
.filters::-webkit-scrollbar {
  display: none;
}
.filter {
  flex: none;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: var(--fs-sm);
  transition:
    color var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
}
.filter:hover {
  color: var(--text-1);
}
.filter[aria-pressed='true'] {
  background: var(--text-1);
  color: var(--bg-0);
  font-weight: 500;
}
.filter__count {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.6;
}
.projects {
  display: grid;
  gap: 16px;
}
@media (min-width: 48em) {
  .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 72em) {
  .projects {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .projects > .project:first-child {
    grid-column: span 2;
  }
  .projects > .project:first-child .project__cover {
    aspect-ratio: 16 / 7.4;
  }
}
.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}
.project.is-hidden {
  display: none;
}
.project__cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line-1);
  background: #080a0e;
}
.project__cover svg,
.project__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-4) var(--ease-out);
}
.project:hover .project__cover svg,
.project:hover .project__cover img {
  transform: scale(1.04);
}
.project__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.project__badges .chip {
  background: rgba(8, 10, 14, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.project__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: 20px 22px 22px;
}
.project__cat {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--cyan);
}
.project__title {
  font-size: 1.1875rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.project__desc {
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.project__stack {
  margin-top: auto;
  padding-top: 6px;
}
.project__stack .chip {
  min-height: 24px;
  font-size: 0.75rem;
  padding: 2px 9px;
}
.project__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-1);
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  transition: color var(--dur-2) var(--ease-out);
}
.link:hover {
  color: var(--text-1);
}
.link .icon {
  width: 15px;
  height: 15px;
}
.link--primary {
  color: var(--text-1);
  font-weight: 500;
}
.link--primary .icon {
  transition: transform var(--dur-2) var(--ease-out);
}
.link--primary:hover .icon {
  transform: translateX(3px);
}
.link[aria-disabled='true'] {
  color: #5d6476;
  pointer-events: none;
}
.projects__status {
  margin-top: var(--s-5);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

/* Project modal */
.modal {
  width: min(880px, calc(100% - 24px));
  max-height: min(88vh, 900px);
  padding: 0;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-2);
  background: #0b0d12;
  color: var(--text-1);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.9), var(--glow-1);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out),
    overlay var(--dur-3) allow-discrete,
    display var(--dur-3) allow-discrete;
}
.modal[open] {
  opacity: 1;
  transform: none;
}
@starting-style {
  .modal[open] {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}
.modal::backdrop {
  background: rgba(3, 4, 6, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal__scroll {
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal__cover {
  aspect-ratio: 16 / 7;
  border-bottom: 1px solid var(--line-1);
}
.modal__cover svg,
.modal__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: rgba(8, 10, 14, 0.75);
  border: 1px solid var(--line-2);
  color: var(--text-1);
}
.modal__body {
  display: grid;
  gap: var(--s-6);
  padding: clamp(1.25rem, 1rem + 2vw, 2.5rem);
}
.modal__head {
  display: grid;
  gap: 12px;
}
.modal__title {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}
.modal__grid {
  display: grid;
  gap: var(--s-5);
}
@media (min-width: 48em) {
  .modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.modal__section h3 {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-3);
}
.modal__section p {
  color: var(--text-2);
  line-height: 1.65;
}

/* AI Lab */
.lab {
  display: grid;
  gap: 16px;
}
.lab__grid {
  display: grid;
  gap: 12px;
}
@media (min-width: 40em) {
  .lab__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64em) {
  .lab {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: start;
  }
}
.exp {
  display: grid;
  gap: 12px;
  padding: 20px;
  min-height: 190px;
  grid-template-rows: auto auto 1fr auto;
}
.exp__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.exp__top span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.exp h3 {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.exp p {
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.exp__bar {
  position: relative;
  height: 2px;
  border-radius: 2px;
  background: var(--line-1);
  overflow: hidden;
}
.exp__bar::after {
  /* indeterminate "running" indicator — not a progress claim */
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, var(--violet), transparent);
  animation: scan 3.6s var(--ease-in-out) infinite;
  animation-play-state: paused;
}
.exp:hover .exp__bar::after,
.is-visible .exp__bar::after {
  animation-play-state: running;
}
@keyframes scan {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(340%);
  }
}
.lab__side {
  display: grid;
  gap: 12px;
}
@media (min-width: 64em) {
  .lab__side {
    position: sticky;
    top: calc(var(--nav-h) + 40px);
  }
}
.log-line {
  display: block;
}

/* Playground */
.pg {
  display: grid;
  gap: 16px;
  padding: clamp(1rem, 0.75rem + 1vw, 1.5rem);
}
.pg__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pg__datasets {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-1);
  background: var(--surface-1);
}
.pg__datasets .filter {
  min-height: 34px;
  padding: 0 14px;
}
.pg__controls {
  display: flex;
  gap: 8px;
}
.pg__stage {
  display: grid;
  gap: 16px;
}
@media (min-width: 56em) {
  .pg__stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  }
}
.pg__panel {
  position: relative;
  border-radius: var(--r-md);
  border: 1px solid var(--line-1);
  background: #07090c;
  overflow: hidden;
}
.pg__panel-label {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  pointer-events: none;
}
.pg__input {
  aspect-ratio: 1;
  width: 100%;
  cursor: crosshair;
  touch-action: none;
}
.pg__net {
  width: 100%;
  height: 100%;
  min-height: 280px;
}
.pg__readout {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.8);
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.pg__readout.is-on {
  opacity: 1;
}
.pg__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line-1);
  background: var(--line-1);
}
@media (min-width: 40em) {
  .pg__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.pg__stat {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: #090b0f;
}
.pg__stat dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.pg__stat dd {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
}
.pg__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.pg__legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pg__legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.pg__legend .l-a {
  background: var(--cyan);
}
.pg__legend .l-b {
  border: 2px solid var(--violet);
}
.pg__note {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* GitHub activity */
.gh {
  display: grid;
  gap: 16px;
}
.gh__summary {
  display: grid;
  gap: 16px;
  padding: 22px;
}
@media (min-width: 64em) {
  .gh {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: start;
  }
}
.gh__profile {
  display: flex;
  align-items: center;
  gap: 14px;
}
.gh__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--text-2);
}
.gh__avatar img {
  width: 100%;
  height: 100%;
}
.gh__kv {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line-1);
  background: var(--line-1);
}
.gh__kv div {
  padding: 12px 14px;
  background: #090b0f;
}
.gh__kv dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.gh__kv dd {
  font-size: 1.25rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.langbar {
  display: flex;
  height: 8px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line-1);
  gap: 2px;
}
.langbar span {
  height: 100%;
}
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.8125rem;
  color: var(--text-2);
  padding: 0;
  list-style: none;
}
.langs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.langs i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.repos {
  display: grid;
  gap: 12px;
}
@media (min-width: 40em) {
  .repos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.repo {
  display: grid;
  gap: 10px;
  padding: 18px;
  min-height: 150px;
  grid-template-rows: auto 1fr auto;
}
.repo__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-1);
  word-break: break-word;
}
.repo__desc {
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.repo__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
}
.repo__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.repo--skeleton {
  border-style: dashed;
  border-color: var(--line-2);
  background: transparent;
  box-shadow: none;
}
.skel {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
}
.gh__empty {
  display: grid;
  gap: 8px;
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* Contact */
.contact {
  display: grid;
  gap: var(--s-7);
}
@media (min-width: 64em) {
  .contact {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--s-8);
  }
}
.contact__title {
  font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
  text-wrap: balance;
}
.contact__intro {
  display: grid;
  gap: var(--s-5);
  align-content: start;
}
.channels {
  display: grid;
  gap: 8px;
  margin-top: var(--s-4);
  padding: 0;
  list-style: none;
}
.channel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-height: 64px;
}
.channel__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  color: var(--text-1);
}
.channel__text {
  display: grid;
  min-width: 0;
}
.channel__text small {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.channel__text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel__arrow {
  margin-left: auto;
  color: var(--text-3);
  transition:
    transform var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out);
}
a.channel:hover .channel__arrow {
  color: var(--text-1);
  transform: translate(2px, -2px);
}
.form {
  display: grid;
  gap: 18px;
  padding: clamp(1.25rem, 1rem + 1.5vw, 2.25rem);
}
.form__row {
  display: grid;
  gap: 18px;
}
@media (min-width: 40em) {
  .form__row {
    grid-template-columns: 1fr 1fr;
  }
}
.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.form__hint {
  color: var(--text-3);
  font-size: 0.8125rem;
}
.form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form__status {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}
.form__status.is-success {
  display: flex;
  border: 1px solid rgba(94, 226, 160, 0.35);
  background: rgba(94, 226, 160, 0.06);
  color: #bdf5d9;
}
.form__status.is-error {
  display: flex;
  border: 1px solid rgba(255, 122, 133, 0.35);
  background: rgba(255, 122, 133, 0.06);
  color: #ffc6cb;
}
.form__status .icon {
  margin-top: 2px;
}
.btn.is-loading {
  pointer-events: none;
  opacity: 0.8;
}
.btn.is-loading .icon {
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Footer */
.footer {
  position: relative;
  padding: var(--s-8) 0 calc(var(--s-6) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-1);
  overflow: hidden;
}
.footer__grid {
  display: grid;
  gap: var(--s-6);
}
@media (min-width: 48em) {
  .footer__grid {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}
.footer__brand {
  display: grid;
  gap: 10px;
}
.footer__brand p {
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
  list-style: none;
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-1);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.footer__word {
  margin-top: var(--s-6);
  font-size: min(11rem, 12.6vw);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 0.85;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(110, 139, 255, 0.14), transparent 80%);
  -webkit-background-clip: text;
  background-clip: text;
  user-select: none;
  white-space: nowrap;
}

/* 9. Motion ---------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--dur-4) var(--ease-out),
    transform var(--dur-4) var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
.hero [data-hero] {
  animation: heroIn 1s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 90ms + 80ms);
}
@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .dot::after,
  .hero__scroll i::after,
  .exp__bar::after {
    display: none;
  }
}

/* 10. Utilities --------------------------------------------------------------------- */
.stack-sm {
  display: grid;
  gap: var(--s-3);
}
.muted {
  color: var(--text-3);
}
