/*
 * Yalla Körkort website. Design B · Signal (docs/DESIGN_PROPOSAL_V2.md §8):
 * charcoal and road-sign yellow, Cairo for every language.
 *
 * The yellow rule: --accent is a FILL. On a light ground it is never text, an icon or a
 * line (1.43:1). Text and icons on yellow are charcoal (--on-accent, 11.29:1).
 * Yellow text is allowed only on the charcoal hero band (11.29:1).
 */

/* Cairo, self-hosted (SIL OFL 1.1, see Cairo-OFL.txt). Variable weight 200-1000. */
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/assets/fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/assets/fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #F4F4F2;
  --surface: #FFFFFF;
  --surface-alt: #EBEBE7;
  --border: #DEDDD7;
  --border-strong: #8A8C94;
  --text: #17181C;
  --muted: #5C5E66;
  --accent: #FFC629;
  --accent-soft: #FFF3CC;
  --on-accent: #17181C;
  --ink: #17181C;
  --warning: #875400;
  --warning-soft: #FFF0CC;
  --danger: #C2381F;
  --danger-soft: #FDEBE7;
  --band: #17181C;
  --band-text: #F3F3F0;
  --band-muted: #B4B6BD;

  --radius: 20px;
  --radius-sm: 12px;
  --wrap: 1120px;
  --read: 46rem;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1012;
    --surface: #1A1B1F;
    --surface-alt: #24262B;
    --border: #33353B;
    --border-strong: #6E717A;
    --text: #F3F3F0;
    --muted: #A3A5AD;
    --accent-soft: #2A2618;
    --ink: #FFC629;
    --warning: #F2B544;
    --warning-soft: #33280F;
    --danger: #FF8D7A;
    --danger-soft: #3A1D18;
    --band: #1A1B1F;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

:lang(ar) body, body:lang(ar) { line-height: 1.8; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.icon { width: 1.5em; height: 1.5em; flex: none; fill: currentColor; }
[dir="rtl"] .icon.dir { transform: scaleX(-1); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  inset-inline-start: var(--gutter);
  top: -100px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Header ----------------------------------------------------------------- */

.site-header {
  background: var(--band);
  color: var(--band-text);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.125rem;
  text-decoration: none;
  white-space: nowrap;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.langs ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.langs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--band-muted);
}
.langs a:hover { color: var(--band-text); text-decoration: underline; }
.langs a[aria-current] {
  background: var(--accent);
  color: var(--on-accent);
}
.langs .short { display: none; }
@media (max-width: 480px) {
  .langs .long { display: none; }
  .langs .short { display: inline; }
  .langs a { padding: 0 10px; }
}

/* Hero ------------------------------------------------------------------- */

.band {
  background: var(--band);
  color: var(--band-text);
}
.hero { padding: 40px 0 56px; }
.hero .wrap {
  display: grid;
  gap: 32px;
  align-items: center;
}
@media (min-width: 880px) {
  .hero { padding: 72px 0 88px; }
  .hero .wrap { grid-template-columns: 1fr 280px; }
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.5rem, 9vw, 4.25rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.hero h1 .yel { color: var(--accent); } /* yellow on charcoal only: 11.29:1 */
.hero .lead {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 3.6vw, 1.625rem);
  line-height: 1.4;
  font-weight: 700;
  max-width: 34ch;
}
:lang(ar) .hero .lead { line-height: 1.6; }
.hero .sub {
  margin: 0 0 28px;
  color: var(--band-muted);
  max-width: 52ch;
}
.hero-art img {
  width: 200px;
  border-radius: 44px;
  margin-inline: auto;
  box-shadow: 0 0 0 1px #33353B;
}
@media (max-width: 879px) { .hero-art { display: none; } }

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 20px 8px 16px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  line-height: 1.15;
}
.store-badge:hover { background: #F2B200; }
.store-badge small { display: block; font-size: 0.75rem; font-weight: 600; }
.store-badge strong { display: block; font-size: 1.125rem; font-weight: 800; }
.soon { margin: 0 0 20px; color: var(--band-muted); font-size: 0.9375rem; }

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  font-size: 0.9375rem;
  color: var(--band-text);
  border-top: 1px solid #33353B;
  padding-top: 16px;
  max-width: 60ch;
}
.notice .icon { width: 1.25em; height: 1.25em; margin-top: 0.2em; }

