/* =========================================================
   irfanali.me
   ========================================================= */

/* ---------- tokens ---------- */
:root {
  --bg: #f6f5f1;
  --bg-2: #eeece6;
  --card: #fdfcfa;
  --text: #0f0f0f;
  --text-2: #56544f;
  --text-3: #8e8b84;
  --line: #e1ded6;
  --line-2: #cfcbc1;
  --accent: #e2470f;
  --accent-ink: #c23a08;
  --accent-soft: rgba(226, 71, 15, .09);
  --ok: #1f9d55;
  --scan-ground: 15, 15, 15;
  --scan-hit: 226, 71, 15;
  --grain: .05;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 68px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #09090a;
  --bg-2: #111113;
  --card: #121214;
  --text: #f0efeb;
  --text-2: #a6a49e;
  --text-3: #6c6a66;
  --line: #1f1f22;
  --line-2: #2d2d31;
  --accent: #ff6a2b;
  --accent-ink: #ff8a57;
  --accent-soft: rgba(255, 106, 43, .11);
  --ok: #3ddc84;
  --scan-ground: 240, 239, 235;
  --scan-hit: 255, 106, 43;
  --grain: .07;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090a;
    --bg-2: #111113;
    --card: #121214;
    --text: #f0efeb;
    --text-2: #a6a49e;
    --text-3: #6c6a66;
    --line: #1f1f22;
    --line-2: #2d2d31;
    --accent: #ff6a2b;
    --accent-ink: #ff8a57;
    --accent-soft: rgba(255, 106, 43, .11);
    --ok: #3ddc84;
    --scan-ground: 240, 239, 235;
    --scan-hit: 255, 106, 43;
    --grain: .07;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--sans); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
svg { width: 1em; height: 1em; flex: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.mono { font-family: var(--mono); font-size: .76rem; letter-spacing: .02em; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); }
.skip:focus { top: 16px; }

/* film grain: barely there, but it takes the digital edge off */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: .6em;
  height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--text);
  font-weight: 500; font-size: .95rem; white-space: nowrap; overflow: hidden; isolation: isolate;
  transition: border-color .3s var(--ease), color .3s var(--ease), background .3s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--accent); transform: translateY(101%); transition: transform .5s var(--ease-out);
}
.btn:hover { border-color: var(--accent); color: #fff; }
.btn:hover::before { transform: none; }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-sm { height: 38px; padding: 0 16px; font-size: .88rem; }
.btn-ghost { background: transparent; }
.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 999px;
  border: 1px solid var(--line-2); background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--text-2); cursor: pointer; font-size: 17px;
  transition: color .25s, border-color .25s, background .25s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.when-dark { display: none; }
