/* vibetuner.si — site styles (lab-notebook look). Tokens in tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; cursor: var(--cursor); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 350;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: .86em; }
a, button, summary, select, label[for] { cursor: var(--cursor-pointer); }
input, textarea { cursor: text; }
html:lang(ar) body { font-weight: 400; }
:where(body [lang="en"]) { font-family: "Readex Pro", system-ui, sans-serif; direction: ltr; unicode-bidi: isolate; }
:where(body [lang="ar"]) { font-family: var(--font-arabic-body); }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--madder); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0; text-wrap: balance; }
h1, h2 { font-weight: 700; letter-spacing: -0.022em; line-height: 1.06; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-1); font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0; line-height: 1.32; font-weight: 700; }
:lang(ar) h3 { font-family: var(--font-arabic-body); line-height: 1.45; }
:lang(ar) .panel-tag, :lang(ar) .chip-soft { font-family: var(--font-body); }

.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 20; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0;
  font-weight: 500; font-size: var(--step--1); white-space: nowrap; text-decoration: none; cursor: var(--cursor-pointer);
  transition: background-color .15s ease, box-shadow .15s ease;
}
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #2c2363; }
.btn-quiet { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule), var(--shadow); }
.btn-quiet:hover { box-shadow: inset 0 0 0 1px #cfc8b8, var(--shadow); }
.btn-sm { min-height: 34px; padding: 0 14px; }
.btn-block { width: 100%; min-height: 48px; }
.btn[aria-busy="true"] { opacity: .65; pointer-events: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.brand-word { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.035em; }
:lang(ar) .brand-word { font-family: var(--font-arabic-display); letter-spacing: 0; font-size: 1.35rem; line-height: 1; padding-bottom: 4px; }
.nav { display: flex; gap: 26px; margin-inline-start: auto; }
.nav a { text-decoration: none; color: var(--ink-2); font-size: var(--step--1); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { font-weight: 500; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.lang-toggle { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--panel); cursor: var(--cursor-pointer); font-size: var(--step--1); }
.lang-toggle:hover { border-color: #cfc8b8; }
.lang-toggle [lang="ar"] { font-family: var(--font-arabic-body); font-weight: 500; }
.header-actions .btn { min-height: 38px; }
@media (max-width: 820px) { .nav { display: none; } .header-actions { margin-inline-start: auto; } }
@media (max-width: 400px) { .header-actions .btn-ink { padding: 0 14px; } }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 88px) clamp(64px, 8vw, 104px); border-bottom: 1px solid var(--rule); }
.hero-stage { display: grid; grid-template-columns: 1fr minmax(0, 700px) 1fr; gap: 24px; align-items: center; width: min(1440px, 100% - 32px); }
.hero-center { text-align: center; display: grid; justify-items: center; gap: 0; position: relative; }
:lang(ar) .hero h1 { font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem); line-height: 1.25; }
.hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.4vw, 4.1rem); display: inline; }
.hero h1 > span { display: inline; }
.hero h1 > .mark-wrap { position: relative; display: inline-block; }
.hero-mark { display: inline-block; width: .95em; height: .95em; vertical-align: -0.12em; margin-inline-start: .18em; transform: rotate(4deg); border-radius: 10px; box-shadow: 0 6px 14px -6px rgba(26,19,64,.45); }
.hero-sub { margin-top: 20px; font-size: var(--step-1); color: var(--ink-2); max-width: 36em; line-height: 1.65; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 7px; font-size: .78em; line-height: 1.7; vertical-align: .08em; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.pill-bad { background: #fde4e6; color: var(--madder-deep); }
.pill-good { background: #ddf3e6; color: #17734a; }

.composer {
  width: 100%; margin-top: 32px; text-align: start;
  background: var(--panel); border-radius: var(--radius-l); box-shadow: inset 0 0 0 1px var(--rule), var(--shadow);
  padding: 18px 18px 14px;
}
.composer:focus-within { box-shadow: inset 0 0 0 1.5px #c9c1b0, var(--shadow); }
.composer textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; font-size: var(--step-0); line-height: 1.55; min-height: 88px; color: var(--ink); }
.composer textarea::placeholder { color: var(--ink-3); }
.composer-bar { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.stations { display: flex; flex-wrap: wrap; gap: 6px; }
.stations button { border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; padding: 5px 12px; font-size: var(--step--1); cursor: var(--cursor-pointer); color: var(--ink-2); }
.stations button:hover { color: var(--ink); border-color: #cfc8b8; }
.stations button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-go { padding-inline: 18px 6px; min-height: 42px; }
.go-dot { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; }
.go-dot svg { width: 13px; height: 13px; }
[dir="rtl"] .go-dot svg { transform: scaleX(-1); }
.hero-note { margin-top: 22px; color: var(--ink-2); font-size: var(--step--1); display: inline-flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--palm-dark); box-shadow: 0 0 0 4px rgba(31,157,92,.16); flex: none; }

.doodle-in { margin: 0; justify-self: end; display: grid; justify-items: end; gap: 0; width: 220px; }
.doodle-arrow-in { width: 110px; margin-top: -6px; margin-inline-end: -26px; }
.doodle-out { margin: 0; display: flex; align-items: center; gap: 10px; justify-self: start; }
.doodle-arrow-out { width: 70px; flex: none; }
.tree { margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.75; color: var(--ink); direction: ltr; text-align: left; white-space: pre; }
.tree.swap { animation: tree-in .4s ease both; }
@keyframes tree-in { from { opacity: 0; transform: translateY(4px); } }
[dir="rtl"] .doodle-in svg, [dir="rtl"] .doodle-arrow-out { transform: scaleX(-1); }
[dir="rtl"] .doodle-in svg text { display: none; }
@media (max-width: 1400px) { .hero-stage { grid-template-columns: 1fr minmax(0, 600px) 1fr; gap: 20px; } .doodle-in { width: 200px; } }
@media (max-width: 1240px) {
  .hero-stage { grid-template-columns: 1fr; }
  .doodle-in { display: none; }
  .doodle-out { justify-self: center; }
  .doodle-arrow-out { transform: rotate(90deg); width: 44px; }
  [dir="rtl"] .doodle-arrow-out { transform: rotate(90deg); }
  .doodle-out { flex-direction: column; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(80px, 10vw, 128px); }
.section-alt { background: var(--paper-2); border-block: 1px solid var(--rule); }
/* Section label: the brand cursor points at what follows. */
.kicker { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: var(--step--1); font-weight: 500; margin-bottom: 18px; }
.kicker::before { content: ""; flex: none; width: 11px; height: 15px; background: var(--madder); clip-path: polygon(0 0, 0 100%, 38% 74%, 100% 71%); }
.lede { margin-top: 18px; font-size: var(--step-1); color: var(--ink-2); max-width: 40em; line-height: 1.6; }

