/* ---------------------------------------------------------------------------
   Naiiman — the landing site's whole stylesheet.

   Token names are the app's (canvas, surface, ink, line, accent…) with new
   values, so rebranding the app later is a values swap rather than a redesign.
   One responsive layout, not a desktop page and a phone page.
--------------------------------------------------------------------------- */

:root {
  --canvas: oklch(0.982 0.009 92);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.968 0.010 92);

  --ink: oklch(0.235 0.020 150);
  --ink-muted: oklch(0.515 0.017 150);
  --ink-subtle: oklch(0.655 0.013 150);

  --line: oklch(0.905 0.011 92);

  --accent: oklch(0.475 0.105 150);
  --accent-hover: oklch(0.415 0.095 150);
  --accent-soft: oklch(0.955 0.032 150);
  --accent-ring: oklch(0.475 0.105 150 / 0.30);
  --accent-ink: oklch(0.990 0.006 92);

  --warm: oklch(0.720 0.125 62);
  --danger: oklch(0.520 0.170 25);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-color: 150 18% 22%;
  --shadow-card: 0 1px 2px hsl(var(--shadow-color) / 0.05), 0 4px 16px -6px hsl(var(--shadow-color) / 0.10);
  --shadow-pop: 0 2px 4px hsl(var(--shadow-color) / 0.06), 0 12px 32px -8px hsl(var(--shadow-color) / 0.18);

  --gutter: clamp(20px, 5vw, 80px);
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --arabic: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: oklch(0.170 0.012 150);
    --surface: oklch(0.213 0.013 150);
    --surface-2: oklch(0.250 0.014 150);

    --ink: oklch(0.965 0.006 92);
    --ink-muted: oklch(0.740 0.010 92);
    --ink-subtle: oklch(0.605 0.010 92);

    --line: oklch(0.308 0.014 150);

    --accent: oklch(0.760 0.125 150);
    --accent-hover: oklch(0.815 0.120 150);
    --accent-soft: oklch(0.300 0.048 150);
    --accent-ring: oklch(0.760 0.125 150 / 0.35);
    --accent-ink: oklch(0.185 0.030 150);

    --warm: oklch(0.800 0.115 65);
    --danger: oklch(0.700 0.150 25);

    --shadow-color: 150 30% 3%;
  }
}

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.018em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 4px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
::selection { background: var(--accent-soft); color: var(--ink); }

/* Arabic sets looser and takes no negative tracking. */
[dir="rtl"] body, body[dir="rtl"] { font-family: var(--arabic); line-height: 1.75; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: normal; }

.display { font-family: var(--display); font-weight: 400; letter-spacing: -0.005em; }
[dir="rtl"] .display { font-family: var(--arabic); font-weight: 600; letter-spacing: normal; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ------------------------------------------------------------- header -- */

.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 18px;
}

.wordmark { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.wordmark:hover { text-decoration: none; color: inherit; }
.wordmark .mark {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--arabic); font-size: 20px; font-weight: 600; line-height: 1;
  color: var(--accent-ink);
}
.wordmark .name { font-family: var(--display); font-size: 27px; line-height: 1; }
[dir="rtl"] .wordmark .name { font-family: var(--arabic); font-size: 25px; font-weight: 600; }

.lang {
  display: inline-flex; align-items: center;
  height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink-muted);
  font-family: var(--sans); font-size: 14px;
}
.lang:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
[dir="rtl"] .lang { font-family: var(--sans); }

/* --------------------------------------------------------------- hero -- */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}
.hero .wrap { position: relative; padding-block: clamp(40px, 7vw, 88px) clamp(48px, 8vw, 96px); }

.hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (min-width: 940px) { .hero-grid { grid-template-columns: minmax(0, 1fr) 420px; } }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; font-weight: 500; color: var(--ink-muted);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--warm); }
[dir="rtl"] .chip { font-family: var(--arabic); font-size: 13px; }

.hero h1 { margin-top: 26px; font-size: clamp(38px, 6.4vw, 62px); line-height: 1.04; }
[dir="rtl"] .hero h1 { font-size: clamp(32px, 5.4vw, 52px); line-height: 1.28; }

.lede { margin-top: 22px; max-width: 30em; font-size: clamp(16px, 1.6vw, 17.5px); line-height: 1.6; color: var(--ink-muted); }
[dir="rtl"] .lede { line-height: 1.8; }

.gloss {
  margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line);
  max-width: 30em; display: flex; align-items: center; gap: 13px; flex-wrap: wrap;
}
.gloss b { font-family: var(--arabic); font-size: 25px; font-weight: 600; line-height: 1; color: var(--accent); }
.gloss span { font-size: 14.5px; line-height: 1.5; color: var(--ink-muted); }

