/* =========================================================
   Fardin Sheikh Milani — personal site
   ========================================================= */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}
/* Persian UI (Estedad, OFL). Body + display read from --font-fa; hero name uses heavier weight. */
@font-face {
  font-family: "Estedad";
  src: url("../fonts/estedad-arabic-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/estedad-arabic-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EEF1;
}
@font-face {
  font-family: "Estedad";
  src: url("../fonts/estedad-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/estedad-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  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;
}

/* ---------- Tokens ---------- */
:root {
  --font-serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --font-fa: "Estedad";
  --font-fa-name: "Estedad";
  --font-display: var(--font-serif);

  --gutter: clamp(20px, 4vw, 48px);
  --maxw: 1320px;
  --radius: 22px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-h: 64px;
}

:root,
[data-theme="dark"] {
  --bg: #0c0c0b;
  --bg-2: #151513;
  --bg-3: #1d1d1a;
  --fg: #eeeae2;
  --fg-2: #aaa69d;
  --fg-3: #85817a;
  --line: rgba(238, 234, 226, .12);
  --line-2: rgba(238, 234, 226, .22);
  --accent: #ff6a3d;
  --accent-text: #ff7a52;
  --accent-soft: rgba(255, 106, 61, .14);
  --on-accent: #120a06;
  --ok: #6ee7a8;
  --grain-opacity: .05;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f1ea;
  --bg-2: #ebe7dd;
  --bg-3: #e1dcd0;
  --fg: #121211;
  --fg-2: #4a4842;
  --fg-3: #67645d;
  --line: rgba(18, 18, 17, .13);
  --line-2: rgba(18, 18, 17, .26);
  --accent: #d4441b;
  --accent-text: #b13812;
  --accent-soft: rgba(212, 68, 27, .1);
  --on-accent: #fffaf5;
  --ok: #138a4e;
  --grain-opacity: .07;
  color-scheme: light;
}

/* Persian: every type role resolves to the one Persian family, Latin included. */
:root[lang="fa"] {
  --font-fa-stack: var(--font-fa), ui-sans-serif, system-ui, sans-serif;
  --font-sans: var(--font-fa-stack);
  --font-serif: var(--font-fa-stack);
  --font-mono: var(--font-fa-stack);
  --font-display: var(--font-fa-stack);
  --font-sans-fa: var(--font-fa-stack);
}
/* Persian script must never be tracked. */
:lang(fa), :lang(fa) * { letter-spacing: 0 !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 96px;
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color .35s ease, color .35s ease;
}
:root[lang="fa"] body { font-family: var(--font-sans-fa); line-height: 1.85; }

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain-opacity);
  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%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");
}

img, svg, canvas, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--on-accent); }

svg[viewBox="0 0 24 24"]:not(.brand-ico) {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-ico { fill: currentColor; }
.brand-ico.stroke { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.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;
}

.skip-link {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: none; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* language-pending: avoid flashing English when Persian was chosen */
.i18n-pending main, .i18n-pending .site-header, .i18n-pending .site-footer { opacity: 0; }

/* ---------- Progress ---------- */
.progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}
[dir="rtl"] .progress span { transform-origin: right center; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-block-start: 12px;
  inset-inline: 0;
  z-index: 50;
  pointer-events: none;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: -12px 0 auto;
  height: calc(var(--header-h) + 44px);
  background: linear-gradient(var(--bg) 35%, transparent);
  z-index: -1;
}
.header-bar {
  pointer-events: auto;
  width: min(100% - 24px, var(--maxw) + 24px);
  margin-inline: auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: 20px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 74%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  transition: background-color .35s ease, border-color .35s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 500;
  letter-spacing: -.01em;
}
.brand-mark { width: 28px; height: 28px; flex: none; overflow: visible; }
.brand-mark .bm-bg { fill: var(--fg); transition: fill .35s ease; }
.brand-mark .bm-l { fill: var(--bg); stroke: var(--bg); stroke-width: .75; stroke-linejoin: round; transition: fill .35s ease, stroke .35s ease; }
.brand-mark .bm-a { fill: var(--accent); transform-box: fill-box; transform-origin: 50% 100%; }
.brand:hover .bm-a, .brand:focus-visible .bm-a { animation: mark-hop .7s var(--ease-out); }
@keyframes mark-hop {
  0% { transform: none; }
  35% { transform: translateY(-7px) scale(.9, 1.1); }
  70% { transform: translateY(0) scale(1.18, .82); }
  100% { transform: none; }
}

.nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 999px;
  font-size: .9rem;
  color: var(--fg-2);
  transition: color .2s ease, background-color .2s ease;
}
.nav a:hover { color: var(--fg); background: var(--line); }
.nav a.is-active { color: var(--fg); }
.nav a.is-active::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-inline-end: 8px;
}

