/* Milon public homepage (milon.sovintel.co, signed out).
   Layout B (split), centrepiece i (the mem with its dictionary gloss), theme follows the system.
   Tokens are copied from lingua/static/style.css + ambient.css (pomegranate palette); this file
   must not depend on /static, which is closed to signed-out visitors. */

@font-face { font-family: "Rubik"; src: url("fonts/Rubik-Variable.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("fonts/Rubik-Italic-Variable.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Frank Ruhl Libre"; src: url("fonts/FrankRuhlLibre-Variable.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --page: #f3ede1; --surface: #fbf8f1; --surface-2: #f1eadd; --border: #e2d8c5; --border-strong: #c7b9a0;
  --text: #221d18; --text-2: #4d443a; --muted: #685d4f;
  --brand: #951b56; --brand-hover: #7c1446; --brand-ink: #8e1a52; --brand-soft: #f5e2e9; --on-brand: #fff8f2;
  --focus: #951b56; --hero: #951b56; --on-hero: #fff8f2; --on-hero-2: #f6d9e5;
  --danger: #a93c06; --danger-soft: #f9e2d4;
  --warn: #8a5a00; --warn-soft: #fbedc9;
  --pat-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Crect x='3' y='3' width='66' height='66' fill='none' stroke='%23000' stroke-width='.9' stroke-opacity='.7'/%3E%3Crect x='8.5' y='8.5' width='55' height='55' fill='none' stroke='%23000' stroke-width='.6' stroke-opacity='.45'/%3E%3Cpath d='M38.2 36Q41.89 39.1 46.4 36Q41.89 32.9 38.2 36ZM37.56 37.56Q37.97 42.36 43.35 43.35Q42.36 37.970 37.56 37.56ZM36 38.2Q32.9 41.89 36 46.4Q39.1 41.89 36 38.2ZM34.44 37.56Q29.64 37.97 28.65 43.35Q34.03 42.36 34.44 37.56ZM33.8 36Q30.11 32.9 25.6 36Q30.11 39.1 33.8 36ZM34.44 34.44Q34.03 29.64 28.65 28.65Q29.64 34.03 34.44 34.44ZM36 33.8Q39.1 30.11 36 25.6Q32.9 30.11 36 33.8ZM37.56 34.44Q42.36 34.03 43.35 28.65Q37.97 29.64 37.56 34.44Z' fill-opacity='.8'/%3E%3Cpath d='M37.39 36.57Q38.6 38.81 41.45 38.26Q39.83 35.85 37.39 36.57ZM36.57 37.39Q35.85 39.83 38.26 41.45Q38.81 38.6 36.57 37.39ZM35.43 37.39Q33.19 38.6 33.74 41.45Q36.15 39.83 35.43 37.39ZM34.61 36.57Q32.17 35.85 30.55 38.26Q33.4 38.81 34.61 36.57ZM34.61 35.43Q33.4 33.19 30.55 33.74Q32.17 36.15 34.61 35.43ZM35.43 34.61Q36.15 32.17 33.74 30.55Q33.19 33.4 35.43 34.61ZM36.57 34.61Q38.81 33.4 38.26 30.55Q35.85 32.17 36.57 34.61ZM37.39 35.43Q39.830 36.15 41.45 33.74Q38.6 33.19 37.39 35.43Z' fill-opacity='.5'/%3E%3Ccircle cx='36.0' cy='36.0' r='1.8'/%3E%3C/svg%3E");
  --pat-ink: color-mix(in srgb, var(--text) 82%, var(--brand));
  --pat-a: 11%;
  --hero-pat-a: 16%;
  --font-ui: "Rubik", "Noto Sans", "DejaVu Sans", system-ui, sans-serif;
  --font-he: "Frank Ruhl Libre", "Noto Serif Hebrew", "David Libre", serif;
  --r-lg: 22px; --r-md: 12px; --r-sm: 8px;
  --gutter: clamp(32px, 6vw, 88px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #15120e; --surface: #1f1b16; --surface-2: #28231c; --border: #3a3229; --border-strong: #5a4e40;
    --text: #f2eadc; --text-2: #d3c7b4; --muted: #ab9e8a;
    --brand: #e46ba6; --brand-hover: #ee86b7; --brand-ink: #f08fbc; --brand-soft: #3a1c2a; --on-brand: #1d0a13;
    --focus: #f08fbc; --hero: #6e1d45; --on-hero: #fdeef4; --on-hero-2: #f1c6d9;
    --danger: #f0954a; --danger-soft: #3b2213;
    --warn: #f2c66a; --warn-soft: #3a2c10;
    --pat-ink: color-mix(in srgb, var(--text) 45%, #d6a861);
    --pat-a: 13%; --hero-pat-a: 20%;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--page); color: var(--text);
  font: 400 1rem/1.55 var(--font-ui); overflow-x: hidden;
}
a { color: var(--brand-ink); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[lang="he"] { font-family: var(--font-he); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* The rosette: a tile used only as a mask over an ink colour, as in ambient.css */
.pattern { position: absolute; inset: 0; pointer-events: none;
  background-color: color-mix(in srgb, var(--pat-ink) var(--pat-a), transparent);
  -webkit-mask: var(--pat-tile) 0 0 / 72px 72px repeat; mask: var(--pat-tile) 0 0 / 72px 72px repeat; }

/* ---------- Layout: split screen, a pomegranate stage, the door on the right ---------- */
.home { display: grid; min-height: 100vh; min-height: 100dvh;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas: "stage panel" "stage features" "stage foot";
  grid-template-rows: 1fr auto auto; }

.brand { grid-area: stage; align-self: start; justify-self: start; z-index: 2; margin: 44px 0 0 48px;
  display: inline-flex; color: var(--on-hero); text-decoration: none; --brand: var(--on-hero-2); }
.brand:hover { color: var(--on-hero); }
.brand:focus-visible { outline-color: var(--on-hero); }
.brand .word { display: block; width: 104px; height: 29px; margin-top: 4px; }

.stage { grid-area: stage; position: relative; overflow: hidden; background: var(--hero); color: var(--on-hero);
  display: flex; align-items: center; justify-content: center; padding: 96px 48px 64px; }
.stage .pattern { --pat-ink: var(--on-hero); --pat-a: var(--hero-pat-a);
  -webkit-mask: var(--pat-tile) 0 0 / 72px 72px repeat, radial-gradient(ellipse 55% 45% at 50% 50%, rgb(0 0 0 / .08), rgb(0 0 0 / .5) 55%, #000 90%);
  -webkit-mask-composite: source-in;
  mask: var(--pat-tile) 0 0 / 72px 72px repeat, radial-gradient(ellipse 55% 45% at 50% 50%, rgb(0 0 0 / .08), rgb(0 0 0 / .5) 55%, #000 90%);
  mask-composite: intersect; }
.stage::after { content: ""; position: absolute; inset: 18px; border: 1px solid color-mix(in srgb, var(--on-hero) 30%, transparent);
  border-radius: 6px; pointer-events: none; }

/* The mem, large, with its dictionary entry beneath */
.centre { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin: 0; }
.mem { display: block; height: clamp(150px, 44vh, 420px); width: auto; max-width: 32vw; aspect-ratio: 573 / 667;
  color: var(--on-hero); filter: drop-shadow(0 30px 40px rgb(0 0 0 / .25)); }
.entry { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: clamp(14px, 3vh, 32px); }
.rule { width: 56px; height: 1.5px; background: color-mix(in srgb, var(--on-hero) 55%, transparent); margin: 6px 0 14px; }
.gloss { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 14px; margin: 0;
  color: var(--on-hero); font-size: 1.15rem; }
.gloss .tr { font-style: italic; font-weight: 500; letter-spacing: .02em; }
.gloss .pos { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.gloss .mean { font-weight: 600; }
.gloss .pos, .gloss .from { color: var(--on-hero-2); }
/* Niqqud sits below the baseline: give the Hebrew its own line box so nothing clips */
.gloss .from [lang="he"] { font-size: 1.2em; line-height: 1.6; display: inline-block; padding-bottom: .05em; }

/* The door */
.panel { grid-area: panel; align-self: end; display: flex; flex-direction: column; gap: 22px;
  padding: 120px var(--gutter) 40px; max-width: 620px; }
.beta { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .75rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brand-ink); }
.beta::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
h1 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.12; text-wrap: balance;
  font-size: clamp(2rem, 1.2rem + 2.4vw, 3.1rem); }
.lede { margin: 0; color: var(--text-2); text-wrap: pretty; font-size: 1.08rem; max-width: 40ch; }

/* Access-code form */
.signin { display: grid; gap: 8px; width: 100%; }
.signin label { font-weight: 600; font-size: .9rem; }
.signin .hint { margin: 0; font-size: .82rem; color: var(--muted); }
.field { display: flex; gap: 8px; }
.field input {
  flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 500 1.0625rem/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: .035em;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--muted); opacity: 1; letter-spacing: .035em; }
.field input:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border-strong)); }
.field input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.btn {
  flex: none; height: 52px; padding: 0 22px; border: 0; border-radius: var(--r-md); cursor: pointer;
  background: var(--brand); color: var(--on-brand); font: 600 1rem/1 var(--font-ui); letter-spacing: .01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--brand-hover); }
