/* ══════════════════════════════════════════════════════════════════════════
   Landing page.

   Loaded on its own, without the app's stylesheet, so it redeclares the
   handful of tokens it uses rather than pulling in 800 lines to draw a hero.
   The values are the app's: somebody who clicks Δοκιμή should not feel they
   have arrived somewhere else.

   All visuals are drawn here — inline SVG and CSS. `docs/img/*.png` is
   gitignored, so a landing page that referenced a screenshot would show a
   broken image on a fresh checkout.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;

  --bg:            #f2f2f2;
  --bg-2:          #e9e9e9;
  --surface:       #ffffff;
  --surface-2:     #f7f7f7;
  --border:        rgba(0, 0, 0, .10);
  --border-strong: rgba(0, 0, 0, .18);
  --text:          #111111;
  --text-2:        #545454;
  --muted:         #6d6d6d;
  --accent:        #0f766e;
  --accent-hover:  #0b5f58;
  --accent-soft:   #dcefec;
  --accent-ink:    #0a5750;
  --on-accent:     #ffffff;
  --good:          #0ca30c;
  --warning:       #fab219;
  --critical:      #d03b3b;
  --chart-1:       #2b7fd4;
  --chart-2:       #e08a3c;

  --radius:    14px;
  --radius-sm: 9px;
  --maxw:      1120px;
}

/* The viewer's theme has three states: an explicit choice stamps data-theme,
   and the default "system" stamps nothing — so the media query is guarded
   against a light choice rather than used alone. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0f0f0f;
    --bg-2:          #080808;
    --surface:       #171717;
    --surface-2:     #1f1f1f;
    --border:        rgba(255,255,255,.11);
    --border-strong: rgba(255,255,255,.20);
    --text:          #f0f0f0;
    --text-2:        #b4b4b4;
    --muted:         #949494;
    --accent:        #2dd4bf;
    --accent-hover:  #5eead4;
    --accent-soft:   #12302e;
    --accent-ink:    #7ff0e2;
    --on-accent:     #06201d;
  }
}

:root[data-theme="dark"] {
  --bg:            #0f0f0f;
  --bg-2:          #080808;
  --surface:       #171717;
  --surface-2:     #1f1f1f;
  --border:        rgba(255,255,255,.11);
  --border-strong: rgba(255,255,255,.20);
  --text:          #f0f0f0;
  --text-2:        #b4b4b4;
  --muted:         #949494;
  --accent:        #2dd4bf;
  --accent-hover:  #5eead4;
  --accent-soft:   #12302e;
  --accent-ink:    #7ff0e2;
  --on-accent:     #06201d;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The UA default for a heading is bold, which lands outside the three rungs
   this page otherwise keeps to. Size and space carry the hierarchy instead. */
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.015em; font-weight: 600; }
strong, b { font-weight: 600; }
p { margin: 0; }
a { color: inherit; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 500; font-size: 15px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn[aria-busy="true"] { opacity: .65; pointer-events: none; }

/* ── Header ────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; gap: 14px; height: 66px; }

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-inline-end: auto; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 600; font-size: 18px;
}
.brand-name { font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.brand-sub { font-size: 12px; color: var(--muted); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; gap: 44px; align-items: center; }

.eyebrow {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 13px; font-weight: 500; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(30px, 5.4vw, 50px); }
.hero .lede { font-size: clamp(16px, 2.1vw, 19px); color: var(--text-2); margin-top: 18px; max-width: 46ch; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .fineprint { margin-top: 14px; font-size: 13.5px; color: var(--muted); }

/* ── Cards and sections ────────────────────────────────────────────────── */
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: clamp(22px, 3.2vw, 30px); }
.section .sub { color: var(--text-2); margin-top: 12px; max-width: 62ch; }

/* Six equal boxes said nothing about which of these matters most, and drew a
   border and a shadow apiece to say it. Unboxed rows let the type and the
   gutter do the grouping; the scheduler leads at a size the others do not,
   so the chapter has something to look at first. */