.controls { display: flex; align-items: center; gap: 6px; }
.ctrl {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding-inline: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg);
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.ctrl:hover { background: var(--line); border-color: var(--line-2); }
.ctrl svg { width: 18px; height: 18px; }

.lang-toggle { font-weight: 600; font-size: .85rem; }
.lang-toggle .lang-fa, .lang-toggle .lang-en { font-family: var(--font-mono); letter-spacing: .04em; }
:root[lang="fa"] .lang-toggle .lang-fa,
:root:not([lang="fa"]) .lang-toggle .lang-en { display: none; }

.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

.menu-toggle { display: none; gap: 10px; grid-auto-flow: column; padding-inline: 16px; font-size: .9rem; font-weight: 500; }
.menu-icon { display: grid; gap: 5px; width: 16px; }
.menu-icon span { display: block; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform .35s var(--ease-out); }
.menu-toggle[aria-expanded="true"] .menu-icon span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------- Mobile nav ---------- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 48px) var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav ol { list-style: none; margin: 0; padding: 0; }
.mobile-nav li { border-bottom: 1px solid var(--line); }
.mobile-nav nav a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-block: 14px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 10vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}
:root[lang="fa"] .mobile-nav nav a { font-weight: 600; font-size: clamp(1.9rem, 8.5vw, 3rem); }
.mobile-nav .n { font-family: var(--font-mono); font-size: .75rem; color: var(--fg-3); }
.mobile-nav a:active, .mobile-nav a:hover { color: var(--accent-text); }
.mobile-nav-foot { margin-top: 32px; font-family: var(--font-mono); font-size: .8rem; color: var(--fg-2); overflow-wrap: anywhere; }
.mobile-nav-foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Shared type ---------- */
.eyebrow, .section-label, .kicker, .chip, .p-cat, .stack-label, .tags li, .stack-list li, .chart-cap, .hero-meta dt, .fig-n, .skill-n, .p-n {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
:root[lang="fa"] :is(.eyebrow, .section-label, .kicker, .chip, .p-cat, .stack-label, .tags li, .stack-list li, .chart-cap, .hero-meta dt, .fig-n, .skill-n, .p-n) {
  font-size: .85rem;
  font-weight: 500;
  text-transform: none;
}

.mask { display: block; overflow: hidden; padding-block-end: .08em; margin-block-end: -.08em; }
.mask > span { display: block; }

.pulse {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.pulse::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

/* ---------- Buttons & links ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding-inline: 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: .975rem;
  overflow: hidden;
  isolation: isolate;
  transition: color .3s ease, border-color .3s ease, background-color .3s ease;
}
.btn svg { width: 18px; height: 18px; transition: transform .35s var(--ease-out); }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform .45s var(--ease-out);
}
.btn-primary:hover { color: var(--on-accent); }
.btn-primary:hover::before { transform: none; }
.btn-primary:hover svg { transform: translateX(3px); }
[dir="rtl"] .btn-primary:hover svg { transform: scaleX(-1) translateX(3px); }
.btn-ghost { border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--fg); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-weight: 500;
  font-size: .95rem;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% - 10px) / 0 1px;
  transition: color .2s ease, background-size .35s var(--ease-out);
}
[dir="rtl"] .link-arrow { background-position: 100% calc(100% - 10px); }
.link-arrow svg { width: 16px; height: 16px; transition: transform .35s var(--ease-out); }
.link-arrow:hover { color: var(--accent-text); background-size: calc(100% - 22px) 1px; }
.link-arrow:hover svg { transform: translate(2px, -2px); }
[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
[dir="rtl"] .link-arrow:hover svg { transform: scaleX(-1) translate(2px, -2px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  overflow: hidden;
}
.hero-canvas {
  position: absolute;
  inset-block-start: calc(var(--header-h) + 28px);
  inset-inline-end: auto;
  right: 0;
  left: auto;
  width: 66%;
  height: 66%;
  direction: ltr;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%), linear-gradient(to top, transparent 0%, #000 30%, #000 90%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, #000 22%), linear-gradient(to top, transparent 0%, #000 30%, #000 90%, transparent 100%);
  mask-composite: intersect;
}
[dir="rtl"] .hero-canvas {
  right: auto;
  left: 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%), linear-gradient(to top, transparent 0%, #000 30%, #000 90%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 22%), linear-gradient(to top, transparent 0%, #000 30%, #000 90%, transparent 100%);
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-block: calc(var(--header-h) + 52px) clamp(28px, 4vw, 48px);
}
.hero-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
}
.eyebrow { color: var(--fg-2); }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: .875rem; color: var(--fg-2); }

.hero-fig {
  position: absolute;
  z-index: 3;
  inset-block-start: calc(var(--header-h) + 112px);
  inset-inline-start: 42%;
  max-width: 290px;
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: .8rem;
  line-height: 1.5;
  color: var(--fg-2);
}
.hero-fig figcaption { display: grid; gap: 4px; }
.fig-n { color: var(--accent-text); }
.rerun {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding-inline: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .8rem;
  color: var(--fg);
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  transition: border-color .2s ease, background-color .2s ease, transform .15s ease, opacity .2s ease;
  touch-action: manipulation;
}
.rerun svg { width: 14px; height: 14px; transition: transform .6s var(--ease-out); }
.rerun:hover { border-color: var(--line-2); background: var(--bg-2); }
.rerun:hover svg { transform: rotate(180deg); }
.rerun:active { transform: scale(.95); }
.rerun[aria-busy="true"] { cursor: progress; border-color: var(--accent); color: var(--accent-text); }
.rerun[aria-busy="true"] svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rerun-row { display: flex; align-items: center; gap: 12px; }
.run-meta { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; color: var(--fg-3); white-space: nowrap; }
:root[lang="fa"] .run-meta { font-family: var(--font-sans-fa); letter-spacing: 0; font-size: .8rem; }
.run-meta.is-new { color: var(--accent-text); }

.hero-name {
  margin-block-start: auto;
  padding-block-start: 48px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.6rem, 13.2vw, 12.5rem);
  line-height: .88;
  letter-spacing: -.03em;
}
.hero-name .line { display: block; overflow: hidden; padding: 0 .06em .1em; margin: 0 -.06em -.1em; }
.hero-name .line > span { display: block; }
.hero-name em { color: var(--fg-2); }
:root[lang="fa"] .hero-name {
  font-family: var(--font-fa-name), var(--font-fa-stack);
  font-weight: 700;
  line-height: 1.18;
  font-size: clamp(2.65rem, 8.2vw, 7.25rem);
}
:root[lang="fa"] .hero-name .line {
  overflow: visible;
  padding: 0 .04em .14em;
  margin: 0 -.04em -.14em;
}
:root[lang="fa"] .hero-name em { font-style: normal; font-weight: 600; color: var(--fg-2); }

.hero-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 32px clamp(32px, 6vw, 96px);
  align-items: end;
  margin-block-start: clamp(24px, 3vw, 40px);
  padding-block-start: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--line);
}
.hero-lede {
  max-width: 34ch;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.45;
  letter-spacing: -.01em;
  color: var(--fg);
}
.hero-lede em { font-family: var(--font-serif); font-size: 1.12em; color: var(--accent-text); }
:root[lang="fa"] .hero-lede { max-width: 40ch; line-height: 1.8; text-wrap: pretty; }
:root[lang="fa"] .hero-lede em { font-family: inherit; font-style: normal; font-size: 1em; font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 28px; }

.hero-meta { display: grid; gap: 0; }
.hero-meta > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
  font-size: .925rem;
  line-height: 1.45;
}
.hero-meta > div:last-child { border-bottom: 0; }
.hero-meta dt { color: var(--fg-3); padding-top: 2px; }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding-block: clamp(96px, 13vw, 176px);
}
.section + .section::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: var(--gutter);
  height: 1px;
  background: var(--line);
}
@media (min-width: 1416px) {
  .section + .section::before { inset-inline: calc((100% - var(--maxw)) / 2); }
}

.section-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  margin-block-end: clamp(48px, 7vw, 96px);
}
.section-label {
  grid-column: 1 / span 3;
  display: flex;
  gap: 12px;
  color: var(--fg-2);
  padding-top: .9em;
}
.section-label [data-num] { color: var(--accent-text); }
.section-title {
  grid-column: 4 / -1;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 6.2vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.section-title em { color: var(--accent-text); }
:root[lang="fa"] .section-title { font-weight: 600; line-height: 1.3; font-size: clamp(2.1rem, 5vw, 4.4rem); }
:root[lang="fa"] .section-title em { font-style: normal; }

.section-body, .about-grid, .entries, .projects, .skills, .stack, .contact-grid, .more {
  margin-inline-start: calc((100% + 24px) * 3 / 12);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.portrait { position: relative; max-width: 300px; }
.portrait picture {
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line), 0 0 0 10px var(--bg), 0 0 0 11px var(--line);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); filter: grayscale(.35) contrast(1.05); transition: filter .6s ease, transform .9s var(--ease-out); }
.portrait:hover img { filter: none; transform: scale(1.08); }
.portrait figcaption { margin-top: 22px; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
:root[lang="fa"] .portrait figcaption { font-family: inherit; letter-spacing: 0; font-size: .85rem; }

.about-copy { display: grid; gap: 24px; max-width: 62ch; }
.about-copy p { color: var(--fg-2); }
.about-copy .lead { font-size: clamp(1.25rem, 1.9vw, 1.6rem); line-height: 1.45; color: var(--fg); letter-spacing: -.012em; }
:root[lang="fa"] .about-copy .lead { line-height: 1.85; letter-spacing: 0; }

.principle {
  margin-top: 12px;
  padding-inline-start: 24px;
  border-inline-start: 2px solid var(--accent);
}
.principle p { font-family: var(--font-serif); font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.15; color: var(--fg); }
:root[lang="fa"] .principle p { font-family: var(--font-display); font-weight: 600; line-height: 1.6; font-size: clamp(1.3rem, 2.2vw, 1.8rem); }
:root[lang="fa"] .principle em { font-style: normal; }
.principle footer { margin-top: 10px; font-size: .9rem; color: var(--fg-3); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-block-start: clamp(64px, 9vw, 120px);
  border-top: 1px solid var(--line);
}
.stats li {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 28px 24px 0;
  border-inline-start: 1px solid var(--line);
}
.stats li:first-child { border-inline-start: 0; padding-inline-start: 0; }
.stat-num {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 5.6vw, 5.2rem);
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
:root[lang="fa"] .stat-num { font-weight: 600; }
.stat-num small { font-size: .38em; color: var(--fg-3); letter-spacing: 0; margin-inline-start: 4px; }
.stats li:first-child .stat-num { color: var(--accent-text); }
.stat-cap { max-width: 26ch; font-size: .925rem; line-height: 1.5; color: var(--fg-2); }

/* ---------- Entries (education / experience) ---------- */
.entries { display: grid; }
.entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 24px clamp(24px, 4vw, 56px);
  padding-block: clamp(32px, 4vw, 48px);
}
.entry .rule {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1px;
  background: var(--line-2);
  transform-origin: left center;
}
[dir="rtl"] .entry .rule { transform-origin: right center; }
.entry:last-child { border-bottom: 1px solid var(--line); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--fg-2);
  white-space: nowrap;
}
.chip-live { color: var(--fg); border-color: color-mix(in oklab, var(--ok) 45%, transparent); }