.btn:active { transform: translateY(1px); }
.btn[aria-busy="true"] { cursor: progress; opacity: .8; }
.btn svg { width: 18px; height: 18px; }
.msg { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); font-size: .9rem; color: var(--text); }
.msg:empty { display: none; }
.msg[data-kind="error"] { background: var(--danger-soft); border-left: 3px solid var(--danger); }
.msg[data-kind="wait"] { background: var(--warn-soft); border-left: 3px solid var(--warn); }

/* Features */
.features { grid-area: features; margin: 0 var(--gutter); padding: 28px 0 36px; max-width: 620px; border-top: 1px solid var(--border); }
.features-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.feat { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: start; align-content: start; }
.feat .num { grid-row: span 2; font-family: var(--font-he); font-weight: 700; font-size: 2rem; line-height: 1.1;
  color: var(--brand-ink); width: 1.4em; text-align: center; }
.feat h3 { margin: 4px 0 0; font-size: 1rem; font-weight: 600; letter-spacing: -.005em; }
.feat p { margin: 0; color: var(--text-2); font-size: .92rem; line-height: 1.5; }

.foot { grid-area: foot; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: .85rem;
  color: var(--muted); padding: 0 var(--gutter) 40px; }
.foot a { color: var(--text-2); }

/* ---------- Phone and narrow tablet: stacked ---------- */
@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; grid-template-areas: "stage" "panel" "features" "foot"; grid-template-rows: auto; }
  .stage { min-height: 300px; padding: 72px 16px 36px; }
  .stage::after { inset: 10px; }
  .brand { margin: 26px 0 0 26px; }
  .brand .word { width: 84px; height: 24px; }
  .mem { width: 150px; height: auto; max-width: none; }
  .gloss { font-size: 1rem; }
  .panel { padding: 30px 16px 26px; max-width: none; gap: 16px; }
  .features { margin: 0 16px; padding: 22px 0 26px; max-width: none; }
  .features-list { gap: 16px; }
  .foot { padding: 0 16px 28px; }
}
/* Phones, and the narrow split (861-1100px) where a 24-character code would not fit beside the button */
@media (max-width: 420px), (min-width: 861px) and (max-width: 1100px) {
  .field { flex-direction: column; }
}

