/* The public pages of lamdio.com (/, /students, /parents, /teachers, /schools, /math and the topic pages), made by
   backend/pages.py from site/content/ with site/templates/page.html. One small stylesheet, nothing else to load.
   Look: the Lamdio brand (navy + amber, petrol + coral in dark, the glass gradient), the same tokens as the app.
   The tokens are copied from styles.css; tests/test_pages.py checks they stay the same.
   Signature: the amber "answer dot" of the logo marks every section heading. Maths stays on one line, left to right. */

/* Heebo, from this site (backend/fonts.py), as in fonts.css. swap: text shows at once in the device's font. */
@font-face {
  font-family: "Heebo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/heebo-hebrew-5.3.0.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: "Heebo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/heebo-latin-5.3.0.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;
}

:root {
  --bg: #edf0f3;
  --surface: #ffffff;
  --ink: #15203b;
  --muted: #5a6579;
  --line: #d3d9e2;
  --line-strong: #7d8799;
  --accent: #17254a;
  --accent-strong: #0f1a38;
  --accent-soft: #e1e7f6;
  --on-accent: #ffffff;
  --mark: #d99a06;
  --mark-soft: #fbf1d3;
  --mark-ink: #7a5600;
  --focus: #17254a;
  --glass-bg: linear-gradient(160deg, #d3dbf0, #eceff6 60%, #f8ecd0);
  --mark-edge: solid;
  color-scheme: light;

  --font: "Heebo", system-ui, "Segoe UI", sans-serif;
  --wrap: 1160px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --r: 14px;
  --r-lg: 28px;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --bg: #111214;
    --surface: #1a1c1f;
    --ink: #ecf0f3;
    --muted: #a3abb8;
    --line: #2a2e34;
    --line-strong: #7a8290;
    --accent: #3aa6bf;
    --accent-strong: #5cc0d6;
    --accent-soft: #15303a;
    --on-accent: #06222b;
    --mark: #ff9b7a;
    --mark-soft: #3a241c;
    --mark-ink: #ffb59b;
    --focus: #ff9b7a;
    --glass-bg: linear-gradient(160deg, #172a30, #131416 60%, #261b17);
    --mark-edge: dashed;
    color-scheme: dark;
  }
}
@media screen {
  :root[data-mode="dark"] {
    --bg: #111214;
    --surface: #1a1c1f;
    --ink: #ecf0f3;
    --muted: #a3abb8;
    --line: #2a2e34;
    --line-strong: #7a8290;
    --accent: #3aa6bf;
    --accent-strong: #5cc0d6;
    --accent-soft: #15303a;
    --on-accent: #06222b;
    --mark: #ff9b7a;
    --mark-soft: #3a241c;
    --mark-ink: #ffb59b;
    --focus: #ff9b7a;
    --glass-bg: linear-gradient(160deg, #172a30, #131416 60%, #261b17);
    --mark-edge: dashed;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 17px; overflow-x: clip; scroll-padding-top: 8rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--ink); font: 400 1rem/1.7 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul, blockquote { margin: 0; }
a { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 30; background: var(--surface); color: var(--ink); padding: 0.7rem 1rem; border-radius: var(--r); }
.skip:focus { top: 0.75rem; }
h1, h2, h3 { text-wrap: balance; }
.nw { white-space: nowrap; }                     /* "מורה AI", "ו-1/2 = 3/6": never parted at a line end */

/* maths: one isolated left-to-right run, never split over two lines (as bdi.math in the app) */
bdi.math { display: inline-block; white-space: nowrap; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: bottom;
  font-weight: 600; font-variant-numeric: tabular-nums; scrollbar-width: thin; }

/* buttons: one filled, one outlined; 44px at least */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 44px; padding: 0.5rem 1.05rem;
  border-radius: 12px; border: 1.5px solid var(--line-strong); background: transparent; color: var(--ink);
  font: 600 0.95rem/1.2 var(--font); text-decoration: none; white-space: nowrap; transition: background-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--accent-soft); }
.btn:active { transform: translateY(2px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 3px 0 var(--accent-strong); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.primary:active { box-shadow: none; transform: translateY(3px); }
.btn.big { min-height: 54px; padding-inline: 1.7rem; font-size: 1.08rem; border-radius: 14px; }
.btn svg { flex: none; width: 1.15rem; height: 1.15rem; }

/* the top bar: sign up and log in in one corner, download in the other, the logo between; the menu below */
.bar { position: sticky; top: 0; z-index: 10; background: var(--bg); border-block-end: 1px solid var(--line); }
.bar-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem; min-height: 4.2rem; }
.auth { display: flex; gap: 0.5rem; justify-self: start; }
.get { justify-self: end; }
.logo { display: flex; align-items: center; min-height: 44px; color: var(--accent); line-height: 0; border-radius: 8px; }
.logo .lockup { display: block; width: auto; height: 2rem; }
.logo .tile { display: none; width: 2.3rem; height: 2.3rem; border-radius: 10px; }
.menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 0.25rem; padding-block-end: 0.35rem; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.8rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.menu a:hover { background: var(--accent-soft); }
.menu a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 3px; text-underline-offset: 0.45em; }

/* the opening: where you are, what the page is, one button */
.hero { margin-block: 1.25rem 0; background: var(--glass-bg); border-radius: var(--r-lg); padding: clamp(1.5rem, 5vw, 3.6rem); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.4rem; font-size: 0.92rem; color: var(--ink); margin-block-end: 0.9rem; }
.crumbs li + li::before { content: "‹"; margin-inline-end: 0.4rem; color: var(--ink); }
.crumbs a { color: var(--ink); display: inline-block; padding-block: 0.6rem; }
.crumbs [aria-current] { font-weight: 600; padding-block: 0.6rem; }
.hero h1 { font-weight: 800; font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.12; letter-spacing: -0.015em; max-width: 22ch; text-wrap: balance; overflow-wrap: break-word; }
.hero-cta { margin-block-start: 1.6rem; }

/* the text and, on a wide screen, a column beside it with the button and the related pages */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; margin-block: clamp(2.2rem, 5vw, 3.5rem); }
.side { position: sticky; top: 8.5rem; display: grid; gap: 1.5rem; }
.side-cta .btn { width: 100%; }

