/* Dear Larbi — site styles
   Plain CSS, no build step. Mobile first. Respects light/dark and reduced motion. */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20CF; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20CF; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Naskh"; src: url("../fonts/noto-naskh-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Naskh"; src: url("../fonts/noto-naskh-arabic-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --paper: #f7f4ee;
  --paper-2: #efeae0;
  --card: #ffffff;
  --ink: #18233a;
  --ink-2: #44506a;
  --line: #ddd6c8;
  --blue: #3f6fc4;
  --blue-ink: #2b56a8;      /* blue that passes AA on paper */
  --blue-deep: #22407a;
  --blue-soft: #e6eefb;
  --yellow: #f2c230;
  --red: #b42318;
  --focus: #f2c230;

  --font-body: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --step--1: clamp(0.94rem, 0.9rem + 0.2vw, 1rem);
  --step-0: clamp(1.125rem, 1.08rem + 0.25vw, 1.25rem);   /* body: 18–20px */
  --step-1: clamp(1.35rem, 1.2rem + 0.7vw, 1.6rem);
  --step-2: clamp(1.7rem, 1.4rem + 1.4vw, 2.3rem);
  --step-3: clamp(2.2rem, 1.6rem + 2.8vw, 3.6rem);

  --space: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  --section: clamp(4rem, 3rem + 5vw, 7.5rem);
  --radius: 18px;
  --radius-lg: 28px;
  --max: 1160px;
  --shadow: 0 1px 2px rgb(24 35 58 / .06), 0 8px 28px rgb(24 35 58 / .08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10151f;
    --paper-2: #161d2b;
    --card: #1a2232;
    --ink: #eef2fa;
    --ink-2: #b7c1d6;
    --line: #2c3750;
    --blue: #7ea3ec;
    --blue-ink: #9dbaf2;
    --blue-deep: #0d1a33;
    --blue-soft: #1c2a47;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 28px rgb(0 0 0 / .35);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}
html[lang="ar"] body { font-family: "Naskh", var(--font-body); line-height: 1.8; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--blue-ink); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 .5em; text-wrap: balance; }
html[lang="ar"] :is(h1, h2, h3) { font-family: "Naskh", var(--font-display); letter-spacing: 0; line-height: 1.4; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); font-weight: 500; }
p { margin: 0 0 1em; max-width: 66ch; text-wrap: pretty; }
em.letter { font-style: italic; font-weight: 400; color: var(--blue-ink); }

.skip { position: absolute; inset-inline-start: 1rem; top: -100px; background: var(--ink); color: var(--paper); padding: .75rem 1rem; border-radius: 10px; z-index: 100; }
.skip:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.section { padding-block: var(--section); }
.eyebrow { font-weight: 700; font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; color: var(--blue-ink); margin-bottom: .75rem; }
html[lang="ar"] .eyebrow { letter-spacing: 0; }
.lead { font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 52px; padding: .8rem 1.4rem; border-radius: 999px;
  font: 700 var(--step-0)/1.2 inherit; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, background-color .15s ease;
}
.btn-primary { background: var(--blue-ink); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--blue); color: #0d1a33; } .btn-primary:hover { background: #a9c3f5; } }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.nav { display: none; gap: 1.6rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: var(--step--1); padding-block: .5rem; }
.nav a:hover { color: var(--blue-ink); }
.bar-end { display: flex; align-items: center; gap: .6rem; }
.lang { position: relative; }
.lang select {
  appearance: none; font: 700 var(--step--1) var(--font-body); color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
  min-height: 44px; padding: .4rem 2.1rem .4rem 1rem; cursor: pointer;
}
html[dir="rtl"] .lang select { padding: .4rem 1rem .4rem 2.1rem; }
.lang::after { content: ""; position: absolute; inset-inline-end: .9rem; top: 50%; width: .45rem; height: .45rem; border: solid var(--ink-2); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.bar .btn { display: none; min-height: 44px; padding: .5rem 1.1rem; font-size: var(--step--1); }
@media (min-width: 900px) { .nav { display: flex; } .bar .btn { display: inline-flex; } }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 2rem + 4vw, 5.5rem) var(--section); overflow: clip; }
.hero-grid { display: grid; gap: clamp(2.5rem, 2rem + 3vw, 4.5rem); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }
.hero h1 { margin-bottom: .4em; }
.hero .lead { margin-bottom: 1.8rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.6rem; }
.reassure { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; padding: 0; margin: 0; list-style: none; color: var(--ink-2); font-size: var(--step--1); }
.reassure li { display: inline-flex; align-items: center; gap: .5rem; }
.reassure li::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--yellow); flex: none; }