/* ---------- Short laptop screens (1280x580 / 1366x650 CSS px at 150 %): one screen, no scroll ---------- */
@media (min-width: 861px) and (max-height: 820px) {
  .stage { padding: 64px 40px 36px; }
  .stage::after { inset: 14px; }
  .brand { margin: 30px 0 0 38px; }
  .brand .word { width: 92px; height: 26px; }
  .mem { height: clamp(150px, 41vh, 330px); }
  .entry { margin-top: 2.2vh; }
  .gloss { font-size: 1.02rem; }
  .rule { margin: 4px 0 10px; }
  .panel { gap: 12px; padding: 30px clamp(32px, 4.5vw, 64px) 16px; max-width: 680px; }
  .beta { font-size: .7rem; }
  h1 { font-size: clamp(1.75rem, .9rem + 3vh, 2.5rem); }
  .lede { font-size: 1rem; line-height: 1.5; max-width: 56ch; }
  .signin { gap: 6px; }
  .signin label { font-size: .85rem; }
  .field input, .btn { height: 46px; }
  .signin .hint { font-size: .78rem; }
  .features-list { gap: 10px; }
  .features { padding: 14px 0 16px; margin: 0 clamp(32px, 4.5vw, 64px); max-width: none; }
  .feat { gap: 0 12px; }
  .feat .num { font-size: 1.45rem; }
  .feat h3 { margin: 0; font-size: .95rem; }
  .feat p { font-size: .85rem; line-height: 1.4; }
  .foot { padding: 0 clamp(32px, 4.5vw, 64px) 18px; font-size: .8rem; }
}

