/* =========================================================
   Deepak Kumar Behera — Editorial Portfolio
   ========================================================= */

/* Self-hosted Google Fonts (latin + latin-ext only), OFL-licensed: Anton, Instrument Serif, Inter Tight, JetBrains Mono */
/* Anton 400 normal — latin-ext */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/anton-normal-latin-ext-0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Anton 400 normal — latin */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/anton-normal-latin-1.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;
}
/* Instrument Serif 400 italic — latin-ext */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/instrument-serif-italic-latin-ext-2.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Instrument Serif 400 italic — latin */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/instrument-serif-italic-latin-3.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;
}
/* Instrument Serif 400 normal — latin-ext */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/instrument-serif-normal-latin-ext-4.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Instrument Serif 400 normal — latin */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/instrument-serif-normal-latin-5.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;
}
/* Inter Tight 400 normal — latin-ext */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/inter-tight-normal-latin-ext-6.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter Tight 400 normal — latin */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/inter-tight-normal-latin-7.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;
}
/* Inter Tight 500 normal — latin-ext */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/inter-tight-normal-latin-ext-6.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter Tight 500 normal — latin */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/inter-tight-normal-latin-7.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;
}
/* Inter Tight 600 normal — latin-ext */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/inter-tight-normal-latin-ext-6.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter Tight 600 normal — latin */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/inter-tight-normal-latin-7.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;
}
/* JetBrains Mono 400 normal — latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/jetbrains-mono-normal-latin-ext-8.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono 400 normal — latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/jetbrains-mono-normal-latin-9.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;
}
/* JetBrains Mono 500 normal — latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/jetbrains-mono-normal-latin-ext-8.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono 500 normal — latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/jetbrains-mono-normal-latin-9.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 {
  --paper: #EEE9DF;
  --paper-2: #E4DDD0;
  --ink: #121110;
  --muted: #625D55;
  --line: rgba(18, 17, 16, 0.16);
  --accent: #FF4A1C;
  --accent-text: #B4330F; /* small orange text: 4.5:1 on paper and paper-2 */
  --accent-ink: #FFFFFF;
  --gold: #D4A72C;
  --card: #F6F2EA;
  --portrait-opacity: 1;

  --f-display: 'Anton', 'Impact', sans-serif;
  --f-serif: 'Instrument Serif', Georgia, serif;
  --f-sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --paper: #0F0E0D;
  --paper-2: #1A1816;
  --ink: #EEE9DF;
  --muted: #948D82;
  --line: rgba(238, 233, 223, 0.14);
  --accent: #FF5A2E;
  --accent-text: #FF5A2E;
  --accent-ink: #0F0E0D;
  --gold: #E8BE4A;
  --card: #1A1816;
  --portrait-opacity: 1;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
html.is-locked { overflow: hidden; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease-out), color .5s var(--ease-out);
}
body.is-loading { overflow: hidden; }

main { overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; text-transform: uppercase; }
.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; }
.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 1001;
  padding: 10px 16px; border-radius: 100px; background: var(--ink); color: var(--paper);
  font-family: var(--f-mono); font-size: 12px; text-transform: uppercase;
  transform: translateY(-160%); transition: transform .3s var(--ease-out);
}
.skip-link:focus-visible { transform: none; }
#about:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
kbd { font-family: var(--f-mono); font-size: .85em; }

/* Decorative loops pause while off-screen (toggled from JS) */
.is-offscreen, .is-offscreen *, .is-offscreen::before, .is-offscreen::after, .is-offscreen *::before, .is-offscreen *::after { animation-play-state: paused !important; }

.section { padding: clamp(96px, 14vw, 180px) var(--gutter); position: relative; }
.section__label {
  display: flex; gap: 10px; align-items: center;
  color: var(--muted); margin-bottom: clamp(28px, 4vw, 48px);
}
.section__label span { color: var(--accent-text); }

.line { display: block; overflow: hidden; padding-bottom: .04em; padding-right: .03em; }
.split { display: inline-block; }
.split .word { display: inline-block; white-space: nowrap; }
/* no will-change here: hundreds of chars would each get their own GPU layer; GSAP promotes them only while animating */
.char { display: inline-block; }

.big-title {
  font-family: var(--f-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(3.4rem, 11vw, 10rem);
  line-height: .9;
  letter-spacing: -.01em;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.big-title .serif { font-size: 1.02em; color: var(--accent); }

/* ---------- Buttons & links ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 16px 26px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  font-weight: 500; font-size: 15px;
  overflow: hidden;
  isolation: isolate;
  transition: color .45s var(--ease), border-color .45s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ink);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform .5s var(--ease);
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--paper); }
.btn i { font-style: normal; transition: transform .45s var(--ease); }
.btn:hover i { transform: rotate(-45deg); }

.btn--fill { background: var(--ink); color: var(--paper); }
.btn--fill::before { background: var(--accent); }
.btn--fill:hover { color: var(--accent-ink); border-color: var(--accent); }

.link-arrow {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; padding-bottom: 3px;
}
.link-arrow::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: currentColor; transform-origin: right; transform: scaleX(1);
  transition: transform .5s var(--ease);
}
.link-arrow:hover::after { transform-origin: left; animation: underline .7s var(--ease); }
.link-arrow i { font-style: normal; transition: transform .4s var(--ease); display: inline-block; }
.link-arrow:hover i { transform: translate(3px, -3px); }
@keyframes underline { 0% { transform: scaleX(1); transform-origin: right; } 49% { transform: scaleX(0); transform-origin: right; } 50% { transform-origin: left; } 100% { transform: scaleX(1); transform-origin: left; } }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 100px;
}

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 24px var(--gutter);
  font-family: var(--f-mono); font-size: 12px; text-transform: uppercase;
}
.preloader__top, .preloader__bottom { display: flex; justify-content: space-between; }
.preloader__count {
  font-family: var(--f-display); font-size: clamp(7rem, 30vw, 26rem); line-height: .8;
  align-self: flex-end; display: flex;
}
.preloader__pct { color: var(--accent); font-size: .35em; margin-top: .1em; }
/* fixed-width counter: the digits change, the box doesn't, so nothing shifts while it counts */
.preloader__num { display: inline-block; min-width: 2.62ch; text-align: right; font-variant-numeric: tabular-nums; }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
html:not(.js) .preloader { display: none; }

/* ---------- Grain / progress / cursor ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 900; pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
[data-theme="dark"] .grain { opacity: .09; }
/* touch devices: keep the texture, skip the constant repaint (battery) */
@media (pointer: coarse) { .grain { animation: none; } }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-5%, 3%); }
  40% { transform: translate(4%, -6%); } 60% { transform: translate(-3%, 7%); }
  80% { transform: translate(6%, 2%); } 100% { transform: translate(0, 0); }
}

.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 950; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