.entry-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.org-logo {
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  border-radius: 16px;
  background: #fbf9f4;
  border: 1px solid var(--line);
}
.org-logo img { width: 52px; height: 52px; object-fit: contain; }

.entry-main { display: grid; gap: 10px; max-width: 68ch; }
.entry-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.3vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -.02em;
}
:root[lang="fa"] .entry-title { font-weight: 600; letter-spacing: 0; line-height: 1.4; font-size: clamp(1.5rem, 2.8vw, 2.25rem); }
.entry-role { font-family: var(--font-sans); font-size: 1rem; letter-spacing: 0; color: var(--fg-2); font-weight: 400; }
:root[lang="fa"] .entry-role { font-family: inherit; font-weight: 400; }
.entry-track { color: var(--accent-text); font-weight: 500; }
.entry-org { font-weight: 500; }
.entry-desc { color: var(--fg-2); }

.bullets { display: grid; gap: 8px; margin-top: 6px; color: var(--fg-2); }
.bullets li { position: relative; padding-inline-start: 22px; }
.bullets li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .8em;
  width: 10px;
  height: 1px;
  background: var(--accent);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags li {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--line);
  color: var(--fg-2);
  font-size: .7rem;
  text-transform: none;
  letter-spacing: .02em;
}
:root[lang="fa"] .tags li { font-size: .8rem; }