/* ---------- Very wide screens: keep the door from drifting ---------- */
@media (min-width: 1600px) {
  .panel, .features, .foot { max-width: 680px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* =====================================================================
   Privacy notice (privacy.html)
   ===================================================================== */
.doc-top { background: var(--hero); color: var(--on-hero); position: relative; overflow: hidden; }
.doc-top .pattern { --pat-ink: var(--on-hero); --pat-a: var(--hero-pat-a); }
.doc-top .inner { position: relative; max-width: 760px; margin: 0 auto; padding: 22px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.doc-top .brand { margin: 0; }
.doc-top .back { color: var(--on-hero); font-size: .9rem; font-weight: 500; }
.doc-top .back:hover { color: var(--on-hero-2); }
.doc-top .back:focus-visible { outline-color: var(--on-hero); }
.doc { max-width: 760px; margin: 0 auto; padding: 36px 16px 64px; }
.doc h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.5rem); margin-bottom: 6px; }
.doc .meta { margin: 0 0 22px; color: var(--muted); font-size: .9rem; }
.doc h2 { font-size: 1.2rem; font-weight: 600; margin: 34px 0 10px; letter-spacing: -.005em; }
.doc p, .doc li { color: var(--text-2); }
.doc strong { color: var(--text); font-weight: 600; }
.doc ul { padding-left: 1.25em; }
.doc li + li { margin-top: 4px; }
.doc .callout { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--r-sm); padding: 12px 14px; }
.draft { background: var(--warn-soft); border: 1.5px dashed var(--warn); border-radius: var(--r-md); padding: 12px 14px; margin: 0 0 26px; font-size: .92rem; color: var(--text); }
.tbc { background: var(--warn-soft); color: var(--text); border: 1px dashed var(--warn); border-radius: 4px; padding: 0 4px; font-style: normal; font-size: .92em; }
.tbc::before { content: "To confirm: "; font-weight: 600; }
.table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.doc table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.doc tr:last-child td { border-bottom: 0; }
.doc th { color: var(--text); font-weight: 600; background: var(--surface-2); }
.doc a { overflow-wrap: anywhere; }

/* ---------- iPhone / iPad: "Add to Home Screen" tip (home.js shows it on iOS Safari only) ---------- */
.a2hs[hidden] { display: none; }
.a2hs { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  padding: 14px 52px 14px 14px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: inset 3px 0 0 var(--brand); font-size: .9rem; color: var(--text-2); }
.a2hs-icon { width: 44px; height: 44px; border-radius: 10px; display: block;
  box-shadow: 0 1px 2px rgb(0 0 0 / .18); }
.a2hs-title { margin: 1px 0 6px; font-size: .98rem; font-weight: 600; color: var(--text); letter-spacing: -.005em; line-height: 1.3; }
.a2hs-steps { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; line-height: 1.45; }
.a2hs-steps li::marker { color: var(--brand-ink); font-weight: 600; }
.a2hs-steps strong { color: var(--text); font-weight: 600; }
.a2hs-share { width: 1.25em; height: 1.25em; vertical-align: -.25em; color: var(--brand-ink); margin: 0 1px; }
.a2hs-more { display: inline-block; padding: 0 5px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text); font-size: .8em; letter-spacing: .08em; line-height: 1.5; }
.a2hs-note { margin: 8px 0 0; font-size: .84rem; color: var(--muted); line-height: 1.45; }
.a2hs-close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.a2hs-close:hover { background: var(--surface-2); color: var(--text); }
.a2hs-close svg { width: 18px; height: 18px; }
.demo-link { color: var(--brand-ink); font-weight: 600; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.demo-link svg { width: 15px; height: 15px; transition: transform .15s ease; }
.demo-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.demo-link:hover svg { transform: translateX(2px); }
.demo-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 3px; }
.signin .demo-row { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--border); text-align: center; font-size: .9rem; color: var(--text-2); }
