/* Vazirmatn — SIL Open Font License (assets/fonts/OFL.txt) */
@font-face { font-family: "Vazirmatn"; src: url("../assets/fonts/Vazirmatn-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../assets/fonts/Vazirmatn-Medium.ttf") format("truetype"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../assets/fonts/Vazirmatn-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

/* ---------- tokens: monochrome ---------- */
:root {
  --bg: #f8f8f8;
  --surface: #ffffff;
  --media: #ececec;
  --text: #222222;
  --muted: #7b7b7b;
  --line: #e2e2e2;
  --faint: #e9e9e9;
  --badge-bg: #222222;
  --badge-text: #f8f8f8;
  --nav-bg: rgba(248, 248, 248, .8);
  --font: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  --display-weight: 400;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111; --surface: #181818; --media: #1c1c1c; --text: #f2f2f2; --muted: #8a8a8a;
    --line: #2a2a2a; --faint: #1b1b1b; --badge-bg: #f2f2f2; --badge-text: #111111; --nav-bg: rgba(17, 17, 17, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111111; --surface: #181818; --media: #1c1c1c; --text: #f2f2f2; --muted: #8a8a8a;
  --line: #2a2a2a; --faint: #1b1b1b; --badge-bg: #f2f2f2; --badge-text: #111111; --nav-bg: rgba(17, 17, 17, .8);
  color-scheme: dark;
}
html[lang="en"] {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --display-weight: 300;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.8; letter-spacing: 0;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
html[lang="en"] body { line-height: 1.55; letter-spacing: -0.01em; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p, dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .container { padding-inline: 32px; } }

.skip { position: absolute; inset-inline-start: 8px; top: -48px; background: var(--text); color: var(--bg); padding: 8px 14px; z-index: 100; }
.skip:focus { top: 8px; }

/* underlined text link with an outward arrow (mirrors in RTL) */
.arrow-link, .cta-link { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.arrow-link::after, .cta-link::after { content: "\00a0↗"; display: inline-block; text-decoration: none; transition: transform .2s ease; }
html[dir="rtl"] .arrow-link::after, html[dir="rtl"] .cta-link::after { content: "\00a0↖"; }
.arrow-link:hover::after, .cta-link:hover::after { transform: translate(2px, -2px); }
html[dir="rtl"] .arrow-link:hover::after, html[dir="rtl"] .cta-link:hover::after { transform: translate(-2px, -2px); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--nav-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; letter-spacing: -0.01em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: .78rem; font-weight: 700; letter-spacing: -0.02em;
}
.nav { display: none; gap: 32px; margin-inline-start: 48px; }
.nav a { font-size: .88rem; color: var(--text); opacity: .75; }
.nav a:hover { opacity: 1; }
.header-actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.text-btn, .icon-btn { font: inherit; color: var(--text); background: none; border: 0; cursor: pointer; height: 36px; opacity: .75; }
.text-btn:hover, .icon-btn:hover { opacity: 1; }
.text-btn { font-size: .85rem; padding: 0 8px; }
.icon-btn { width: 36px; display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; }
.cta-link { display: none; font-size: .88rem; margin-inline-start: 16px; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
.nav.open {
  display: flex; flex-direction: column; gap: 0; position: absolute; top: 64px; inset-inline: 0; margin: 0;
  height: calc(100vh - 64px); background: var(--bg); padding: 24px 32px;
}
.nav.open a { font-size: 2rem; padding: 8px 0; opacity: 1; font-weight: var(--display-weight); }
@media (min-width: 860px) {
  .nav, .nav.open { display: flex; flex-direction: row; gap: 32px; position: static; height: auto; padding: 0; margin-inline-start: 48px; background: none; }
  .nav.open a { font-size: .88rem; padding: 0; opacity: .75; font-weight: 400; }
  .cta-link { display: inline-block; }
  .menu-btn { display: none; }
}

/* ---------- hero ---------- */
.hero { padding: 32px 0 72px; }
.hero-grid { display: grid; gap: 40px; align-items: stretch; }
.side-label { display: none; }
.hero-text { display: flex; flex-direction: column; justify-content: center; gap: 0; }
.stats { display: flex; gap: 40px; margin-bottom: 32px; }
.stats div { display: flex; flex-direction: column; }
.stat-num { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem); font-weight: var(--display-weight); line-height: 1.2; }
.stats dd { font-size: .8rem; color: var(--muted); }
.hello {
  font-size: clamp(2.6rem, 1.3rem + 4.6vw, 5.4rem); font-weight: var(--display-weight);
  line-height: 1.3; letter-spacing: 0; margin: 0; max-width: 11em;
}
html[lang="en"] .hello { letter-spacing: -0.04em; line-height: 1.02; }
.intro { font-size: clamp(1.05rem, 1rem + .35vw, 1.3rem); margin-top: 20px; color: var(--muted); }
.intro::before { content: "— "; color: var(--muted); }
.lead { color: var(--muted); max-width: 30em; margin-top: 6px; }
.scroll-down { margin-top: 56px; font-size: .85rem; color: var(--muted); align-self: flex-start; }
.scroll-down:hover { color: var(--text); }

.portrait {
  position: relative; aspect-ratio: 4 / 5; background: var(--media); overflow: hidden;
  display: grid; place-items: center; border-radius: 4px;
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  filter: grayscale(1) contrast(1.05); transition: filter .6s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1);
  animation: fade-up 1.2s cubic-bezier(.16, 1, .3, 1) both .2s;
}
.portrait:hover img { filter: grayscale(0); transform: scale(1.015); }
.portrait-fallback {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: clamp(7rem, 22vw, 16rem); font-weight: 200; letter-spacing: -0.06em; line-height: 1;
  color: var(--muted); opacity: .35;
}

@media (min-width: 900px) {
  .hero { padding: 24px 0 80px; }
  .hero-grid { grid-template-columns: 36px 1.15fr 0.85fr; gap: 48px; min-height: calc(100vh - 140px); }
  .side-label {
    display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 16px;
    font-size: .75rem; color: var(--muted); padding: 8px 0;
  }
  .side-label span:first-child, .side-label #sideYear { writing-mode: vertical-rl; }
  html[dir="ltr"] .side-label span:first-child, html[dir="ltr"] .side-label #sideYear { transform: rotate(180deg); }
  .side-line { flex: 1; width: 1px; background: var(--line); }
  .portrait { aspect-ratio: auto; min-height: 560px; }
}

/* ---------- sections ---------- */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .section { padding: 136px 0; } }
.split { display: grid; gap: 28px; }
@media (min-width: 900px) { .split { grid-template-columns: 220px 1fr; gap: 48px; } }
.section-label { font-size: .85rem; color: var(--muted); }
.section-label .num { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin-inline-end: 8px; }
.section-title { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 5rem); font-weight: var(--display-weight); line-height: 1.15; }
html[lang="en"] .section-title { letter-spacing: -0.04em; line-height: 1; }
.head-split { margin-bottom: 64px; align-items: end; }

/* about */
.statement { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.4rem); font-weight: var(--display-weight); line-height: 1.6; }
html[lang="en"] .statement { line-height: 1.3; letter-spacing: -0.025em; }
.statement .dim { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin-top: 4px; }
.skills { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 6px 0; color: var(--muted); font-size: .9rem; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: 0; }
html[dir="rtl"] .skills { justify-content: flex-end; }
.skills li:not(:last-child)::after { content: "/"; margin-inline: 12px; opacity: .45; }