.prose { max-width: 42rem; font-size: 1.06rem; line-height: 1.8; }
.prose > p, .prose section > * + * { margin-block-start: 0.9rem; }
.prose > p:first-child { font-size: 1.2rem; line-height: 1.7; }
.prose section { margin-block-start: 2.6rem; }
.prose > section:first-child { margin-block-start: 0; }
.prose h2 { display: flex; align-items: baseline; gap: 0.6rem; font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 800; line-height: 1.3; }
.prose h2::before { content: ""; flex: none; width: 0.62rem; height: 0.62rem; border-radius: 50%; background: var(--mark); transform: translateY(-0.12em); }
.prose h3 { font-size: 1.18rem; font-weight: 700; line-height: 1.4; margin-block-start: 1.6rem; }
.prose a { color: var(--accent-strong); font-weight: 600; text-underline-offset: 0.2em; }
.prose a[dir="ltr"] { overflow-wrap: anywhere; font-weight: 500; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li + li { margin-block-start: 0.45rem; }
/* a list of links ("לאן ממשיכים"): each link is a full-height target */
.prose li > a:first-child { display: inline-flex; align-items: center; min-height: 44px; }
.prose ul li::marker { color: var(--mark-ink); }
.prose strong { font-weight: 700; }

/* numbered steps: a round number, the step beside it */
.prose ol { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 0.7rem; }
/* (not a grid: the text and the maths runs inside a step must stay one flowing line) */
.prose ol > li { counter-increment: step; position: relative; padding-inline-start: 2.75rem; min-height: 2rem; margin: 0; }
.prose ol > li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0.12rem; display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 0.95rem; line-height: 1; }

/* a worked example: its own card */
.prose section.example { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.2rem, 3.5vw, 1.9rem); }
/* an example told in labelled lines ("שאלה:", "הסבר:"): the label above its line */
.prose section.lines p > strong:first-child { display: block; font-size: 0.9rem; color: var(--mark-ink); }

/* "טעות נפוצה" and other notes: the amber box */
.prose blockquote { background: var(--mark-soft); border-inline-start: 4px var(--mark-edge) var(--mark); border-radius: var(--r); padding: 1rem 1.2rem; }
.prose blockquote p + p { margin-block-start: 0.6rem; }

