:root {
  --bg: #0a0a0b;
  --ink: #efe9e1;
  --muted: #8d877f;
  --blood-hi: #b3100f;
  --gold: #c9a24a;
  --font: "Vazirmatn", system-ui, sans-serif;
  --rule: #2a2a2c;
  --chip: rgba(10,10,11,.7);
}
/* white background (?theme=light): the line, the drawing and the letters turn black */
:root[data-theme="light"] {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6e6862;
  --rule: #dcd8d3;
  --chip: rgba(255,255,255,.75);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--font); overflow-x: hidden; }

.badge {
  position: absolute; top: 16px; left: 16px; z-index: 50;   /* scrolls away with the hero, so it never covers the menu */
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--rule); padding: 6px 10px; border-radius: 999px;
  background: var(--chip); backdrop-filter: blur(6px);
}
/* top right: the white/dark switch and the language switch */
.top-actions { position: fixed; top: 16px; right: 16px; z-index: 50; display: flex; gap: 8px; direction: ltr; }
.lang-switch, .theme-switch {
  font: inherit; font-size: 12px; color: var(--ink); text-decoration: none; letter-spacing: .08em;
  border: 1px solid var(--rule); padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--chip); backdrop-filter: blur(6px);
}
.theme-switch { letter-spacing: 0; }
.lang-links { display: flex; gap: 4px; }
.lang-links .lang-switch { padding: 6px 10px; }
.lang-links .lang-switch[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lang-switch:hover, .theme-switch:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Hero ---------- */
.hero { height: 100vh; display: grid; place-items: center; text-align: center; padding: 0 16px; }
.hero .kicker { letter-spacing: .3em; font-size: 13px; color: var(--gold); }
.hero h1 { font-weight: 900; font-size: clamp(40px, 7vw, 110px); margin: .2em 0; line-height: 1.1; }
.hero .hint { color: var(--muted); font-size: 14px; margin-top: 4vh; }
.hero .hint span { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(8px); } }

/* =====================================================================
   The site under the story (site.js): about, strategy, principles, work,
   the featured event, events, publications, members, join, footer.
   ===================================================================== */
:root { --panel: #141416; --line-2: #232326; }
:root[data-theme="light"] { --panel: #f5f3ef; --line-2: #e6e2dc; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.sec { padding: 16vh 0 12vh; }
.sec.alt { background: var(--panel); }
.sec.page { padding-top: calc(var(--header-h) + 10vh); min-height: 70vh; }
.featured-block { margin: 0 0 12vh; }
.sec-head { margin-bottom: 6vh; }
.sec-head h2, .sec-head h1, .sec h2, .done h2, .statement {
  font-weight: 900; font-size: clamp(34px, 4.6vw, 68px); line-height: 1.15; margin: .2em 0 .3em; max-width: 24ch;
  text-wrap: balance;
}
.statement { max-width: 22ch; font-size: clamp(36px, 5.2vw, 80px); }
/* the gold words in titles: gold, upright, in every language */
.sec em, .statement em { font-style: normal; color: var(--gold); }
.sec-sub, .kicker { color: var(--gold); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; margin: 0; }
[dir="rtl"] .sec-sub, [dir="rtl"] .kicker { letter-spacing: 0; font-size: 14px; }
.lede { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.8; color: var(--ink); max-width: 46em; margin: 0 0 6vh; }
[dir="ltr"] .lede { line-height: 1.6; }
.prose p, .card p, .principle p, .phases p, .event-body, .pub p { color: var(--muted); line-height: 2; font-size: 16px; margin: 0; }
[dir="ltr"] .prose p, [dir="ltr"] .card p, [dir="ltr"] .principle p, [dir="ltr"] .phases p, [dir="ltr"] .event-body, [dir="ltr"] .pub p { line-height: 1.7; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3vw; }
.prose { margin: 7vh 0; }
.cards { margin-top: 2vh; }
.card { border-top: 1px solid var(--rule); padding-top: 22px; transition: border-color .4s; }
.card:hover { border-top-color: var(--gold); }
.principle { transition: border-color .4s, transform .4s cubic-bezier(.2,.7,.2,1); }
.principle:hover { transform: translateX(var(--nudge, 4px)); }
[dir="rtl"] .principle:hover { --nudge: -4px; }

/* gentle motion (site.js): rise into view one after another */
.rise { opacity: 0; transform: translateY(26px); transition: opacity .9s cubic-bezier(.2,.7,.2,1) var(--d, 0ms), transform .9s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; transition: none; } }
.card h3, .principle h3, .phases h3 { font-size: clamp(20px, 1.7vw, 26px); margin: 0 0 .5em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2vw; margin: 7vh 0 0; }
.stat strong { display: block; font-weight: 900; font-size: clamp(40px, 5vw, 76px); line-height: 1; color: var(--ink); }
.stat span { color: var(--muted); font-size: 14px; letter-spacing: .12em; }
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3vw; counter-reset: ph; }
.phases li { counter-increment: ph; border-top: 3px solid var(--blood-hi); padding-top: 22px; }
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5vh 4vw; }
.principle { padding-inline-start: 22px; border-inline-start: 3px solid var(--gold); }
.done { margin-top: 14vh; }
.date-card h3 { font-weight: 900; font-size: clamp(30px, 3vw, 46px); }

