/* Ivrio — "Editorial Israel" (design/inspiration/DESIGN_DIRECTION.md).
   Paper, ink, one vermilion accent. Fraunces (display) + IBM Plex Sans (text) + Frank Ruhl Libre (Hebrew).
   All fonts self-hosted (no font CDN, CNIL). Square edges, hairline rules, no shadows, no gradients. */

@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-latin-vf.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-latin-vf-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/plex-sans-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/plex-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/plex-sans-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/plex-sans-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Frank Ruhl Libre"; src: url("/assets/fonts/frank-ruhl-hebrew-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Frank Ruhl Libre"; src: url("/assets/fonts/frank-ruhl-hebrew-500.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Frank Ruhl Libre"; src: url("/assets/fonts/frank-ruhl-latin-500.woff2") format("woff2"); font-weight: 400 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --paper: #F6F4EF;
  --ink: #151515;
  --muted: #4A453E;
  --rule: #E3DED6;
  --rule-strong: #151515;
  --accent: #C73E12;      /* vermilion: actions + the one italic word */
  --wrong: #A32018;       /* correction underline */
  --right: #1F6B3A;       /* confirmed form */
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --text: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --hebrew: "Frank Ruhl Libre", "Times New Roman", serif;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Hebrew: always its own face and direction */
[lang="he"] { font-family: var(--hebrew); font-feature-settings: normal; letter-spacing: 0; }

/* ---------- Masthead ---------- */
.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 22px 0 18px; border-bottom: 1px solid var(--rule-strong); }
.wordmark { font: 600 1.6rem/1 var(--display); font-optical-sizing: auto; letter-spacing: -0.02em; text-decoration: none; }
.wordmark:hover { color: var(--ink); }
.masthead nav { display: flex; gap: 22px; font-size: 0.9375rem; }
.masthead nav a { text-decoration: none; }
.masthead nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.masthead .tagline { display: none; color: var(--muted); font-size: 0.9375rem; }
@media (min-width: 900px) { .masthead .tagline { display: block; margin-right: auto; padding-left: 28px; } }

/* ---------- Hero ---------- */
.hero { display: grid; gap: 28px; padding: 36px 0 64px; grid-template-areas: "text" "photo" "form"; }
.hero-text { grid-area: text; }
.hero-photo { grid-area: photo; }
.hero-form { grid-area: form; }
h1 {
  font: 500 clamp(2.5rem, 7.2vw, 5.4rem)/1.0 var(--display);
  font-optical-sizing: auto;
  letter-spacing: -0.025em;
  margin: 0 0 22px;
  max-width: 13ch;
  text-wrap: balance;
}
h1 em, h2 em { font-style: italic; color: var(--accent); font-weight: 450; }
.lead { font-size: 1.1875rem; line-height: 1.55; max-width: 34em; margin: 0; }
.availability { margin: 18px 0 0; color: var(--muted); font-size: 0.9375rem; }
.availability strong { color: var(--ink); font-weight: 500; }

@media (min-width: 960px) {
  .hero {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: none;
    column-gap: 24px;
    row-gap: 40px;
    padding: 64px 0 96px;
  }
  .hero-text { grid-column: 1 / span 6; grid-row: 1; align-self: end; }
  .hero-form { grid-column: 1 / span 5; grid-row: 2; align-self: start; }
  .hero-photo { grid-column: 8 / span 5; grid-row: 1 / span 2; }
}

