/* OrQuest site: tokens, type, and the few pieces every page shares
   (home, the guide pages, privacy, 404).

   The palette is the app's own ("Techelet and Ink", src/theme/tokens.ts).
   Techelet is the only decorative colour. Amber means the streak and the
   Ner lamp, nothing else. The --paper-* tokens are the cut-paper art's four
   blues (assets/art/MANIFEST.md in the app), and --sky and --glow are sampled
   from the films themselves (assets/film/README.md), so type laid over the
   film sits on exactly the colour the film paints. */

/* The app's two families, served from this site (assets/fonts, OFL, the
   licences beside the files): one variable file per script covers every
   weight from 400 to 700, and a page downloads only the scripts it shows. */
@font-face { font-family: "Assistant"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/assistant-hebrew.woff2) format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Assistant"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/assistant-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Assistant"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/assistant-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; }
@font-face { font-family: "Frank Ruhl Libre"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/frank-ruhl-libre-hebrew.woff2) format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Frank Ruhl Libre"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/frank-ruhl-libre-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Frank Ruhl Libre"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/frank-ruhl-libre-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; }
/* Fallbacks sized to the web fonts' metrics, so a desktop page does not move
   when the fonts arrive (measured: every page's shift under 0.1, most near 0).
   Desktop only: on a slow phone they cost about a second of first paint, and
   phones had no such shift to begin with. */
@font-face { font-family: "Assistant Fallback"; src: local("Arial"); size-adjust: 91.2%; ascent-override: 111.8%; descent-override: 31.8%; line-gap-override: 0%; unicode-range: U+0000-058F, U+0600-FFFF; }
@font-face { font-family: "Assistant Fallback"; src: local("Arial"); size-adjust: 93.2%; ascent-override: 109.4%; descent-override: 31.1%; line-gap-override: 0%; unicode-range: U+0590-05FF, U+FB1D-FB4F; }
@font-face { font-family: "Frank Ruhl Libre Fallback"; src: local("Times New Roman"); size-adjust: 111.1%; ascent-override: 86.4%; descent-override: 29.7%; line-gap-override: 0%; unicode-range: U+0000-058F, U+0600-FFFF; }
@font-face { font-family: "Frank Ruhl Libre Fallback"; src: local("Times New Roman"); size-adjust: 106.1%; ascent-override: 90.5%; descent-override: 31.1%; line-gap-override: 0%; unicode-range: U+0590-05FF, U+FB1D-FB4F; }

:root {
  --bg: #F1F3F6;
  --bg-deep: #E4E8EE;
  --surface: #FFFFFF;
  --surface-2: #E9ECF1;
  --inset: #F6F8FA;
  --ink: #12161C;
  --ink-2: #464E5A;
  --ink-3: #5F6873;
  --ink-4: #8A939F;
  --line: #D9DDE4;
  --line-strong: #C3C9D3;
  /* A form field's edge: 3:1 against the field and the card around it (WCAG 1.4.11). */
  --field-line: #7C8592;
  --brand: #1A4FA0;
  --brand-hover: #16407F;
  --brand-edge: #0A2450;
  --brand-tint: #E4ECFA;
  --brand-tint-2: #C9DAF5;
  --on-brand: #FFFFFF;
  --flame: #9F5507;
  --flame-tint: #FBEEDC;
  --shadow-rgb: 18, 22, 28;
  --shadow-a: .10;
  --phone-bezel: #0E1116;

  /* The paper world. Identical in both themes: the art is full bleed on its
     own ground, like the app's covers. */
  --paper-deep: #0F3470;
  --paper: #1A4FA0;
  --paper-mid: #4E7EC4;
  --paper-pale: #C9DAF5;
  --sky: #05367E;
  --glow: #E0EFFF;
  --on-sky: #F4F8FF;
  --on-sky-2: #BFD3F2;

  --f-display: "Frank Ruhl Libre", "Times New Roman", "David", serif;
  --f-body: "Assistant", "Segoe UI", "Arial Hebrew", system-ui, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", "SF Mono", monospace;

  --step--1: .8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.2rem + 1.9vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.3rem + 3.4vw, 3.9rem);
  --step-5: clamp(2.7rem, 1.4rem + 5vw, 5.6rem);
  --step-6: clamp(3.2rem, 1.2rem + 7.6vw, 8rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 1240px;
  --r-card: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  /* Motion: heavy, settling, never linear. */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.32, .72, 0, 1);
  color-scheme: light;
}
/* 200% zoom on a phone leaves about 160px: display type steps down so no
   single word is wider than the column. */