/* ---------- Problem ---------- */
.interrogation { display: grid; grid-template-columns: 1fr minmax(0, 480px) 1fr; gap: 20px; align-items: center; margin-top: clamp(48px, 6vw, 72px); }
.q { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
.q li { position: relative; display: grid; gap: 4px; }
.q-left li { text-align: end; padding-inline-end: 74px; }
.q-right li { text-align: start; padding-inline-start: 74px; }
.q b { font-family: var(--font-display); font-weight: 650; font-size: var(--step-1); line-height: 1.25; letter-spacing: -0.01em; }
:lang(ar) .q b { letter-spacing: 0; }
:lang(ar) .q code { font-family: var(--font-arabic-body); font-size: 14px; }
.q code { color: var(--madder); font-size: 13px; font-weight: 500; }
.q-arrow { position: absolute; top: 50%; width: 60px; height: 30px; translate: 0 -50%; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.q-left .q-arrow { inset-inline-end: 0; }
.q-right .q-arrow { inset-inline-start: 0; }
[dir="rtl"] .q-arrow { transform: scaleX(-1); }

.window { background: var(--panel); border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--rule), var(--shadow); overflow: hidden; direction: ltr; text-align: left; }
.window-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e7a5a0; }
.window-bar i:nth-child(2) { background: #e9cf96; }
.window-bar i:nth-child(3) { background: #a9cfa4; }
.window-bar span { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-inline-end: 42px; }
.window-code { margin: 0; padding: 18px 18px 18px 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.95; color: var(--ink); white-space: pre-wrap; }
.window-code .ln { display: inline-block; width: 40px; text-align: right; padding-right: 16px; color: #c0bbcc; user-select: none; }
.window-code .mut { color: var(--ink-3); }
.window-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--rule); background: var(--paper); font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); white-space: pre; }
.window-foot .bad { color: var(--madder); }
.window-foot .good { color: var(--palm-dark); }
.shipped { margin: 56px auto 0; width: max-content; max-width: 100%; text-align: center; font-family: var(--font-display); font-weight: 650; font-size: var(--step-2); letter-spacing: -0.02em; }
:lang(ar) .shipped { letter-spacing: 0; }
.shipped svg { width: 100%; height: 14px; margin-top: 4px; }
@media (max-width: 1020px) {
  .interrogation { grid-template-columns: 1fr; }
  .q { gap: 18px; }
  .q-left li, .q-right li { text-align: start; padding: 0; }
  .q-arrow { display: none; }
  .window { order: -1; }
}

