/* darija.pro — Zellige nuit tokens for the web (twin of the app's DT.Palette / DT.Gradients, WU-35).
 * Source: design/nuit/app-tokens.css (the app's CSS twin) and app-tokens-wu35.md. Same hexes, nothing invented.
 * Always dark. Saffron is a FILL (ink text on saffron, never saffron text on a light ground).
 * The khatim star is back as the section bullet and the hero watermark; the lattice is the ground's texture. */

@font-face {
  font-family: 'Readex Pro';
  src: url('/fonts/ReadexPro-Variable.ttf') format('truetype-variations');
  font-weight: 200 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #0F0E0C; --ground-top: #1F1116; --ground-mid: #16110F;
  --surface: #1A1815; --elevated: #24211D;
  --text: #F5EFE6; --muted: #A89F91; --line: #302A24;
  --saffron: #F2A900; --saffron-light: #FFC44D; --saffron-ink: #0F0E0C;
  --terracotta: #D9673A; --terracotta-light: #E58A5E;
  --success: #3DBE7A; --danger: #E0533F;
  --hero-top: #2A1D18; --hero-mid: #1C1714; --hero-end: #181412;
  --hero-terracotta-top: #2E1D19; --hero-terracotta-mid: #1F1714;
  --text-on-hero: #C9AE86; --label-on-hero: #E8C88C;
  --row-top: #2A231D; --row-end: #211D19; --field-top: #252019; --field-end: #1B1815;
  --dock-fill: #181513; --segment-active: #2A241F;

  --ground-gradient: linear-gradient(176deg, var(--ground-top) 0%, var(--ground-mid) 40%, var(--ground) 100%);
  --hero-gradient: linear-gradient(150deg, var(--hero-top) 0%, var(--hero-mid) 62%, var(--hero-end) 100%);
  --hero-terracotta-gradient: linear-gradient(150deg, var(--hero-terracotta-top) 0%, var(--hero-terracotta-mid) 60%, var(--hero-end) 100%);
  --saffron-gradient: linear-gradient(140deg, var(--saffron-light), var(--saffron));
  --saffron-rail: linear-gradient(90deg, var(--saffron), var(--saffron-light));
  --row-gradient: linear-gradient(100deg, var(--row-top), var(--row-end));
  --field-gradient: linear-gradient(100deg, var(--field-top), var(--field-end));
  --lattice: repeating-linear-gradient(45deg, rgba(242,169,0,0.07) 0 1px, transparent 1px 30px),
             repeating-linear-gradient(-45deg, rgba(242,169,0,0.07) 0 1px, transparent 1px 30px),
             repeating-linear-gradient(0deg, rgba(217,103,58,0.05) 0 1px, transparent 1px 30px),
             repeating-linear-gradient(90deg, rgba(217,103,58,0.05) 0 1px, transparent 1px 30px);
  --bloom-saffron: radial-gradient(ellipse 120% 60% at 12% -4%, rgba(242,169,0,0.20), transparent 62%);
  --bloom-terracotta: radial-gradient(ellipse 90% 45% at 100% 10%, rgba(217,103,58,0.20), transparent 60%);
  --hero-shadow: 0 18px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,214,140,0.10);
  --saffron-lift: 0 8px 18px rgba(242,169,0,0.28);
  --saffron-ring: 0 0 0 6px rgba(242,169,0,0.12);
  --saffron-glow: 0 0 14px rgba(242,169,0,0.45);
  --dock-shadow: 0 14px 34px rgba(0,0,0,0.6);

  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', 'Geeza Pro', 'Noto Naskh Arabic', sans-serif;
  --fs-display-xl: 30px; --fs-display-xl-ar: 32px; --fs-stat-hero: 44px;
  --fs-display: 28px; --fs-title: 22px; --fs-card-lat: 21px; --fs-card-ar: 22px;
  --fs-body: 15px; --fs-small: 13px; --fs-label: 11px; --ls-label: 0.08em;
  --r-card: 18px; --r-hero: 24px; --r-pill: 999px; --r-chip: 8px; --r-tile: 10px;
  --hairline: 1px solid var(--line);
  --surface-72: rgba(26,24,21,0.72); --elevated-90: rgba(36,33,29,0.90); --dock-92: rgba(24,21,19,0.92);
}