.cursor { position: fixed; top: 0; left: 0; z-index: 999; pointer-events: none; mix-blend-mode: difference; transition: opacity .3s; }
.cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 50%; }
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
.cursor__ring {
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border: 1px solid #fff;
  display: grid; place-items: center;
  transition: width .4s var(--ease-out), height .4s var(--ease-out), margin .4s var(--ease-out), background-color .3s;
}
.cursor__label { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; color: #000; opacity: 0; transition: opacity .2s; }
.cursor.is-hover .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(255,255,255,.12); }
.cursor.is-label .cursor__ring { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: #fff; }
.cursor.is-label .cursor__label { opacity: 1; }
.cursor.is-hidden, .cursor.is-native { opacity: 0; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
@media (hover: hover) and (pointer: fine) { html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor summary { cursor: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  mix-blend-mode: difference; color: #fff;
  transition: transform .6s var(--ease);
}
.nav.is-hidden { transform: translateY(-110%); }
/* wordmark: italic serif, same voice as the favicon's "d" */
.nav__logo { font-family: var(--f-serif); font-style: italic; font-size: 31px; line-height: 1; letter-spacing: -.01em; display: inline-flex; align-items: baseline; }
.nav__logo-dot { display: inline-block; font-style: normal; transition: transform .5s var(--ease); }
.nav__logo:hover .nav__logo-dot { transform: translateY(-7px); }
.nav__links { display: flex; gap: 32px; }
.nav__links a { position: relative; font-size: 14px; font-weight: 500; overflow: hidden; display: inline-block; height: 1.3em; line-height: 1.3em; }
.nav__links a::before {
  content: attr(data-text); position: absolute; top: 100%; left: 0;
  font-family: var(--f-serif); font-style: italic; font-size: 16px;
}
.nav__links a span, .nav__links a::before { transition: transform .45s var(--ease); display: inline-block; }
.nav__links a:hover span, .nav__links a:hover::before { transform: translateY(-100%); }
/* current section stays bright, the rest step back */
.nav__links a { transition: opacity .4s var(--ease-out); }
.nav__links.has-active a:not(.is-active):not(:hover) { opacity: .45; }
.nav__right { display: flex; align-items: center; gap: 22px; }
.nav__clock { font-size: 11px; }
.nav__cmd {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 11px; border: 1px solid currentColor; border-radius: 100px;
  font-size: 11px; opacity: .8; transition: opacity .3s;
}
.nav__cmd:hover { opacity: 1; }
.nav__cmd kbd { font-size: 11px; }
/* phones: the command menu gets an icon button (no keyboard to press Ctrl K with) */
.nav__find { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid currentColor; place-items: center; }
.nav__find svg { width: 16px; height: 16px; }

.theme-toggle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; }
.theme-toggle__sun {
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  border: 1.5px solid currentColor;
  transition: transform .7s var(--ease);
}
[data-theme="dark"] .theme-toggle__sun { transform: rotate(180deg); }

.nav__burger { display: none; width: 44px; height: 44px; position: relative; }
.nav__burger span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: currentColor; transition: transform .5s var(--ease), top .5s var(--ease); }
.nav__burger span:first-child { top: 17px; }
.nav__burger span:last-child { top: 25px; }
.menu-open .nav { mix-blend-mode: normal; color: var(--accent-ink); }
.menu-open .nav__burger span:first-child { top: 21px; transform: rotate(45deg); }
.menu-open .nav__burger span:last-child { top: 21px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 790;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: flex-end; padding: 100px var(--gutter) 48px;
  clip-path: circle(0% at calc(100% - 40px) 38px);
  transition: clip-path .9s var(--ease);
  pointer-events: none;
}
.menu-open .menu { clip-path: circle(150% at calc(100% - 40px) 38px); pointer-events: auto; }
.menu ul { list-style: none; width: 100%; }
.menu li { overflow: hidden; border-top: 1px solid rgba(0,0,0,.2); }
.menu a {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--f-display); font-size: clamp(3rem, 14vw, 6rem); line-height: 1.05; text-transform: uppercase;
  transform: translateY(100%); transition: transform .8s var(--ease);
}
.menu a span { font-family: var(--f-mono); font-size: 12px; }
.menu-open .menu a { transform: translateY(0); }
.menu-open .menu li:nth-child(2) a { transition-delay: .05s; }
.menu-open .menu li:nth-child(3) a { transition-delay: .1s; }
.menu-open .menu li:nth-child(4) a { transition-delay: .15s; }
.menu-open .menu li:nth-child(5) a { transition-delay: .2s; }
.menu-open .menu li:nth-child(6) a { transition-delay: .25s; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  padding: 96px var(--gutter) 32px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.hero__meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.hero__status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.hero__status i { width: 8px; height: 8px; border-radius: 50%; background: #2BB673; box-shadow: 0 0 0 0 rgba(43,182,115,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(43,182,115,0); } 100% { box-shadow: 0 0 0 0 rgba(43,182,115,0); } }

/* two boxes with the photo's geometry: the aura (behind the name) and the face (in front of it) */
.hero__face, .hero__aura, .hero__marks {
  position: absolute; right: 2vw; bottom: 0; z-index: 2;
  height: min(calc(100% - 124px), 58vw); aspect-ratio: 1087 / 1199;
  pointer-events: none;
}
.hero__aura { z-index: 0; }
.hero__marks { z-index: 2; } /* above the name (z 1); the face comes later in the DOM at z 2, so it still wins */

/* Route graph: lives in the portrait's coordinate space, extended past the photo on every side.
   Nodes/edges are generated outside a keep-out zone around the person, so nothing sits behind the face. */
.route-graph, .route-marks { position: absolute; left: -40%; top: -20%; width: 180%; max-width: none; height: 130%; overflow: visible; }
.rg-edge { stroke: color-mix(in srgb, var(--ink) 15%, transparent); stroke-width: 2; }
.rg-node { fill: var(--paper); stroke: color-mix(in srgb, var(--ink) 38%, transparent); stroke-width: 2; transition: fill .35s, stroke .35s; }
.rg-node.is-hub { stroke: color-mix(in srgb, var(--ink) 60%, transparent); }
.rg-node.is-seen { fill: color-mix(in srgb, var(--accent) 45%, var(--paper)); stroke: var(--accent); }
.rg-seen { stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-width: 2.4; }
.rg-path { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.rg-runner { fill: var(--ink); stroke: var(--paper); stroke-width: 3; }
.rg-end { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.rg-label { font-family: var(--f-mono); font-size: 22px; letter-spacing: .1em; fill: var(--accent); }

/* clean black-and-white portrait, fading out at the bottom */
.hero__cutout {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: 50% 100%;
  filter: grayscale(1) contrast(1.08);
  opacity: var(--portrait-opacity);
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 98%);
}
.hero > :not(.hero__face):not(.hero__aura):not(.hero__marks) { position: relative; z-index: 1; }
.hero > .hero__bottom, .hero > .hero__meta { z-index: 3; } /* buttons and the meta row stay above the photo and the route */

.hero__title {
  --hero-fs: min(27vw, 42vh, 30rem);
  font-family: var(--f-display); font-weight: 400;
  font-size: var(--hero-fs);
  line-height: .82; letter-spacing: -.02em;
  margin: 1.5vh 0 .5vh;
  display: grid; justify-items: start;
}
.hero__name { margin-left: -.04em; padding-right: .06em; }
.hero__serif {
  font-family: var(--f-serif); font-style: italic; font-size: .36em; line-height: 1.05;
  letter-spacing: -.01em; padding-left: .08em;
}
.hero__lede { display: flex; flex-direction: column; gap: 8px; }
.hero__role { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.hero__role .mono { color: var(--muted); }
.rotator {
  display: grid; overflow: hidden;
  font-family: var(--f-serif); font-style: italic; font-size: clamp(1.4rem, 2vw, 2.2rem);
  line-height: 1.15; height: 1.15em; color: var(--accent); letter-spacing: 0;
}
.rotator__word { grid-area: 1 / 1; white-space: nowrap; }
html.js .rotator__word + .rotator__word { transform: translateY(100%); }

.hero__bottom { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 32px; align-items: end; }
.hero__intro { max-width: 460px; font-size: clamp(16px, 1.35vw, 19px); color: var(--muted); }
.hero__intro em { font-family: var(--f-serif); font-size: 1.2em; color: var(--ink); }
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__wins { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hero__wins li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 100px;
  font-size: 11px; background: color-mix(in srgb, var(--paper) 75%, transparent);
}
.hero__wins b { font-weight: 500; padding: 3px 8px; border-radius: 100px; background: var(--ink); color: var(--paper); }
.hero__wins li:first-child b { background: var(--gold); color: #1B1406; }

.badge { width: 130px; height: 130px; position: relative; display: grid; place-items: center; }
.badge__text { position: absolute; inset: 0; animation: spin 14s linear infinite; }
.badge__text text { font-family: var(--f-mono); font-size: 13.5px; letter-spacing: 2px; fill: var(--ink); }
.badge__arrow { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 22px; transition: transform .5s var(--ease); }
.badge:hover .badge__arrow { transform: scale(1.15) rotate(-360deg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Marquee ---------- */
.marquee {
  background: var(--ink); color: var(--paper);
  padding: 22px 0; overflow: hidden;
  transform: rotate(-2deg) scale(1.04);
  margin: 40px 0;
  position: relative; z-index: 2;
}
.marquee__track { display: flex; gap: 40px; width: max-content; will-change: transform; }
.marquee span { font-family: var(--f-display); font-size: clamp(2rem, 5vw, 4rem); text-transform: uppercase; line-height: 1; }
.marquee span:nth-of-type(even) { font-family: var(--f-serif); font-style: italic; text-transform: none; }
.marquee b { color: var(--accent); font-size: clamp(1.5rem, 3vw, 2.4rem); align-self: center; font-weight: 400; }

/* ---------- About ---------- */
.about__manifesto {
  font-size: clamp(1.8rem, 4.2vw, 4rem);
  line-height: 1.12; letter-spacing: -.02em; font-weight: 500;
  max-width: 1300px;
  text-indent: 18%;
}
.about__manifesto .word { display: inline-block; text-indent: 0; }

.about__grid { display: grid; grid-template-columns: minmax(260px, 400px) 1fr; gap: clamp(32px, 6vw, 96px); margin-top: clamp(64px, 9vw, 130px); align-items: center; }

/* story → pipeline → DEEPAK.EXE, beside the portrait */
.about__side { display: flex; flex-direction: column; gap: clamp(22px, 2.6vw, 34px); max-width: 640px; }
.about__story { display: flex; flex-direction: column; gap: 12px; font-size: clamp(16px, 1.3vw, 19px); color: var(--muted); }
.about__story em { font-family: var(--f-serif); font-size: 1.18em; color: var(--ink); }

.pipeline { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; font-size: 11px; }
.pipeline li { display: flex; align-items: center; }
.pipeline li span { padding: 7px 12px; border: 1px solid var(--line); border-radius: 100px; transition: border-color .4s, color .4s, background-color .4s; }
.pipeline li:last-child span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* connector arrow between stages: a line that draws, plus a head */
.pipeline li + li::before {
  content: ""; width: clamp(18px, 2.4vw, 34px); height: 1px; margin: 0 2px 0 6px;
  background: var(--accent); transform-origin: left; transform: scaleX(var(--draw, 1));
}
.pipeline li + li span { position: relative; }
.pipeline li + li span::before {
  content: ""; position: absolute; left: -9px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  border-top: 1px solid var(--accent); border-right: 1px solid var(--accent); rotate: 45deg;
  opacity: var(--draw, 1);
}

/* DEEPAK.EXE: same window chrome as the terminal */
.exe {
  --t-bg: #121110; --t-bar: #1B1917; --t-fg: #EEE9DF; --t-dim: #8F887D; --t-line: rgba(238, 233, 223, .12); --t-green: #4CD38A;
  background: var(--t-bg); color: var(--t-fg); border: 1px solid var(--t-line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .55);
}
.exe__bar { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: var(--t-bar); border-bottom: 1px solid var(--t-line); color: var(--t-dim); font-size: 11px; }
.exe__dots { display: flex; gap: 5px; }
.exe__dots i { width: 8px; height: 8px; border-radius: 50%; background: #3A3632; }
.exe__dots i:first-child { background: var(--accent); }
.exe__rows { display: grid; gap: 2px; padding: 14px 16px 16px; font-size: 12px; text-transform: none; letter-spacing: .01em; }
.exe__rows div { display: grid; grid-template-columns: 17ch 1fr; gap: 12px; align-items: baseline; padding: 3px 0; }
.exe__rows div + div { border-top: 1px dashed var(--t-line); }
.exe__rows dt { color: var(--accent); white-space: nowrap; }
.exe__rows dd { color: var(--t-fg); }
.exe__rows div:last-child dd::after { content: "_"; color: var(--t-green); animation: blink 1s steps(1) infinite; margin-left: 2px; }

.about__portrait { transform-style: preserve-3d; }
.portrait { position: relative; margin: 0; transform-style: preserve-3d; }
.portrait__stage { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 0 0 14px 14px; }
.portrait__arch {
  position: absolute; left: 6%; right: 6%; top: 26%; bottom: 0;
  border-radius: 999px 999px 14px 14px;
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, #fff 22%, var(--accent)), var(--accent) 62%);
}
/* head breaks out above the arch; shoulders spill past its sides */
.portrait__cut {
  position: absolute; left: 0; bottom: 0; width: 100%; height: auto;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .28));
}
.portrait__sticker {
  position: absolute; left: -18px; bottom: 72px; z-index: 2;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--f-serif); font-style: italic; font-size: clamp(1.2rem, 1.8vw, 1.6rem); line-height: 1;
  padding: 10px 18px; border-radius: 100px; white-space: nowrap;
  rotate: -6deg; translate: 0 0 60px;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .45);
}
.hand { display: inline-block; transform-origin: 70% 70%; animation: hand 2.6s ease-in-out infinite; }
@keyframes hand { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.portrait__caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 11px; color: var(--muted); }
.portrait__caption span:last-child { color: var(--accent-text); text-align: right; }

/* compact strip after the narrative */
.about__stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat__num { font-family: var(--f-display); font-size: clamp(2.4rem, 4.4vw, 4.2rem); line-height: 1; }
.stat__label { color: var(--muted); font-size: 14px; }
.stat__src { font-size: 10px; opacity: .8; white-space: nowrap; }

/* ---------- Work (horizontal) ---------- */
.work { position: relative; }
.work__pin { height: 100vh; overflow: hidden; overflow: clip; position: relative; } /* clip: can't be scrolled, even by keyboard focus */
.work__track { display: flex; height: 100%; width: max-content; will-change: transform; }

/* progress HUD for the horizontal scroll */
.work__hud {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 22px; z-index: 2;
  display: flex; align-items: center; gap: 18px; color: var(--muted); pointer-events: none;
}
.work__count b { color: var(--ink); font-weight: 500; }
.work__bar { flex: 1; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.work__bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }

.panel { height: 100%; flex-shrink: 0; padding: 96px var(--gutter) 64px; position: relative; }
.panel--intro { width: 60vw; display: flex; flex-direction: column; justify-content: center; }
.panel__hint { color: var(--muted); display: flex; gap: 10px; align-items: center; }
.arrow-slide { display: inline-block; animation: slide 1.6s var(--ease) infinite; color: var(--accent); }
@keyframes slide { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(10px); } }

.project { width: 88vw; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.project__head { display: flex; justify-content: space-between; align-items: flex-start; }
.project__num { font-family: var(--f-display); font-size: clamp(2rem, min(5vw, 9vh), 4.5rem); line-height: 1; -webkit-text-stroke: 1px var(--ink); color: transparent; }
.project__year { color: var(--muted); }
.project__body { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: center; min-height: 0; }
.project__title { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.6rem, min(7vw, 12vh), 7rem); line-height: .92; }
.project__title .serif { color: var(--accent); }
.project__tag { font-size: clamp(1.1rem, min(2vw, 3.4vh), 1.8rem); line-height: 1.2; margin: 10px 0 min(26px, 2.6vh); max-width: 34ch; }
.project__metrics { list-style: none; display: flex; gap: clamp(18px, 3vw, 40px); padding: min(18px, 1.8vh) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: min(20px, 2vh); }
.project__metrics li { display: flex; flex-direction: column; }
.project__metrics strong { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.4rem, min(2.6vw, 4.6vh), 2.4rem); line-height: 1.1; color: var(--accent); }
.project__metrics span { font-size: 12px; color: var(--muted); }
.project__links { margin-top: min(24px, 2.4vh); display: flex; gap: 24px; }

.project__visual {
  position: relative; aspect-ratio: 1; width: min(100%, 62vh); justify-self: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  transform-style: preserve-3d;
}
.project__visual svg { width: 100%; height: 100%; }
.visual__caption { position: absolute; left: 16px; bottom: 14px; color: var(--muted); }

/* LifeLine visual */
.l-edges line { stroke: var(--ink); stroke-width: 2; opacity: .18; }
.l-blocked { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 6 6; opacity: .8; }
.l-x { fill: var(--accent); font-size: 20px; font-family: var(--f-sans); }
.l-nodes circle { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.l-start { fill: var(--ink); }
.l-end { fill: var(--accent); }
.l-path { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 520; stroke-dashoffset: 520; animation: route 4s var(--ease) infinite; }
.l-car { fill: var(--ink); stroke: var(--card); stroke-width: 3; }
@keyframes route { 0% { stroke-dashoffset: 520; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }

/* BroadBridge visual: Monte Carlo fan */
.w-grid line { stroke: var(--ink); opacity: .1; stroke-dasharray: 4 6; }
.w-band { fill: var(--accent); opacity: .13; }
.w-paths polyline {
  fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; opacity: .3;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  animation: sim 5s var(--ease) infinite; animation-delay: calc(var(--i) * 45ms);
}
.w-goal { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 6; }
.w-label { fill: var(--accent); font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; }
.w-median {
  fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 600; stroke-dashoffset: 600; animation: sim 5s var(--ease) infinite; animation-delay: .8s;
}
.w-start { fill: var(--ink); }
.w-end { fill: var(--accent); stroke: var(--card); stroke-width: 3; }
@keyframes sim { 0% { stroke-dashoffset: 600; } 50%, 88% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }

/* UPI Risk Desk visual: dispute ring */
.u-edges line { stroke: var(--ink); stroke-width: 1.2; opacity: .15; }
.u-nodes circle { fill: var(--ink); opacity: .32; }
.u-pulse { fill: none; stroke: var(--accent); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ringPulse 2.6s ease-out infinite; }
.u-ring {
  fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--accent); stroke-width: 3; stroke-linejoin: round;
  stroke-dasharray: 480; stroke-dashoffset: 480; animation: loopDraw 4s var(--ease) infinite;
}
.u-ring-nodes circle { fill: var(--card); stroke: var(--accent); stroke-width: 3; }
.u-coin { fill: var(--accent); }
.u-label { fill: var(--accent); font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; }
@keyframes ringPulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes loopDraw { 0% { stroke-dashoffset: 480; } 40%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -480; } }

/* NER SafeRoute visual: contours + detour */
.n-contours path { fill: none; stroke: var(--ink); stroke-width: 1.2; opacity: .2; }
.n-hatch { stroke: var(--accent); stroke-width: 3; opacity: .45; }
.n-hazard { fill: url(#n-hatch); }
.n-hazard-ring { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 6; transform-box: fill-box; transform-origin: center; animation: spin 16s linear infinite; }
.n-label { fill: var(--accent); font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; }
.n-short { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 2 8; stroke-linecap: round; opacity: .45; }
.n-x { fill: var(--accent); font-size: 22px; font-family: var(--f-sans); }
.n-safe {
  fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 560; stroke-dashoffset: 560; animation: safeDraw 4.5s var(--ease) infinite;
}
.n-start { fill: var(--ink); }
.n-end { fill: var(--accent); stroke: var(--card); stroke-width: 3; }
@keyframes safeDraw { 0% { stroke-dashoffset: 560; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -560; } }

.panel--outro { width: 70vw; display: flex; flex-direction: column; justify-content: center; gap: 12px; border-left: 1px solid var(--line); }
.panel--outro p { color: var(--muted); }
.more { list-style: none; border-top: 1px solid var(--line); margin: 4px 0 18px; width: min(560px, 100%); }
.more li { border-bottom: 1px solid var(--line); }
.more a { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 14px; padding: 14px 0; transition: padding .4s var(--ease), color .3s; }
.more__name { font-family: var(--f-display); font-size: clamp(1.3rem, 2vw, 1.8rem); text-transform: uppercase; line-height: 1; }
.more em { color: var(--muted); font-size: 1.1rem; }
.more i { font-style: normal; color: var(--accent); transition: transform .4s var(--ease); }
.more a:hover { padding-left: 10px; color: var(--accent); }
.more a:hover i { transform: translate(3px, -3px); }
.outro__link { font-family: var(--f-display); font-size: clamp(4rem, 11vw, 11rem); line-height: .9; text-transform: uppercase; display: inline-flex; align-items: flex-start; gap: .1em; transition: color .4s var(--ease); width: max-content; }
.outro__link span { font-size: .45em; color: var(--accent); transition: transform .5s var(--ease); display: inline-block; }
.outro__link:hover { color: var(--accent); }
.outro__link:hover span { transform: translate(10px, -10px) rotate(45deg); }

/* ---------- Journey ---------- */
.rows { border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); position: relative; }
.row summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 180px 1.4fr 1fr 40px; gap: 24px; align-items: center;
  padding: 30px 0; position: relative; isolation: isolate;
  transition: padding .5s var(--ease), color .4s var(--ease);
}
.row summary::-webkit-details-marker { display: none; }
.row summary::before {
  content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1;
  background: var(--accent); transform: scaleY(0); transform-origin: bottom;
  transition: transform .5s var(--ease);
}
.row summary:hover::before { transform: scaleY(1); }
.row summary:hover { color: var(--accent-ink); padding-left: 16px; }
.row summary:hover .row__date { color: inherit; }
.row__date { color: var(--muted); transition: color .3s; }
.row__title { font-family: var(--f-display); font-size: clamp(1.6rem, 3vw, 2.8rem); text-transform: uppercase; line-height: 1; }
.row__org { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.1rem, 1.6vw, 1.5rem); }
.row__icon { font-size: 28px; justify-self: end; transition: transform .5s var(--ease); font-weight: 300; }
.row[open]:not(.is-closing) .row__icon { transform: rotate(45deg); }
/* padding lives on the list so the body can animate down to a true 0 height */
.row__body { display: grid; grid-template-columns: 180px 1fr; gap: 24px; overflow: hidden; }
.row__body ul { grid-column: 2; list-style: none; display: flex; flex-direction: column; gap: 10px; color: var(--muted); max-width: 70ch; padding-bottom: 32px; }
.row__body li { padding-left: 22px; position: relative; }
.row__body li::before { content: "↳"; position: absolute; left: 0; color: var(--accent); }
.row__body strong { color: var(--ink); font-weight: 600; }

.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: clamp(64px, 8vw, 110px); }
.skills__col { border-top: 1px solid var(--ink); padding-top: 16px; }
.skills__col h3 { color: var(--accent-text); font-size: 12px; margin-bottom: 14px; font-weight: 500; }
.skills__col p { font-size: clamp(1.1rem, 1.6vw, 1.45rem); line-height: 1.45; font-weight: 500; }

