/* ورّاق — landing page. Typography does the work: no boxes, no rules, no shadows. */

@font-face { font-family: "Warraq Display"; src: url(fonts/display-bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Warraq Sans"; src: url(fonts/sans-regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Warraq Sans"; src: url(fonts/sans-medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #f1eee6;
  --ink: #1f1e1a;
  --ink-2: #5f5b52;
  --ink-3: #716c60;
  --dark: #141414;       /* near-black gray: hero and dark bands */
  --dark-ink: #ece8de;
  --dark-ink-2: #a3a79c;
  --accent: #c9372c;     /* the one color: red, for buttons and caret */

  --display: "Warraq Display", "Noto Naskh Arabic", "Geeza Pro", serif;
  --sans: "Warraq Sans", -apple-system, system-ui, "Segoe UI", sans-serif;

  --wide: 1320px;
  --read: 34rem;
  --gutter: clamp(1rem, 5vw, 5rem);
  --s-1: .5rem; --s-2: 1rem; --s-3: 2rem; --s-4: 4rem; --s-5: 7rem; --s-6: 11rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.8 var(--sans);
  font-feature-settings: "ss06"; /* tashkeel placement, same set as the app */
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
.on-dark :focus-visible { outline-color: var(--accent); }
::selection { background: #d9cbb3; }
[id] { scroll-margin-top: 5rem; }

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

/* Type roles */
.display { font-family: var(--display); font-weight: 700; line-height: 1.15; text-wrap: balance; font-feature-settings: "ss06", "swsh"; }
.eyebrow { font: 500 .85rem/1 var(--sans); color: var(--ink-2); }
.muted { color: var(--ink-2); }
.latin { font-family: var(--sans); direction: ltr; unicode-bidi: isolate; }
.h2 { font-size: clamp(2.2rem, 5vw, 4.4rem); max-width: 16ch; margin-top: var(--s-2); }
.split .h2 { font-size: clamp(2rem, 3.4vw, 3rem); max-width: none; }
.lead { font-size: clamp(1.15rem, .9vw + .85rem, 1.45rem); line-height: 1.75; margin-top: var(--s-3); color: var(--ink-2); }
.on-dark .lead { color: var(--dark-ink-2); }

/* Stat blocks: eyebrow / big figure / short caption. No borders. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--s-4) var(--s-4); margin-top: var(--s-5); }
@media (min-width: 900px) { .stats { margin-top: var(--s-6); } }
.stat b { display: block; font: 700 clamp(1.9rem, 3.2vw, 2.9rem)/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat b.latin { font-family: var(--sans); font-weight: 500; letter-spacing: -.01em; font-size: clamp(1.6rem, 2.7vw, 2.45rem); text-align: right; }
.stat p { font: 400 1rem/1.6 var(--sans); margin-top: .7rem; max-width: 24ch; text-wrap: pretty; color: var(--ink-2); }
@media (max-width: 720px) { .stats { gap: var(--s-3); } .stat p { max-width: none; } }
.on-dark .stat p { color: var(--dark-ink-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 1rem/1 var(--sans);
  padding: .95em 1.6em; min-height: 44px;
  background: var(--ink); color: var(--paper);
  text-decoration: none; border-radius: 4px;
  transition: background .2s ease, color .2s ease;
}
.btn:hover { background: #000; }
.btn--lg { font-size: 1.2rem; padding: 1.05em 2em; }
.on-dark .btn { background: var(--accent); color: #fff; }
.on-dark .btn:hover { background: #dc4a3e; }
.btn--ghost, .on-dark .btn--ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.btn--ghost:hover, .on-dark .btn--ghost:hover { background: rgb(255 255 255 / .06); }

/* Nav (sits on the dark hero) */
.nav { position: sticky; top: 0; z-index: 10; background: var(--dark); color: var(--dark-ink); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; min-height: 44px; font: 700 1.5rem/1 var(--display); text-decoration: none; }
.nav ul { display: flex; gap: var(--s-3); list-style: none; padding: 0; margin: 0; }
.nav ul a { display: inline-block; font: 500 .95rem/1 var(--sans); text-decoration: none; color: var(--dark-ink-2); padding: .75em 0; }
.nav ul a:hover { color: var(--dark-ink); }
.nav .btn { padding-block: .8em; }
@media (max-width: 720px) { .nav .btn { display: none; } .nav ul { gap: var(--s-2); } .nav ul a { font-size: .85rem; } }

/* Hero: dark, one color */
.hero { padding-block: var(--s-5) var(--s-5); min-height: calc(100vh - 4.25rem); min-height: calc(100svh - 4.25rem); display: grid; align-content: center; }
.hero .wrap { width: 100%; }
.hero .eyebrow { margin-bottom: var(--s-2); }
.hero h1 { font-size: clamp(3rem, 13vw, 12rem); line-height: 1.05; white-space: nowrap; color: var(--dark-ink); }
.hero .lede { font-size: clamp(1.15rem, 1.3vw + .6rem, 1.5rem); line-height: 1.7; margin-top: var(--s-3); max-width: 28ch; color: var(--dark-ink); }
.hero .cta { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-top: var(--s-4); }

@media (max-width: 720px) {
  .hero { min-height: 0; padding-block: var(--s-4) var(--s-5); }
}

/* Editor mock — live HTML text, not an image */
.editor { background: var(--paper); color: var(--ink); border-radius: 12px; overflow: hidden; }
.editor__page {
  font-family: var(--sans); font-size: clamp(.95rem, .3vw + .8rem, 1.1rem); line-height: 1.85;
  max-width: 40rem; padding: clamp(2.5rem, 5vw, 4rem) 3rem clamp(2.5rem, 6vw, 4.5rem);
}
.editor__page p, .editor__page .h, .editor__page li { position: relative; }
.editor__page .h { font: 500 1.5em/1.4 var(--sans); margin-bottom: .6em; }
.editor__page em { font-style: normal; font-weight: 500; } /* Arabic emphasis is upright Medium, as in the app */
.editor__page p + p, .editor__page ul + p { margin-top: 1em; }
.editor__page ul { list-style: none; padding: 0; margin-top: 1em; }
.mk { color: #78746b; font-weight: 400; }                    /* faded delimiter */
.mk--hang { position: absolute; inset-inline-end: 100%; padding-inline-end: .6em; } /* block marker hangs in the margin */
.mk--near { color: var(--ink); }                                 /* delimiter next to the caret */
.caret { display: inline-block; width: 2px; height: 1.1em; vertical-align: -.2em; background: var(--accent); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.editor--focus p { color: #78746b; }
.editor--focus p.is-focus { color: var(--ink); }
.editor--focus .mk { color: #a09b90; }
.editor--focus p.is-focus .mk { color: #78746b; }
.hero .editor { margin-top: var(--s-6); max-width: 62rem; }
.hero .editor__page { max-width: 44rem; }

/* Sections */
section { padding-block: var(--s-6); }
@media (max-width: 720px) { section { padding-block: var(--s-5); } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4) var(--s-5); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.on-dark { background: var(--dark); color: var(--dark-ink); }
.on-dark .eyebrow, .on-dark .muted { color: var(--dark-ink-2); }
.on-dark ::selection { background: #4a1f1a; }
.on-dark .h2, .on-dark .h1 { color: var(--dark-ink); }

/* Live samples */
.sample { font-family: var(--sans); font-size: clamp(1.35rem, 2.4vw, 2.1rem); line-height: 1.75; font-weight: 500; }
.sample .latin { white-space: nowrap; }
.md { font-family: var(--sans); font-weight: 500; font-size: clamp(1.8rem, 3.2vw, 2.8rem); line-height: 1.5; align-self: center; }
.md .mk { color: var(--ink-3); }
.pair { display: grid; gap: 0; margin-top: var(--s-3); }
.pair .word:first-child { color: var(--ink-3); }
.pair .word { font-family: var(--sans); font-weight: 500; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 2; }
.pair .word[lang] { line-height: 2.1; margin-top: .3em; }

/* Download */
.download .h1 { font-size: clamp(3rem, 9.5vw, 8.5rem); line-height: 1.2; }
.download .cta { margin-top: var(--s-4); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); }
.download .fine { font: 400 .9rem/1.7 var(--sans); color: var(--dark-ink-2); }
.download .fine a, footer a { display: inline-block; padding-block: .7em; }

/* FAQ — spacing instead of rules */
.faq .h2 { font-size: clamp(2rem, 3.4vw, 3rem); }
.faq .list { margin-top: var(--s-4); display: grid; gap: var(--s-2); max-width: var(--read); }
.faq summary { cursor: pointer; list-style: none; font: 500 1.15rem/1.5 var(--sans); padding: .6rem 0; display: flex; justify-content: space-between; gap: var(--s-2); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+" / ""; color: var(--ink-2); font-weight: 400; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 1rem; max-width: var(--read); color: var(--ink-2); }

/* Footer */
footer { padding-block: var(--s-4) var(--s-5); font: 400 .9rem/1.8 var(--sans); color: var(--ink-2); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-3); }
footer ul { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); list-style: none; padding: 0; margin: 0; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }
footer .brand { color: var(--ink); font-size: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .btn, .faq summary::after { transition: none; }
}
