/* Darik public site. Hand-written; tokens documented in DESIGN.md. Two rooms: night (black + gold), day (ivory + sage). */

@font-face {
  font-family: "Yekan Bakh";
  src: url("../fonts/YekanBakhFaNum-VF.woff2") format("woff2");
  font-weight: 100 950;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font: "Yekan Bakh", Tahoma, sans-serif;

  --night: #000000;
  --night-2: #0c0a08;
  --night-surface: #181512;
  --night-line: #2a2520;
  --night-ink: #f4efe8;
  --night-muted: #a8a296;
  --gold: #d6aa3f;
  --gold-hi: #e9c678;
  --on-gold: #141009;
  --mask: #000000;
  --glint: rgb(255 244 200 / 0.35);

  --bg: #f4efe8;
  --surface: #fbf8f3;
  --ink: #222924;
  --muted: #454e48;
  --sage: #4b5d4e;
  --sage-soft: #e3eae4;
  --line: #d9d2c6;
  --gold-text: #765901;

  --t-display: clamp(2.5rem, 5.2vw, 4.75rem);
  --t-h2: clamp(1.875rem, 3.4vw, 3rem);
  --t-h3: clamp(1.25rem, 1.8vw, 1.5rem);
  --t-lead: clamp(1.0625rem, 1.4vw, 1.25rem);
  --t-body: 1rem;
  --t-small: 0.875rem;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --r-tag: 6px; --r-card: 14px; --r-shot: 20px; --r-pill: 999px;
  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141615; --surface: #1c1f1d; --ink: #f1efea; --muted: #9ca6a0;
    --sage: #a5bea9; --sage-soft: #232d25; --line: #2e3430; --gold-text: #dfb55b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141615; --surface: #1c1f1d; --ink: #f1efea; --muted: #9ca6a0;
  --sage: #a5bea9; --sage-soft: #232d25; --line: #2e3430; --gold-text: #dfb55b;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: clip;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--t-body); line-height: 1.9; font-weight: 400;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, figure, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 700; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h2 { font-size: var(--t-h2); line-height: 1.3; }
h3 { font-size: var(--t-h3); line-height: 1.5; }
p { text-wrap: pretty; }
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.day :focus-visible { outline-color: var(--ink); }

.skip {
  position: absolute; inset-inline-start: var(--s4); top: -100px; z-index: 100;
  background: var(--night); color: var(--night-ink); padding: var(--s2) var(--s4); border-radius: var(--r-tag);
}
.skip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip:focus { top: var(--s2); }

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

/* rooms */
.night { background: var(--night-2); color: var(--night-ink); }
.night .muted { color: var(--night-muted); }
.day { background: var(--bg); color: var(--ink); }
.day.alt { background: var(--surface); }
.muted { color: var(--muted); }
.lead { font-size: var(--t-lead); line-height: 1.9; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5); border-radius: var(--r-pill);
  font-weight: 500; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hi); }
.btn-line { border-color: color-mix(in srgb, currentColor 45%, transparent); }
.btn-line:hover { border-color: currentColor; background: color-mix(in srgb, currentColor 8%, transparent); }

.tag {
  display: inline-block; font-size: var(--t-small); font-weight: 500; line-height: 1.7;
  padding: 2px var(--s3); border-radius: var(--r-tag);
  background: var(--sage-soft); color: var(--sage);
}
.night .tag { background: none; border: 1px solid var(--night-line); color: var(--night-muted); }
.night .tag.todo { color: var(--gold); border-color: currentColor; }

.link { color: var(--sage); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; transition: text-decoration-color 160ms var(--ease); text-decoration-color: var(--line); }
.link:hover { text-decoration-color: currentColor; }
.night .link { color: var(--gold); text-decoration-color: var(--night-line); }

/* nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; background: var(--night); color: var(--night-ink); border-block-end: 1px solid var(--night-line); }
.nav .wrap { display: flex; align-items: center; gap: var(--s6); height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: var(--s2); text-decoration: none; min-height: 44px; }
.brand .sym { width: 32px; height: 32px; flex: none; }
.brand .word { font-family: var(--font); font-weight: 950; font-variation-settings: "wght" 950; font-size: 1.45rem; line-height: 1; color: currentColor; }
.nav-links { display: flex; gap: var(--s6); margin-inline-start: auto; }
.nav-links a { text-decoration: none; font-weight: 500; color: var(--night-muted); padding-block: var(--s3); transition: color 160ms var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--night-ink); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); }
.nav-tools { display: flex; align-items: center; gap: var(--s3); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-pill); color: var(--night-muted); transition: color 160ms var(--ease), background-color 160ms var(--ease); }
.icon-btn:hover { color: var(--night-ink); background: var(--night-surface); }
.icon-btn svg { width: 22px; height: 22px; }
.theme .moon, :root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}
.menu-btn { display: none; }
.nav .btn { min-height: 44px; }

@media (max-width: 899px) {
  :root { --nav-h: 64px; }
  .menu-btn { display: grid; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 0 0; height: calc(100dvh - var(--nav-h)); z-index: 49;
    flex-direction: column; gap: 0; margin: 0; padding: var(--s5) var(--gutter);
    background: var(--night); visibility: hidden; opacity: 0;
    transition: opacity 160ms var(--ease), visibility 160ms;
  }
  .nav-links a { font-size: var(--t-h3); color: var(--night-ink); padding-block: var(--s4); border-block-end: 1px solid var(--night-line); }
  .nav-links a[aria-current="page"] { box-shadow: none; color: var(--gold); }
  .nav.open .nav-links { visibility: visible; opacity: 1; transition: opacity 160ms var(--ease); overflow-y: auto; }
  .nav-tools { margin-inline-start: auto; }
  .nav .nav-cta { display: none; }
  .nav-links .nav-cta-m { display: inline-flex; margin-block-start: var(--s6); border: 0; color: var(--on-gold); font-size: var(--t-body); }
}
@media (min-width: 900px) { .nav-links .nav-cta-m { display: none; } }

/* sections */
.sec { padding-block: var(--s9); }
.sec-head { max-width: 46ch; margin-block-end: var(--s7); }
.sec-head h2 + p { margin-block-start: var(--s4); }
.grid { display: grid; gap: var(--s5); grid-template-columns: repeat(12, minmax(0, 1fr)); }
@media (min-width: 900px) {
  .sec { padding-block: var(--s8); }
  .home .sec { min-height: calc(var(--h, 1) * min(100vh, 900px)); }
}
@media (max-width: 899px) {
  .sec { padding-block: var(--s8); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > * { grid-column: 1 / -1 !important; }
}

/* hero */
.hero.night { background: var(--night); color: var(--night-ink); min-height: 100svh; padding-block: calc(var(--nav-h) + var(--s7)) var(--s6); overflow: clip; }
.hero > .wrap { display: flex; flex-direction: column; min-height: calc(100svh - var(--nav-h) - var(--s7) - var(--s6)); position: relative; z-index: 1; }
.hero-head { align-items: start; }
.hero h1 { grid-column: 1 / span 7; font-size: var(--t-display); line-height: 1.25; }
.hero-side { grid-column: 9 / span 4; }
.hero-side p { color: var(--night-muted); font-size: var(--t-lead); }
.hero-acts { display: flex; flex-wrap: wrap; gap: var(--s3); margin-block-start: var(--s5); }
.stage { flex: 1; min-height: 300px; position: relative; margin-block-start: var(--s5); }
.coin { position: absolute; inset-block: 0; inset-inline-start: 50%; aspect-ratio: 1408 / 1500; translate: 50% 0; }
[dir="rtl"] .coin { translate: 50% 0; }
.coin img { width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, var(--mask) 55%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, var(--mask) 55%, transparent 100%); }
.sweep { position: absolute; left: 26.5%; top: 16%; width: 44%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; pointer-events: none; }
.sweep::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, var(--glint) 50%, transparent 60%); transform: translateX(-110%); }
@media (prefers-reduced-motion: no-preference) {
  .js .coin { animation: rise 900ms var(--ease) both; }
  .js .sweep::before { animation: sweep 1600ms 700ms ease-in-out both; }
  .js .hero-head > * { animation: rise 700ms var(--ease) both; }
  .js .hero-side { animation-delay: 120ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes sweep { from { transform: translateX(-110%); } to { transform: translateX(110%); } }
@media (max-width: 899px) {
  .hero.night { padding-block-start: calc(var(--nav-h) + var(--s6)); }
  .hero-acts .btn { flex: 1 1 100%; }
  .stage { min-height: 320px; }
}

/* what */
.what-text { grid-column: 1 / span 5; }
.what-text p + p { margin-block-start: var(--s4); }
.what-text h2 { margin-block-end: var(--s5); }
.what-shots { grid-column: 6 / span 7; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.shot { border-radius: var(--r-shot); border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.shot img { width: 100%; }

/* showcase */
.show-list { grid-column: 1 / span 6; }
.show-list button {
  display: grid; grid-template-columns: 3ch minmax(0, 1fr); gap: var(--s1) var(--s4); width: 100%; text-align: start;
  padding: var(--s4) var(--s2); border-block-end: 1px solid var(--line); color: var(--muted);
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.show-list button .n { grid-row: span 2; color: var(--sage); font-weight: 500; }
.show-list button b { font-size: var(--t-h3); font-weight: 700; line-height: 1.5; color: var(--ink); }
.show-list button span.d { font-size: var(--t-small); line-height: 1.7; }
.show-list button:hover { background: var(--sage-soft); }
.show-list button[aria-selected="true"] { background: var(--sage-soft); box-shadow: inset 3px 0 0 var(--gold-text); }
[dir="rtl"] .show-list button[aria-selected="true"] { box-shadow: inset -3px 0 0 var(--gold-text); }
.show-view { grid-column: 8 / span 4; display: grid; gap: var(--s5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.js .show-view { grid-template-columns: minmax(0, 1fr); justify-items: end; align-items: start; }
.js .show-view .shot { grid-area: 1 / 1; max-width: 340px; opacity: 0; visibility: hidden; transition: opacity 200ms var(--ease), visibility 200ms; }
.js .show-view .shot.on { opacity: 1; visibility: visible; }
@media (min-width: 900px) { .js .show-view .shot { max-width: clamp(240px, calc((100vh - 330px) * 430 / 900), 340px); } }
@media (max-width: 899px) {
  .js .show-view .shot { max-width: 300px; }
  .show-list button { min-height: 44px; }
  .show-list button span.d { display: none; }
  .show-list button[aria-selected="true"] span.d { display: block; }
}

/* ledger rows (features, lessons, team) */
.rows { }
.row { display: grid; grid-template-columns: 4ch minmax(0, 4fr) minmax(0, 7fr); gap: var(--s5); padding-block: var(--s5); border-block-end: 1px solid var(--line); align-items: baseline; }
.row .n { color: var(--sage); font-weight: 500; }
.row p { color: var(--muted); }
.row .tag { margin-block-start: var(--s2); }
a.row { text-decoration: none; transition: background-color 160ms var(--ease); }
a.row:hover { background: var(--sage-soft); }
a.row:hover :is(h2, h3) { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
@media (max-width: 899px) {
  .row { grid-template-columns: 3ch minmax(0, 1fr); gap: var(--s1) var(--s3); }
  .row > :nth-child(3) { grid-column: 2; }
}
.sec-foot { margin-block-start: var(--s6); }

/* videos */
.player { position: relative; border-radius: var(--r-card); overflow: hidden; background: var(--night-surface); aspect-ratio: 16 / 10; }
.player img, .player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.play { position: absolute; inset: 0; width: 100%; display: grid; place-items: center; }
.play .disc { width: 72px; height: 72px; border-radius: 50%; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; transition: transform 160ms var(--ease), background-color 160ms var(--ease); }
.play:hover .disc { transform: scale(1.06); background: var(--gold-hi); }
.play:active .disc { transform: scale(0.98); }
.play .disc svg { width: 26px; height: 26px; }

.feat { align-items: start; margin-block-end: var(--s8); }
.feat .player { grid-column: 1 / span 8; }
.feat-text { grid-column: 9 / span 4; }
.feat-text h3, .feat-text h2 { font-size: var(--t-h3); line-height: 1.5; margin-block: var(--s2) var(--s4); }
.step { color: var(--gold); font-weight: 500; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); font-size: var(--t-small); color: var(--night-muted); }

.vgrid { display: grid; gap: var(--s7) var(--s5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vgrid.big { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vcard h3 { margin-block: var(--s2) var(--s3); }
.vcard .player { margin-block-end: var(--s4); }
.vcard .play .disc { width: 56px; height: 56px; }
.vcard .player img { transition: transform 400ms var(--ease); }
.vcard:hover .player img { transform: scale(1.025); }
.vcard[hidden] { display: none; }
@media (max-width: 899px) { .vgrid, .vgrid.big { grid-template-columns: minmax(0, 1fr); gap: var(--s6); } }
@media (min-width: 900px) and (max-width: 1099px) { .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-block-end: var(--s7); }
.chip { min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-pill); border: 1px solid var(--night-line); color: var(--night-muted); font-weight: 500; transition: color 160ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease); }
.chip:hover { color: var(--night-ink); border-color: var(--night-muted); }
.chip[aria-pressed="true"] { background: var(--night-ink); color: var(--night-2); border-color: var(--night-ink); }

/* team */
.people { display: grid; gap: var(--s5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.person .ph { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: var(--r-card); background: var(--sage-soft); color: var(--sage); margin-block-end: var(--s4); object-fit: cover; display: grid; place-items: center; font-size: var(--t-small); font-weight: 500; }
.person .role { color: var(--sage); font-weight: 500; font-size: var(--t-small); }
.person p.bio { color: var(--muted); margin-block-start: var(--s2); }
@media (max-width: 899px) { .people { grid-template-columns: minmax(0, 1fr); } }

/* close + footer */
.closing { background: var(--night); color: var(--night-ink); display: flex; flex-direction: column; }
.close { flex: 1; align-items: start; padding-block: var(--s7) var(--s5); position: relative; z-index: 1; }
.close-text { grid-column: 1 / span 6; }
.close-text p { max-width: 44ch; margin-block: var(--s4) var(--s6); color: var(--night-muted); font-size: var(--t-lead); }
.close-coin { grid-column: 8 / span 5; }
.close-coin img { width: 100%; max-height: 48vh; object-fit: contain; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, var(--mask) 55%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, var(--mask) 55%, transparent 100%); }
@media (min-width: 900px) { .home .closing { min-height: min(100vh, 900px); } }
@media (max-width: 899px) { .close-coin { display: none; } }
.foot { color: var(--night-muted); padding-block: var(--s5) var(--s8); font-size: var(--t-small); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s7); align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-inline-start: auto; }
.foot a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; transition: color 160ms var(--ease); }
.foot a:hover { color: var(--night-ink); }
.foot .fine { flex-basis: 100%; }
@media (max-width: 899px) { .foot nav { margin-inline-start: 0; } }

/* inner pages */
.page-head { padding-block: calc(var(--nav-h) + var(--s8)) var(--s7); }
.page-head h1 { font-size: var(--t-display); line-height: 1.25; max-width: 18ch; }
.page-head p { margin-block-start: var(--s4); max-width: 52ch; font-size: var(--t-lead); }
.page-head.night p { color: var(--night-muted); }
.page-head.day p { color: var(--muted); }
.page-head + .sec { padding-block-start: 0; }
@media (max-width: 899px) { .page-head { padding-block: calc(var(--nav-h) + var(--s7)) var(--s6); } }
.prose { max-width: 66ch; }
.prose p + p { margin-block-start: var(--s4); }
.prose h2 { margin-block: var(--s8) var(--s4); }
.prose h2:first-child { margin-block-start: 0; }

/* article */
.article { display: grid; gap: var(--s7); grid-template-columns: minmax(0, 66ch) minmax(0, 1fr); align-items: start; }
.article-body { font-size: 1.0625rem; line-height: 2; }
.article-body h2 { font-size: clamp(1.5rem, 2.2vw, 1.875rem); margin-block: var(--s8) var(--s4); scroll-margin-top: calc(var(--nav-h) + var(--s4)); }
.article-body h2:first-of-type { margin-block-start: var(--s6); }
.article-body p + p { margin-block-start: var(--s4); }
.article-body ul { margin-block: var(--s4); padding-inline-start: var(--s5); list-style: disc; }
.article-body li { margin-block: var(--s2); }
.article-body li::marker { color: var(--sage); }
.formula { margin-block: var(--s5); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-tag); font-weight: 500; color: var(--gold-text); }
.day.alt .formula { background: var(--bg); }
.draft { margin-block-end: var(--s6); padding: var(--s3) var(--s4); border: 1px dashed var(--sage); border-radius: var(--r-tag); color: var(--sage); font-size: var(--t-small); font-weight: 500; }
.aside { position: sticky; top: calc(var(--nav-h) + var(--s5)); display: grid; gap: var(--s6); }
.aside h2 { font-size: var(--t-body); line-height: 1.9; margin-block-end: var(--s2); }
.toc { }
.toc a { display: block; padding-block: var(--s2); color: var(--muted); text-decoration: none; min-height: 44px; transition: color 160ms var(--ease); }
.toc a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.aside-box { border-block-start: 1px solid var(--line); padding-block-start: var(--s4); }
.aside-box p { color: var(--muted); font-size: var(--t-small); margin-block-end: var(--s4); }
.aside-box .player { border-radius: var(--r-tag); margin-block-end: var(--s3); }
.aside-box .play .disc { width: 48px; height: 48px; }
@media (max-width: 999px) { .article { grid-template-columns: minmax(0, 1fr); } .aside { position: static; } .aside-box { display: none; } .article-end .aside-box { display: block; } }
.article-end { display: none; margin-block-start: var(--s8); gap: var(--s6); }
@media (max-width: 999px) { .article-end { display: grid; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* jobs: rows beside the tools screen */
.rows.jobs { grid-column: 1 / span 8; }
.rows.jobs .row { grid-template-columns: 3ch minmax(0, 1fr); gap: var(--s1) var(--s4); padding-block: var(--s4); }
.rows.jobs .row p { grid-column: 2; }
.jobs-shot { grid-column: 10 / span 3; align-self: start; }
@media (max-width: 899px) { .jobs-shot { max-width: 300px; justify-self: center; } }

/* desktop fit: each home section holds one screen (videos two) at 1440x900 */
@media (min-width: 900px) {
  .home .sec { padding-block: var(--s7); }
  .home .sec-head { margin-block-end: var(--s6); }
  .home .show-list button, .home .rows.jobs .row { padding-block: var(--s3); }
  .home .jobs-shot { max-width: max(240px, calc((100vh - 290px) * 430 / 900)); justify-self: end; }
}

@media (min-width: 900px) { .home .person .ph { max-height: calc(100vh - 420px); } }

/* phone fit */
@media (max-width: 899px) {
  .hero.night { padding-block-end: var(--s5); }
  .hero > .wrap { min-height: calc(100svh - var(--nav-h) - var(--s6) - var(--s5)); }
  .stage { min-height: 220px; margin-block-start: var(--s4); }
  .person { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: var(--s4); align-items: start; }
  .person .ph { grid-row: span 3; margin: 0; aspect-ratio: 1; }
}
@media (max-width: 899px) { .show-view { order: -1; } }
@media (max-width: 899px) {
  .home .vgrid .vcard { display: grid; grid-template-columns: 132px minmax(0, 1fr); column-gap: var(--s4); align-items: start; }
  .home .vgrid .vcard .player { grid-row: span 3; margin: 0; border-radius: var(--r-tag); }
  .home .vgrid .vcard .play .disc { width: 44px; height: 44px; }
  .home .vgrid .vcard h3 { font-size: var(--t-body); line-height: 1.7; margin-block: 0 var(--s2); }
  .home .vgrid { gap: var(--s5); }
}

/* fixes from the keyboard, dark-mode and code review pass */
@media (min-width: 1000px) { .article-body { grid-column: 1; grid-row: 1; } .aside { grid-column: 2; grid-row: 1; } }
.play:focus-visible, .player video:focus-visible { outline-offset: -4px; }
@media (max-width: 899px) {
  .page-head .link { display: inline-flex; align-items: center; min-height: 44px; }
  .home .vgrid .vcard:has(.player > :is(iframe, video)) { display: block; }
  .home .vgrid .vcard:has(.player > :is(iframe, video)) .player { margin-block-end: var(--s4); }
}

/* hero: copy on the right, the coin on the left, on its pedestal */
.hero .hero-head { flex: 1; align-items: center; }
.hero .hero-head > .hero-text { grid-column: 1 / span 6; }
.hero .hero-head > .stage { grid-column: 7 / span 6; min-height: 0; margin-block-start: 0; }
.hero .hero-text p { color: var(--night-muted); font-size: var(--t-lead); margin-block-start: var(--s5); max-width: 36ch; }
.hero .hero-acts { margin-block-start: var(--s6); }
.hero .stage .coin { position: relative; inset: auto; translate: none; width: min(100%, 520px); margin-inline: auto; }
@media (max-width: 899px) {
  .hero .hero-head { align-items: start; }
  .hero .hero-head > .hero-text, .hero .hero-head > .stage { grid-column: 1 / -1; }
  .hero .stage .coin { width: min(78%, 340px); }
}

/* Homepage coin video and still fallback share the same footprint. */
.hero .stage .coin-film { aspect-ratio: 926 / 986; }
.coin-film .coin-poster, .coin-film .coin-loop { position: absolute; inset: 0; width: 100%; height: 100%; }
.coin-film .coin-loop {
  object-fit: cover;
  mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, var(--mask) 55%, transparent 100%);
}
@media (max-width: 899px) {
  .hero .hero-head > .stage { order: -1; }
  .hero .hero-head > .hero-text { order: 1; }
}

.coin-intro { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .hero .hero-head > *, .js .hero .coin-film { animation: none; }
  .js .hero.is-entering .stage { z-index: 2; pointer-events: none; }
  .hero.is-entering .coin-intro { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; transform-origin: 49% 37%; }
}

.typing-line { display: grid; direction: rtl; }
.typing-line > span { grid-area: 1 / 1; min-width: 0; }
.typing-line > span:first-child { opacity: 0; }
.typing-now::after {
  content: ''; display: inline-block; width: 0; height: .83em;
  border-inline-start: 2px solid currentColor; vertical-align: -.05em;
}

@media (prefers-reduced-motion: no-preference) {
  .js .home > header.nav:not(.open) { animation: darik-nav-in 420ms 5s ease-out both; }
  .js .home.nav-ready > header.nav:not(.open) { animation: darik-nav-ready 420ms ease-out both; }
  @keyframes darik-nav-in {
    from { opacity: 0; visibility: hidden; }
    to { opacity: 1; visibility: visible; }
  }
  @keyframes darik-nav-ready {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

.hero-mark { position: relative; display: inline-block; white-space: nowrap; }
.hero-mark svg { position: absolute; pointer-events: none; width: 100%; height: .32em; left: 0; bottom: .02em; overflow: visible; }
.hero-mark path { fill: none; stroke: #d9b751; stroke-opacity: .82; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
@media (prefers-reduced-motion: no-preference) {
  .hero.copy-pending .hero-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .hero.draw-marks .hero-mark path { stroke-dasharray: 1; animation: hero-mark-draw .75s ease-out var(--mark-delay, 0s) both; }
}
@keyframes hero-mark-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.hero-brand, .hero-title { display: block; }
.hero-brand { font-weight: 950; }
.hero-title { margin-block-start: .12em; font-size: .74em; line-height: 1.45; font-weight: 700; }
.hero-brand.typing-line, .hero-title.typing-line { display: grid; }
.hero .hero-text .hero-marked { font-weight: 450; }

.hero-highlight {
  background: linear-gradient(0deg, rgba(216, 177, 76, .32), rgba(234, 202, 119, .20)) right 75% / 100% .74em no-repeat;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
@media (prefers-reduced-motion: no-preference) {
  .hero.copy-pending .hero-marked { opacity: 0; }
  .js .hero:not(.draw-marks):not(.copy-static) .hero-highlight { background-size: 0% .74em; }
  .js .hero:not(.draw-marks):not(.copy-static) .hero-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .hero.draw-marks .hero-highlight { animation: hero-highlight-fill .7s ease-out .8s both; }
}
@keyframes hero-highlight-fill { from { background-size: 0% .74em; } to { background-size: 100% .74em; } }


/* ---- landing sections ---- */
.era-text, .ai-text, .conn-text { grid-column: 1 / span 7; }
.trust-infra { grid-column: 1 / span 7; }
.trust-support { grid-column: 8 / span 5; }
.era-shot, .ai-shot, .conn-shot { grid-column: 9 / span 4; align-self: start; justify-self: center; width: 100%; max-width: max(240px, calc((100vh - 200px) * 430 / 900)); }
.lead { max-width: 52ch; }
.sec h2 + .lead { margin-block-start: var(--s4); }
.era-rows { margin-block-start: var(--s6); }
.era-rows .row { grid-template-columns: 3ch minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); padding-block: var(--s3); }
.era-rows .was { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.era-rows .now { color: var(--ink); font-weight: 500; }
.steps { margin-block-start: var(--s6); }
.steps .row { grid-template-columns: 3ch minmax(0, 1fr); gap: var(--s1) var(--s4); padding-block: var(--s3); }
.steps .row p { grid-column: 2; }
.night .row { border-color: var(--night-line); }
.night .row p { color: var(--night-muted); }
.night .row .n { color: var(--gold); }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); margin-block-start: var(--s2); }
.flow li { border-block-start: 1px solid var(--line); padding-block-start: var(--s4); }
.flow .n { display: block; font-size: var(--t-display); line-height: 1.2; font-weight: 700; color: var(--gold-text); margin-block-end: var(--s3); }
.flow p { color: var(--muted); margin-block-start: var(--s2); }
.trust-col h2 + .rows, .trust-col h2 + .lead { margin-block-start: var(--s5); }
@media (max-width: 899px) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .era-shot, .ai-shot, .conn-shot { max-width: 300px; }
  .era-rows .row { grid-template-columns: 3ch minmax(0, 1fr); }
  .era-rows .row > :nth-child(3) { grid-column: 2; }
}
@media (min-width: 900px) { .home .sec { padding-block: var(--s7); } }

/* ---- scroll: a gold hairline of progress, content that settles in, the hero that recedes ---- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: right; z-index: 60; pointer-events: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress { animation: progress-grow linear both; animation-timeline: scroll(root); }
    .home .hero .hero-head { animation: hero-recede linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
  }
}
@keyframes progress-grow { to { transform: scaleX(1); } }
@keyframes hero-recede { to { transform: translateY(-6vh) scale(.965); opacity: .12; } }
.js .rv:not(.in) { opacity: 0; }
.js .rv.in { animation: rv-in 760ms var(--ease) calc(var(--i, 0) * 80ms) both; }
@keyframes rv-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* the app showcase pins to the screen and follows the scroll, one app screen per step */
@media (min-width: 900px) and (min-height: 820px) and (prefers-reduced-motion: no-preference) {
  .js #app { scroll-margin-top: calc(var(--nav-h) * -1); }
  .js .home .sec.pin { padding: 0; min-height: 0; }
  .js .pin-track { height: 460vh; }
  .js .pin-stage { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; padding-block-start: var(--nav-h); }
  .js .pin-stage > .wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); }
}


/* ---- scroll, second layer (as on the reference page): the bar turns into a floating glass pill once you scroll ---- */
:root { --glass: rgb(10 10 10 / 0.62); }
.nav, .nav .wrap { transition: background-color 320ms var(--ease), border-color 320ms var(--ease), border-radius 320ms var(--ease), height 320ms var(--ease), margin 320ms var(--ease), padding 320ms var(--ease); }
@media (min-width: 900px) {
  .nav.scrolled { background: transparent; border-color: transparent; }
  .nav.scrolled .wrap { box-sizing: border-box; margin-block-start: 10px; height: 56px; padding-inline: 22px; border-radius: var(--r-pill);
    background: var(--glass); border: 1px solid var(--night-line); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
}

/* "برنامه‌ی همه‌کاره" section */
.all-text { grid-column: 1 / span 7; }
.all-shot { grid-column: 9 / span 4; align-self: start; justify-self: center; width: 100%; max-width: max(240px, calc((100vh - 200px) * 430 / 900)); }
@media (max-width: 899px) { .all-shot { max-width: 300px; } }

/* no app screenshots: text sections run full width, the numbered columns carry the picture */
.era-text { grid-column: 1 / -1; }
.rows.jobs { grid-column: 1 / -1; }
.flow.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.night .flow li { border-color: var(--night-line); }
.night .flow p { color: var(--night-muted); }
.night .flow .n { color: var(--gold); }
.flow li .lead { max-width: none; }
@media (min-width: 900px) {
  .rows.jobs .row { grid-template-columns: 4ch minmax(0, 4fr) minmax(0, 7fr); }
  .rows.jobs .row p { grid-column: auto; }
}
@media (max-width: 899px) { .flow.three { grid-template-columns: minmax(0, 1fr); } }
.poster-empty { position: absolute; inset: 0; display: grid; place-items: center; background: var(--night-surface); }
.poster-empty svg { width: 22%; height: auto; max-width: 96px; opacity: .55; }

.foot .powered { margin-block-start: calc(var(--s2) * -1); opacity: .75; text-align: center; }


/* ---- themes: dark is black and gold everywhere; light keeps the hero and the closing call black, everything between is light ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0b; --surface: #131313; --ink: #f4efe8; --muted: #a8a296;
    --sage: #d9c38a; --sage-soft: #1c1913; --line: #2a2620; --gold-text: #dfb55b;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0b; --surface: #131313; --ink: #f4efe8; --muted: #a8a296;
  --sage: #d9c38a; --sage-soft: #1c1913; --line: #2a2620; --gold-text: #dfb55b;
}
:root[data-theme="light"] .night:not(.hero):not(.closing),
:root[data-theme="light"] .nav.scrolled {
  --night-2: var(--surface); --night-surface: #ece5da; --night-line: var(--line);
  --night-ink: var(--ink); --night-muted: var(--muted);
}
:root[data-theme="light"] .night:not(.hero):not(.closing) { background: var(--surface); color: var(--ink); }
:root[data-theme="light"] .night:not(.hero):not(.closing) :is(.step, .link, .tag.todo, .flow .n, .row .n) { color: var(--gold-text); }
:root[data-theme="light"] .nav.scrolled {
  color: var(--ink);
  background: var(--surface);
  border-block-end-color: var(--line);
}
:root[data-theme="light"] .nav.scrolled .nav-links {
  background: var(--surface);
}
@media (min-width: 900px) {
  :root[data-theme="light"] .nav.scrolled { background: transparent; }
  :root[data-theme="light"] .nav.scrolled .wrap { background: rgb(251 248 243 / 0.92); }
}
html[data-theme-reveal]::view-transition-old(root), html[data-theme-reveal]::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---- theme switch ---- */
.theme-switch {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding-inline: 14px;
  border-radius: var(--r-pill); border: 1px solid var(--night-line); color: var(--night-ink);
  font-size: var(--t-small); font-weight: 500; line-height: 1;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}
.theme-switch:hover { background: var(--night-surface); border-color: var(--night-muted); }
.theme-switch:active { transform: translateY(1px); }
.ts-icon { width: 18px; height: 18px; overflow: visible; flex: none; }
.ts-disc, .ts-rays line { transform-box: view-box; transform-origin: 12px 12px; }
/* light: a full sun. Coming back from dark the rays wait for the bite to clear, then return one after another */
.ts-bite { transform: translate(10px, -10px); transition: transform 380ms cubic-bezier(.65, 0, .35, 1); }
.ts-disc { transition: transform 380ms cubic-bezier(.23, 1, .32, 1); }
.ts-rays line { transition: transform 260ms cubic-bezier(.23, 1, .32, 1) calc(140ms + var(--i) * 22ms), opacity 260ms cubic-bezier(.23, 1, .32, 1) calc(140ms + var(--i) * 22ms); }
/* dark: the rays retract one after another and a bite turns the sun into a moon */
:root[data-theme="dark"] .ts-bite { transform: none; transition-delay: 60ms; }
:root[data-theme="dark"] .ts-disc { transform: scale(1.8); transition-delay: 40ms; }
:root[data-theme="dark"] .ts-rays line { transform: scale(.5); opacity: 0; transition-delay: calc(var(--i) * 18ms); }
.ts-label { display: grid; }
.ts-label > span { grid-area: 1 / 1; transition: opacity 240ms cubic-bezier(.23, 1, .32, 1), filter 240ms cubic-bezier(.23, 1, .32, 1); }
.ts-d { opacity: 0; filter: blur(3px); }
:root[data-theme="dark"] .ts-l { opacity: 0; filter: blur(3px); }
:root[data-theme="dark"] .ts-d { opacity: 1; filter: none; }

/* light theme: an empty video card is light wherever it sits (lesson asides too) */
:root[data-theme="light"] .poster-empty, :root[data-theme="light"] .player { background: #ece5da; }


/* ---- pricing ---- */
.pricing-head { margin-inline: auto; text-align: center; margin-block-end: var(--s5); }
.billing { display: flex; width: max-content; margin: 0 auto var(--s7); padding: 4px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.billing label { cursor: pointer; }
.billing input { position: absolute; opacity: 0; pointer-events: none; }
.billing span { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding-inline: var(--s5); border-radius: var(--r-pill); font-weight: 500; color: var(--muted); transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.billing input:checked + span { background: var(--ink); color: var(--bg); }
.billing input:focus-visible + span { outline: 2px solid var(--gold-text); outline-offset: 2px; }
.save { font-size: var(--t-small); font-weight: 500; padding: 1px var(--s2); border-radius: var(--r-pill); background: var(--sage-soft); color: var(--sage); }
.billing input:checked + span .save { background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; }
.plans { display: grid; gap: var(--s5); grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: var(--s6) var(--s5) var(--s5); border: 1px solid var(--line); border-radius: var(--r-shot); background: var(--surface); position: relative; }
.plan.featured { border-color: var(--gold); box-shadow: 0 24px 48px -32px color-mix(in srgb, var(--gold) 70%, transparent); }
.plan-flag { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translate(50%, -50%); white-space: nowrap; font-size: var(--t-small); font-weight: 500; padding: 2px var(--s3); border-radius: var(--r-pill); background: var(--gold); color: var(--on-gold); }
.plan h3 { font-size: var(--t-h3); }
.plan-sub { color: var(--muted); font-size: var(--t-small); line-height: 1.8; margin-block-start: var(--s2); min-height: 3.6em; }
.trial { align-self: start; margin-block-start: var(--s4); font-size: var(--t-small); font-weight: 500; padding: 2px var(--s3); border-radius: var(--r-pill); background: var(--sage-soft); color: var(--sage); }
.price { display: flex; align-items: baseline; gap: var(--s2); margin-block-start: var(--s5); }
.amt { display: inline-grid; font-size: clamp(2.25rem, 3.6vw, 3rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.amt > span { grid-area: 1 / 1; transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 220ms; }
.was { color: var(--muted); font-size: var(--t-h3); text-decoration-thickness: 1px; }
.unit { color: var(--muted); font-size: var(--t-small); }
.annual-note { color: var(--sage); font-size: var(--t-small); font-weight: 500; margin-block-start: var(--s2); min-height: 1.8em; }
.plan-features { display: grid; gap: var(--s3); margin-block: var(--s5) var(--s6); padding-block-start: var(--s5); border-block-start: 1px solid var(--line); }
.plan-features li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--s3); align-items: start; line-height: 1.8; }
.plan-features li::before { content: ""; width: 18px; height: 18px; margin-block-start: 5px; background: var(--sage);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
.plan.featured .plan-features li::before { background: var(--gold-text); }
.plan-cta { margin-block-start: auto; width: 100%; }
.pricing-note { text-align: center; font-size: var(--t-small); margin-block-start: var(--s6); }
/* monthly / annual: both prices are always laid out, only one is visible, so nothing moves when switching */
.y-only { visibility: hidden; }
.amt .y { opacity: 0; transform: translateY(6px); visibility: hidden; }
#pricing:has(input[value="y"]:checked) .y-only { visibility: visible; }
#pricing:has(input[value="y"]:checked) .amt .m { opacity: 0; transform: translateY(-6px); visibility: hidden; }
#pricing:has(input[value="y"]:checked) .amt .y { opacity: 1; transform: none; visibility: visible; }
@media (max-width: 899px) {
  .plans { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .plan-sub { min-height: 0; }
}