/* ---------- Lab panels ---------- */
.lab-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; margin-top: clamp(40px, 5vw, 64px); }
.panel { background: var(--panel); border-radius: var(--radius-l); box-shadow: inset 0 0 0 1px var(--rule), var(--shadow); padding: clamp(22px, 3vw, 32px); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 980px) { .lab-grid > .panel { grid-column: span 12; } }
.panel-tag { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-copy { color: var(--ink-2); font-size: var(--step--1); max-width: 54ch; line-height: 1.65; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-hollow { border: 2px solid #c98a2b; }
.dot-ok { border: 2px solid var(--palm-dark); }
.sw-base { background: #4a4170; border-radius: 3px !important; }
.sw-tuned { background: var(--wool); border-radius: 3px !important; }

.chart { width: 100%; height: auto; margin-top: 8px; direction: ltr; }
.chart .grid-lines path { stroke: #eee9df; stroke-dasharray: 3 4; }
.chart .axis text { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-3); text-anchor: end; }
.chart .xaxis text { text-anchor: middle; }
.chart .target { stroke: var(--palm-dark); stroke-width: 1.5; stroke-dasharray: 6 5; }
.chart .target-label { font-family: var(--font-mono); font-size: 11px; fill: var(--palm-dark); }
.chart .baseline { stroke: #b9b3c9; stroke-dasharray: 3 4; }
.chart .base-label { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-3); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.chart .pts circle { fill: #fff; stroke: #c98a2b; stroke-width: 2; }
.chart .pts circle.ok { fill: var(--palm-dark); stroke: #fff; stroke-width: 2.5; }
.chart .ship-label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; fill: var(--palm-dark); }

.crew { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.crew li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid #efebe3; font-size: var(--step--1); }
.crew li > div { display: grid; }
.crew b { font-weight: 600; }
.crew b span { color: var(--ink-3); font-weight: 500; margin-inline-start: 6px; font-size: .92em; }
.crew li > div > span { color: var(--ink-2); line-height: 1.5; }
:lang(ar) .av { font-family: var(--font-arabic-display); font-size: 1.15rem; padding-bottom: 3px; }
.av { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; color: var(--madder); font-size: 1rem; }
.loop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: auto; padding-top: 8px; }
.loop span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 4px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--rule); background: var(--paper); }
:lang(ar) .loop span { font-family: var(--font-arabic-body); font-size: 12.5px; letter-spacing: 0; padding: 3px 10px 5px; }
[dir="rtl"] .loop svg { transform: scaleX(-1); }
.loop svg { width: 14px; height: 10px; fill: none; stroke: var(--ink-3); stroke-width: 1.3; stroke-linecap: round; }

.panel-dark { background: var(--indigo); color: var(--wool); box-shadow: none; }
.panel-dark h3 { color: var(--wool); }
.panel-dark .panel-tag { color: var(--lavender); }
.panel-dark .panel-copy, .panel-dark .legend { color: var(--lavender); }
.bench { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; margin-top: 18px; padding-top: 28px; border-top: 1px solid var(--indigo-line); }
.bench-col { display: grid; gap: 10px; min-width: 0; }
.bench .bars { height: 210px; display: flex; align-items: flex-end; justify-content: center; gap: 6px; background: repeating-linear-gradient(to top, transparent 0 51.5px, rgba(167,159,214,.15) 51.5px 52.5px); }
.bench .bars span { position: relative; width: min(30px, 40%); height: calc(var(--v) * 1%); border-radius: 5px 5px 2px 2px; }
.bench .b0 { background: #4a4170; }
.bench .b1 { background: var(--wool); }
.bench em { position: absolute; bottom: 100%; left: 50%; translate: -50% -4px; font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--lavender); }
.bench .b1 em { color: var(--wool); font-weight: 600; }
.bench-col p { text-align: center; font-size: 13px; color: var(--lavender); line-height: 1.3; }
:lang(ar) .bench-col p { font-size: 14px; }
:lang(ar) .chart .target-label, :lang(ar) .chart .base-label, :lang(ar) .chart .ship-label { font-family: var(--font-arabic-body); font-size: 13px; }
@media (max-width: 760px) {
  .bench { grid-template-columns: repeat(4, 1fr); row-gap: 28px; }
  .bench .bars { height: 150px; background: none; }
}

.chip-soft { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); padding: 4px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--rule); background: var(--paper); }
.feed { list-style: none; margin: 4px 0 0; padding: 0; position: relative; }
.feed::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 58px; width: 1px; background: var(--rule); }
.feed li { display: grid; grid-template-columns: 46px 1fr; gap: 28px; padding-block: 12px; position: relative; font-size: var(--step--1); }
.feed li::after { content: ""; position: absolute; inset-inline-start: 54px; top: 19px; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #c0bbcc; }
.feed li.flag::after { background: var(--saffron); box-shadow: none; }
.feed li.approved::after { background: var(--palm-dark); }
.feed time { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); padding-top: 2px; }
.feed p { color: var(--ink-2); line-height: 1.55; }
.feed p b { color: var(--ink); font-weight: 600; }
.feed code { background: var(--paper-2); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.feed-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.artifact { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); font-family: var(--font-mono); font-size: 13px; direction: ltr; }
.artifact span { display: inline-flex; gap: 8px; align-items: center; }
.artifact svg { width: 15px; height: 15px; color: var(--ink-3); }
.artifact b { font-weight: 600; color: var(--palm-dark); background: #ddf3e6; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.mini-label { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.exports { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.exports span { padding: 9px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--rule); font-size: 13px; color: var(--ink-2); background: var(--panel); }
.exports span:last-child { grid-column: span 2; border: 1px dashed #cfc8b8; box-shadow: none; }

.kingdom-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 8px; }
@media (max-width: 980px) { .kingdom-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .kingdom-list { grid-template-columns: 1fr; } }
.kingdom-list b { display: block; font-weight: 600; margin-bottom: 6px; padding-top: 14px; border-top: 2px solid var(--saffron); }
.kingdom-list p { color: var(--ink-2); font-size: var(--step--1); line-height: 1.6; }

/* ---------- Runs on ---------- */
.runs { padding-block: 56px; text-align: center; border-bottom: 1px solid var(--rule); background: var(--paper); }
.runs-title { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
:lang(ar) .runs-title { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-size: var(--step--1); }
.runs-title-2 { margin-top: 36px; }
.runs-list { list-style: none; padding: 0; margin: 22px auto 0; max-width: 860px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 34px; direction: ltr; }
.runs-list li { font-family: "Bricolage Grotesque", sans-serif; font-weight: 600; font-size: 1.2rem; color: #9893ab; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 8px; }
.runs-list li::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: #d5d0e0; transform: rotate(45deg); }
.runs-models li::before { border-radius: 50%; transform: none; background: #f2c98a; }

/* ---------- Letter ---------- */
.letter-section { background: var(--panel); }
.letter-grid { display: grid; grid-template-columns: minmax(0, 620px) 1fr; gap: 64px; align-items: center; }
@media (max-width: 900px) { .letter-grid { grid-template-columns: 1fr; } .cutout { max-width: 260px; } }
.letter h2 { font-size: var(--step-3); letter-spacing: -0.03em; line-height: 1.12; }
.letter [data-i18n="letter.body"] { margin-top: 32px; display: grid; gap: 18px; color: var(--ink); }
.letter [data-i18n="letter.body"] p:first-child { text-indent: 1.6em; }
:lang(ar) .letter [data-i18n="letter.body"] { font-family: "Thmanyah Serif Text", var(--font-arabic-body); font-size: 1.13rem; line-height: 1.95; gap: 16px; }
.signoff { display: flex; align-items: center; gap: 14px; margin-top: 36px; }
.signoff svg { width: 54px; height: 54px; }
.signoff div { display: grid; font-size: var(--step--1); color: var(--ink-2); }
.sig { font-family: var(--font-arabic-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.cutout { margin: 0; justify-self: center; width: 100%; max-width: 340px; transform: rotate(-2.5deg); }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: clamp(40px, 5vw, 64px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; }
@media (max-width: 980px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: s; background: var(--panel); border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--rule); padding: 22px; display: grid; gap: 8px; align-content: start; }
.steps li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 13px; font-weight: 600; background: var(--ink); color: #fff; margin-bottom: 8px; }
.steps li:nth-child(4)::before { background: var(--madder); }
.steps p { color: var(--ink-2); font-size: var(--step--1); line-height: 1.6; }

.dev { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: center; margin-top: clamp(56px, 7vw, 88px); }
@media (max-width: 900px) { .dev { grid-template-columns: 1fr; gap: 24px; } }
.dev-copy h3 { font-size: var(--step-2); }
.dev-copy p { margin-top: 12px; color: var(--ink-2); max-width: 44ch; }
.code { background: var(--indigo); border-radius: var(--radius-l); padding: 16px 22px 22px; color: var(--wool); overflow-x: auto; text-align: left; }
.code pre { margin: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.75; white-space: pre; }
.code .c { color: var(--lavender); }
.code .ok { color: var(--palm); }
.code .p { color: var(--saffron); }
.code-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.code-tabs button { background: none; border: 0; border-radius: 999px; padding: 5px 12px; cursor: var(--cursor-pointer); color: var(--lavender); font-family: var(--font-mono); font-size: 12px; }
.code-tabs button[aria-selected="true"] { background: var(--indigo-lift); color: var(--wool); }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: start; }
@media (max-width: 900px) { .faq-grid { grid-template-columns: 1fr; gap: 24px; } }
.faq-grid h2 { font-size: var(--step-3); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: var(--cursor-pointer); padding: 20px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 20px; font-weight: 500; font-size: var(--step-0); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; border-inline-end: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(225deg); }
.faq details p { padding-bottom: 22px; color: var(--ink-2); max-width: 62ch; font-size: var(--step--1); line-height: 1.7; }

/* ---------- Closing + forms ---------- */
.closing { padding-block: clamp(80px, 10vw, 128px); border-top: 1px solid var(--rule); }
.closing-inner { display: grid; justify-items: center; text-align: center; }
.closing .waitlist { margin-top: 32px; width: min(560px, 100%); text-align: start; }
.waitlist { display: grid; gap: 10px; }
.field-row { display: flex; gap: 6px; padding: 6px; background: var(--panel); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--rule), var(--shadow); }
.field-row:focus-within { box-shadow: inset 0 0 0 1.5px #c9c1b0, var(--shadow); }
.field-row input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 0 16px; min-height: 42px; }
[dir="rtl"] .field-row input { text-align: right; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-grid input, .field-grid select { width: 100%; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); }
.field-grid input:focus, .field-grid select:focus { outline: none; border-color: #c9c1b0; }
.field-grid select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 34px; }
[dir="rtl"] .field-grid select { background-position: 13px 52%, 18px 52%; }
input::placeholder { color: var(--ink-3); }
@media (max-width: 520px) {
  .field-row { flex-direction: column; border-radius: 16px; }
  .field-row input { min-height: 46px; }
  .field-grid { grid-template-columns: 1fr; }
}
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-size: var(--step--1); color: var(--ink-2); text-align: center; }
.form-status[data-state="ok"] { color: var(--palm-dark); font-weight: 500; }
.form-status[data-state="error"] { color: var(--madder-deep); }

.modal { border: 0; padding: 32px; border-radius: var(--radius-l); width: min(560px, calc(100% - 32px)); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(26,19,64,.45); }
.modal::backdrop { background: rgba(26, 19, 64, .35); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .22s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal h2 { font-size: var(--step-3); }
.modal .muted { margin-block: 10px 22px; font-size: var(--step--1); }
.modal-close-form { position: absolute; top: 12px; inset-inline-end: 12px; margin: 0; }
.modal-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; font-size: 22px; cursor: var(--cursor-pointer); color: var(--ink-2); }
.modal-x:hover { background: var(--paper-2); }
.modal-idea { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--rule); border-inline-start: 3px solid var(--saffron); font-size: var(--step--1); color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { padding-block: 32px; background: var(--paper); font-size: var(--step--1); color: var(--ink-3); }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer nav a { text-decoration: none; color: var(--ink-2); }
.site-footer nav a:hover { color: var(--ink); }

/* ---------- Pricing ---------- */
.pricing-hero { padding-block: clamp(56px, 8vw, 96px) clamp(40px, 5vw, 56px); text-align: center; border-bottom: 1px solid var(--rule); }
.pricing-hero .wrap { display: grid; justify-items: center; }
.pricing-hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.4vw, 4.1rem); }
.pricing-hero .lede { margin-inline: auto; }
.billing { display: inline-flex; margin-top: 28px; padding: 4px; border-radius: 999px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--rule); }
.billing button { border: 0; background: none; border-radius: 999px; padding: 7px 16px; cursor: var(--cursor-pointer); color: var(--ink-2); font-size: var(--step--1); }
.billing button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.billing small { margin-inline-start: 6px; color: var(--palm-dark); font-weight: 600; }
.billing button[aria-pressed="true"] small { color: #9be7bd; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; margin-top: clamp(40px, 5vw, 56px); }
@media (max-width: 960px) { .plans { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }
.plan { background: var(--panel); border-radius: var(--radius-l); box-shadow: inset 0 0 0 1px var(--rule), var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 20px; position: relative; }
.plan.featured { box-shadow: inset 0 0 0 2px var(--ink), var(--shadow); }
.plan-flag { position: absolute; top: -12px; inset-inline-start: 24px; background: var(--saffron); color: var(--ink); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.plan-name { display: flex; align-items: baseline; gap: 10px; }
.plan-name h2 { font-size: var(--step-2); letter-spacing: -0.02em; }
.plan-name small [lang="en"] { font-family: "Bricolage Grotesque", sans-serif; font-weight: 600; letter-spacing: -0.01em; }
.plan-name small { font-family: var(--font-arabic-display); font-weight: 700; color: var(--madder); font-size: 1.05rem; }
.plan-for { color: var(--ink-2); font-size: var(--step--1); min-height: 3.2em; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; direction: ltr; justify-content: flex-start; }
[dir="rtl"] .price { justify-content: flex-end; }
.price .amt { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: var(--step-4); letter-spacing: -0.045em; line-height: 1; }
.price .cur { font-weight: 600; font-size: var(--step-0); }
.price .per { color: var(--ink-3); font-size: var(--step--1); }
.price { min-height: calc(var(--step-4) * 1.05); align-items: flex-end; }
.price .talk { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); letter-spacing: -0.02em; line-height: 1.15; }
:lang(ar) .price .talk { letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; font-size: var(--step--1); }
.plan li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; color: var(--ink-2); line-height: 1.5; }
.plan li::before { content: ""; width: 9px; height: 5px; margin-top: 7px; margin-inline-start: 3px; border-left: 1.8px solid var(--palm-dark); border-bottom: 1.8px solid var(--palm-dark); transform: rotate(-45deg); }
.plan li.kpi { color: var(--ink); font-weight: 500; }
.plan li.kpi div > span:first-child { background: linear-gradient(transparent 14%, var(--highlight) 14%, var(--highlight) 92%, transparent 92%); padding-inline: 3px; border-radius: 3px; }
.kpi-note { display: block; font-family: var(--font-mono); font-size: 11.5px; color: var(--madder); font-weight: 400; margin-top: 3px; }
:lang(ar) .kpi-note { font-family: var(--font-body); }
.plan .btn { width: 100%; min-height: 46px; }
.plan-sub { font-size: 12.5px; color: var(--ink-3); border-top: 1px solid #efebe3; padding-top: 14px; margin-top: auto; }

.credits-wrap { margin-top: clamp(56px, 7vw, 88px); display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .credits-wrap { grid-template-columns: 1fr; gap: 24px; } }
.credits-wrap h2 { font-size: var(--step-3); }
.credits-wrap .lede { font-size: var(--step-0); }
.table-wrap { overflow-x: auto; background: var(--panel); border-radius: var(--radius-l); box-shadow: inset 0 0 0 1px var(--rule), var(--shadow); padding: 8px 24px; }
.credits { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.credits th, .credits td { padding: 14px 0; border-bottom: 1px solid #efebe3; text-align: start; }
.credits tr:last-child th, .credits tr:last-child td { border-bottom: 0; }
.credits thead th { color: var(--ink-3); font-weight: 500; font-size: 12.5px; }
.credits tbody th { font-weight: 500; padding-inline-end: 16px; }
.credits td { color: var(--ink-2); }
.credits td:last-child, .credits th:last-child { text-align: end; font-family: var(--font-mono); font-size: 13px; white-space: nowrap; color: var(--ink); }
.credits thead th:last-child { color: var(--ink-3); font-family: var(--font-body); }

/* 404 */
.lost { min-height: 70vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 16px; padding: 48px 16px; }
.lost h1 { font-size: clamp(2.3rem, 1.5rem + 3.4vw, 4.1rem); }
.lost p { color: var(--ink-2); }

.code .ar { font-family: var(--font-arabic-body); unicode-bidi: isolate; direction: rtl; }

.pricing-hero + .section { padding-top: clamp(48px, 6vw, 72px); }
.pricing-hero + .section .plans { margin-top: 0; }

/* small fixes */
.brand svg { flex: none; }
.hero-note { display: block; text-align: center; }
.hero-note .live-dot { display: inline-block; vertical-align: 1px; margin-inline-end: 6px; }
:lang(ar) .credits td:last-child { font-family: var(--font-body); }

/* ---------- Crew cursors (hero) ----------
   The crew shows up like teammates in a shared doc: same cursor as the visitor's, each with a name tag. */
.composer, .doodle-out { position: relative; }
.cc { position: absolute; z-index: 3; display: inline-flex; align-items: flex-start; pointer-events: none; direction: ltr; --c: var(--madder); --ink-on: #fff;
  animation: cc-in 1.1s cubic-bezier(.2,.8,.2,1) var(--delay, .5s) both, cc-drift var(--drift, 7s) ease-in-out calc(var(--delay, .5s) + 1.1s) infinite alternate; }
.cc svg { width: 22px; height: 22px; flex: none; }
.cc path { fill: var(--c); stroke: #fff; stroke-width: 1.7; stroke-linejoin: round; paint-order: stroke; }
.cc b { margin: 17px 0 0 -7px; background: var(--c); color: var(--ink-on); font-family: var(--font-body); font-weight: 500; font-size: 12.5px; line-height: 1; padding: 5px 9px 6px; border-radius: 2px 10px 10px 10px; white-space: nowrap; unicode-bidi: plaintext; box-shadow: 0 6px 14px -6px rgba(26,19,64,.45); }
:lang(ar) .cc b { padding: 4px 10px 7px; font-size: 13px; }
.cc-dalil { --c: var(--saffron); --ink-on: var(--indigo); top: -26px; inset-inline-end: 16%; --from: 40px -30px; --delay: .5s; --drift: 6s; }
.cc-hakam { bottom: -38px; inset-inline-end: -18px; --from: 50px 40px; --delay: .8s; --drift: 8s; }
.cc-sani { --c: var(--palm-dark); top: 72%; left: 74%; --from: 50px 40px; --delay: 1.1s; --drift: 9s; }
.cc-rawi { --c: #5a4fcf; top: calc(100% + 4px); left: 46%; --from: 40px 40px; --delay: 1.4s; --drift: 7.5s; }
.cc-dalil.reading b::after { content: " is reading…"; font-weight: 400; }
:lang(ar) .cc-dalil.reading b::after { content: " يقرأ…"; }
@keyframes cc-in { from { opacity: 0; translate: var(--from); } }
@keyframes cc-drift { to { transform: translate(5px, -4px); } }
@media (max-width: 1240px) { .cc-rawi { display: none; } }
@media (max-width: 720px) { .cc-sani, .cc-hakam { display: none; } .cc-dalil { inset-inline-end: 10%; } }

.lost-art { width: 220px; height: auto; }