/* --------------------------------------------------------------- form -- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
}
.signup { padding: 24px; box-shadow: var(--shadow-pop); }

.seg {
  display: flex; align-items: center; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2);
}
.seg button {
  flex: 1; height: 44px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-muted);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background-color 150ms, color 150ms;
}
.seg button[aria-selected="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px hsl(var(--shadow-color) / 0.12);
}

.signup h2 { margin-top: 22px; font-size: 19px; }
.signup .sub { margin-top: 7px; font-size: 14.5px; line-height: 1.55; color: var(--ink-muted); }
[dir="rtl"] .signup .sub { line-height: 1.7; }

.fields { margin-top: 22px; display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 500; }
.field > label .opt { font-size: 12px; font-weight: 400; color: var(--ink-subtle); }

input, select, button, textarea { font: inherit; color: inherit; }

.control {
  width: 100%; height: 44px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink);
  padding: 0 12px; font-size: 14px;
}
.control::placeholder { color: var(--ink-subtle); }
.control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.control:disabled { background: var(--surface-2); color: var(--ink-subtle); cursor: not-allowed; }
.control[aria-invalid="true"] { border-color: var(--danger); }

.phone-row { display: flex; align-items: center; gap: 8px; }
.phone-row .prefix {
  flex: none; display: flex; align-items: center; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface-2); color: var(--ink-muted); font-size: 14px;
}
[dir="rtl"] .phone-row input { text-align: right; }

/* A bot fills every field it can see; a person never sees this one. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.cta {
  margin-top: 22px; width: 100%; height: 48px;
  border: 0; border-radius: var(--radius-md);
  background: var(--accent); color: var(--accent-ink);
  font-size: 15px; font-weight: 500; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background-color 150ms, opacity 150ms;
}
.cta:hover { background: var(--accent-hover); }
.cta:active { transform: scale(0.985); }
.cta:disabled { opacity: 0.6; cursor: progress; }

.fineprint { margin-top: 13px; font-size: 12.5px; line-height: 1.5; text-align: center; color: var(--ink-subtle); }
.fineprint a { color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; }

.formmsg { margin-top: 14px; font-size: 14px; line-height: 1.55; text-align: center; }
.formmsg:empty { display: none; }
.formmsg[data-state="error"] { color: var(--danger); }
.formmsg[data-state="ok"] { color: var(--accent); }

/* The whole card is replaced on success — a form you already sent is noise. */
.done { padding: 40px 24px; text-align: center; }
.done .tick {
  width: 52px; height: 52px; margin: 0 auto 18px;
  border-radius: 999px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
}
.done h2 { font-size: 21px; }
.done p { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-muted); }

/* ------------------------------------------------------------ content -- */

section.band { padding-block: clamp(48px, 7vw, 96px); }
section.band > .wrap > h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; }
[dir="rtl"] section.band > .wrap > h2 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.35; }

/* Narrow screens get a snap-scrolling rail: three stacked steps cost about a
   screen and a half of scrolling to read one idea in three beats. It bleeds
   past the gutter so the next card peeks — that sliver is the only thing
   telling a thumb there is more to the side. */
.steps {
  margin-top: clamp(28px, 4vw, 44px);
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }

.steps > .step {
  flex: 0 0 76%;
  scroll-snap-align: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.steps > .step h3 { margin-top: 16px; }

@media (min-width: 780px) {
  .steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(28px, 3.5vw, 40px);
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  /* Back to bare columns on desktop — the card chrome is a swipe affordance,
     and there is nothing to swipe when all three are already side by side. */
  .steps > .step {
    flex: initial;
    padding: 0;
    border: 0;
    background: none;
  }
  .steps > .step h3 { margin-top: 20px; }
}

/* A scrollable region needs to be reachable without a pointer. */
.steps:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

.step-num {
  position: relative; width: 48px; height: 48px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.step-num i {
  position: absolute; top: -3px; inset-inline-end: -3px;
  width: 21px; height: 21px; border-radius: 999px;
  background: var(--ink); color: var(--canvas);
  font-style: normal; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { margin-top: 20px; font-size: 18px; }
.step p { margin-top: 9px; font-size: 15px; line-height: 1.6; color: var(--ink-muted); }
[dir="rtl"] .step p { line-height: 1.8; }

/* Same rail as the steps. Two audiences side by side also reads better than
   one buried under the other: swiping between them is the two-sided pitch. */
.two-up {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  /* room for the card shadow: overflow-x also clips vertically */
  padding-block: 6px 10px;
  scrollbar-width: none;
}
.two-up::-webkit-scrollbar { display: none; }
.two-up > .pitch { flex: 0 0 84%; scroll-snap-align: start; }
.two-up:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (min-width: 880px) {
  .two-up {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
    padding-block: 0;
  }
  .two-up > .pitch { flex: initial; }
}

.pitch { padding: clamp(24px, 3vw, 32px); }
.pitch .eyebrow { font-size: 12.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-subtle); }
[dir="rtl"] .pitch .eyebrow { letter-spacing: normal; text-transform: none; font-size: 13px; }
.pitch h3 { margin-top: 12px; font-size: clamp(23px, 2.4vw, 30px); line-height: 1.15; }
[dir="rtl"] .pitch h3 { font-size: clamp(22px, 2.2vw, 27px); line-height: 1.45; }
.pitch ul { margin: 26px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.pitch li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 1.6; color: var(--ink-muted); }
[dir="rtl"] .pitch li { line-height: 1.8; }
.pitch li svg { flex: none; margin-top: 3px; color: var(--accent); }
[dir="rtl"] .pitch li svg { margin-top: 6px; }
.pitch li b { font-weight: 500; color: var(--ink); }
[dir="rtl"] .pitch li b { font-weight: 600; }

.where { border-block: 1px solid var(--line); background: var(--surface-2); text-align: center; }
.where p { margin: 18px auto 0; max-width: 42em; font-size: clamp(15.5px, 1.6vw, 16.5px); line-height: 1.65; color: var(--ink-muted); }
[dir="rtl"] .where p { line-height: 1.9; }

/* Collapsed by default, opened on wide screens by app.js. That way the space
   saving on a phone does not depend on JavaScript running, and the worst a
   failure costs a desktop reader is one tap per question. */
.faq { margin-top: clamp(26px, 3.5vw, 40px); display: grid; gap: 0; }

.qa { border-bottom: 1px solid var(--line); }
.qa:first-child { border-top: 1px solid var(--line); }

.qa > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 15px 0;
  font-size: 16px; font-weight: 600; cursor: pointer;
  list-style: none;
}
.qa > summary::-webkit-details-marker { display: none; }
.qa > summary::after {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  margin-inline-end: 2px;
  border-inline-end: 1.5px solid var(--ink-subtle);
  border-block-end: 1.5px solid var(--ink-subtle);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}
.qa[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.qa > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.qa > p { padding-bottom: 18px; font-size: 15px; line-height: 1.65; color: var(--ink-muted); }
[dir="rtl"] .qa > p { line-height: 1.85; }

@media (min-width: 780px) {
  .faq { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 64px; }
  /* Open and static on desktop: the rules that were there before accordions. */
  .qa, .qa:first-child { border: 0; }
  .qa > summary { min-height: 0; padding: 0; font-size: 17px; cursor: default; }
  .qa > summary::after { display: none; }
  .qa > p { margin-top: 10px; padding-bottom: 0; }
}

mark {
  padding: 1px 6px; border-radius: var(--radius-xs);
  background: color-mix(in oklab, var(--warm) 22%, transparent);
  color: var(--ink); font-weight: 500;
}

/* ------------------------------------------------------------- footer -- */

.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap {
  padding-block: 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.site-footer .who { display: flex; align-items: center; gap: 11px; font-size: 14px; color: var(--ink-muted); }
.site-footer .who .mark {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--arabic); font-size: 17px; font-weight: 600; line-height: 1;
  color: var(--accent-ink);
}
.social-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.social {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  color: var(--ink-muted); font-size: 14px;
}
.social:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

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

/* ---------------------------------------------------------------- 404 -- */

.notfound {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center;
}
.notfound .mark {
  width: 48px; height: 48px; margin: 0 auto;
  border-radius: 14px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--arabic); font-size: 29px; font-weight: 600; line-height: 1;
  color: var(--accent-ink);
}
.notfound h1 { margin-top: 24px; font-size: clamp(30px, 6vw, 40px); line-height: 1.1; }
.notfound p { margin-top: 14px; font-size: 16px; line-height: 1.6; color: var(--ink-muted); }
.notfound .home {
  display: inline-flex; align-items: center; height: 44px;
  margin-top: 28px; padding: 0 20px;
  border-radius: var(--radius-md); background: var(--accent); color: var(--accent-ink);
  font-size: 15px; font-weight: 500;
}
.notfound .home:hover { background: var(--accent-hover); color: var(--accent-ink); text-decoration: none; }

/* -------------------------------------------------------------- signups -- */

.admin { padding-block: clamp(32px, 5vw, 56px) 80px; }
.admin h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.1; }
.admin h2 { margin-top: 48px; font-size: 20px; }
.admin .muted { margin-top: 8px; font-size: 14px; line-height: 1.55; color: var(--ink-muted); }

.stats { margin-top: 28px; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
  padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.stat b { display: block; font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 7px; font-size: 13px; color: var(--ink-muted); }

.admin table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.admin th { text-align: start; font-weight: 500; }
.admin thead th {
  padding: 0 12px 10px 0; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-subtle); border-bottom: 1px solid var(--line);
}
.admin td, .admin tbody th { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }

.areas tbody th { width: 10em; }
.areas .barcell { width: auto; }
.areas .bar { display: block; height: 8px; border-radius: 999px; background: var(--accent); min-width: 4px; }
.areas .num { width: 3em; text-align: end; font-variant-numeric: tabular-nums; color: var(--ink-muted); }

.scroller { overflow-x: auto; }
.list { min-width: 620px; }
.list .when { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.list .mono { font-variant-numeric: tabular-nums; }
.admin .muted td, .admin td .muted { color: var(--ink-subtle); }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tag.owner { background: color-mix(in oklab, var(--warm) 20%, transparent); color: var(--ink); }