/* questions and answers, always open */
.faq { margin-block-start: 2.6rem; display: grid; gap: 0.7rem; }
.faq h2 { margin-block-end: 0.4rem; }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.25rem; }
.qa h3 { margin: 0; font-size: 1.08rem; }
.qa p { margin-block-start: 0.35rem; }

/* related pages */
.related h2 { font-size: 1rem; font-weight: 700; margin-block-end: 0.4rem; }
.related ul { list-style: none; padding: 0; border-block-start: 1px solid var(--line); }
.related li { border-block-end: 1px solid var(--line); }
.related a { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; min-height: 48px; padding-block: 0.5rem;
  color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35; }
.related a::after { content: "←"; color: var(--mark-ink); }
.related a:hover { color: var(--accent-strong); text-decoration: underline; }

/* footer */
.foot { background: var(--surface); padding-block: 2rem 2.6rem; border-block-start: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 2rem; }
.links { display: flex; flex-wrap: wrap; gap: 0 0.4rem; }
.links a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.7rem; color: var(--ink); font-weight: 500; text-decoration: none; border-radius: 8px; }
.links a:hover { text-decoration: underline; }
.fine { color: var(--muted); font-size: 0.92rem; }

/* the button that stays at the bottom on a phone */
.cta-bar { display: none; }

/* the install how-to (frontend/install.js builds it, via landing.js) */
.install-sheet { width: min(420px, calc(100vw - 2rem)); border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem 1.2rem 1.1rem;
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgb(21 32 59 / 0.3); display: grid; gap: 1rem; font-family: var(--font); }
.install-sheet:not([open]) { display: none; }
.install-sheet::backdrop { background: rgb(21 32 59 / 0.45); }
.install-sheet-head { display: flex; align-items: center; gap: 0.75rem; }
.install-sheet-head img { border-radius: 12px; flex: none; }
.install-sheet-head h2 { font-size: 1.15rem; margin: 0; }
.install-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.install-steps li { display: flex; gap: 0.7rem; align-items: center; unicode-bidi: plaintext; }
.install-step-icon { flex: none; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); }
.install-step-icon svg { width: 1.2rem; height: 1.2rem; }
.install-note.warn { background: var(--mark-soft); border-radius: 10px; padding: 0.6rem 0.8rem; }
.install-sheet .btn { justify-self: stretch; min-height: 44px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; cursor: pointer; }
#toast { position: fixed; inset-inline: 1rem; bottom: 5.5rem; margin-inline: auto; max-width: 22rem; background: var(--ink); color: var(--bg);
  padding: 0.8rem 1rem; border-radius: 12px; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
#toast.on { opacity: 1; }

@media (max-width: 900px) {
  .bar { position: static; }                     /* a phone keeps its height for the text; the button below stays */
  html { scroll-padding-top: 1rem; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .side-cta { display: none; }
  /* hidden until the top button has scrolled out of view (landing.js adds .on); without JavaScript it stays hidden */
  .cta-bar { display: block; position: fixed; inset-inline: 0; bottom: 0; z-index: 10; background: var(--bg); border-block-start: 1px solid var(--line);
    padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom)); transform: translateY(110%); visibility: hidden;
    transition: transform 0.2s, visibility 0.2s; }
  .cta-bar.on { transform: none; visibility: visible; }
  .cta-bar .btn { width: 100%; min-height: 50px; }
  body { padding-block-end: 4.6rem; }
}
@media (max-width: 480px) {
  /* a narrow phone keeps both "הרשמה" and "התחברות" in their corner (Yakir, 6 Nov): smaller buttons, and "הורדה" shows
     only its icon (the word stays for screen readers) */
  .auth { gap: 0.35rem; }
  .bar .btn { padding-inline: 0.6rem; font-size: 0.88rem; }
  .get .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 560px) {
  .bar-in { gap: 0.4rem; min-height: 3.8rem; }
  .logo .lockup { display: none; }
  .logo .tile { display: block; }
  .btn { padding-inline: 0.75rem; font-size: 0.92rem; }
  .menu { gap: 0; justify-content: space-between; }
  .menu a { padding-inline: 0.45rem; font-size: 0.95rem; }
  .hero { margin-block-start: 0.75rem; border-radius: 20px; }
  .hero-cta .btn { width: 100%; }
  .prose { font-size: 1.03rem; }
  .side { top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, #toast, .cta-bar { transition: none; }
}
@media print {
  .bar, .cta-bar, .side, .foot, .hero-cta { display: none; }
}