/* S-1 ground: gradient + lattice + one bloom. Flat under reduced transparency / more contrast. */
html { background: var(--ground); }
body { margin: 0; color: var(--text); background: var(--ground-gradient); background-attachment: fixed;
       font-family: var(--font); font-size: var(--fs-body); line-height: 1.5; -webkit-font-smoothing: antialiased; position: relative; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
               background: var(--bloom-saffron), var(--lattice); }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  body { background: var(--ground); } body::before { display: none; }
  .card, .hero-card { background: var(--surface) !important; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
a { color: inherit; }
.ar { direction: rtl; unicode-bidi: isolate; font-weight: 400; }
.lat { font-weight: 600; }
.muted { color: var(--muted); }
.label { font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.label.saffron { color: var(--saffron); } .label.terracotta { color: var(--terracotta-light); }
.label .khatim { width: 10px; height: 10px; flex: 0 0 auto; }

/* S-3 card · S-2 hero card */
.card { background: var(--surface-72); border: var(--hairline); border-radius: var(--r-card); padding: 16px; }
.hero-card { position: relative; overflow: hidden; background: var(--hero-gradient); border: 1px solid rgba(242,169,0,0.22);
             border-radius: var(--r-hero); box-shadow: var(--hero-shadow); padding: 24px; }
.hero-card::before { content: ""; position: absolute; width: 240px; height: 240px; left: -50px; top: -70px; border-radius: 50%;
                     background: radial-gradient(circle, rgba(242,169,0,0.18), transparent 66%); pointer-events: none; }
.hero-card .watermark { position: absolute; right: -30px; bottom: -40px; width: 132px; height: 132px; color: var(--saffron); opacity: .10; pointer-events: none; }
.hero-card.terracotta { background: var(--hero-terracotta-gradient); border-color: rgba(217,103,58,0.30); }
.hero-card.terracotta::before { left: auto; right: -50px; width: 210px; height: 210px; background: radial-gradient(circle, rgba(217,103,58,0.34), transparent 66%); }
.hero-card .gloss { color: var(--text-on-hero); } .hero-card .label { color: var(--label-on-hero); }

/* Buttons: S-11 ghost · filled saffron gradient with ink text */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border: 0;
       border-radius: var(--r-pill); font: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
       background: var(--saffron-gradient); color: var(--saffron-ink); box-shadow: var(--saffron-lift); }
.btn.ghost, main.article a.btn.ghost { background: rgba(242,169,0,0.08); color: var(--saffron); border: 1px solid rgba(242,169,0,0.32); box-shadow: none; min-height: 46px; }
.btn.ghost.terracotta { background: rgba(217,103,58,0.10); color: var(--terracotta-light); border-color: rgba(217,103,58,0.34); }

/* Pills, chips (S-6 / S-6b alternate), word chips (S-7), badge (S-19), play disc (S-14), rail (S-17), field (S-5) */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); padding: 8px 13px; font-size: var(--fs-small); border: var(--hairline); color: var(--muted); }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); font-size: 14px; color: var(--text);
        background: linear-gradient(140deg, rgba(242,169,0,0.22), rgba(242,169,0,0.10)); border: 1px solid rgba(242,169,0,0.32); }
.chip.alt { background: linear-gradient(140deg, rgba(217,103,58,0.22), rgba(217,103,58,0.10)); border-color: rgba(217,103,58,0.32); }
.wordchip { display: inline-block; font-size: 12.5px; padding: 7px 11px; border-radius: var(--r-chip); background: rgba(15,14,12,0.6); border: 1px solid rgba(242,169,0,0.20); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--success); border: 1px solid var(--success); border-radius: var(--r-pill); padding: 3px 9px; }
.play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--saffron-gradient); color: var(--saffron-ink); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--saffron-ring), var(--saffron-lift); flex: 0 0 auto; }
.rail { height: 6px; border-radius: 3px; background: rgba(245,239,230,0.12); overflow: hidden; } .rail i { display: block; height: 100%; background: var(--saffron-rail); }
.field { background: var(--field-gradient); border: 1px solid rgba(242,169,0,0.26); border-radius: var(--r-card); box-shadow: inset 0 1px 0 rgba(255,196,77,0.08); }
.segment { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--elevated-90); border: var(--hairline); }
.segment span { padding: 8px 14px; border-radius: var(--r-pill); font-size: 13px; color: var(--muted); }
.segment span.on { background: var(--saffron-gradient); color: var(--saffron-ink); font-weight: 500; }
.hair { height: 1px; background: var(--line); }