@media (max-width: 19.9em) {
  :root { --step-3: 1.5rem; --step-4: 1.75rem; --step-5: 2rem; --step-6: 2.25rem; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0F14; --bg-deep: #070A0E; --surface: #141922; --surface-2: #1C232E; --inset: #10151D;
    --ink: #E9EDF3; --ink-2: #A8B2C0; --ink-3: #8590A0; --ink-4: #59626F;
    --line: #232B37; --line-strong: #333D4C; --field-line: #6B7688;
    --brand: #79A6F7; --brand-hover: #93B8FA; --brand-edge: #4874C0; --brand-tint: #17233A; --brand-tint-2: #1F3355;
    --on-brand: #08152B; --flame: #E9A44A; --flame-tint: #2C2110;
    --shadow-rgb: 0, 0, 0; --shadow-a: .5; --phone-bezel: #05070A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C0F14; --bg-deep: #070A0E; --surface: #141922; --surface-2: #1C232E; --inset: #10151D;
  --ink: #E9EDF3; --ink-2: #A8B2C0; --ink-3: #8590A0; --ink-4: #59626F;
  --line: #232B37; --line-strong: #333D4C; --field-line: #6B7688;
  --brand: #79A6F7; --brand-hover: #93B8FA; --brand-edge: #4874C0; --brand-tint: #17233A; --brand-tint-2: #1F3355;
  --on-brand: #08152B; --flame: #E9A44A; --flame-tint: #2C2110;
  --shadow-rgb: 0, 0, 0; --shadow-a: .5; --phone-bezel: #05070A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--brand-tint-2); color: var(--ink); }

h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.06; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
h2 { font-size: var(--step-5); }
h3 { font-size: var(--step-2); line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; }
/* Frank Ruhl Libre sets a narrow word space; at display sizes words run together. */
h1, h2, h3 { word-spacing: .06em; }
/* Hebrew: no tracking (it reads as a rendering fault), and the glyphs run
   shorter than Latin at the same size (alef 597 units to H 660), so display
   Hebrew is set a step larger. */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; word-spacing: normal; }
[dir="rtl"] h2 { font-size: calc(var(--step-5) * 1.08); }
.he { font-family: var(--f-display); direction: rtl; unicode-bidi: isolate; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.lede { font-size: var(--step-1); color: var(--ink-2); max-width: 22.6em; line-height: 1.5; }
.eyebrow { font-size: var(--step--1); letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--brand); }
[dir="rtl"] .eyebrow { letter-spacing: .02em; }

.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--brand); color: var(--on-brand); padding: .6rem 1rem; border-radius: 999px; z-index: 100; text-decoration: none; }
.skip:focus { top: 1rem; }

/* ---- Buttons ------------------------------------------------------------
   The app's pill on its plinth: a 4pt block of the edge colour the face
   springs down onto. A trailing arrow sits in its own disc and leans forward
   on hover. */
.btn {
  display: inline-flex; align-items: center; gap: .7rem; white-space: nowrap;
  min-height: 52px; padding: .75rem 1.5rem; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 1.02rem; text-decoration: none; cursor: pointer;
  transition: transform .22s var(--ease-soft), box-shadow .22s var(--ease-soft), background-color .2s;
}
.btn:has(.btn-disc) { padding-inline-end: .45rem; }
.btn svg { width: 1.05em; height: 1.05em; }
.btn-disc {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); transition: transform .3s var(--ease-soft);
}
.btn:hover .btn-disc { transform: translateX(3px) scale(1.05); }
[dir="rtl"] .btn:hover .btn-disc { transform: translateX(-3px) scale(1.05); }
[dir="rtl"] .flip { transform: scaleX(-1); }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 4px 0 var(--brand-edge); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brand-edge); }
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-quiet:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.btn-quiet:active { transform: translateY(1px); }
/* On the paper sky: a pale face on a deep plinth. */
.btn-light { background: var(--on-sky); color: var(--paper-deep); box-shadow: 0 4px 0 #0A2450; }
.btn-light .btn-disc { background: rgba(15, 52, 112, .1); }
.btn-light:hover { background: #FFFFFF; }
.btn-light:active { transform: translateY(3px); box-shadow: 0 1px 0 #0A2450; }

.icon-btn { display: inline-grid; place-items: center; min-width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); padding-inline: .6rem; font-weight: 700; gap: .35rem; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.lang-btn { display: inline-flex; align-items: center; font-size: .95rem; }
.lang-btn [lang="he"] { font-family: var(--f-body); }

.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-family: var(--f-display); font-weight: 600; font-size: 1.28rem; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; }

/* ---- A phone around a real screenshot ----------------------------------- */
.phone {
  position: relative; width: min(100%, var(--pw, 300px)); aspect-ratio: 390 / 844;
  border-radius: 13.5% / 6.2%; padding: 2.4%;
  background: var(--phone-bezel);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .07) inset,
    0 1px 2px rgba(var(--shadow-rgb), calc(var(--shadow-a) * .6)),
    0 40px 80px -30px rgba(var(--shadow-rgb), calc(var(--shadow-a) * 2.4));
}
:where(.phone) picture, :where(.phone) > img { display: block; width: 100%; height: 100%; border-radius: 11.6% / 5.4%; overflow: hidden; background: var(--bg); }
:where(.phone) img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

@media (prefers-reduced-motion: reduce) {
  .btn, .btn-disc { transition: none; }
}

/* The metric-matched fallbacks (top of this file), on desktop widths only:
   after the :root tokens, so they win. */
@media (min-width: 48em) {
  :root {
    --f-display: "Frank Ruhl Libre", "Frank Ruhl Libre Fallback", "Times New Roman", "David", serif;
    --f-body: "Assistant", "Assistant Fallback", "Segoe UI", "Arial Hebrew", system-ui, sans-serif;
  }
}

/* ---- Legal links, on every page's footer (BRIEF 1.3) ---------------------
   Their own row under the rest, a step quieter than the content links but
   the same ink, so they read clearly (ink-2 is 7.6:1 on the ground). */
.foot-legal { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .45rem 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .9rem; }
.foot-legal a { color: var(--ink-2); text-decoration: none; }
.foot-legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-legal a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---- What the operator has not filled in yet (normal builds only) --------
   A {{TOKEN}} from site.config.json that is still empty: visible to the
   owner, and --release refuses to publish it. */
mark.ph {
  display: inline-block; padding: 0 .4em; border-radius: 6px;
  background: var(--brand-tint); color: var(--brand); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent);
  font-family: var(--f-mono); font-size: .8em; font-weight: 600; line-height: 1.55; letter-spacing: 0;
  overflow-wrap: anywhere; direction: ltr; unicode-bidi: isolate;
}
/* A link to a page this build does not have: the words stay, dotted. */
.ph-link { text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; }
