/* Public home page (web/public/home.html): days to the NMT, a live task, three subject cards,
   pictures of the cabinet. Every class starts with home- so it cannot meet an app component. */

/* ---- Hero ---- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem); gap: clamp(var(--space-8), 5vw, var(--space-16)); align-items: start; padding-block: clamp(var(--space-12), 6vw, var(--space-16)) clamp(var(--space-12), 5vw, var(--space-16)); }
.home-hero h1 { margin: 0; font-size: var(--public-title); font-weight: var(--head-weight); letter-spacing: var(--head-track); line-height: var(--leading-display); text-wrap: balance; }
.home-days { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-date { margin: var(--space-4) 0 0; color: var(--muted); font-size: var(--text-subhead); }
.home-lead { max-width: 33em; margin: var(--space-6) 0 0; font-size: clamp(var(--text-body), 1.5vw, var(--text-title3)); line-height: var(--leading-read); }
.home-lead b { font-weight: 650; white-space: nowrap; }
.home-facts { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); margin: var(--space-6) 0 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--text-subhead); }
.home-facts li { display: inline-flex; gap: var(--space-2); align-items: center; }
.home-facts li::before { content: ""; flex: none; width: .45rem; height: .45rem; border-radius: 50%; background: var(--know); }
.home-hero .hero-actions { display: flex; gap: var(--space-6); align-items: center; flex-wrap: wrap; margin-top: var(--space-8); }

/* ---- Live task: the app's exercise engine (static/app/ui/exercise.js) on the page ---- */
.home-live { display: grid; gap: var(--space-4); min-width: 0; }
/* Until KaTeX has drawn a formula its TeX source is one long word: let it wrap, not widen the page. */
.home-live-card { min-width: 0; overflow-wrap: anywhere; }
.home-live-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.home-live-head h2 { margin: 0; font-size: var(--text-callout); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.home-live .seg button { font-size: var(--text-subhead); padding-inline: var(--space-4); white-space: nowrap; }
.home-live .seg button::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: var(--space-2); border-radius: 50%; background: var(--tone); vertical-align: .08em; }
.home-live [data-value="history"], .home-live-card[data-course="history"] { --tone: var(--subject-history); }
.home-live [data-value="ukr"], .home-live-card[data-course="ukr"] { --tone: var(--subject-ukr); }
.home-live [data-value="math"], .home-live-card[data-course="math"] { --tone: var(--subject-math); }
.home-live-card { display: grid; gap: var(--space-4); padding: var(--space-6) var(--space-6) var(--space-6); border-radius: var(--radius-study); background: var(--paper); box-shadow: var(--shadow); border: 1px solid var(--card-border); }
.home-live-source { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--muted); font-size: var(--text-footnote); }
.home-live-source::before { content: ""; flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--tone); }
.home-live-source span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-live-card .type-card { padding: 0; box-shadow: none; background: none; text-align: left; border-radius: 0; }
.home-live-card .type-card legend { font-size: var(--text-body); font-weight: 600; line-height: var(--leading-body); }
.home-live-review { display: grid; gap: var(--space-3); }
.home-live-review:focus { outline: none; }
.home-live-review .exam-feedback { display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-4); border-radius: var(--radius-group); background: var(--fill); white-space: pre-line; }
.home-live-review .exam-feedback p { margin: 0; }
.home-live-more { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.home-live-note { margin: 0; color: var(--muted); font-size: var(--text-subhead); }

/* ---- Sections ---- */
.home-section { border-top: 1px solid var(--line); padding-block: clamp(var(--space-12), 5vw, var(--space-16)); }
.home-section > h2 { margin: 0; max-width: 20em; font-size: clamp(var(--text-title1), 3.2vw, var(--text-display)); font-weight: var(--head-weight); letter-spacing: var(--head-track); line-height: var(--leading-display); text-wrap: balance; }
.home-sub { margin: var(--space-3) 0 0; max-width: 38em; color: var(--muted); font-size: var(--text-body); }

/* ---- Subjects: different cards, each with a piece of its course ---- */
.home-courses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-8); }
.home-course { --tone: var(--accent); display: grid; gap: var(--space-4); align-content: start; padding: clamp(var(--space-6), 2.4vw, var(--space-8)); border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); color: var(--fg); text-decoration: none; transition: transform .2s var(--ease-out); }
.home-course:hover { border-color: var(--tone); }
.home-course:active { transform: scale(var(--press-scale)); transition-duration: var(--press-in); }
.home-course-history { --tone: var(--subject-history); grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: center; gap: var(--space-4) var(--space-12); }
.home-course-ukr { --tone: var(--subject-ukr); }
.home-course-math { --tone: var(--subject-math); }
.home-course h3 { margin: 0; font-size: var(--text-title2); letter-spacing: var(--head-track); }
.home-course-text { display: grid; gap: var(--space-2); }
.home-course-text p { margin: 0; color: var(--muted); }
.home-course-text .home-course-stats { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin-top: var(--space-1); color: var(--fg); font-size: var(--text-subhead); font-weight: 600; font-variant-numeric: tabular-nums; }
.home-course-link { color: var(--accent); font-weight: 600; font-size: var(--text-subhead); }
.home-course-sample { margin: 0; padding: var(--space-4) var(--space-4); border-radius: var(--radius-group); background: color-mix(in srgb, var(--tone) 9%, var(--surface)); }
.home-timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; position: relative; }
.home-timeline::before { content: ""; position: absolute; left: 0; right: 0; top: .4rem; height: 2px; background: color-mix(in srgb, var(--tone) 45%, transparent); }
.home-timeline li { position: relative; display: grid; gap: var(--space-1); padding-top: var(--space-6); padding-right: var(--space-2); }
.home-timeline li::before { content: ""; position: absolute; top: 0; left: 0; width: .85rem; height: .85rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--tone); box-sizing: border-box; }
.home-timeline li:last-child::before { background: var(--tone); }
.home-timeline b { font-weight: 650; }
.home-timeline span { color: var(--muted); font-size: var(--text-footnote); font-variant-numeric: tabular-nums; }
.home-stress { display: flex; align-items: baseline; gap: var(--space-2) var(--space-4); flex-wrap: wrap; }
.home-stress-word { font: 600 var(--text-large-title)/var(--leading-display) var(--font-word); }
.home-stress-word b { color: color-mix(in srgb, var(--tone) 70%, var(--fg)); font-weight: inherit; text-decoration: underline 3px; text-underline-offset: .2em; }
.home-stress-note { color: var(--muted); font-size: var(--text-subhead); }
.home-formula { font: italic clamp(var(--text-title3), 5vw, var(--text-title1))/1.3 var(--font-word); white-space: nowrap; }
.home-formula small { display: block; margin-top: var(--space-1); font: var(--text-footnote)/var(--leading-small) var(--font-ui); color: var(--muted); white-space: normal; }