/* ---------- Trophies ---------- */
.trophies { background: var(--paper-2); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; perspective: 1200px; }
.card {
  position: relative; overflow: hidden;
  min-height: 380px; padding: 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  transform-style: preserve-3d;
  transition: box-shadow .4s var(--ease-out);
}
.card:hover { box-shadow: 0 30px 60px -30px rgba(0,0,0,.35); }
.card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card__kind { display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.card__kind span { color: var(--ink); }
.card__emoji { font-size: 44px; line-height: 1; transform: translateZ(60px); filter: saturate(.9); }
.card__rank { font-family: var(--f-display); font-size: clamp(3.6rem, 5.6vw, 6rem); line-height: .9; -webkit-text-stroke: 1.5px var(--ink); color: transparent; transform: translateZ(40px); white-space: nowrap; }
.card__body { display: flex; flex-direction: column; gap: 6px; }
.card h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.5rem, 2vw, 2rem); text-transform: uppercase; line-height: 1; transform: translateZ(30px); }
.card p { font-family: var(--f-serif); font-style: italic; font-size: 1.2rem; line-height: 1.25; color: var(--muted); transform: translateZ(20px); }
.card__shine {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.35), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.card:hover .card__shine { opacity: 1; }
.card--gold { background: linear-gradient(145deg, #F4D46A 0%, var(--gold) 45%, #A87B12 100%); color: #1B1406; border-color: transparent; }
.card--gold .card__rank { -webkit-text-stroke-color: #1B1406; }
.card--gold p, .card--gold .card__kind { color: rgba(27,20,6,.72); }
.card--gold .card__kind span { color: #1B1406; }
.card--gold::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%); animation: sheen 3.5s ease-in-out infinite;
}
@keyframes sheen { 0%, 40% { transform: translateX(-120%); } 80%, 100% { transform: translateX(120%); } }

.certs { margin-top: clamp(56px, 7vw, 96px); }
.certs h3 { color: var(--accent-text); font-size: 12px; margin-bottom: 16px; font-weight: 500; }
.certs ul { list-style: none; border-top: 1px solid var(--line); }
.certs li { border-bottom: 1px solid var(--line); }
.certs__row, .certs li > a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 20px 0; transition: padding .4s var(--ease), color .3s;
}
.certs li:hover > .certs__row, .certs li:hover > a { padding-left: 14px; }
.certs li > a:hover { color: var(--accent); }
.certs__name { font-size: clamp(1.05rem, 1.6vw, 1.4rem); font-weight: 500; }
.certs__name i { font-style: normal; color: var(--accent); font-size: .8em; }
.certs__by { color: var(--muted); white-space: nowrap; }

.card__link { align-self: flex-start; margin-top: 6px; font-size: 11px; border-bottom: 1px solid currentColor; padding-bottom: 2px; transform: translateZ(20px); transition: color .3s; }
.card__link:hover { color: var(--accent); }
.card--gold .card__link:hover { color: #1B1406; opacity: .7; }
.row__cert { color: var(--accent-text); border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.row__body li:has(.row__cert)::before { content: none; }
.row__body li:has(.row__cert) { padding-left: 0; }

/* ---------- Lab: Path Lab ---------- */
.lab__head { display: grid; grid-template-columns: 1fr minmax(260px, 440px); gap: 24px 64px; align-items: end; margin-bottom: clamp(36px, 5vw, 64px); }
.lab__head .big-title { margin-bottom: 0; }
.lab__lede { color: var(--muted); font-size: clamp(16px, 1.3vw, 19px); }
.lab__lede em { font-family: var(--f-serif); font-size: 1.2em; color: var(--ink); }

.lab__app {
  display: grid; gap: 14px;
  padding: clamp(12px, 1.6vw, 20px);
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper-2);
}
.lab__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.lab__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn--sm { padding: 10px 18px; font-size: 13px; gap: 10px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 100px; background: var(--card); }
.seg button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 100px;
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase;
  transition: background-color .3s, color .3s;
}
@media (hover: hover) { .seg button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); } }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* legend + brush swatches */
.key { display: inline-block; width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }
.key--wall { background: var(--ink); box-shadow: 0 0 0 1px var(--paper); }
.key--mud { background: color-mix(in srgb, var(--muted) 45%, var(--card)); }
.key--erase { border: 1px dashed currentColor; }
.key--seen { background: color-mix(in srgb, var(--accent) 30%, var(--card)); }
.key--path { height: 4px; width: 16px; border-radius: 4px; background: var(--accent); }
.key--start, .key--end { border-radius: 50%; background: var(--ink); }
.key--end { background: var(--accent); }