/* Sections --------------------------------------------------------------- */

main { display: block; }
.section { padding: 56px 0; }
.section + .section { padding-top: 0; }
.section h2 {
  margin: 0 0 8px;
  font-size: clamp(1.625rem, 4.4vw, 2.25rem);
  line-height: 1.2;
  font-weight: 800;
}
.section .intro { margin: 0 0 28px; color: var(--muted); max-width: 60ch; }

.features {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 {
  margin: 16px 0 6px;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 800;
}
.card p { margin: 0; color: var(--muted); }
.card p + p { margin-top: 8px; }
.well {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
}
.well .icon { width: 28px; height: 28px; }

.also {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}
.also li { display: flex; align-items: center; gap: 8px; }
.also .icon { width: 1.25em; height: 1.25em; color: var(--text); }

.shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 880px) { .shots { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.shots img {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  background: var(--surface-alt);
}

.privacy-strip {
  display: grid;
  gap: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
}
@media (min-width: 760px) {
  .privacy-strip { grid-template-columns: auto 1fr; align-items: center; gap: 24px; padding: 32px; }
}
.privacy-strip h2 { margin-bottom: 4px; font-size: 1.5rem; }
.privacy-strip p { margin: 0; color: var(--muted); }
.privacy-strip p + p { margin-top: 8px; }
.wells { display: flex; gap: 8px; }

.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
}
.more .icon { width: 1.2em; height: 1.2em; }

/* Legal pages ------------------------------------------------------------ */

.doc-head { padding: 40px 0 32px; }
.doc-head h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.15;
  font-weight: 900;
}
.doc-head .meta { margin: 0; color: var(--band-muted); }
.doc-head .meta strong { color: var(--band-text); }

.doc {
  max-width: var(--read);
  padding-block: 32px 64px;
}
.doc h2 {
  margin: 40px 0 12px;
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 800;
  scroll-margin-top: 16px;
}
.doc h3 { margin: 24px 0 8px; font-size: 1.125rem; font-weight: 800; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc ul, .doc ol { padding-inline-start: 1.4em; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--muted); }

.toc {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 8px;
}
.toc h2 { margin: 0 0 8px; font-size: 1rem; color: var(--muted); font-weight: 700; }
.toc ol { margin: 0; columns: 2 14rem; column-gap: 32px; }
.toc li { break-inside: avoid; }

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--accent-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 0 0 16px;
}
.callout .icon { width: 1.4em; height: 1.4em; margin-top: 0.15em; }
.callout p:last-child { margin-bottom: 0; }
.callout.danger { background: var(--danger-soft); }
.callout.danger .icon { color: var(--danger); }

.todo {
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 700;
  padding: 0 4px;
  border-radius: 4px;
}

.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 48px;
  min-height: 36px;
  margin-bottom: 14px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.96875rem;
}
.doc th, .doc td {
  text-align: start;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.doc th { background: var(--surface-alt); font-weight: 700; }
.doc tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .doc table, .doc tbody, .doc tr, .doc td { display: block; width: 100%; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .doc tr:last-child { border-bottom: 0; }
  .doc td { border: 0; padding: 4px 14px; }
  .doc td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--muted);
  }
}

.mailbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  text-decoration: none;
  direction: ltr;
}
.mailbox:hover { background: #F2B200; }

/* Footer ----------------------------------------------------------------- */

.site-footer {
  background: var(--band);
  color: var(--band-text);
  padding: 40px 0 48px;
  font-size: 0.9375rem;
}
.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}
.site-footer p { margin: 0 0 8px; color: var(--band-muted); max-width: 70ch; }
.ltr { direction: ltr; unicode-bidi: isolate; }

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

.notfound { padding: 64px 0 80px; }
.notfound h1 { font-size: clamp(2rem, 7vw, 3rem); margin: 0 0 24px; line-height: 1.15; }
.notfound .lang-block { margin-bottom: 28px; }
.notfound .lang-block p { margin: 0 0 6px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header, .site-footer, .skip, .toc { display: none; }
  .band { background: none; color: #000; }
  body { background: #fff; color: #000; }
}