/* ---- Cabinet screens: simplified pictures, hidden from screen readers ---- */
.home-screens { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-8) 0 0; padding: 0; list-style: none; }
.home-screen { display: grid; gap: var(--space-3); align-content: start; }
.home-screen h3 { margin: 0; font-size: var(--text-body); letter-spacing: 0; }
.home-screen > p { margin: calc(var(--space-2) * -1) 0 0; color: var(--muted); font-size: var(--text-subhead); }
.home-phone { display: grid; gap: var(--space-2); align-content: start; min-height: 15.5rem; padding: var(--space-4); overflow: hidden; border-radius: var(--radius-card); background: var(--bg); border: 1px solid var(--line); font-size: var(--text-caption1); line-height: var(--leading-small); }
.home-phone-title { margin: 0 0 var(--space-1); font-size: var(--text-body); font-weight: 700; letter-spacing: var(--head-track); }
.home-phone-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: 10px; background: var(--surface); }
.home-phone-row i { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--tone, var(--accent)); }
.home-phone-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.home-phone-row span { color: var(--muted); white-space: nowrap; }
.home-phone-btn { display: block; margin-top: auto; padding: var(--space-2); border-radius: 10px; background: var(--primary); color: var(--on-primary); text-align: center; font-weight: 600; }
.home-phone-steps { display: flex; gap: var(--space-1); }
.home-phone-steps span { flex: 1; padding: var(--space-1) 0; border-radius: 7px; background: var(--fill); text-align: center; color: var(--muted); }
.home-phone-steps .on { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: var(--shadow); }
.home-phone-note { display: grid; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-radius: 10px; background: var(--surface); }
.home-phone-note b { font-size: var(--text-footnote); }
.home-phone-note em { font-style: normal; background: color-mix(in srgb, var(--subject-history) 18%, transparent); border-radius: 3px; padding: 0 .15em; }
.home-phone-timer { display: flex; justify-content: space-between; align-items: baseline; }
.home-phone-timer b { font-size: var(--text-body); font-variant-numeric: tabular-nums; }
.home-phone-opt { padding: var(--space-2) var(--space-2); border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.home-phone-opt.right { border-color: var(--know); color: var(--know); font-weight: 600; }
.home-phone-opt.wrong { border-color: var(--again); color: var(--again); text-decoration: line-through; }
.home-phone-bar { height: .4rem; border-radius: 2px; background: var(--fill); overflow: hidden; }
.home-phone-bar span { display: block; height: 100%; width: var(--w); background: var(--know); }
.home-phone-day { display: grid; grid-template-columns: 1.6rem 1fr; gap: var(--space-2); align-items: center; }
.home-phone-day > span { color: var(--muted); font-variant-numeric: tabular-nums; }
.home-phone-today > span { color: var(--accent); font-weight: 700; }
.home-phone-caption { margin: var(--space-4) 0 0; color: var(--muted); font-size: var(--text-footnote); }

/* The forgetting curve: drops with time, lifted back by each review. */
.home-recall { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: var(--space-4) var(--space-12); align-items: center; margin-top: var(--space-8); padding: clamp(var(--space-6), 3vw, var(--space-8)); border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); }
.home-recall h3 { margin: 0; font-size: clamp(var(--text-title3), 2.2vw, var(--text-title1)); letter-spacing: var(--head-track); line-height: var(--leading-title3); text-wrap: balance; }
.home-recall p { margin: var(--space-2) 0 0; color: var(--muted); }
.home-recall svg { width: 100%; height: auto; overflow: visible; }
.home-recall-curve { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.home-recall-axis { stroke: var(--line); stroke-width: 1.5; }
.home-recall-dot { fill: var(--know); }
.home-recall text { fill: var(--muted); font: var(--text-caption1) var(--font-ui); }

/* ---- FAQ and the last call ---- */
.home-faq .faq-list { margin-top: var(--space-6); }
.home-faq > .text-action { margin-top: var(--space-3); }
.home-final { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-8); }
.home-final h2 { margin: 0; font-size: clamp(var(--text-title2), 2.6vw, var(--text-large-title)); letter-spacing: var(--head-track); }
.home-final p { margin: var(--space-2) 0 0; color: var(--muted); }

@media (max-width: 62rem) {
  .home-hero { grid-template-columns: minmax(0, 1fr); }
  .home-live { max-width: 40rem; }
  .home-course-history { grid-template-columns: minmax(0, 1fr); }
  .home-screens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 45rem) {
  .home-hero { padding-top: var(--space-8); gap: var(--space-8); }
  .home-hero h1 { font-size: var(--text-large-title); }
  .home-live .seg { width: 100%; grid-auto-columns: 1fr; }
  .home-live .seg button { padding-inline: var(--space-2); font-size: var(--text-subhead); }
  .home-live .seg button::before { margin-right: var(--space-1); }
  .home-courses, .home-recall { grid-template-columns: minmax(0, 1fr); }
  .home-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-4); }
  .home-timeline::before { display: none; }
  .home-screens { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .home-course:active { transform: none; opacity: var(--press-dim); }
}
