/* Direction 7: Runway-inspired cinematic type. Tokens first; everything below references them. */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/geist-latin-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --ink: #f2f2f2;
  --body: #c9c9c9;
  --muted: #8a8f98;
  --accent: #3cffd0;
  --accent-hover: #8dffe4;
  --on-accent: #04140f;
  --paper: #f2f2ee;
  --paper-muted: #50545b;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --m: clamp(20px, 3vw, 44px);
  --side: max(var(--m), calc((100% - 1560px) / 2));
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.76, 0, .24, 1);
  --ease-soft: cubic-bezier(.33, 1, .68, 1);
  color-scheme: dark;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
h1, h2, h3 { text-wrap: balance; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
section[id], footer[id] { scroll-margin-top: 96px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: var(--m); top: -60px; z-index: 10; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* Buttons */
.pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
  transition: transform 140ms var(--ease-out), background-color 180ms ease;
}
.pill:active { transform: scale(.97); }
.pill--dark { background: var(--ink); color: var(--bg); }
@media (hover: hover) and (pointer: fine) {
  .pill:hover { background: var(--accent-hover); }
  .pill--dark:hover { background: #ffffff; }
}

/* Header */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; height: 68px; padding: 0 var(--side); font-size: 15px; transition: background-color 240ms ease; }
.top.is-solid { background: var(--bg); }
.top__mark { font-weight: 700; font-size: 16px; text-decoration: none; }
.top nav { display: flex; gap: 26px; }
.top nav a, .top__cv { text-decoration: none; color: var(--body); transition: color 180ms ease; }
.top nav a[aria-current='true'] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.top__cv { color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .top nav a:hover { color: var(--accent); } .top__cv:hover { color: var(--accent-hover); } }

main { position: relative; z-index: 1; background: var(--bg); }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: clamp(24px, 4vw, 80px); padding: 0 var(--side); overflow: hidden; }
.hero__text { align-self: center; padding: 96px 0 4vh; }
.hero h1 { font-weight: 700; font-size: clamp(72px, 10.4vw, 188px); line-height: .86; letter-spacing: -.06em; margin-bottom: clamp(28px, 4vh, 48px); }
.hero h1 .line:nth-child(2) { color: var(--accent); }
.hero__drift { display: block; will-change: transform; }
.hero__copy { max-width: 540px; }
.hero__role { font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.hero__copy p:not(.hero__role) { color: var(--body); font-size: 18px; margin: 10px 0 26px; }
.hero__who { align-self: end; height: min(calc(100svh - 72px), 1100px); }
.hero__who picture { display: block; height: 100%; }
.hero__who img { height: 100%; width: auto; }
.hero__who img { filter: grayscale(var(--g, 1)) contrast(1.04); }

/* Masked line reveal and portrait shutter, on load. Hidden states only exist when JS is on. */
.lines .line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.lines [data-line] { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .js .hero .lines [data-line] { transform: translateY(105%); animation: line-up 950ms var(--ease-out) forwards; animation-delay: calc(var(--i) * 110ms + 150ms); }
  .js [data-mask] [data-line] { transform: translateY(105%); transition: transform 950ms var(--ease-out); }
  .js [data-mask].is-in [data-line] { transform: none; }
  .js .hero__who picture { display: block; clip-path: inset(100% 0 0 0); animation: shutter 1100ms var(--ease-in-out) 250ms forwards; }
  .js .hero__who img { transform: scale(1.12); animation: settle 1500ms var(--ease-soft) 250ms forwards; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
@keyframes line-up { to { transform: none; } }
@keyframes shutter { to { clip-path: inset(0); } }
@keyframes settle { to { transform: none; } }

/* Skills marquee (decorative; the real list is in #skills) */
.marquee { overflow: hidden; background: var(--surface); padding: 30px 0; white-space: nowrap; }
.marquee__track { display: inline-flex; gap: 48px; padding-left: 48px; animation: marquee 60s linear infinite; }
.marquee span { font-size: clamp(36px, 4.4vw, 64px); font-weight: 600; letter-spacing: -.035em; }
.marquee span:nth-child(even) { color: var(--muted); }
.marquee:hover .marquee__track, .marquee.is-off .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* Sections */
section { padding: 160px var(--side) 0; }
h2 { font-weight: 600; font-size: clamp(44px, 6vw, 96px); line-height: .95; letter-spacing: -.05em; margin-bottom: 64px; }

.about { display: grid; grid-template-columns: 7fr 5fr; gap: 64px; align-items: start; }
.about__lead { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.2; letter-spacing: -.02em; font-weight: 500; }
.about__lead em { font-style: normal; color: var(--accent); }
.about__text { color: var(--body); font-size: 18px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; color: var(--muted); font-size: 15px; }
.facts b { display: block; color: var(--ink); font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 4px; }

/* Experience: index with detail panel */
.index { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.index__list { position: sticky; top: 12vh; }
.index__row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; width: 100%; text-align: left; padding: 18px 0; color: var(--muted); transition: color 200ms ease; }
.index__title { font-size: clamp(28px, 3vw, 46px); font-weight: 600; letter-spacing: -.035em; line-height: 1.05; }
.index__org { font-size: 15px; text-align: right; }
.index__row[aria-selected='true'] { color: var(--ink); }
.index__row[aria-selected='true'] .index__org { color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .index__row:hover { color: var(--ink); } }
.detail { background: var(--surface); border-radius: 24px; padding: 40px; }
.detail__org { color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.detail h3 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.detail h4 { font-size: 18px; font-weight: 600; margin: 24px 0 4px; }
.bullets li { color: var(--body); padding: 6px 0 6px 22px; position: relative; }
.bullets li::before { content: ''; position: absolute; left: 0; top: 1.05em; width: 10px; height: 2px; background: var(--accent); }
html:not(.js) .index { grid-template-columns: 1fr; }
html:not(.js) .index__list { display: none; }
html:not(.js) .detail + .detail { margin-top: 16px; }
@media (prefers-reduced-motion: no-preference) { .js .detail:not([hidden]) { animation: fade-in 450ms var(--ease-out); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Skills */
.skills__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skills__grid { column-gap: 40px; row-gap: 48px; }
.skill-group h3 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 18px; min-height: 2.2em; }
.skill-group h3::first-letter { color: var(--accent); }
.skill-group li { display: flex; align-items: center; gap: 14px; min-height: 48px; font-size: 18px; color: var(--body); font-weight: 500; transition: transform 200ms var(--ease-out); }
.skill-group img { width: 28px; height: 28px; flex: none; }
@media (hover: hover) and (pointer: fine) { .skill-group li:hover { transform: translateX(6px); } }

/* Certifications drag row */
.drag { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 20px; scrollbar-width: none; overscroll-behavior-x: contain; }
.drag::-webkit-scrollbar { display: none; }
.drag figure { flex: none; width: 280px; scroll-snap-align: start; background: var(--paper); color: var(--bg); border-radius: 24px; padding: 32px 26px 26px; transition: transform 250ms var(--ease-out); }
.drag img { width: 170px; height: 170px; object-fit: contain; margin: 0 auto; }
.drag figcaption { margin-top: 22px; font-weight: 600; font-size: 18px; line-height: 1.25; }
.drag figcaption span { display: block; color: var(--paper-muted); font-weight: 400; font-size: 15px; margin-top: 2px; }
.edu { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; margin-top: 56px; padding-bottom: 160px; }
.edu h3 { font-size: clamp(40px, 5vw, 80px); font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.edu p { color: var(--body); }

/* Footer: the closing invitation */
.footer { background: var(--accent); color: var(--on-accent); padding: 140px var(--side) 0; overflow: hidden; }
.footer__main { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(40px, 6vw, 112px); align-items: end; }
.footer__invite { font-size: clamp(40px, 4.4vw, 76px); font-weight: 600; letter-spacing: -.05em; line-height: .95; text-wrap: balance; }
.footer__sub { font-size: 28px; font-weight: 500; letter-spacing: -.02em; margin-top: 14px; }
.footer__acts { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 40px; }
.footer__list { font-size: 20px; }
.footer__list li { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 14px 18px; border-radius: 14px; }
.footer__list li:nth-child(odd) { background: rgba(4, 20, 15, .07); }
.footer__list span { color: #0d4a3c; font-size: 17px; }
.footer__list a { font-weight: 600; text-decoration: none; text-align: right; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { .footer__list a:hover { text-decoration: underline; text-underline-offset: 4px; } }
.footer__legal { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; margin-top: 120px; }
.footer__word { font-size: min(12.3vw, 200px); font-weight: 700; letter-spacing: -.065em; line-height: .8; white-space: nowrap; margin-top: 18px; transform: translateY(14%); }
.footer a:focus-visible { outline-color: var(--on-accent); }
.footer .pill--dark { background: var(--bg); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .footer .pill--dark:hover { background: #1f1f1f; } }

@media (max-width: 820px) {
  .top nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 80px; }
  .hero__text { padding: 24px 0 0; }
  .hero h1 { font-size: 19vw; margin-bottom: 20px; }
  .hero__who { justify-self: center; width: min(78vw, 440px); height: 46svh; order: -1; overflow: hidden; }
  .hero__who picture, .hero__who img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
  .hero__copy { padding-bottom: 72px; }
  .about, .index { grid-template-columns: 1fr; gap: 32px; }
  .facts { grid-template-columns: 1fr; }
  .index__list { position: static; }
  .detail { padding: 24px; }
  .skills__grid { grid-template-columns: 1fr; }
  .skill-group h3 { min-height: 0; }
  .footer__sub { font-size: 22px; }
  .footer { padding-top: 96px; }
  .footer__main { grid-template-columns: 1fr; }
  .footer__list { font-size: 17px; }
  .footer__legal { margin-top: 72px; }
  .drag figure { width: 72vw; }
  section { padding-top: 110px; }
  .footer__word { font-size: 13.4vw; }
}
@media (pointer: fine) { html { overscroll-behavior: none; } }
#VisitorCount { font-variant-numeric: tabular-nums; }
a, button { -webkit-tap-highlight-color: rgba(60, 255, 208, .25); }