/* ---------- darija.pro layout (Zellige nuit) ---------- */
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(32px, 5.2vw, 52px); font-weight: 600; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 1em; } ul, ol { padding-left: 1.2em; }
.small { font-size: var(--fs-small); } .center { text-align: center; }
.lede { font-size: 18px; line-height: 1.55; } .lede.center { max-width: 62ch; margin: 0 auto 24px; }
main { max-width: 1100px; margin: 0 auto; padding: 0 20px 96px; }
section { padding: 44px 0; } .section-title { text-align: center; margin-bottom: 28px; }

/* header (S-13 dock look) */
header.site { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; max-width: 1100px; margin: 0 auto;
  background: var(--dock-92); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(242,169,0,0.16); border-radius: 0 0 22px 22px; box-shadow: var(--dock-shadow); }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 18px; font-weight: 600; white-space: nowrap; }
.mark img { border-radius: 8px; }
header.site nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
header.site nav a { text-decoration: none; color: var(--muted); } header.site nav a:hover { color: var(--text); }
.lang { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--elevated-90); border: var(--hairline); }
.lang a { padding: 5px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; }
.lang a.on { background: var(--saffron-gradient); color: var(--saffron-ink) !important; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; color: var(--saffron-ink) !important; }

/* footer */
footer.site { border-top: var(--hairline); margin: 24px auto 0; padding: 32px 20px 120px; max-width: 1100px; font-size: 14px; }
footer.site .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px; margin-bottom: 20px; }
footer.site ul { list-style: none; padding: 0; margin: 0; } footer.site li { margin: 6px 0; }
footer.site a { color: var(--muted); text-decoration: none; } footer.site a:hover { color: var(--text); }
footer.site .mark { margin-bottom: 8px; }

/* store badge — saffron fill, ink text, the app's own button language */
.store { display: inline-flex; align-items: center; gap: 10px; background: var(--saffron-gradient); color: var(--saffron-ink); text-decoration: none; border-radius: var(--r-pill); padding: 10px 20px 10px 16px; line-height: 1.05; box-shadow: var(--saffron-lift); min-height: 52px; }
.store, .store *, main.article .store, main.article a.store { color: var(--saffron-ink); }
.store small { display: block; font-size: 11px; opacity: .8; } .store b { font-size: 18px; font-weight: 600; }
.store.compact { min-height: 46px; padding: 8px 16px 8px 14px; } .store.compact b { font-size: 16px; }
.cta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 20px 0; }
.sticky-cta { display: none; }

/* hero */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-top: 32px; }
.hero .label { margin-bottom: 14px; }
.proof { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.proof li { min-height: 36px; font-size: 13px; }
.phone-wrap .shot img { max-width: 320px; margin: 0 auto; }

/* screenshots: the neutral frame from the app's composite lane (hairline bezel, no chrome) */
.shot { margin: 0; } .shot img { border-radius: 30px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 18px 40px rgba(0,0,0,0.45); }
.shot figcaption { text-align: center; margin-top: 12px; }

/* features */
.feature { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 32px 0; border-top: var(--hairline); }
.feature.flip > div { order: 2; } .feature .shot img { max-width: 270px; margin: 0 auto; }
.feature h2 { font-size: clamp(21px, 2.6vw, 27px); margin-top: 8px; } .feature p { color: var(--muted); font-size: 16px; }

/* how / pricing */
.how ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: step; }
.how li { counter-increment: step; } .how li h3::before { content: counter(step) " · "; color: var(--saffron); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto 22px; }
.plan { position: relative; } .plan.best { border-color: rgba(242,169,0,0.5); background: var(--hero-gradient); }
.best-tag { position: absolute; top: -12px; left: 16px; background: var(--saffron-gradient); color: var(--saffron-ink); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--r-pill); }
.plan .price { font-size: 32px; font-weight: 600; margin: 6px 0 8px; }
.legal { max-width: 74ch; margin: 18px auto 0; text-align: center; } .legal a { color: var(--muted); }

/* code teaser · about · final */
.code-teaser .hero-card h2 { margin-top: 8px; } .code-teaser .hero-card .btn { margin-top: 6px; }
.about-card { max-width: 760px; margin: 0 auto; padding: 28px; } .about-card p { font-size: 16px; }
.final { text-align: center; padding: 56px 24px; } .final .store { margin-top: 8px; } .final h2 { max-width: 30ch; margin: 0 auto 10px; }
.cta { margin: 28px 0; } .cta .cta-title { font-size: 20px; margin-bottom: 6px; }