/* ---------- work ---------- */
.works { display: grid; gap: 72px 32px; }
@media (min-width: 760px) { .works { grid-template-columns: repeat(2, 1fr); } }
.work { display: flex; flex-direction: column; gap: 6px; }
.work-media {
  aspect-ratio: 4 / 3; background: var(--media); overflow: hidden; margin-bottom: 18px; border-radius: 4px;
  display: grid; place-items: center;
}
.work-media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .5s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.work:hover .work-media img { filter: none; transform: scale(1.02); }
.work-initial {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: clamp(6rem, 12vw, 10rem); font-weight: 200; line-height: 1; color: var(--muted); opacity: .4;
  transition: opacity .4s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}
.work:hover .work-initial { opacity: .7; transform: scale(1.04); }
.work-head { display: flex; align-items: baseline; gap: 14px; }
.work-index { font-size: .8rem; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.work h3 { font-size: clamp(1.4rem, 1.2rem + .8vw, 2rem); font-weight: 500; line-height: 1.3; }
html[lang="en"] .work h3 { letter-spacing: -0.03em; }
.work-year { margin-inline-start: auto; font-size: .85rem; color: var(--muted); }
.work-meta { color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.work-desc { max-width: 34em; margin-top: 4px; }
.work-tech { color: var(--muted); font-size: .78rem; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: 0; }
html[dir="rtl"] .work-tech { text-align: right; }
.work-links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 8px; font-size: .9rem; }
.work.featured { grid-column: 1 / -1; }
.work.featured .work-media { aspect-ratio: 16 / 10; }
.work.featured h3 { font-size: clamp(1.8rem, 1.3rem + 2vw, 3rem); }
.badge { font-size: .7rem; padding: 1px 8px; border-radius: 999px; background: var(--badge-bg); color: var(--badge-text); }

/* ---------- expertise ---------- */
.expertise { list-style: none; padding: 0; margin: 0; }
.expertise li { display: grid; gap: 6px; padding: 28px 0; border-top: 1px solid var(--line); }
.expertise li:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 760px) { .expertise li { grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: baseline; } }
.expertise h3 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.9rem); font-weight: var(--display-weight); }
html[lang="en"] .expertise h3 { letter-spacing: -0.025em; }
.expertise p { color: var(--muted); }