.features { display: grid; gap: 30px 44px; margin-top: 38px; }
@media (min-width: 700px)  { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1020px) { .features { grid-template-columns: repeat(3, 1fr); } }

.feature h3 { font-size: 16.5px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.feature p { color: var(--text-2); margin-top: 8px; font-size: 15px; max-width: 46ch; }
.feature .icon { color: var(--accent); flex: none; }

.feature-lead { grid-column: 1 / -1; padding-bottom: 30px; border-bottom: 1px solid var(--border); }
.feature-lead h3 { font-size: clamp(19px, 2.4vw, 23px); letter-spacing: -.015em; }
.feature-lead h3 .icon { width: 24px; height: 24px; }
.feature-lead p { font-size: clamp(16px, 1.9vw, 17.5px); margin-top: 10px; max-width: 62ch; }

/* Once there is room for three columns the lead sets its heading beside its
   text rather than above it, so the row it owns is not two thirds empty. */
@media (min-width: 1020px) {
  .feature-lead { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: 0 48px; align-items: start; }
  .feature-lead p { margin-top: 4px; }
}

/* ── The two-constraints diagram ───────────────────────────────────────── */
.constraint {
  display: grid; gap: 20px; margin-top: 30px;
}
@media (min-width: 860px) { .constraint { grid-template-columns: 1fr 1fr; } }

figure { margin: 0; }
figcaption { margin-top: 12px; color: var(--text-2); font-size: 15px; }
/* The hero's mock is smaller than the constraint diagrams and its caption
   labels a drawing rather than explaining a rule, so it sits a rung quieter. */
.hero figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.constraint svg { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }

/* ── Access matrix ─────────────────────────────────────────────────────── */
.matrix-scroll { overflow-x: auto; margin-top: 28px; -webkit-overflow-scrolling: touch; }
table.matrix {
  width: 100%; min-width: 560px; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; font-size: 15px;
}
.matrix th, .matrix td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--border); }
.matrix thead th { background: var(--surface-2); font-size: 13px; color: var(--text-2); font-weight: 500; }
/* Row headers are <th> too, so they inherit the UA's bold. They name the row
   rather than heading a section; the dots in the cells carry the answer. */
.matrix tbody th { font-weight: 500; }
.matrix td + td, .matrix th + th { text-align: center; }
.matrix tbody tr:last-child td { border-bottom: 0; }
.yes { color: var(--accent); font-weight: 600; }
.no { color: var(--muted); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--border); padding: 34px 0 46px; color: var(--muted); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; }
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }

/* ── Demo status ───────────────────────────────────────────────────────── */
#demo-status {
  margin-top: 14px; font-size: 14.5px; color: var(--text-2);
  min-height: 1.6em;
}
#demo-status[data-kind="err"] { color: var(--critical); }

.spinner {
  display: inline-block; width: 14px; height: 14px; margin-inline-end: 8px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .btn { transition: none; }
}

/* ── Narrow screens ────────────────────────────────────────────────────────
   At 390px the brand plus two buttons is more than a 66px bar can hold. The
   strapline goes first — it is the least load-bearing thing on the page —
   then the buttons tighten. The page body must never scroll sideways; wide
   content (the access matrix) scrolls inside its own container instead. */
@media (max-width: 560px) {
  .top .wrap { gap: 8px; padding-inline: 16px; }
  .brand-sub { display: none; }
  .brand-mark { width: 32px; height: 32px; font-size: 16px; }
  .brand-name { font-size: 16px; }
  .top .btn { padding: 9px 12px; font-size: 14px; }

  .wrap { padding-inline: 16px; }
  .hero { padding: 44px 0 40px; }
  .section { padding: 42px 0; }
  .hero .cta .btn,
  .section .cta .btn { flex: 1 1 100%; justify-content: center; }
}

/* Wider than the phone but still one column: the hero art sits under the
   words rather than beside them. */
@media (min-width: 940px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
}