/* events */
.feature { background: linear-gradient(var(--bg), var(--bg)); }
.badge-gold { color: var(--gold); font-size: 14px; margin: 0 0 3vh; }
.events { display: grid; gap: 22px; }
.event { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--rule); padding-top: 26px; }
.event:has(.event-cover) { grid-template-columns: minmax(180px, 30%) 1fr; gap: 3vw; }
.event-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.event.featured .event-cover { aspect-ratio: auto; height: auto; }
.event-meta { color: var(--gold); font-size: 14px; margin: 0 0 .4em; }
.event h3 { font-weight: 900; font-size: clamp(24px, 2.6vw, 40px); margin: 0 0 .5em; line-height: 1.2; }
.event.featured h3 { font-size: clamp(32px, 4vw, 60px); }
.event details summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.event-body { max-width: 46em; margin-bottom: 18px !important; white-space: pre-line; }
.files { display: grid; gap: 8px; margin: 10px 0 18px; max-width: 46em; }
.files .kicker { margin-bottom: 4px; }
.file-link { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 8px; color: var(--ink); text-decoration: none; }
.file-link:hover { border-color: var(--gold); }
.file-kind { font-size: 11px; font-weight: 700; color: var(--gold); min-width: 38px; }
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.file-act { color: var(--muted); font-size: 13px; white-space: nowrap; }
.file-video { margin: 0; }
.file-video video { width: 100%; border-radius: 8px; background: #000; }
.file-video figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; direction: ltr; text-align: start; }