.lab__stage { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.lab__canvas { display: block; width: 100%; height: 480px; touch-action: none; cursor: crosshair; }

.lab__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; font-size: 11px; }
.lab__legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.lab__legend li { display: inline-flex; align-items: center; gap: 7px; }
.lab__status { color: var(--muted); text-transform: none; letter-spacing: 0; }
.lab__status b { color: var(--ink); font-weight: 500; }

.race { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.algo {
  display: grid; gap: 8px; text-align: left;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  transition: border-color .3s, box-shadow .3s, transform .5s var(--ease);
}
@media (hover: hover) { .algo:hover { border-color: var(--ink); transform: translateY(-2px); } }
.algo[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.algo__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.algo__name { font-family: var(--f-display); font-size: clamp(1.4rem, 2vw, 1.9rem); text-transform: uppercase; line-height: 1; }
.algo__desc { font-family: var(--f-serif); font-style: italic; font-size: 1.05rem; line-height: 1.2; color: var(--muted); }
.algo__flag { font-size: 10px; padding: 3px 8px; border-radius: 100px; border: 1px solid var(--line); white-space: nowrap; color: var(--muted); }
.algo__flag.is-good { background: #2BB673; border-color: transparent; color: #0B2A1A; }
.algo__flag.is-bad { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.algo__bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.algo__bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); transition: transform .6s var(--ease); }
.algo[aria-pressed="true"] .algo__bar i { background: var(--accent); }
.algo__nums { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.algo__nums b { color: var(--ink); font-weight: 500; }

/* ---------- Lab: Terminal ---------- */
.shell { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: clamp(28px, 5vw, 80px); align-items: start; margin-top: clamp(80px, 10vw, 140px); }
.shell__kicker { color: var(--accent-text); }
.shell__intro h3 { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.6rem, 4.6vw, 4.4rem); line-height: .92; margin: 10px 0 18px; }
.shell__intro h3 .serif { color: var(--accent); }
.shell__intro p { color: var(--muted); }
.shell__intro code, .shell__intro kbd {
  font-family: var(--f-mono); font-size: .82em; color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 6px; border-radius: 4px;
}
.shell__tip { margin-top: 18px; font-size: 11px; }
@media (hover: none) { .shell__tip { display: none; } } /* no keyboard shortcuts on touch */

.term {
  --t-bg: #121110; --t-bar: #1B1917; --t-fg: #EEE9DF; --t-dim: #8F887D; --t-line: rgba(238, 233, 223, .12); --t-green: #4CD38A;
  background: var(--t-bg); color: var(--t-fg);
  border: 1px solid var(--t-line); border-radius: 12px; overflow: hidden;
  font-family: var(--f-mono); font-size: 13px; line-height: 1.6;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .55);
  transition: border-color .3s;
}
.term:focus-within { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.term__bar { display: flex; align-items: center; gap: 14px; padding: 11px 16px; background: var(--t-bar); border-bottom: 1px solid var(--t-line); color: var(--t-dim); font-size: 11px; }
.term__dots { display: flex; gap: 6px; }
.term__dots i { width: 10px; height: 10px; border-radius: 50%; background: #3A3632; }
.term__dots i:first-child { background: var(--accent); }
.term__title { flex: 1; text-align: center; }
.term__out {
  height: clamp(300px, 46vh, 420px); overflow-y: auto; padding: 16px 18px 4px;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3A3632 transparent;
}
.t-line { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }
.t-acc { color: var(--accent); }
.t-dim { color: var(--t-dim); }
.t-ok, .t-prompt { color: var(--t-green); }
.t-err { color: #FF7A59; }
.t-line a { color: var(--t-fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.t-line a:hover { color: var(--accent); }
.t-cmd { font: inherit; color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; }
.t-cmd:hover { color: var(--t-fg); }
.term__form { display: flex; align-items: center; gap: 10px; padding: 6px 18px 16px; }
.term__prompt { color: var(--t-green); white-space: nowrap; }
.term__input { flex: 1; min-width: 0; font: inherit; color: var(--t-fg); background: transparent; border: 0; outline: none; caret-color: var(--accent); }
.term__input::placeholder { color: var(--t-dim); opacity: .6; }
/* snake */
.t-game { margin: 6px 0 10px; user-select: none; touch-action: none; }
.t-game__board {
  display: grid; grid-template-columns: repeat(var(--cols), 13px); grid-auto-rows: 13px; gap: 2px;
  padding: 8px; width: max-content; border: 1px solid var(--t-line); border-radius: 6px; background: rgba(238, 233, 223, .02);
}
.t-game__board i { border-radius: 3px; background: rgba(238, 233, 223, .06); }
.t-game__board i.g-s { background: color-mix(in srgb, var(--accent) 70%, var(--t-bg)); }
.t-game__board i.g-h { background: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.t-game__board i.g-f { background: var(--t-green); border-radius: 50%; transform: scale(.8); }
.t-game__status { margin-top: 6px; color: var(--t-fg); display: flex; align-items: center; gap: 14px; }
.t-game__quit { font: inherit; color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; min-height: 32px; padding: 0 6px; }
@media (max-width: 520px) { .t-game__board { grid-template-columns: repeat(var(--cols), 12px); grid-auto-rows: 12px; padding: 6px; } }
.term__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--t-line); }
.term__chips button { font-size: 11px; color: var(--t-fg); border: 1px solid var(--t-line); border-radius: 100px; padding: 5px 11px; transition: border-color .3s, color .3s; }
@media (hover: hover) { .term__chips button:hover { border-color: var(--accent); color: var(--accent); } }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 988; display: grid; place-items: start center; padding: 14vh 16px 16px; }
.palette[hidden] { display: none; }
.palette__backdrop { position: absolute; inset: 0; background: rgba(10, 9, 8, .45); opacity: 0; transition: opacity .35s var(--ease-out); }
.palette__panel {
  position: relative; width: min(600px, 100%);
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(-14px) scale(.98);
  transition: opacity .3s var(--ease-out), transform .45s var(--ease-out);
}
.palette.is-open .palette__backdrop { opacity: 1; }
.palette.is-open .palette__panel { opacity: 1; transform: none; }
.palette__search { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.palette__caret { color: var(--accent); font-size: 22px; line-height: 1; }
.palette__input { flex: 1; min-width: 0; font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; outline: none; }
.palette__input::placeholder { color: var(--muted); opacity: .7; }
.palette__esc { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; }
.palette__list { list-style: none; max-height: min(52vh, 420px); overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.palette__group { padding: 10px 10px 6px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); }
.palette__item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.palette__item[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.palette__hint { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.palette__item[aria-selected="true"] .palette__hint { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.palette__empty { padding: 22px 12px; color: var(--muted); }
.palette__foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

/* ---------- Hero: TL;DR link ---------- */
.hero__tldr {
  flex-basis: 100%; justify-content: flex-start; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 0; margin-top: 2px; font-size: 11px; color: var(--muted); text-align: left;
}
.hero__tldr span { color: var(--ink); border-bottom: 1px solid currentColor; padding-bottom: 1px; transition: color .3s; }
.hero__tldr i { font-style: normal; color: var(--accent-text); transition: transform .4s var(--ease); }
.hero__tldr:hover span { color: var(--accent-text); }
.hero__tldr:hover i { transform: translateX(4px); }

/* ---------- TL;DR dialog ---------- */
.tldr { position: fixed; inset: 0; z-index: 985; display: grid; place-items: center; padding: 16px; }
.tldr[hidden] { display: none; }
.tldr__backdrop { position: absolute; inset: 0; background: rgba(10, 9, 8, .55); opacity: 0; transition: opacity .35s var(--ease-out); }
.tldr__panel {
  position: relative; width: min(960px, 100%); max-height: min(92vh, 980px); max-height: min(92dvh, 980px); display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(24px) scale(.985); transition: opacity .35s var(--ease-out), transform .55s var(--ease-out);
}
.tldr__panel:focus { outline: none; }
.tldr.is-open .tldr__backdrop { opacity: 1; }
.tldr.is-open .tldr__panel { opacity: 1; transform: none; }
.tldr__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.tldr__hint { color: var(--muted); font-size: 11px; }
.tldr__actions { display: flex; align-items: center; gap: 8px; }
.tldr__x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 15px; transition: background-color .3s; }
.tldr__x:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.tldr__sheet { overflow-y: auto; padding: clamp(20px, 3vw, 36px); overscroll-behavior: contain; }

.tldr__head { padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.tldr__kicker { color: var(--accent-text); font-size: 11px; }
.tldr__name { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: .95; margin: 6px 0 4px; }
.tldr__role { color: var(--muted); font-size: 14px; }
.tldr__status { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--ink); }
.tldr__status i { width: 8px; height: 8px; border-radius: 50%; background: #2BB673; }
@media print { .tldr__status { font-size: 7.5pt; margin-top: 3px; } .tldr__status i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.tldr__contact { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; font-size: 11px; text-transform: none; }
.tldr__contact a { border-bottom: 1px solid var(--line); }
.tldr__contact a:hover { color: var(--accent-text); }
.tldr__one { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.2; margin: 16px 0 6px; }
.tldr__grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px 36px; }
.tldr__block { margin-top: 16px; }
.tldr__block h3 { font-size: 11px; font-weight: 500; color: var(--accent-text); padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.tldr__wins { list-style: none; display: grid; gap: 7px; font-size: 14px; }
.tldr__wins li { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: baseline; }
.tldr__wins b { justify-self: start; font-weight: 500; font-size: 10px; padding: 2px 7px; border-radius: 100px; background: var(--ink); color: var(--paper); }
.tldr__wins li:first-child b { background: var(--gold); color: #1B1406; }
.tldr__projects ul { list-style: none; display: grid; gap: 12px; }
.tldr__ptop { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tldr__ptop strong { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: 1.15rem; letter-spacing: .01em; }
.tldr__when { color: var(--muted); font-size: 10px; }
.tldr__links { margin-left: auto; display: flex; gap: 10px; font-size: 10px; }
.tldr__links a { color: var(--accent-text); }
.tldr__projects p { font-size: 14px; }
.tldr__projects .tldr__metrics { font-size: 10.5px; text-transform: none; letter-spacing: 0; color: var(--ink); margin-top: 2px; }
.tldr__projects .tldr__stack { font-size: 10px; color: var(--muted); margin-top: 2px; }
.tldr__more { font-size: 10px; color: var(--muted); margin-top: 10px; text-transform: none; }
.tldr__list { list-style: none; display: grid; gap: 7px; font-size: 13.5px; }
.tldr__note { display: block; color: var(--muted); font-size: 12.5px; }
.tldr__skills { display: grid; gap: 6px; font-size: 13.5px; }
.tldr__skills div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: baseline; }
.tldr__skills dt { font-size: 10px; color: var(--muted); }
.tldr__foot { margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-transform: none; }

@media (max-width: 760px) {
  .tldr { padding: 0; place-items: end center; }
  .tldr__panel { max-height: 94vh; max-height: 94dvh; border-radius: 14px 14px 0 0; }
  .tldr__hint { display: none; }
  .tldr__bar { padding-left: 14px; }
  .tldr__grid { grid-template-columns: 1fr; }
}

/* ---------- Print: the TL;DR sheet is the printout ---------- */
@media print {
  @page { size: A4; margin: 12mm 13mm; }
  :root, [data-theme="dark"] {
    --paper: #fff; --paper-2: #fff; --ink: #111; --muted: #555; --line: #ccc; --accent: #B4330F; --accent-text: #B4330F; --gold: #E8BE4A;
  }
  html, body { background: #fff !important; color: #111; }
  body > :not(.tldr) { display: none !important; }
  .tldr, .tldr[hidden] { display: block !important; position: static; padding: 0; }
  .tldr__backdrop, .tldr__bar { display: none !important; }
  .tldr__panel { position: static; width: auto; max-height: none; border: 0; box-shadow: none; border-radius: 0; opacity: 1 !important; transform: none !important; overflow: visible; }
  .tldr__sheet { overflow: visible; padding: 0; }
  .tldr__name { font-size: 26pt; margin: 2px 0; }
  .tldr__role { font-size: 9.5pt; }
  .tldr__contact { font-size: 8pt; margin-top: 6px; }
  .tldr__head { padding-bottom: 8px; }
  .tldr__one { font-size: 12pt; margin: 8px 0 2px; }
  .tldr__block { margin-top: 8px; }
  .tldr__block h3 { font-size: 7.5pt; margin-bottom: 5px; padding-bottom: 3px; }
  .tldr__projects li, .tldr__list li, .tldr__wins li { break-inside: avoid; }
  .tldr__wins, .tldr__list, .tldr__skills, .tldr__projects p { font-size: 8.8pt; line-height: 1.35; }
  .tldr__wins, .tldr__list, .tldr__projects ul { gap: 4px; }
  .tldr__projects ul { gap: 7px; }
  .tldr__note { font-size: 8pt; }
  .tldr__projects .tldr__metrics { font-size: 7.6pt; }
  .tldr__projects .tldr__stack, .tldr__when, .tldr__links, .tldr__more, .tldr__skills dt { font-size: 7pt; }
  .tldr__ptop strong { font-size: 10.5pt; }
  .tldr__grid { gap: 2px 24px; grid-template-columns: 1.2fr 1fr; }
  .tldr__foot { margin-top: 10px; font-size: 7pt; }
  .tldr__links a::after { content: ""; }
  .tldr__wins b { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Contact ---------- */
.contact__title { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(3.6rem, 13vw, 13rem); line-height: .88; margin-bottom: clamp(48px, 6vw, 90px); }
.contact__title .serif { color: var(--accent); }
.contact__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }

.email { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; margin-bottom: 48px; }
.email__text { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.8rem, 4.4vw, 4rem); line-height: 1.05; position: relative; word-break: break-all; }
.email__text::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.email:hover .email__text::after { transform: scaleX(1); }
.email__hint { color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 22px; margin-bottom: 40px; }
.form label { display: flex; flex-direction: column; gap: 8px; }
.form label > span { color: var(--muted); }
.form input, .form textarea {
  font: inherit; font-size: 18px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 8px 0 12px; resize: vertical; outline: none;
  transition: border-color .3s;
}
.form input::placeholder, .form textarea::placeholder { color: var(--muted); opacity: .6; }
.form input:focus, .form textarea:focus { border-color: var(--accent); }
.form .btn { align-self: flex-start; }

.socials { display: flex; flex-wrap: wrap; gap: 28px; }

.coffee {
  position: sticky; top: 110px;
  background: var(--ink); color: var(--paper);
  border-radius: 14px; padding: clamp(24px, 3vw, 40px);
  display: flex; flex-direction: column; gap: 14px;
  overflow: hidden; transform-style: preserve-3d;
}
.coffee::before {
  content: ""; position: absolute; width: 320px; height: 320px; right: -120px; top: -120px;
  border-radius: 50%; background: var(--accent); opacity: .18; filter: blur(10px);
}
.coffee__kicker { color: var(--accent); }
.coffee h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.4rem, 4vw, 3.6rem); text-transform: uppercase; line-height: .95; }
.coffee h3 .serif { color: var(--accent); }
.coffee p { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.coffee p em { font-family: var(--f-serif); font-size: 1.15em; }
.coffee__fine { color: color-mix(in srgb, var(--paper) 72%, transparent); margin-top: 6px; }
.btn--coffee { align-self: flex-start; background: #FFDD00; color: #111; border-color: #FFDD00; margin-top: 8px; }
.btn--coffee::before { background: var(--accent); }
.btn--coffee:hover { color: #fff; border-color: var(--accent); }
.btn--coffee:hover i { transform: rotate(-12deg) scale(1.2); }
.coffee__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.coffee__actions .btn--coffee { margin-top: 0; }
.coffee__other { align-self: flex-start; font-size: 10px; text-transform: none; color: color-mix(in srgb, var(--paper) 72%, transparent); border-bottom: 1px solid currentColor; }
.coffee__other:hover { color: var(--paper); }
/* no UPI ID yet: the buy button stays hidden and the chat leads */
html:not(.has-upi) .coffee__buy { display: none; }
.btn--chat { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 45%, transparent); }
.btn--chat::before { background: var(--paper); }
.btn--chat:hover { color: var(--ink); border-color: var(--paper); }
html:not(.has-upi) .btn--chat { background: #FFDD00; color: #111; border-color: #FFDD00; }
html:not(.has-upi) .btn--chat::before { background: var(--accent); }
html:not(.has-upi) .btn--chat:hover { color: #fff; border-color: var(--accent); }

/* ---------- Coffee dialog (UPI) ---------- */
.cafe { position: fixed; inset: 0; z-index: 986; display: grid; place-items: center; padding: 16px; }
.cafe[hidden] { display: none; }
.cafe__backdrop { position: absolute; inset: 0; background: rgba(10, 9, 8, .55); opacity: 0; transition: opacity .35s var(--ease-out); }
.cafe__panel {
  position: relative; width: min(640px, 100%); max-height: 94vh; max-height: 94dvh; overflow-y: auto;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(22px, 3.4vw, 36px); box-shadow: 0 60px 120px -40px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(24px) scale(.985); transition: opacity .35s var(--ease-out), transform .55s var(--ease-out);
}
.cafe__panel:focus { outline: none; }
.cafe.is-open .cafe__backdrop { opacity: 1; }
.cafe.is-open .cafe__panel { opacity: 1; transform: none; }
.cafe__x { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; }
.cafe__x:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.cafe__kicker { color: var(--accent-text); font-size: 11px; }
.cafe__title { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: .95; margin: 8px 0 18px; }
.cafe__title .serif { color: var(--accent); }
.cafe__sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cafe__sizes button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-align: left; transition: border-color .3s, box-shadow .3s;
}
.cafe__sizes button span { font-size: 13px; color: var(--muted); }
.cafe__sizes button b { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; line-height: 1; }
.cafe__sizes button:hover { border-color: var(--ink); }
.cafe__sizes button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cafe__pay { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: center; margin-top: 20px; }
.cafe__qrwrap { margin: 0; }
.cafe__qr { aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.cafe__qr svg { width: 100%; height: 100%; display: block; shape-rendering: crispEdges; }
.cafe__qrwrap figcaption { margin-top: 8px; font-size: 10px; color: var(--muted); }
.cafe__qrwrap figcaption b { color: var(--ink); font-weight: 500; }
.cafe__side { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.cafe__note { color: var(--muted); font-size: 14px; }
.cafe__id { display: inline-flex; gap: 12px; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px dashed var(--line); border-radius: 100px; font-size: 12px; text-transform: none; }
.cafe__id i { font-style: normal; color: var(--accent-text); text-transform: uppercase; font-size: 10px; }
.cafe__id:hover { border-color: var(--ink); }
.cafe__fine { color: var(--muted); font-size: 10px; text-transform: none; }
.cafe__alt { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.cafe__alt a { color: var(--ink); border-bottom: 1px solid currentColor; }
.cafe__alt a:hover { color: var(--accent-text); }
@media (max-width: 560px) {
  .cafe { padding: 0; place-items: end center; }
  .cafe__panel { border-radius: 16px 16px 0 0; }
  .cafe__sizes { grid-template-columns: 1fr 1fr; }
  .cafe__pay { grid-template-columns: 1fr; }
  .cafe__qrwrap { width: min(220px, 70%); justify-self: center; }
}

.coffee__cup { position: relative; width: 120px; height: 130px; margin: 6px 0 4px; transform: translateZ(40px); }
.cup { position: absolute; bottom: 14px; left: 10px; width: 78px; height: 70px; background: var(--paper); border-radius: 4px 4px 30px 30px; overflow: hidden; }
.cup__coffee { position: absolute; left: 0; right: 0; top: 0; height: 12px; background: #6F4326; }
.cup__coffee::after { content: ""; position: absolute; left: 20%; top: 3px; width: 40%; height: 4px; border-radius: 4px; background: #A0673E; }
.cup__handle { position: absolute; right: -24px; top: 14px; width: 28px; height: 28px; border: 6px solid var(--paper); border-radius: 50%; }
.coffee__cup .cup { overflow: visible; }
.coffee__cup .cup__coffee { border-radius: 4px 4px 0 0; }
.saucer { position: absolute; bottom: 4px; left: 0; width: 110px; height: 12px; border-radius: 50%; background: var(--paper); opacity: .85; }
.steam { position: absolute; left: 22px; top: 0; width: 60px; height: 50px; display: flex; justify-content: space-between; }
.steam span { width: 6px; height: 40px; border-radius: 6px; background: linear-gradient(to top, color-mix(in srgb, var(--paper) 55%, transparent), transparent); filter: blur(2px); animation: steam 2.6s ease-in-out infinite; opacity: 0; }
.steam span:nth-child(2) { animation-delay: .6s; }
.steam span:nth-child(3) { animation-delay: 1.2s; }
@keyframes steam { 0% { transform: translateY(20px) scaleX(1); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-20px) scaleX(2.2) skewX(10deg); opacity: 0; } }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--paper); padding: 48px var(--gutter) 24px; overflow: hidden; }
.footer__top, .footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__top .mono { color: color-mix(in srgb, var(--paper) 72%, transparent); }
.footer__name { font-family: var(--f-display); font-size: 31vw; line-height: .8; letter-spacing: -.02em; margin: 40px 0 24px -.03em; white-space: nowrap; }
.footer__name .fl { display: inline-block; will-change: transform; }
.footer__name .fl--c { color: var(--accent); font-family: var(--f-sans); font-size: .25em; vertical-align: top; }

/* live GitHub strip */
.ghlive {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 28px; padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--paper) 16%, transparent); border-radius: 100px; width: max-content; max-width: 100%;
  color: color-mix(in srgb, var(--paper) 72%, transparent); font-size: 11px; transition: border-color .3s;
}
.ghlive[hidden] { display: none; }
.ghlive:hover { border-color: var(--accent); }
.ghlive b { color: var(--paper); font-weight: 500; }
.ghlive__dot { width: 8px; height: 8px; border-radius: 50%; background: #4CD38A; box-shadow: 0 0 0 0 rgba(76, 211, 138, .6); animation: pulse 2s infinite; }
.ghlive__label { color: var(--paper); }
.ghlive__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.ghlive__bars i { width: 5px; height: calc(var(--h) * 18px); min-height: 2px; border-radius: 1px; background: color-mix(in srgb, var(--paper) 22%, transparent); }
.ghlive__bars i.on { background: var(--accent); }
.footer__bottom { color: color-mix(in srgb, var(--paper) 72%, transparent); }

/* ---------- Theme switch (View Transitions) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 990;
  transform: translate(-50%, calc(100% + 60px));
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 20px; border-radius: 100px;
  opacity: 0; visibility: hidden;
  transition: transform .6s var(--ease), opacity .3s, visibility 0s .6s;
  pointer-events: none;
}
.toast.is-show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .6s var(--ease), opacity .3s; }

/* ---------- Easter egg ---------- */
.rain { position: fixed; top: -60px; z-index: 970; pointer-events: none; font-size: 32px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .card { min-height: 320px; }
  .nav__links { gap: 22px; }
  .nav__right { gap: 16px; }
}

@media (max-width: 1024px) {
  .hero__bottom { grid-template-columns: 1fr 1fr; }
  .badge { display: none; }
  .skills { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .race { grid-template-columns: 1fr 1fr; }
  .lab__head { grid-template-columns: 1fr; align-items: start; }
  .shell { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav__links, .nav__clock, .nav__cmd, .work__hud { display: none; }
  .nav__find { display: grid; }
  .nav__right { gap: 10px; }
  .nav__burger { display: block; }
  .hide-sm { display: none; }

  .hero { padding-top: 96px; }
  .hero__title { --hero-fs: min(32vw, 40vh); margin-top: 6vh; }
  .hero__serif { font-size: .42em; }
  /* phones: the portrait sits top-right behind the big name, as a faint watermark */
  .hero__face, .hero__aura, .hero__marks { top: 70px; bottom: auto; right: -12vw; height: min(52vh, 100vw); }
  /* the photo is a see-through watermark here, so anything behind it would show across the face */
  .hero__aura, .hero__marks { display: none; }
  .hero__face { z-index: 0; --portrait-opacity: .3; } /* faint watermark behind the name, as before */
  .hero__bottom { grid-template-columns: 1fr; gap: 24px; }

  .about__manifesto { text-indent: 0; }
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 360px; }
  .about__stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .portrait__sticker { left: -6px; }

  /* Work becomes vertical */
  .work__pin { height: auto; overflow: visible; }
  .work__track { flex-direction: column; width: 100%; transform: none !important; }
  .panel { height: auto; width: 100% !important; padding: 64px var(--gutter); border-left: 0; border-top: 1px solid var(--line); }
  .panel--intro { border-top: 0; padding-top: 96px; }
  .panel__hint { display: none; }
  .project__body { grid-template-columns: 1fr; margin-top: 24px; }
  .project__visual { width: 100%; order: -1; }
  .project__metrics { flex-wrap: wrap; }
  .outro__link { font-size: 22vw; }
  .more a { grid-template-columns: 1fr auto; row-gap: 4px; }
  .more em { grid-column: 1; grid-row: 2; }
  .more i { grid-column: 2; grid-row: 1 / 3; align-self: center; }

  .row summary { grid-template-columns: 1fr 32px; gap: 6px 16px; padding: 24px 0; }
  .row__date { grid-column: 1; grid-row: 1; }
  .row__title { grid-column: 1; grid-row: 2; }
  .row__org { grid-column: 1; grid-row: 3; }
  .row__icon { grid-column: 2; grid-row: 1 / 4; align-self: center; }
  .row__body { grid-template-columns: 1fr; }
  .row__body ul { grid-column: 1; }

  .certs__row, .certs li > a { flex-direction: column; gap: 4px; }
  .certs__by { white-space: normal; }
  .lab__actions .btn--sm { padding: 9px 14px; }

  .contact__grid { grid-template-columns: 1fr; }
  .coffee { position: relative; top: 0; }
}

@media (max-width: 520px) {
  .skills { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .stat { padding: 18px 12px; }
  .stat:nth-child(odd) { padding-left: 0; }
  .exe__rows div { grid-template-columns: 13.5ch 1fr; gap: 8px; }
  .pipeline { font-size: 10px; }
  .pipeline li span { padding: 6px 9px; }
  .pipeline li + li::before { width: 12px; margin: 0 1px 0 4px; }
  .stat__src { display: block; margin-top: 2px; }
  .hero__ctas .btn { padding: 14px 20px; }
  .portrait__caption { flex-direction: column; gap: 4px; }
  .portrait__caption span:last-child { text-align: left; }
  .footer__bottom { flex-direction: column; gap: 6px; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 260px; }
  .race { grid-template-columns: 1fr 1fr; gap: 6px; }
  .algo { padding: 12px; }
  .algo__desc { display: none; }
  .lab__bar { flex-direction: column; align-items: stretch; }
  .seg { justify-content: space-between; }
  .seg button { flex: 1; justify-content: center; padding: 8px 10px; }
  .lab__actions .btn--sm { flex: 1; justify-content: center; }
  .term { font-size: 12px; }
  .term__out { padding: 14px 14px 4px; }
  .term__form { padding: 6px 14px 14px; }
  .palette { padding-top: 10vh; }
  .ghlive { border-radius: 14px; width: auto; }
}

/* ---------- Phones in landscape: keep the whole portrait on screen ---------- */
@media (max-width: 960px) and (orientation: landscape) and (max-height: 520px) {
  .hero__face { top: 56px; right: 3vw; height: min(92vh, 44vw); }
}

/* ---------- Touch: 44px targets, no input zoom ---------- */
@media (pointer: coarse) {
  .term__input { font-size: 16px; }
  .term__chips button, .seg button { min-height: 44px; }
  .hero__tldr { min-height: 44px; align-items: center; }
  .palette__item { min-height: 48px; }
  .algo { min-height: 44px; }
}

/* ---------- Static fallback (no GSAP / reduced motion): stack the work panels ---------- */
.no-motion .work__pin { height: auto; overflow: visible; }
.no-motion .work__track { flex-direction: column; width: 100%; }
.no-motion .panel { height: auto; width: 100%; border-left: 0; border-top: 1px solid var(--line); padding: 72px var(--gutter); }
.no-motion .panel--intro { border-top: 0; }
.no-motion .panel__hint, .no-motion .work__hud { display: none; }
.no-motion .project__visual { width: min(100%, 520px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .l-path, .w-paths polyline, .w-median, .u-ring, .n-safe { animation: none !important; stroke-dashoffset: 0 !important; }
  .u-pulse { display: none; }
  .grain { display: none; }
}