/* ---------- contact ---------- */
.contact-title { font-size: clamp(3.2rem, 1.5rem + 8vw, 8rem); font-weight: var(--display-weight); line-height: 1.05; }
html[lang="en"] .contact-title { letter-spacing: -0.05em; line-height: .95; }
.contact-lead { color: var(--muted); margin-top: 16px; }
.email {
  display: inline-block; margin-top: 40px; font-size: clamp(1.2rem, .9rem + 1.6vw, 2.4rem); font-weight: 300;
  letter-spacing: -0.02em; border-bottom: 1px solid currentColor; padding-bottom: 4px; word-break: break-all;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
}
.email:hover { color: var(--muted); }
.socials { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 12px 32px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 28px; overflow: hidden; }
.wordmark {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: clamp(3.5rem, 15.5vw, 13rem); font-weight: 600; letter-spacing: -0.06em; line-height: .85;
  color: var(--faint); white-space: nowrap; user-select: none; text-align: center;
}
:root[data-theme="dark"] .wordmark { color: #1e1e1e; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; font-size: .8rem; color: var(--muted); }
.footer-inner p { margin: 0; }
.footer-inner a:hover { color: var(--text); }

/* =====================================================================
   2026 layer: Liquid Glass, aura, kinetic type, marquee, bento,
   staggered work grid, scroll-driven motion, grain
   ===================================================================== */

/* ---------- Liquid Glass (Apple, iOS 26) ---------- */
:root {
  --glass-bg: rgba(255, 255, 255, .52);
  --glass-border: rgba(255, 255, 255, .7);
  --glass-hi: rgba(255, 255, 255, .85);
  --glass-shadow: 0 10px 40px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
  --tile: rgba(255, 255, 255, .6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass-bg: rgba(30, 30, 30, .5); --glass-border: rgba(255, 255, 255, .12);
    --glass-hi: rgba(255, 255, 255, .18); --glass-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    --tile: rgba(28, 28, 28, .7);
  }
}
:root[data-theme="dark"] {
  --glass-bg: rgba(30, 30, 30, .5); --glass-border: rgba(255, 255, 255, .12);
  --glass-hi: rgba(255, 255, 255, .18); --glass-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  --tile: rgba(28, 28, 28, .7);
}
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(190%); -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 rgba(0, 0, 0, .03), var(--glass-shadow);
}

/* floating capsule header */
.site-header { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding-top: 12px; pointer-events: none; }
.site-header .container { pointer-events: auto; }
.header-inner { height: 56px; padding-inline: 10px 14px; border-radius: 999px; position: relative; }
.nav.open { top: 68px; height: auto; border-radius: 28px; padding: 16px 28px 20px; background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(190%); -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.brand-mark { border-radius: 999px; width: 36px; height: 36px; }
.cta-link {
  text-decoration: none; background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 999px;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), opacity .2s ease;
}
.cta-link:hover { transform: scale(1.04); }
.nav a { position: relative; }
@media (min-width: 860px) {
  .nav.open { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }
  .nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform .3s ease; }
  .nav a:hover::after { transform: scaleX(1); }
}
html { scroll-padding-top: 88px; }
@media (max-width: 359px) { .brand-name { display: none; } .header-inner { padding-inline: 8px 6px; } }

/* ---------- hero aura: soft iridescent light the glass sits on ---------- */
.hero { position: relative; overflow: hidden; }
.aura { position: absolute; inset: -10% -10% auto; height: 120%; pointer-events: none; z-index: 0; filter: blur(70px); opacity: .55; }
.aura span { position: absolute; border-radius: 50%; mix-blend-mode: multiply; animation: drift 22s ease-in-out infinite alternate; }
.aura span:nth-child(1) { width: 42vw; height: 42vw; background: #b9cdfb; inset-inline-end: 8%; top: 10%; }
.aura span:nth-child(2) { width: 34vw; height: 34vw; background: #e2c9f7; inset-inline-end: 26%; top: 34%; animation-duration: 28s; animation-delay: -6s; }
.aura span:nth-child(3) { width: 30vw; height: 30vw; background: #bfeee4; inset-inline-end: 2%; top: 46%; animation-duration: 25s; animation-delay: -12s; }
:root[data-theme="dark"] .aura { opacity: .28; }
:root[data-theme="dark"] .aura span { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .aura { opacity: .28; }
  :root:not([data-theme="light"]) .aura span { mix-blend-mode: screen; }
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6vw, 4vh) scale(1.12); }
  100% { transform: translate(4vw, -3vh) scale(.94); }
}
.hero-grid { position: relative; z-index: 1; }
.portrait { border-radius: 32px; }
.portrait::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 1px 0 var(--glass-hi); pointer-events: none; }
.portrait:not(.has-photo) { background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); }