:root[data-theme="dark"] .when-dark { display: block; }
:root[data-theme="dark"] .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .when-dark { display: block; }
  :root:not([data-theme="light"]) .when-light { display: none; }
}
.link {
  color: var(--text); padding-bottom: 1px;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1.5px no-repeat, linear-gradient(var(--line-2), var(--line-2)) 0 100% / 100% 1px no-repeat;
  transition: background-size .5s var(--ease-out), color .3s;
}
.link:hover { background-size: 100% 1.5px, 100% 1px; color: var(--accent-ink); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 60; padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid transparent;
  transition: background .4s, border-color .4s, transform .5s var(--ease-out);
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom-color: var(--line);
}
.nav.hide { transform: translateY(-100%); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 16px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: .98rem; letter-spacing: -.02em; }
.logo-mark {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--text); color: var(--bg); font: 600 .74rem var(--mono); letter-spacing: 0;
}
.logo-mark::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.nav-links { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--card) 60%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.nav-links a { display: flex; align-items: baseline; gap: 6px; padding: 7px 14px; border-radius: 999px; color: var(--text-2); font-size: .88rem; transition: color .25s, background .25s; }
.nav-links a span { font: 500 .62rem var(--mono); color: var(--text-3); transition: color .25s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); background: var(--bg-2); }
.nav-links a.active span { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-actions .icon-btn { width: 38px; height: 38px; font-size: 16px; }
.progress { position: absolute; left: 0; bottom: -1px; height: 1.5px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.menu-btn { display: none; position: relative; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); cursor: pointer; }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--text); transition: transform .4s var(--ease-out); }
.menu-btn span:first-child { top: 15px; }
.menu-btn span:last-child { top: 21px; }
.menu-open .menu-btn span:first-child { transform: translateY(3px) rotate(45deg); }
.menu-open .menu-btn span:last-child { transform: translateY(-3px) rotate(-45deg); }
.menu { position: fixed; inset: 0; z-index: 55; background: var(--bg); padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 24px); }
.menu-in { display: flex; flex-direction: column; }
.menu-in a { display: flex; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: clamp(2rem, 9vw, 3rem); font-weight: 500; letter-spacing: -.04em; opacity: 0; transform: translateY(16px); animation: menuIn .6s var(--ease-out) forwards; }
.menu-in a:nth-child(2) { animation-delay: .04s; }
.menu-in a:nth-child(3) { animation-delay: .08s; }
.menu-in a:nth-child(4) { animation-delay: .12s; }
.menu-in a:nth-child(5) { animation-delay: .16s; }
.menu-in .mono { color: var(--accent); }
@keyframes menuIn { to { opacity: 1; transform: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: max(100svh, 760px); display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--nav-h) + 72px) 0 32px; overflow: hidden; isolation: isolate;
}
#scan {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 80%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 80%, transparent 100%);
}
.hud { position: absolute; top: calc(var(--nav-h) + 24px); display: flex; gap: 14px; align-items: center; color: var(--text-3); font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; }
.hud-l { left: max(24px, calc((100vw - 1280px) / 2 + 24px)); }
.hud-r { right: max(24px, calc((100vw - 1280px) / 2 + 24px)); }
.hud b { color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.hud .sep { opacity: .5; }
.rec { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: rec 1.6s infinite; }
@keyframes rec { 50% { opacity: .25; } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: end; gap: 56px; }
.kicker { margin: 0 0 24px; color: var(--text-2); text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; overflow: hidden; }
.name { margin: 0; font-weight: 600; font-size: clamp(5.4rem, 14vw, 12rem); line-height: .86; letter-spacing: -.058em; }
.name .ln { display: block; overflow: hidden; padding: 0 .08em .07em 0; margin: 0 -.08em -.07em 0; }
.name .ln > span { display: inline-block; padding-right: .1em; }
.tagline { margin: 26px 0 0; font-size: clamp(1.7rem, 3.5vw, 3rem); line-height: 1.1; letter-spacing: -.035em; color: var(--text-2); overflow: hidden; padding-bottom: .08em; }
.tagline em { color: var(--accent); font-size: 1.14em; }
.line-in { display: inline-block; }
.hero-sub { margin: 20px 0 0; max-width: 31em; font-size: 1.06rem; color: var(--text-2); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.socials { display: flex; gap: 8px; }

/* portrait, framed as a tracked detection */
.target { position: relative; justify-self: end; width: min(100%, 370px); margin: 0 0 8px; --pad: 14px; }
.target-img { aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden; background: var(--bg-2); }
.target-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); filter: grayscale(1) contrast(1.05) brightness(.9); transition: transform 1.8s var(--ease-out), filter 1.4s var(--ease-out); }
.target.locked .target-img img { transform: scale(1); filter: none; }
.target .c { position: absolute; width: 30px; height: 30px; border: 2px solid var(--accent); opacity: 0; transition: transform 1.1s var(--ease-out), opacity .4s; }
.target .c1 { top: calc(var(--pad) * -1); left: calc(var(--pad) * -1); border-right: 0; border-bottom: 0; transform: translate(-48px, -48px); }
.target .c2 { top: calc(var(--pad) * -1); right: calc(var(--pad) * -1); border-left: 0; border-bottom: 0; transform: translate(48px, -48px); }
.target .c3 { bottom: calc(var(--pad) * -1); left: calc(var(--pad) * -1); border-right: 0; border-top: 0; transform: translate(-48px, 48px); }
.target .c4 { bottom: calc(var(--pad) * -1); right: calc(var(--pad) * -1); border-left: 0; border-top: 0; transform: translate(48px, 48px); }
.target.locked .c { opacity: 1; transform: none; }
.target-tag {
  position: absolute; left: calc(var(--pad) * -1); top: calc(var(--pad) * -1 - 26px); margin: 0;
  display: flex; gap: 8px; padding: 3px 8px; background: var(--accent); color: #fff; font-size: .7rem; white-space: nowrap;
  opacity: 0; transform: translateY(6px); transition: opacity .5s .5s, transform .5s .5s var(--ease-out);
}
.target-tag b { font-weight: 500; font-variant-numeric: tabular-nums; }
.target-meta { position: absolute; right: calc(var(--pad) * -1); bottom: calc(var(--pad) * -1 - 26px); color: var(--text-3); font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; opacity: 0; transition: opacity .6s 1s; }
.target.locked .target-tag { opacity: 1; transform: none; }
.target.locked .target-meta { opacity: 1; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 80px 0 0; border-top: 1px solid var(--line); }
.facts div { padding: 18px 20px 0 0; }
.facts div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.facts dt { color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; font-size: .64rem; }
.facts dd { margin: 6px 0 0; font-weight: 500; font-size: .98rem; letter-spacing: -.01em; }