/* Phone mock of the real "Today" screen */
.phone-stage { position: relative; justify-self: center; width: min(100%, 360px); }
.phone-stage::before { content: ""; position: absolute; inset: 8% -18% -6% -18%; background: radial-gradient(closest-side, var(--blue-soft), transparent); z-index: -1; }
.phone { background: #0f1626; border-radius: 46px; padding: 12px; box-shadow: 0 30px 60px -20px rgb(24 35 58 / .45); }
@media (prefers-color-scheme: dark) { .phone { box-shadow: 0 0 0 1px rgb(255 255 255 / .14), 0 30px 60px -20px rgb(0 0 0 / .7); } }
.s-top span, .s-top b { unicode-bidi: isolate; }
.screen { background: #fbf9f5; color: #18233a; border-radius: 36px; padding: 22px 18px 18px; font-family: var(--font-body); }
.screen .s-top { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: #5a6680; margin-bottom: 10px; }
.screen .s-top b { color: #22407a; }
.s-clock { text-align: center; }
.s-clock svg { width: 100%; }
.s-day { font: 600 1.55rem/1.1 var(--font-display); margin: 2px 0 2px; }
.s-date { color: #44506a; font-size: .95rem; margin-bottom: 14px; }
.s-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.s-btn { border-radius: 18px; padding: 14px 10px; font-weight: 700; font-size: .95rem; text-align: center; background: #e6eefb; color: #22407a; }
.s-btn.call { background: #22407a; color: #fff; grid-column: span 2; font-size: 1.05rem; padding: 16px; }
.s-btn.calm { background: #fdf0c7; color: #5c4600; }
.s-next { margin-top: 12px; border-radius: 16px; background: #fff; border: 1px solid #e5dfd3; padding: 12px 14px; font-size: .88rem; color: #44506a; }
.s-next b { color: #18233a; display: block; font-size: .98rem; }

.tight-top { padding-top: 0; }
.s-center { text-align: center; }
.form-note { margin: 0; font-size: .95rem; }

/* ---------- Story ---------- */
.story { background: var(--paper-2); }
.story-grid { display: grid; gap: clamp(2rem, 1.5rem + 3vw, 4rem); align-items: start; }
@media (min-width: 900px) { .story-grid { grid-template-columns: .8fr 1.2fr; } }
.letter-card { background: var(--card); border-radius: var(--radius-lg); padding: clamp(1.6rem, 1.2rem + 2vw, 2.8rem); box-shadow: var(--shadow); position: relative; }
.letter-card .salute { font: italic 400 var(--step-2)/1.1 var(--font-display); color: var(--blue-ink); margin-bottom: .6em; }
html[lang="ar"] .letter-card .salute { font-family: "Naskh", serif; font-style: normal; }
.letter-card p { font-size: var(--step-0); }
.sign { margin-top: 1.4rem; font-weight: 700; color: var(--ink-2); }
.story-mark { width: 120px; margin-bottom: 1.5rem; }

/* ---------- Features ---------- */
.section-head { max-width: 760px; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); list-style: none; padding: 0; margin: 0; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.5rem 1.4rem; }
.feature h3 { margin-bottom: .4em; }
.feature p { color: var(--ink-2); margin: 0; font-size: var(--step--1); line-height: 1.55; }
.ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-ink); margin-bottom: 1.1rem; }
.ico svg { width: 28px; height: 28px; }
.feature.who { border-color: transparent; background: var(--blue-deep); color: #fff; }
.feature.who p { color: #c9d6f2; }
.feature.who .ico { background: rgb(255 255 255 / .12); color: #fff; }

/* ---------- Get the app ---------- */
.download { background: var(--blue-soft); }
.dl-grid { display: grid; gap: 2rem; align-items: center; margin-bottom: 2.5rem; }
@media (min-width: 860px) { .dl-grid { grid-template-columns: 1fr auto; gap: 4rem; } }
.qr { margin: 0; display: grid; justify-items: center; gap: .75rem; text-align: center; max-width: 240px; justify-self: center; }
.qr img { width: 174px; height: 174px; border-radius: 16px; background: #fff; padding: 10px; box-shadow: var(--shadow); box-sizing: content-box; }
.qr figcaption { font-size: var(--step--1); color: var(--ink-2); }
.devices { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.device { background: var(--card); border-radius: var(--radius); padding: 1.5rem 1.5rem 1.25rem; border: 1px solid var(--line); }
.device h3 { margin-bottom: .6rem; }
.device ol { margin: 0; padding-inline-start: 1.3rem; color: var(--ink-2); font-size: var(--step--1); display: grid; gap: .45rem; }
.device li::marker { color: var(--blue-ink); font-weight: 700; }

/* ---------- Audience split ---------- */
.split { display: grid; gap: 1rem; }
@media (min-width: 800px) { .split { grid-template-columns: repeat(3, 1fr); } }
.panel { border-radius: var(--radius-lg); padding: 2rem 1.75rem; background: var(--card); border: 1px solid var(--line); }
.panel ul { margin: .4rem 0 0; padding-inline-start: 1.2rem; color: var(--ink-2); }
.panel li { margin-bottom: .35rem; }
.panel li::marker { color: var(--blue); }

/* ---------- Forms & languages ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.chips li { border: 1.5px solid var(--line); border-radius: 999px; padding: .45rem 1rem; font-size: var(--step--1); font-weight: 700; background: var(--card); }
.two { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; gap: 4rem; } }

/* ---------- Help now ---------- */
.help { background: var(--blue-deep); color: #fff; }
.help .eyebrow { color: var(--yellow); }
.help p { color: #d5dff4; }
.lines { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); margin-top: 2rem; }
.line { background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .14); border-radius: var(--radius); padding: 1.4rem; }
.line .where { font-size: var(--step--1); color: #b8c7e8; margin-bottom: .2rem; }
.line .name { font-weight: 700; margin-bottom: .6rem; }
.line a { color: #fff; font: 600 var(--step-1)/1.2 var(--font-display); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; direction: ltr; unicode-bidi: isolate; }
.line a:hover { text-decoration: underline; }
.line.urgent { background: var(--yellow); color: #2a2100; border-color: transparent; }
.line.urgent .where, .line.urgent .name { color: #4a3b00; }
.line.urgent a { color: #2a2100; }
.help-note { margin-top: 1.4rem; font-size: var(--step--1); }

/* ---------- Principles ---------- */
.principles { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); list-style: none; padding: 0; margin: 0; }
.principles h3 { font-size: var(--step-1); }
.principles p { color: var(--ink-2); font-size: var(--step--1); }
.principles .num { font: italic 400 var(--step-2)/1 var(--font-display); color: var(--blue); display: block; margin-bottom: .6rem; }

/* ---------- Join ---------- */
.join-card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: clamp(1.75rem, 1.2rem + 3vw, 3.5rem); display: grid; gap: 2rem; }
@media (min-width: 900px) { .join-card { grid-template-columns: 1fr 1fr; align-items: start; } }
form { display: grid; gap: 1.1rem; }
label, legend { font-weight: 700; }
.field { display: grid; gap: .4rem; }
input[type="email"], select.input {
  font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--line);
  border-radius: 14px; min-height: 56px; padding: .7rem 1rem; width: 100%;
}
input[type="email"]:focus, select.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 25%, transparent); }
.check { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start; font-weight: 400; font-size: var(--step--1); color: var(--ink-2); }
.check input { width: 26px; height: 26px; margin: .1rem 0 0; accent-color: var(--blue-ink); }
.hp { position: absolute; inset-inline-start: -9999px; }
.status { min-height: 1.6em; font-weight: 700; margin: 0; }
.status.ok { color: #1f7a45; }
.status.err { color: var(--red); }
@media (prefers-color-scheme: dark) { .status.ok { color: #7fd8a4; } .status.err { color: #ff9b8f; } }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 1.3rem 0; font: 500 var(--step-1)/1.3 var(--font-display); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
html[lang="ar"] summary { font-family: "Naskh", serif; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 400 1.8rem/1 var(--font-body); color: var(--blue-ink); flex: none; }
details[open] summary::after { content: "–"; }
details p { color: var(--ink-2); padding-bottom: 1.2rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 3rem 2.5rem; font-size: var(--step--1); color: var(--ink-2); }
.foot { display: grid; gap: 1.5rem; }
@media (min-width: 800px) { .foot { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot .brand { margin-bottom: .8rem; }
.foot img { height: 36px; width: auto; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.foot a { color: var(--ink); }
.memory { font-style: italic; font-family: var(--font-display); color: var(--ink); }
html[lang="ar"] .memory { font-family: "Naskh", serif; font-style: normal; }
.owner { margin: 2rem 0 0; color: var(--ink); font-weight: 700; }
.owner + .fine { margin-top: 1rem; }
.fine { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .9rem; }

/* ---------- Simple page (privacy) ---------- */
.prose { max-width: 760px; padding-block: 3rem var(--section); }
.prose h2 { font-size: var(--step-1); margin-top: 2em; }

/* ---------- Guides ---------- */
.guide { max-width: 780px; padding-block: 2rem var(--section); }
.crumbs { font-size: var(--step--1); color: var(--ink-2); margin-bottom: 1.5rem; }
.crumbs a { color: var(--ink-2); }
.guide-head { margin-bottom: 2rem; }
.guide-head h1 { font-size: var(--step-2); }
.guide-head .meta { font-size: var(--step--1); color: var(--ink-2); margin: 0; }
.quick { background: var(--blue-soft); border-radius: var(--radius); padding: 1.5rem 1.6rem .6rem; margin-bottom: 2.5rem; }
.quick h2 { font-size: var(--step-1); margin-bottom: .6rem; }
.quick ul { margin: 0 0 1rem; padding-inline-start: 1.2rem; display: grid; gap: .45rem; }
.quick li::marker { color: var(--blue-ink); }
.guide-body h2 { font-size: var(--step-1); margin-top: 2.2rem; }
.guide-body ul, .guide-body ol { padding-inline-start: 1.3rem; display: grid; gap: .55rem; margin: 0 0 1.2rem; }
.guide-body li { max-width: 66ch; }
.box { border-radius: var(--radius); padding: 1.4rem 1.6rem .6rem; margin-top: 2rem; }
.box h2 { font-size: var(--step-1); margin-bottom: .5rem; }
.box-doctor { background: #fff6d9; color: #2a2100; border: 1px solid #f0dc9a; }
.box-doctor a { color: #5c4600; }
.box-app { background: var(--card); border: 1px solid var(--line); }
.box-help { background: var(--paper-2); }
@media (prefers-color-scheme: dark) { .box-doctor { background: #3a3110; color: #fff3cc; border-color: #5c4a12; } .box-doctor a { color: #ffe08a; } }
.sources { margin-top: 2.5rem; }
.sources h2, .related h2 { font-size: var(--step-1); }
.sources ul { padding-inline-start: 1.2rem; font-size: var(--step--1); display: grid; gap: .4rem; }
.related { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.related ul { padding-inline-start: 1.2rem; display: grid; gap: .5rem; }
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.guide-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.guide-card h2 { font-size: var(--step-1); margin-bottom: .4rem; }
.guide-card h2 a { color: var(--ink); text-decoration: none; }
.guide-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.guide-card:hover { border-color: var(--blue); }
.guide-card p { color: var(--ink-2); font-size: var(--step--1); margin-bottom: .6rem; }
.guide-card .more { font-weight: 700; color: var(--blue-ink); font-size: var(--step--1); }
.guides-home { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.guides-home a { font-weight: 700; }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}