/* kinetic headline: rises out of a mask on load */
.hello { overflow: hidden; padding-bottom: .08em; }
.hello-inner { display: inline-block; animation: rise 1.2s cubic-bezier(.16, 1, .3, 1) both .1s; }
.intro, .lead, .stats { animation: fade-up 1s cubic-bezier(.16, 1, .3, 1) both; }
.stats { animation-delay: .05s; } .intro { animation-delay: .35s; } .lead { animation-delay: .45s; }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.scroll-down span[aria-hidden] { display: inline-block; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- skills marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; direction: ltr;
  -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; gap: 48px; animation: ticker 40s linear infinite;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.6rem); font-weight: 300; letter-spacing: -0.03em; white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif; }
.marquee-track span { display: inline-flex; align-items: center; gap: 48px; }
.marquee-track span::after { content: "✦"; font-size: .45em; color: var(--muted); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.section#about { border-top: 0; }

/* ---------- bento ---------- */
.bento { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.tile {
  background: var(--tile); border: 1px solid var(--line); border-radius: 28px; padding: 24px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .4s cubic-bezier(.2, .7, .2, 1), border-color .3s ease;
}
.tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.tile-statement { grid-column: 1 / -1; padding: 32px; }
.tile-skills { grid-column: 1 / -1; }
.fact-label { color: var(--muted); font-size: .8rem; font-weight: 400; }
.fact-value { margin-top: 18px; font-size: 1.1rem; }
.tile-skills .skills { margin-top: 14px; }
/* "Latest work" tile: jumps to the project card */
.tile-app { display: block; color: inherit; text-decoration: none; }
.tile-app .fact-value { display: flex; align-items: center; gap: 12px; }
.tile-app img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.tile-app .tile-arrow { margin-inline-start: auto; color: var(--muted); transition: transform .25s ease, color .2s ease; }
.tile-app:hover .tile-arrow { color: var(--text); transform: translateY(3px); }
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(4, 1fr); }
  .tile-statement { grid-column: 1 / 4; grid-row: span 2; padding: 40px; display: flex; align-items: flex-end; }
  .tile-fact:nth-of-type(2) { grid-column: 4; }
  .tile-fact:nth-of-type(3) { grid-column: 4; }
  .tile-skills { grid-column: 1 / -1; }
}
.facts { display: none; }

/* ---------- work: staggered grid + spotlight ---------- */
.work-media { border-radius: 24px; position: relative; }
.work-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .35), transparent 60%);
}
.work:hover .work-media::after { opacity: 1; }
@media (min-width: 760px) {
  .works { padding-bottom: 120px; }
  .work:not(.featured):nth-child(odd) { position: relative; top: 120px; }
}
.work-head h3 { transition: letter-spacing .4s ease; }

/* scroll-driven: media settles from a slight zoom as it enters (progressive) */
@supports (animation-timeline: view()) {
  .work-media img, .work-initial { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
  @keyframes settle { from { transform: scale(1.14); } to { transform: scale(1); } }
  .wordmark { animation: wordmark linear both; animation-timeline: view(); animation-range: entry 0% cover 60%; }
  @keyframes wordmark { from { letter-spacing: .02em; opacity: .3; } to { letter-spacing: -0.06em; opacity: 1; } }
}

/* ---------- contact ---------- */
.email { transition: letter-spacing .4s ease, color .2s ease; }
.email:hover { letter-spacing: 0; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 40px; }
.email-row .email { margin-top: 0; }
.copy-email { font-size: .85rem; padding: 8px 16px; }
.socials a { display: inline-flex; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; transition: background .2s ease, color .2s ease; }
.socials a:hover { background: var(--text); color: var(--bg); }
.copy-chip { font: inherit; color: inherit; background: none; cursor: copy; display: inline-flex; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); transition: background .2s ease, color .2s ease; }
.copy-chip:hover { background: var(--text); color: var(--bg); }

/* ---------- film grain ---------- */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .035;
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* theme switch: circular reveal via the View Transitions API */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (prefers-reduced-motion: reduce) {
  .aura span, .marquee-track, .hello-inner, .intro, .lead, .stats, .scroll-down span[aria-hidden] { animation: none !important; }
  .work-media img, .work-initial, .wordmark { animation: none !important; }
}

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 20px; }

/* ---------- scroll reveal (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