/* hero entrance */
.js .name .ln > span { transform: translateY(105%); }
.js .line-in { transform: translateY(115%); }
.js .fade-in { opacity: 0; transform: translateY(14px); }
.js.ready .name .ln > span, .js.ready .line-in { transform: none; transition: transform 1.3s var(--ease-out); }
.js.ready .name .ln:nth-child(2) > span { transition-delay: .08s; }
.js.ready .tagline .line-in { transition-delay: .22s; }
.js.ready .fade-in { opacity: 1; transform: none; transition: opacity 1s .45s var(--ease-out), transform 1s .45s var(--ease-out); }
.js.ready .facts.fade-in { transition-delay: .65s; }

/* ---------- marquee ---------- */
.marquee {
  position: relative; overflow: hidden; border-block: 1px solid var(--line); padding-block: 20px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 50s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; margin: 0; padding: 0; list-style: none; }
.marquee li { display: flex; align-items: center; gap: 30px; padding-right: 30px; font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: 500; letter-spacing: -.03em; color: var(--text-2); white-space: nowrap; }
.marquee li::after { content: ""; width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding-top: clamp(104px, 13vw, 176px); }
.split { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 56px; }
.label { position: relative; }
.eyebrow { position: sticky; top: calc(var(--nav-h) + 32px); margin: 0; display: flex; gap: 10px; text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; color: var(--text-2); }
.eyebrow span { color: var(--accent); }
.content { min-width: 0; }
.h2 { margin: 0; font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 600; }
.h3 { margin: 0; font-size: clamp(1.7rem, 2.8vw, 2.3rem); line-height: 1; letter-spacing: -.045em; font-weight: 600; }
.display { margin: 0 0 44px; font-size: clamp(3rem, 7.4vw, 6.4rem); line-height: .9; letter-spacing: -.058em; font-weight: 600; }
.display em, .display-sm em, .contact-big em, .lead em { color: var(--accent); }
.display em, .contact-big em { font-size: 1.1em; }
.display-sm em { color: var(--text-2); }
.display-sm { margin: 0 0 22px; font-size: clamp(1.8rem, 3.1vw, 2.5rem); line-height: 1; letter-spacing: -.045em; font-weight: 600; }

/* reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(32px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out); }

/* ---------- about ---------- */
.lead { margin: 0; max-width: 19em; font-size: clamp(1.9rem, 4vw, 3.4rem); line-height: 1.06; letter-spacing: -.048em; font-weight: 500; }
.lead em { font-size: 1.1em; }
.about-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 64px; margin-top: 72px; align-items: start; }
.skill-group + .skill-group { margin-top: 34px; }
.skill-group h3 { margin: 0 0 14px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .14em; font-size: .66rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-2); font-size: .92rem; transition: border-color .25s, color .25s, background .25s; }
.chips li:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.photos { position: relative; padding-bottom: 16%; }
.photo { margin: 0; }
.photo img { width: 100%; height: auto; object-fit: cover; }
.photo figcaption { margin-top: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; font-size: .62rem; }
.photo-a { width: 76%; margin-left: auto; }
.photo-a figcaption { text-align: right; }
.photo-a img { aspect-ratio: 4 / 5; border-radius: 4px; }
.photo-b { position: absolute; left: 0; bottom: 0; width: 40%; }
.photo-b img { aspect-ratio: 1; border-radius: 50%; border: 6px solid var(--bg); }
.photo-b figcaption { text-align: center; }

/* ---------- experience ---------- */
.role { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.role-sub { margin: 12px 0 0; color: var(--text-2); font-size: 1.02rem; }
.pill { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.live { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.module { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 52px; padding-block: 52px; align-items: start; }
.module + .module { border-top: 1px solid var(--line); }
.module-flip .module-media { order: 2; }
.module-media { position: sticky; top: calc(var(--nav-h) + 32px); border-radius: 8px; overflow: hidden; background: #000; }
.module-media img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; }
.job + .job { margin-top: 96px; }
.media-tag { position: absolute; top: 12px; left: 12px; padding: 3px 8px; border-radius: 4px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .62rem; letter-spacing: .12em; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.module-sub { margin: 10px 0 20px; color: var(--text-2); font-size: 1.05rem; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .84rem; font-weight: 500; transition: background .25s; }
.badge:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.badge svg { font-size: .95em; transition: transform .3s var(--ease-out); }
.badge:hover svg:last-child { transform: translate(2px, -2px); }
.badge .play { font-size: .8em; }
.bullets { margin: 28px 0 0; padding: 0; list-style: none; counter-reset: b; }
.bullets li { counter-increment: b; position: relative; padding: 15px 0 15px 40px; border-top: 1px solid var(--line); color: var(--text-2); }
.bullets li::before { content: counter(b, decimal-leading-zero); position: absolute; left: 0; top: 18px; font: 500 .66rem var(--mono); color: var(--accent); }
.bullets b { color: var(--text); font-weight: 500; }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.stack li { padding: 4px 9px; border-radius: 5px; background: var(--bg-2); color: var(--text-2); font-size: .68rem; }

/* ---------- projects ---------- */
.featured { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.feature {
  position: relative; display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); transition: border-color .4s;
}
.spot::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .4s;
  background: radial-gradient(460px circle at var(--sx, 50%) var(--sy, 50%), color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%);
}
.spot:hover::after { opacity: 1; }
.feature:hover { border-color: var(--line-2); }
.feature-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.feature-lg .feature-media { aspect-ratio: 16 / 11; }
.feature:not(.feature-lg) .feature-media { flex: 1 1 auto; aspect-ratio: auto; min-height: 220px; }
.feature:not(.feature-lg) .feature-body { flex: 0 0 auto; }
.feature-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1.4s var(--ease-out); }
.feature:hover .feature-media img { transform: scale(1.07); }
.media-light { background: #fff; }
.media-light img { object-fit: contain; padding: 8% 6%; }
.feature-body { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 24px; flex: 1; }
.feature-top { display: flex; justify-content: space-between; margin: 0; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; font-size: .62rem; }
.feature-top span:first-child { color: var(--accent); }
.feature h3 { margin: 0; padding-right: 56px; font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.08; letter-spacing: -.038em; font-weight: 600; }
.feature p { margin: 0; color: var(--text-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 10px 0 0; list-style: none; }
.tags li { padding: 4px 9px; border-radius: 5px; background: var(--bg-2); color: var(--text-2); font-size: .66rem; }
.feature-go { position: absolute; right: 22px; top: 48px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--text-2); transition: background .35s, color .35s, border-color .35s, transform .6s var(--ease-out); }
.feature:hover .feature-go { background: var(--accent); border-color: var(--accent); color: #fff; transform: rotate(45deg); }

/* project / writing index rows */
.index { margin: 60px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
#writing .index { margin-top: 36px; }
.row {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 84px 40px; align-items: center; gap: 20px;
  padding: 26px 8px; border-bottom: 1px solid var(--line); isolation: isolate;
}
.row::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bg-2); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .55s var(--ease-out); }
.row:hover::before { transform: none; }
.row-n { color: var(--accent); font-size: .68rem; }
.row-n svg { font-size: 18px; color: var(--text); }
.row-title { font-size: clamp(1.15rem, 2vw, 1.6rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.15; transition: transform .55s var(--ease-out); }
.row:hover .row-title { transform: translateX(10px); }
.row-tags, .row-kind { color: var(--text-3); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; }
.row-kind { text-align: right; }
.row-go { justify-self: end; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--text-3); transition: color .3s, background .3s, transform .6s var(--ease-out); }
a.row:hover .row-go { background: var(--accent); color: #fff; transform: rotate(45deg); }
.row-media { display: none; }

/* floating cursor preview for project rows (pointer devices only) */
.preview {
  position: fixed; left: 0; top: 0; z-index: 40; width: 360px; aspect-ratio: 16 / 10; pointer-events: none;
  border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .5);
  opacity: 0; transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotate(var(--pr, 0deg)) scale(var(--ps, .8));
  transition: opacity .35s var(--ease-out);
}
.preview.on { opacity: 1; }
.preview > * { display: grid !important; width: 100%; height: 100%; }
.preview img { width: 100%; height: 100%; object-fit: cover; }

/* generated visuals for the two software projects */
.viz { position: relative; place-items: center; background: var(--bg-2); }
.viz-grid { display: grid; gap: 3px; width: 84%; }
.viz-grid i { aspect-ratio: 1; border-radius: 2px; background: var(--text); transition: opacity .4s; }
.viz-grid i.k { background: var(--accent); }
.viz-label { position: absolute; left: 12px; bottom: 9px; color: var(--text-3); font-size: .58rem; }

/* ---------- roles ---------- */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.role-col ol { margin: 0; padding: 0; list-style: none; counter-reset: r; border-top: 1px solid var(--line); }
.role-col li { counter-increment: r; display: grid; grid-template-columns: 40px 1fr; padding: 15px 0; border-bottom: 1px solid var(--line); color: var(--text-2); transition: color .3s, padding .45s var(--ease-out); }
.role-col li::before { content: counter(r, decimal-leading-zero); font: 500 .66rem/1.9 var(--mono); color: var(--text-3); transition: color .3s; }
.role-col li:hover { color: var(--text); padding-left: 8px; }
.role-col li:hover::before { color: var(--accent); }

/* ---------- writing ---------- */
.writing-intro { margin: 0; max-width: 24em; font-size: clamp(1.5rem, 2.8vw, 2.2rem); line-height: 1.15; letter-spacing: -.04em; font-weight: 500; }
.writing-intro em { color: var(--accent); font-size: 1.08em; }

/* ---------- contact ---------- */
.contact { padding-bottom: clamp(104px, 12vw, 168px); }
.contact-big { margin: 0; font-size: clamp(2.9rem, 7.8vw, 7rem); line-height: .9; letter-spacing: -.058em; font-weight: 600; }
.contact-sub { margin: 30px 0 0; color: var(--text-2); font-size: 1.1rem; max-width: 30em; }
.mailbox { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 44px; padding-bottom: 24px; border-bottom: 1px solid var(--line-2); }
.mail { font-size: clamp(1.1rem, 2.6vw, 2rem); font-weight: 500; letter-spacing: -.035em; overflow-wrap: anywhere; transition: color .3s; }
.mail:hover { color: var(--accent-ink); }
.copy .i-check { display: none; }
.copy.done { color: var(--ok); border-color: var(--ok); }
.copy.done .i-copy { display: none; }
.copy.done .i-check { display: block; }
.copied { color: var(--ok); }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); overflow: hidden; padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-block: 22px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; font-size: .64rem; }
.footer-row time { color: var(--text-2); font-variant-numeric: tabular-nums; }
.footer-row a:hover { color: var(--accent); }
.wordmark {
  font-size: clamp(5rem, 22vw, 22.5rem); font-weight: 600; letter-spacing: -.07em; line-height: .78; text-align: center; white-space: nowrap;
  margin-bottom: -.05em; padding-top: .04em; user-select: none;
  background: linear-gradient(to bottom, var(--text) 5%, transparent 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- theme switch (View Transitions API) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: reveal-theme .85s var(--ease-out); }
@keyframes reveal-theme { from { clip-path: circle(0 at var(--tx, 50%) var(--ty, 0)); } to { clip-path: circle(var(--tr, 150vmax) at var(--tx, 50%) var(--ty, 0)); } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-block; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .eyebrow { position: static; }
  .hud-r { display: none; }
}
@media (max-width: 860px) {
  .hero { min-height: auto; justify-content: flex-start; padding-top: calc(var(--nav-h) + 76px); }
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .target { order: -1; justify-self: start; width: 132px; margin: 26px 0 40px 8px; --pad: 8px; }
  .target .c { width: 16px; height: 16px; }
  .target-tag { font-size: .6rem; top: calc(var(--pad) * -1 - 22px); }
  .target-meta { display: none; }
  .facts { grid-template-columns: 1fr 1fr; margin-top: 56px; }
  .facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 18px; }
  .about-row { grid-template-columns: 1fr; gap: 48px; }
  .photos { max-width: 460px; }
  .module, .module-flip { grid-template-columns: 1fr; gap: 28px; }
  .module-flip .module-media { order: 0; }
  .module-media { position: relative; top: 0; }
  .featured { grid-template-columns: 1fr; }
  .feature:not(.feature-lg) .feature-media { aspect-ratio: 16 / 10; min-height: 0; }
  .roles { grid-template-columns: 1fr; gap: 64px; }
  .row { grid-template-columns: 48px minmax(0, 1fr) 36px; gap: 6px 12px; padding: 22px 4px; }
  .row-tags { grid-column: 2; grid-row: 2; }
  .row-kind { display: none; }
  .row-go { grid-column: 3; grid-row: 1 / span 2; }
  .row-media { display: grid; grid-column: 1 / -1; grid-row: 3; margin-top: 14px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; }
  .row-media img { width: 100%; height: 100%; object-fit: cover; }
  .row:hover .row-title { transform: none; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
  .logo-text { display: none; }
  .hud-l .sep, .hud-l span:last-child { display: none; }
  .hero-cta .btn { flex: 1 1 100%; justify-content: center; }
  .facts dd { font-size: .9rem; }
  .footer-row { justify-content: center; text-align: center; }
}
@media (hover: none) { .preview { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .fade-in, .js .name .ln > span, .js .line-in { opacity: 1; transform: none; }
  .target .c, .target-tag, .target-meta { opacity: 1; transform: none; }
  .target-img img { transform: none; filter: none; }
}

/* Berkshire Grey product images */
.bg-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.bg-shot { margin: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: #f1f1ef; }
.bg-shot img { width: 100%; height: 100%; object-fit: cover; }
.bg-render img { object-fit: cover; }
.bg-credit { grid-column: 1 / -1; margin: 2px 0 0; color: var(--text-3); font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; }