/* publications: a list of rows, no pictures */
.pub-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.pub { border-bottom: 1px solid var(--rule); }
.pub-line {
  display: grid; grid-template-columns: minmax(150px, 220px) 1fr auto; gap: 3vw; align-items: center;
  padding: 34px 10px; color: var(--ink); text-decoration: none;
  transition: background .4s, padding .4s cubic-bezier(.2,.7,.2,1);
}
a.pub-line:hover, a.pub-line:focus-visible { background: var(--panel); padding-inline: 26px; outline: none; }
.pub-meta { color: var(--gold); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; line-height: 1.6; }
[dir="rtl"] .pub-meta { letter-spacing: 0; font-size: 14px; }
.pub-text { display: grid; gap: 8px; }
.pub-title { font-weight: 900; font-size: clamp(22px, 2.3vw, 34px); line-height: 1.25; text-wrap: balance; transition: color .3s; }
a.pub-line:hover .pub-title { color: var(--gold); }
.pub-desc { color: var(--muted); line-height: 1.8; max-width: 62ch; }
[dir="ltr"] .pub-desc { line-height: 1.6; }
.pub-act { white-space: nowrap; color: var(--muted); font-size: 14px; border: 1px solid var(--rule); border-radius: 999px; padding: 9px 18px; transition: color .3s, background .3s, border-color .3s; }
a.pub-line:hover .pub-act { color: #111; background: var(--gold); border-color: var(--gold); }
.pub-arrow { display: inline-block; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
a.pub-line:hover .pub-arrow { transform: translateX(5px); }
[dir="rtl"] a.pub-line:hover .pub-arrow { transform: translateX(-5px); }

/* links, buttons, tabs, forms */
.more, .btn { display: inline-block; margin-top: 5vh; color: var(--ink); text-decoration: none; border: 1px solid var(--rule); border-radius: 999px; padding: 12px 22px; font: inherit; font-size: 15px; cursor: pointer; background: none; }
.btn { margin-top: 0; }
.more:hover, .btn:hover { border-color: var(--gold); color: var(--gold); }
.btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.solid:hover { background: var(--gold); border-color: var(--gold); color: #111; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 5vh; }
.tabs button { font: inherit; font-size: 14px; color: var(--muted); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.form { display: grid; gap: 18px; max-width: 760px; }
.field { display: grid; gap: 8px; }
.field span { color: var(--muted); font-size: 13px; letter-spacing: .08em; }
.form input, .form textarea, .newsletter input {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; width: 100%;
}
.form input:focus, .form textarea:focus, .newsletter input:focus, .btn:focus-visible, .more:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.form .btn { justify-self: start; }
/* the bots' field: hidden without moving it off the page (that would widen an RTL page) */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.form { position: relative; }
.form-status { color: var(--gold); min-height: 1.4em; margin: 0; }
.row { display: flex; gap: 8px; }

/* the nav under the story, and the footer */
/* the header: menu, theme and language, fixed at the top of every page */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 24px;
  background: var(--chip); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2);
}
:root { --header-h: 64px; }
/* ISAD at the start, the menu in the middle, the buttons at the end */
.site-header .site-nav-home { justify-self: start; }
.site-header .site-nav-links { justify-self: center; }
.site-header .top-actions { position: static; justify-self: end; }
.site-nav-links a[aria-current="page"] { color: var(--ink); }
.has-header .sec { scroll-margin-top: var(--header-h); }
.has-header .badge { top: calc(var(--header-h) + 14px); }
.site-nav-home { font-weight: 900; letter-spacing: .06em; color: var(--ink); text-decoration: none; font-family: "Inter Tight", var(--font); }
.site-nav-links { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.site-nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; position: relative; padding: 4px 0; transition: color .3s; }
.site-nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--gold); transform: scaleX(0); transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.site-nav-links a:hover::after, .site-nav-links a[aria-current="page"]::after { transform: scaleX(1); }
[dir="ltr"] .site-nav-links a, [dir="ltr"] .foot-link { text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.site-nav-links a:hover { color: var(--ink); }
.site-foot { border-top: 1px solid var(--line-2); padding: 10vh 0 8vh; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.6fr; gap: 4vw; }
.foot-brand { font-weight: 900; font-size: 28px; margin: 0 0 6px; font-family: "Inter Tight", var(--font); }
.foot-link { display: block; color: var(--muted); text-decoration: none; margin: 8px 0; font-size: 14px; }
.foot-link:hover { color: var(--ink); }
.site-foot .kicker { margin-bottom: 14px; }
.newsletter { margin-top: 12px; }
.newsletter .btn { white-space: nowrap; }

@media (max-width: 900px) {
  .grid2, .phases, .principles { grid-template-columns: 1fr; }
  .pub-line { grid-template-columns: 1fr; gap: 12px; padding: 26px 4px; }
  .pub-act { justify-self: start; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 5vh 4vw; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .event:has(.event-cover) { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  /* on a phone: brand and buttons on the first row, the menu (scrollable) on the second */
  :root { --header-h: 100px; }
  .site-header { grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 10px 16px 0; align-content: start; }
  .site-header .site-nav-links { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: safe center; padding-bottom: 10px; gap: 18px; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
  .sec { padding: 11vh 0 8vh; }
}
/* on a phone the prototype badge would run into the buttons at the top */
@media (max-width: 560px) {
  .badge { display: none; }
}

/* =====================================================================
   Vertical line (v3): a white line runs down the middle; the drawing
   stands to its left; lines of text sit beside it, right then left.
   ===================================================================== */
.vscene { height: 100vh; position: relative; overflow: hidden; }
.vscene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; z-index: 2; }
.vscene .layer { position: absolute; left: 0; top: 0; width: 100%; height: var(--world-h, 100vh); will-change: transform; }
.vscene #line-layer { z-index: 1; }
.vscene #text-layer { z-index: 3; }
.vline { position: absolute; top: 0; width: 2px; margin-left: -1px; height: 0; background: var(--ink); }
.vstem { position: absolute; width: 2px; margin-left: -1px; height: 0; background: var(--ink); }
.vimg { position: absolute; opacity: 0; display: block; }
.vscene .say {
  position: absolute; white-space: nowrap; font-weight: 900; line-height: 1.3;
  font-size: clamp(28px, 4.2vw, 84px); color: var(--ink); opacity: 0;
}
.vscene .say.mark { font-size: clamp(44px, 7vw, 140px); letter-spacing: .04em; opacity: 1; direction: ltr; unicode-bidi: isolate; }
.vscene .say.mark .ch { display: inline-block; opacity: 0; }
/* the full name under ISAD; the extra start padding balances the trailing letter-spacing */
.vscene .mark-sub {
  position: absolute; left: 0; width: 100%; padding: 0 16px 0 calc(16px + .3em); text-align: center;
  font-size: clamp(11px, 1.15vw, 17px); letter-spacing: .3em; line-height: 1.6;
  color: var(--gold); opacity: 0; direction: ltr;
}

.reduced .vscene { height: var(--world-h, auto); }
.reduced .vscene canvas { display: none; }
.reduced .vscene .layer { transform: none !important; }
.reduced .vimg { opacity: 1; filter: invert(1); }
[data-theme="light"] .reduced .vimg { filter: none; }
.reduced .vscene .say, .reduced .vscene .say .ch, .reduced .vscene .mark-sub { opacity: 1 !important; }
.reduced .vstem { display: none; }
