/* Shared prototype foundation. Tokens mirror ../../../tokens/tokens.css (BRAND.md). */
:root {
  --sky: #7FD0FF;
  --ink: #0F1420;
  --paper: #F3F8FC;
  --night: #0B0F17;
  --marigold: #FFB21A;
  --apricot: #FFB59E;
  --lime: #CFF066;
  --ink-60: rgba(15, 20, 32, .64);
  --paper-60: rgba(243, 248, 252, .64);

  --display: "Unbounded", system-ui, sans-serif;
  --text: "IBM Plex Sans", system-ui, sans-serif;
  --gutter: clamp(20px, 4vw, 64px);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
:root[lang="ar"] {
  --display: "Alexandria", system-ui, sans-serif;
  --text: "IBM Plex Sans Arabic", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-size: 18px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--sky); }
::selection { background: var(--ink); color: var(--sky); }

.display { font-family: var(--display); font-weight: 900; letter-spacing: -0.02em; line-height: .95; }
:root[lang="ar"] .display { letter-spacing: 0; line-height: 1.15; }
.num { font-family: "Unbounded", system-ui, sans-serif; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* Language toggle: elements carry both strings; CSS shows one. */
[data-ar] { }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons and the waitlist form */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; height: 52px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; transition: transform .16s var(--ease-out), background .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn--sky { background: var(--sky); color: var(--ink); }
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; color: inherit; }

.waitlist { display: flex; gap: 8px; width: 100%; max-width: 520px; padding: 6px; border-radius: 999px; background: var(--paper); box-shadow: 0 0 0 1.5px var(--ink); }
.waitlist input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 18px; font-size: 17px; outline: none; }
.waitlist input::placeholder { color: var(--ink-60); }
.waitlist.is-done { justify-content: center; align-items: center; height: 64px; font-weight: 600; }
.on-dark .waitlist { background: transparent; box-shadow: 0 0 0 1.5px var(--paper-60); }
.on-dark .waitlist input { color: var(--paper); }
.on-dark .waitlist input::placeholder { color: var(--paper-60); }

.sticker { display: inline-block; padding: 6px 12px 7px; border-radius: 999px; background: var(--marigold); color: var(--ink); font-family: var(--text); font-weight: 600; font-size: 14px; line-height: 1; }

.lang-toggle { background: none; border: 0; padding: 8px 4px; cursor: pointer; font-weight: 600; font-size: 16px; }
.lang-toggle span[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; }

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

/* Form states */
.waitlist:focus-within { box-shadow: 0 0 0 2.5px var(--ink); }
.on-dark .waitlist:focus-within { box-shadow: 0 0 0 2.5px var(--sky); }
.waitlist input[aria-invalid="true"]::placeholder { color: #B42318; }
.waitlist:has(input[aria-invalid="true"]) { box-shadow: 0 0 0 2px #B42318; }

/* FAQ */
.faq details { border-top: 1.5px solid currentColor; }
.faq details:last-child { border-bottom: 1.5px solid currentColor; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; font-family: var(--display); font-weight: 600; font-size: clamp(18px, 1.6vw, 24px); line-height: 1.25; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: "Unbounded", sans-serif; font-weight: 400; font-size: 28px; line-height: 1; transition: transform .25s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 24px; max-width: 60ch; font-size: 18px; }

.form-err { margin-top: 10px; font-size: 14px; font-weight: 600; color: #B42318; }
.on-dark .form-err { color: #F87171; }

/* Tap targets */
.lang-toggle { min-width: 44px; min-height: 44px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }
/* Arabic display headings need more room when they wrap */
:root[lang="ar"] h2.display { line-height: 1.32; }
/* Mobile sticky waitlist bar (added by sections.js) */
.mcta { position: fixed; z-index: 50; inset-inline: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: none; }
.mcta .btn { width: 100%; height: 54px; box-shadow: 0 0 0 2px var(--sky), 0 10px 30px rgba(15, 20, 32, .25); }
@media (max-width: 900px) { .mcta { display: block; transform: translateY(140%); transition: transform .3s var(--ease-out); } .mcta.on { transform: none; } }

@media (max-width: 900px) { main { padding-bottom: 84px; } }

/* hairline figures: brand palettes (ink lines) */
.hl { position: relative; border-radius: 24px; overflow: hidden; background: var(--hairline-plate); }
.hl .stage { aspect-ratio: 5 / 4; --hairline-stroke: 1.15; }
.hl .stage svg { width: 100%; height: 100%; display: block; }
.hl .stage svg .hi { stroke-width: 1.9px; }
.g-sky { --hairline-plate: #7FD0FF; --hairline-hi: #0F1420; --hairline-edge: #0F1420; --hairline-mid: #2C5776; --hairline-lo: #4C8AB3; }
.g-paper { --hairline-plate: #F3F8FC; --hairline-hi: #0F1420; --hairline-edge: #2A3140; --hairline-mid: #6B7482; --hairline-lo: #B4BCC6; }
.g-night { --hairline-plate: #0B0F17; --hairline-hi: #F3F8FC; --hairline-edge: #A9DBFA; --hairline-mid: #4F86AA; --hairline-lo: #24394A; }

.form-note { margin-top: 10px; font-size: 13px; line-height: 1.4; color: var(--ink-60); max-width: 46ch; }
.on-dark .form-note { color: var(--paper-60); }