/* guides */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-bottom: 20px; }
.guide-card { text-decoration: none; color: inherit; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.guide-card img { aspect-ratio: 3 / 2; object-fit: cover; } .guide-card h3 { margin: 14px 16px 6px; font-size: 17px; } .guide-card p { margin: 0 16px 16px; }
.guide-card:hover { border-color: rgba(242,169,0,0.5); }

/* faq */
.faqs > div { max-width: 760px; margin: 0 auto; }
details.faq { border-top: var(--hairline); padding: 14px 0; } details.faq:last-of-type { border-bottom: var(--hairline); }
details.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--saffron); font-size: 22px; line-height: 1; flex: 0 0 auto; } details.faq[open] summary::after { content: "–"; }
details.faq h3 { margin: 0; font-size: 16px; font-weight: 500; } details.faq p { margin: 10px 0 0; color: var(--muted); } details.faq a { color: var(--saffron); }

/* article */
main.article { max-width: 860px; } main.article.wide { max-width: 1000px; }
main.article .crumbs { font-size: 13px; color: var(--muted); margin: 18px 0 24px; } main.article .crumbs a { color: var(--muted); text-decoration: none; }
main.article section { padding: 20px 0; } main.article p { font-size: 17px; line-height: 1.65; }
main.article section.card { padding: 20px 22px; margin: 12px 0; } main.article section.hero-card { padding: 24px; margin: 12px 0; }
main.article section.card h2, main.article section.hero-card h2 { font-size: 20px; margin-top: 0; }
main.article section.card .cta-row { margin: 16px 0 0; }
main.article .feature-img { border-radius: var(--r-hero); border: var(--hairline); margin: 24px 0 8px; box-shadow: var(--hero-shadow); }
main.article .shot img { max-width: 280px; margin: 0 auto; }
main.article .howto { margin: 20px 0; } main.article .howto ol { margin: 0; padding-left: 1.3em; } main.article .howto li { margin: 8px 0; font-size: 16px; }
main.article ul, main.article ol { list-style: revert; } main.article a { color: var(--saffron); }
.related ul { list-style: none !important; padding: 0; } .related li { margin: 8px 0; }

/* code page */
.steps { list-style: none !important; padding: 0 !important; margin: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.steps .num { width: 34px; height: 34px; border-radius: var(--r-tile); background: rgba(242,169,0,0.14); border: 1px solid rgba(242,169,0,0.24); color: var(--saffron); display: grid; place-items: center; font-weight: 600; }
.steps p { margin: 4px 0 0; font-size: 16px !important; }
.mocks { display: flex; gap: 16px; justify-content: center; align-items: flex-start; } .mocks.two .phone { width: min(230px, 46%); }
.creators { margin-top: 24px; } .creators p { margin-bottom: 14px; }

/* redeem form */
.redeem-card { padding: 24px; margin: 8px 0 12px; } .redeem .hint { margin: 10px 0 0; }
.redeem .label { margin-bottom: 8px; }
.redeem-row { display: flex; gap: 10px; flex-wrap: wrap; }
.redeem input { flex: 1 1 220px; min-height: 52px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid rgba(242,169,0,0.26); background: var(--field-gradient); color: var(--text); font: inherit; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(255,196,77,0.08); }
.redeem input::placeholder { color: var(--muted); text-transform: none; letter-spacing: 0; }
.redeem input:focus { outline: 2px solid var(--saffron); outline-offset: 2px; }
.redeem .btn { flex: 0 0 auto; }
.redeem.compact { margin: 8px 0 12px; } .redeem.compact .label { color: var(--label-on-hero); }
.inapp { margin: 12px 0; } .inapp h2 { font-size: 20px; }

@media (max-width: 760px) {
  main { padding-bottom: 110px; }
  .hero, .feature { grid-template-columns: 1fr; gap: 24px; } .feature.flip > div { order: 0; }
  .phone-wrap .shot img, .feature .shot img { max-width: 250px; }
  header.site nav a:not(.btn):not(.lang a) { display: none; } header.site { border-radius: 0; padding: 8px 14px; }
  section { padding: 30px 0; }
  .sticky-cta { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px;
    background: var(--dock-92); backdrop-filter: blur(14px); border: 1px solid rgba(242,169,0,0.16); border-radius: var(--r-pill); box-shadow: var(--dock-shadow); }
  .sticky-cta .small { color: var(--text); font-weight: 500; }
  .redeem .btn { width: 100%; }
}