/* ---------- Work: feature ---------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(24px, 4vw, 56px);
  border-radius: calc(var(--radius) + 6px);
  background: var(--bg-2);
  border: 1px solid var(--line);
  margin-inline-start: 0;
  margin-block-end: clamp(48px, 6vw, 80px);
}
.feature-copy { display: grid; gap: 18px; align-content: start; }
.feature-copy > p { color: var(--fg-2); }
.kicker { color: var(--accent-text); }
.feature-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -.02em;
}
:root[lang="fa"] .feature-title { font-weight: 600; line-height: 1.4; letter-spacing: 0; font-size: clamp(1.6rem, 3vw, 2.5rem); }
.feature-result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding-block: 18px;
  border-block: 1px solid var(--line);
  color: var(--fg-2);
  font-size: .95rem;
  line-height: 1.45;
}
.feature-result .big {
  font-family: var(--font-serif);
  font-size: clamp(3.4rem, 6vw, 5.4rem);
  line-height: .9;
  letter-spacing: -.03em;
  color: var(--accent-text);
  white-space: nowrap;
}
:root[lang="fa"] .feature-result .big { font-weight: 600; }

.chart { display: grid; gap: 22px; align-content: start; min-width: 0; }
.chart-cap { display: grid; gap: 8px; color: var(--fg-2); }
.chart-note {
  font-family: var(--font-sans);
  font-size: .8rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.45;
  color: var(--fg-3);
}
:root[lang="fa"] .chart-note { font-family: var(--font-sans-fa); }

.fx { display: grid; }
.fx-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr));
  gap: 8px clamp(12px, 2vw, 22px);
  align-items: center;
  padding-block: clamp(14px, 2vw, 22px);
  border-top: 1px solid var(--line);
}
.fx-head {
  padding-block: 0 10px;
  border-top: 0;
  font: 500 .68rem/1.3 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-3);
}
:root[lang="fa"] .fx-head { font-family: var(--font-sans-fa); font-size: .78rem; letter-spacing: 0; }
.fx-name { display: grid; gap: 2px; font-size: .88rem; line-height: 1.3; color: var(--fg-2); }
.fx-name small { font-size: .74rem; color: var(--fg-3); }
.fx-cell { display: grid; gap: 7px; min-width: 0; }
.fx-track {
  position: relative;
  height: 10px;
  border-radius: 2px;
  background: color-mix(in oklab, var(--fg-3) 12%, transparent);
}
.fx-bar {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: calc(var(--v) / var(--max) * 100%);
  border-radius: 2px;
  background: color-mix(in oklab, var(--fg-3) 55%, transparent);
  transform-origin: left center;
}
[dir="rtl"] .fx-bar { transform-origin: right center; }
.fx-ci {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: calc(var(--lo) / var(--max) * 100%);
  width: max(1px, calc((var(--hi) - var(--lo)) / var(--max) * 100%));
  height: 1px;
  background: var(--fg-2);
}
.fx-ci::before, .fx-ci::after {
  content: "";
  position: absolute;
  inset-block-start: -6px;
  width: 1px;
  height: 13px;
  background: var(--fg-2);
}
.fx-ci::before { inset-inline-start: 0; }
.fx-ci::after { inset-inline-end: 0; }
.fx-cell b { justify-self: start; direction: ltr; unicode-bidi: isolate; font: 500 .74rem/1 var(--font-mono); color: var(--fg-2); }
:root[lang="fa"] .fx-cell b { font-family: var(--font-sans-fa); font-size: .82rem; }
.fx-cell.is-cost .fx-bar {
  background: repeating-linear-gradient(-45deg, color-mix(in oklab, var(--fg-3) 50%, transparent) 0 3px, color-mix(in oklab, var(--fg-3) 22%, transparent) 3px 6px);
}
.fx-row.is-best .fx-name > span { color: var(--fg); font-weight: 500; }
.fx-row.is-best .fx-name small { color: var(--accent-text); }
.fx-row.is-best .fx-bar { background: var(--accent); }
.fx-row.is-best .fx-cell.is-cost .fx-bar {
  background: repeating-linear-gradient(-45deg, var(--accent) 0 3px, color-mix(in oklab, var(--accent) 40%, transparent) 3px 6px);
}
.fx-row.is-best .fx-cell b { color: var(--accent-text); }

.feature-result small.ci-note { display: block; margin-top: 8px; font-size: .78rem; color: var(--fg-3); }

/* ---------- Work: list ---------- */
.projects { border-top: 1px solid var(--line-2); }
.project {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1.05fr) minmax(0, 1.6fr) 104px;
  gap: 12px clamp(20px, 3vw, 40px);
  padding: clamp(24px, 3vw, 36px) 0;
  border-bottom: 1px solid var(--line);
  transition: background-color .3s ease;
}
.project::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--gutter) * -.5);
  border-radius: 16px;
  background: var(--bg-2);
  opacity: 0;
  z-index: -1;
  transition: opacity .3s ease;
}
.project:hover::before { opacity: 1; }
.p-n { color: var(--fg-3); padding-top: .55em; }
.project:hover .p-n { color: var(--accent-text); }
.p-head { display: grid; gap: 6px; align-content: start; }
.p-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 2.8vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  transition: color .25s ease;
}
.project:hover .p-title { color: var(--accent-text); }
.p-cat { color: var(--fg-3); }
.p-body p { color: var(--fg-2); max-width: 60ch; }
.p-links { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
[dir="rtl"] .p-links { align-items: flex-start; }
.more { margin-top: 28px; }

/* ---------- Toolkit ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-2);
}
.skill {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 28px 24px 8px;
  border-inline-start: 1px solid var(--line);
}
.skill:first-child { border-inline-start: 0; padding-inline-start: 0; }
.skill-n { color: var(--accent-text); }
.skill h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.1vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -.015em;
}
:root[lang="fa"] .skill h3 { font-weight: 600; line-height: 1.4; letter-spacing: 0; font-size: clamp(1.25rem, 1.8vw, 1.55rem); }
.skill li {
  padding-block: 9px;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
  line-height: 1.45;
  color: var(--fg-2);
}
.skill li:last-child { border-bottom: 0; }

.stack {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 32px;
  align-items: center;
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.stack-label { color: var(--fg-3); }
.stack-list { display: flex; flex-wrap: wrap; gap: 8px; }
.stack-list li {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--fg);
  font-size: .75rem;
  text-transform: none;
  letter-spacing: .01em;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.stack-list li:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: end;
}
.contact-main { display: grid; gap: 32px; min-width: 0; }
.contact-intro { max-width: 52ch; color: var(--fg-2); font-size: 1.1rem; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; min-width: 0; }
.email {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4.2vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% / 0 2px;
  padding-bottom: 4px;
  transition: background-size .5s var(--ease-out), color .25s ease;
}
.email:hover { background-size: 100% 2px; color: var(--accent-text); }
[dir="rtl"] .email { direction: ltr; unicode-bidi: isolate; text-align: right; background-position: 100% 100%; }
.copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 14px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: .85rem;
  transition: border-color .2s ease, background-color .2s ease;
}
.copy:hover { border-color: var(--fg); }
.copy svg { width: 16px; height: 16px; }
.copy .i-check { display: none; color: var(--ok); }
.copy.is-copied .i-check { display: block; }
.copy.is-copied .i-copy { display: none; }

.channels { border-top: 1px solid var(--line-2); }
.channels li { border-bottom: 1px solid var(--line); }
.channels a {
  display: grid;
  grid-template-columns: 22px 120px 1fr 20px;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding-block: 8px;
  transition: color .2s ease, padding .35s var(--ease-out);
}
.channels a:hover { color: var(--accent-text); padding-inline-start: 8px; }
.channels .brand-ico { width: 20px; height: 20px; }
.ch-k { font-weight: 500; }
.ch-v { color: var(--fg-2); font-family: var(--font-mono); font-size: .85rem; }
:root[lang="fa"] .ch-v:not([dir="ltr"]) { font-family: var(--font-sans-fa); }
[dir="rtl"] .ch-v[dir="ltr"] { text-align: right; }
.ch-arrow { width: 18px; height: 18px; color: var(--fg-3); transition: transform .35s var(--ease-out), color .2s ease; }
.channels a:hover .ch-arrow { color: var(--accent-text); transform: translate(2px, -2px); }
[dir="rtl"] .ch-arrow { transform: scaleX(-1); }
[dir="rtl"] .channels a:hover .ch-arrow { transform: scaleX(-1) translate(2px, -2px); }

.city { position: relative; }
.city picture { display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); }
.city img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform 1.2s var(--ease-out); }
.city:hover img { transform: scale(1.04); }
.city figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-3);
}
:root[lang="fa"] .city figcaption > span:first-child { font-family: var(--font-sans-fa); letter-spacing: 0; font-size: .85rem; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 56px calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.footer-inner { display: grid; gap: 40px; }
.quote { font-family: var(--font-serif); font-size: clamp(1.6rem, 3.2vw, 2.6rem); line-height: 1.15; letter-spacing: -.015em; max-width: 44ch; text-wrap: balance; }
:root[lang="fa"] .quote { font-family: var(--font-display); font-weight: 600; line-height: 1.6; font-size: clamp(1.3rem, 2.6vw, 2rem); }
.quote-by { display: block; margin-top: 10px; font-family: var(--font-sans); font-size: .95rem; letter-spacing: 0; color: var(--fg-3); }
:root[lang="fa"] .quote-by { font-family: var(--font-sans-fa); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: .9rem; color: var(--fg-2); }
.to-top { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; transition: color .2s ease; }
.to-top svg { width: 16px; height: 16px; transition: transform .35s var(--ease-out); }
.to-top:hover { color: var(--accent-text); }
.to-top:hover svg { transform: translateY(-3px); }

/* ---------- Motion initial states (only when JS animation is active) ---------- */
.motion .header-bar { opacity: 0; }
.motion [data-hero] { opacity: 0; }
.motion .hero-name .line > span { transform: translateY(105%); }
.motion .section-title .mask > span { transform: translateY(105%); }
.motion [data-reveal] { opacity: 0; }
.motion .entry .rule { transform: scaleX(0); }
.motion .fx .fx-bar { transform: scaleX(0); }
.motion .fx .fx-ci, .motion .fx .fx-cell b { opacity: 0; }
.motion .hero-canvas { opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .nav { display: none; }
  .menu-toggle { display: inline-grid; }
}

@media (max-width: 1024px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .section-label, .section-title { grid-column: 1 / -1; padding-top: 0; }
  .section-body, .about-grid, .entries, .projects, .skills, .stack, .contact-grid, .more { margin-inline-start: 0; }
  .feature { grid-template-columns: 1fr; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .skill:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 28px; }
  .hero-fig {
    inset-inline-start: auto;
    inset-inline-end: 0;
    padding: 0;
    border: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .hero-fig figcaption { display: none; }
  .run-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rerun { min-height: 44px; padding-inline: 14px 16px; }
}

@media (max-width: 860px) {
  .hero-canvas {
    width: 100%;
    height: 300px;
    inset-block-start: calc(var(--header-h) + 76px);
    left: 0;
    right: 0;
    -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 35%, #000 85%, transparent 100%);
    mask-image: linear-gradient(to top, transparent 0%, #000 35%, #000 85%, transparent 100%);
  }
  .hero-name { margin-block-start: 0; padding-block-start: 230px; font-size: clamp(3.6rem, 17vw, 7rem); }
  :root[lang="fa"] .hero-name { font-size: clamp(2.35rem, 10.5vw, 4.85rem); line-height: 1.22; }
  .hero-fig { inset-block-start: calc(var(--header-h) + 76px + 300px - 60px); }
  .rerun { width: 44px; padding: 0; justify-content: center; }
  .rerun svg { width: 18px; height: 18px; }
  .rerun-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero-bottom { grid-template-columns: 1fr; }
  .hero-meta > div { grid-template-columns: 96px 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 200px; }
  .entry { grid-template-columns: 1fr; gap: 16px; }
  .entry-meta { flex-direction: row; align-items: center; gap: 14px; }
  .org-logo { width: 56px; height: 56px; border-radius: 13px; }
  .org-logo img { width: 40px; height: 40px; }
  .project { grid-template-columns: 36px minmax(0, 1fr); }
  .p-body, .p-links { grid-column: 2; }
  .p-links { flex-direction: row; gap: 20px; align-items: center; }
  .contact-grid { grid-template-columns: 1fr; }
  .city { max-width: 420px; }
  .city picture { aspect-ratio: 4 / 3; }
}

@media (max-width: 600px) {
  :root { --header-h: 56px; }
  body { font-size: 1rem; }
  .header-bar { padding-inline: 14px 6px; gap: 8px; }
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .menu-toggle { padding-inline: 12px; }
  .brand-name { font-size: .95rem; }
  .hero-inner { padding-block-start: calc(var(--header-h) + 36px); }
  .status { font-size: .8rem; }
  .hero-cta .btn { flex: 1 1 auto; }
  .skills { grid-template-columns: 1fr; }
  .skill { border-inline-start: 0 !important; padding-inline: 0 !important; }
  .skill + .skill { border-top: 1px solid var(--line); margin-top: 16px; }
  .stack { grid-template-columns: 1fr; }
  .fx-row { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
  .fx-head > span:first-child { display: none; }
  .fx-name { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: baseline; gap: 8px; }
  .channels a { grid-template-columns: 22px 1fr 18px; }
  .channels .ch-v { grid-column: 2; grid-row: 2; margin-top: -6px; }
  .channels .ch-arrow { grid-column: 3; grid-row: 1 / span 2; }
  .channels a { row-gap: 2px; padding-block: 12px; }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  .stats li { border-inline-start: 0 !important; padding-inline: 0 !important; }
  .stats li + li { border-top: 1px solid var(--line); margin-top: 20px; }
}

@media (hover: none) {
  .project::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Print ---------- */
@media print {
  body::after, .site-header, .progress, .hero-canvas, .hero-fig, .hero-cta, .copy, .mobile-nav, .city, .to-top { display: none !important; }
  :root { --bg: #fff; --bg-2: #fff; --fg: #000; --fg-2: #222; --fg-3: #444; --line: #ccc; --line-2: #999; --accent-text: #000; }
  .hero { min-height: auto; }
  .section { padding-block: 24px; break-inside: avoid; }
  [data-reveal], [data-hero], .mask > span, .line > span { opacity: 1 !important; transform: none !important; }
}