/* The photograph with the exchange typeset on it (not a chat widget) */
.plate { position: relative; margin: 0; }
.plate img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 35%; }
.exchange {
  position: relative;
  margin: -64px 0 0 auto;
  width: min(92%, 440px);
  background: var(--paper);
  padding: 20px 22px 18px;
  border-top: 3px solid var(--ink);
}
@media (min-width: 960px) { .exchange { position: absolute; left: -96px; bottom: 40px; margin: 0; width: 420px; } }
.exchange .scene { font: italic 400 0.9375rem/1.3 var(--display); color: var(--muted); margin: 0 0 12px; }
.exchange .line { margin: 0 0 12px; }
.exchange .line:last-of-type { margin-bottom: 0; }
.exchange .who { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px; }
.exchange [lang="he"] { display: block; font-size: 1.5rem; line-height: 1.45; font-weight: 500; }
.exchange .tr { display: block; font-style: italic; font-size: 0.9375rem; color: var(--muted); }
.exchange .gloss { display: block; font-size: 0.9375rem; margin-top: 6px; }
.exchange .tutor { padding-top: 12px; border-top: 1px solid var(--rule); }
.wrong { text-decoration: underline wavy var(--wrong); text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.right { color: var(--right); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.credit { font-size: 0.75rem; color: var(--muted); margin: 8px 0 0; }
.credit a { color: inherit; }

/* ---------- Waitlist form ---------- */
form.waitlist { max-width: 520px; }
.field { display: flex; gap: 0; border: 1.5px solid var(--ink); background: #fff; }
.field input[type="email"] { flex: 1; min-width: 0; border: 0; padding: 15px 16px; font: inherit; font-size: 1rem; background: transparent; color: var(--ink); }
.field input[type="email"]:focus { outline: none; }
.field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.field button { border: 0; background: var(--ink); color: var(--paper); font: 500 1rem/1 var(--text); padding: 0 22px; cursor: pointer; }
.field button:hover, .field button:focus-visible { background: var(--accent); }
.field button[disabled] { opacity: 0.6; cursor: wait; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 0.875rem; color: var(--muted); }
.consent input { margin-top: 3px; accent-color: var(--ink); width: 16px; height: 16px; flex: none; }
form .status { min-height: 1.5em; margin: 10px 0 0; font-size: 0.9375rem; }
form .status.ok { color: var(--right); font-weight: 500; }
form .status.err { color: var(--wrong); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.label-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Numbered sections ---------- */
.section { padding: 72px 0; border-top: 1px solid var(--rule-strong); }
.section-head { display: grid; gap: 10px 24px; margin-bottom: 40px; }
.section-no { font: 400 1rem/1 var(--display); font-variant-numeric: lining-nums; color: var(--accent); }
.section-no span { color: var(--muted); font-style: italic; margin-left: 10px; }
h2 { font: 500 clamp(2rem, 4.4vw, 3.4rem)/1.04 var(--display); font-optical-sizing: auto; letter-spacing: -0.02em; margin: 0; max-width: 18ch; text-wrap: balance; }
h3 { font: 600 1.0625rem/1.35 var(--text); margin: 0 0 8px; }
.body p { margin: 0 0 1em; max-width: 36em; }
.body p:last-child { margin-bottom: 0; }
@media (min-width: 960px) {
  .section { padding: 104px 0; }
  .section-head { grid-template-columns: repeat(12, 1fr); align-items: baseline; margin-bottom: 56px; }
  .section-no { grid-column: 1 / span 2; }
  .section-head h2 { grid-column: 3 / span 9; }
}

/* Split: photo and text, alternating sides */
.split { display: grid; gap: 28px; }
.split figure { margin: 0; }
@media (min-width: 960px) {
  .split { grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start; }
  .split .body { grid-column: 3 / span 4; padding-top: 6px; }
  .split figure { grid-column: 8 / span 5; }
  .split.flip .body { grid-column: 8 / span 4; grid-row: 1; }
  .split.flip figure { grid-column: 1 / span 6; grid-row: 1; }
}

/* Memory: a mistake, then the same sentence days later */
.ledger { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.ledger li { display: grid; gap: 6px 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.ledger .when { font: italic 400 1rem/1.3 var(--display); color: var(--muted); }
.ledger [lang="he"] { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.4; font-weight: 500; }
.ledger .tr { font-style: italic; color: var(--muted); font-size: 0.9375rem; }
.ledger .note { font-size: 0.9375rem; }
@media (min-width: 960px) {
  .memory { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
  .memory .body { grid-column: 3 / span 4; }
  .memory .ledger { grid-column: 7 / span 6; }
  .ledger li { grid-template-columns: 9rem 1fr; }
  .ledger li > :not(.when) { grid-column: 2; }
  .ledger .when { grid-row: 1 / span 2; }
}

/* Path: numbered steps, set as text */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 3rem 1fr; gap: 0 16px; padding: 18px 0; border-top: 1px solid var(--rule); }
.steps li::before { content: counter(step, decimal-leading-zero); font: 400 1.25rem/1.4 var(--display); color: var(--accent); }
.steps li p { margin: 0; color: var(--muted); grid-column: 2; }
@media (min-width: 960px) {
  .path { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
  .path .body { grid-column: 3 / span 4; }
  .path .steps { grid-column: 7 / span 6; }
}

/* Situations: a photo strip (one large, two stacked) + the index */
.stills { display: grid; gap: 16px; margin-bottom: 56px; }
.stills figure { margin: 0; }
.stills img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.stills figcaption { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; font-size: 0.875rem; }
.stills figcaption strong { font: italic 500 1.0625rem/1.3 var(--display); }
.stills figcaption span { color: var(--muted); font-size: 0.75rem; text-align: right; }
@media (min-width: 960px) {
  .stills { grid-template-columns: repeat(12, 1fr); column-gap: 24px; row-gap: 24px; }
  .stills .big { grid-column: 1 / span 7; grid-row: 1 / span 2; }
  .stills .big img { aspect-ratio: 4 / 3; }
  .stills .small { grid-column: 8 / span 5; }
}
.index { margin: 0; padding: 0; list-style: none; columns: 1; column-gap: 24px; border-top: 1px solid var(--ink); }
.index li { break-inside: avoid; display: flex; gap: 18px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); font: 400 1.25rem/1.3 var(--display); }
.index li::before { content: attr(data-n); font: 400 0.8125rem/1 var(--text); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.5em; }
@media (min-width: 720px) { .index { columns: 2; } }
@media (min-width: 1100px) { .index { columns: 3; } }
.index-note { margin: 18px 0 0; color: var(--muted); font-size: 0.9375rem; }

/* Audiences: three short text columns, no boxes */
.audiences { display: grid; gap: 32px; }
.audiences > div { border-top: 1px solid var(--ink); padding-top: 16px; }
.audiences h3 { font: 500 1.5rem/1.2 var(--display); margin-bottom: 10px; }
.audiences p { margin: 0; color: var(--muted); max-width: 30em; }
@media (min-width: 960px) { .audiences { grid-template-columns: repeat(12, 1fr); column-gap: 24px; } .audiences > div:nth-child(1) { grid-column: 3 / span 3; } .audiences > div:nth-child(2) { grid-column: 6 / span 3; } .audiences > div:nth-child(3) { grid-column: 9 / span 3; } }

/* Coming next: a quiet definition list */
.later { display: grid; gap: 0 24px; margin: 0; }
.later div { padding: 16px 0; border-top: 1px solid var(--rule); }
.later dt { font-weight: 600; margin-bottom: 4px; }
.later dd { margin: 0; color: var(--muted); }
@media (min-width: 960px) { .later { grid-template-columns: repeat(12, 1fr); } .later div:nth-child(odd) { grid-column: 3 / span 5; } .later div:nth-child(even) { grid-column: 8 / span 5; } }

/* Closing: a flat ink band */
.closing { background: var(--ink); color: var(--paper); padding: 80px 0 88px; }
.closing h2 { color: var(--paper); max-width: 16ch; margin-bottom: 18px; }
.closing p { color: #CFC9BF; max-width: 34em; margin: 0 0 28px; }
.closing .field { border-color: var(--paper); background: var(--ink); }
.closing .field input[type="email"] { color: var(--paper); }
.closing .field input::placeholder { color: #A8A296; }
.closing .field button { background: var(--accent); color: #fff; }
.closing .field button:hover, .closing .field button:focus-visible { background: var(--paper); color: var(--ink); }
.closing .consent { color: #CFC9BF; }
.closing .consent a { color: var(--paper); }
.closing .consent input { accent-color: var(--accent); }
.closing form .status.ok { color: #9FD3AE; }
.closing form .status.err { color: #F2A08C; }
.closing :focus-visible { outline-color: #F2A08C; }
@media (min-width: 960px) { .closing-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; } .closing-grid > * { grid-column: 3 / span 7; } }

/* ---------- Footer ---------- */
footer.colophon { padding: 32px 0 48px; font-size: 0.8125rem; color: var(--muted); display: grid; gap: 10px; }
footer.colophon nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.9375rem; color: var(--ink); }
footer.colophon p { margin: 0; max-width: 60em; }

/* ---------- Text pages (privacy, 404) ---------- */
.prose { max-width: 42rem; padding: 56px 0 80px; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); max-width: none; }
.prose h2 { font: 600 1.125rem/1.35 var(--text); margin: 36px 0 8px; max-width: none; }
.prose p, .prose li { max-width: 38em; }
.draft { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; color: var(--muted); font-size: 0.9375rem; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .waitlist, .closing { display: none; } }
