/* Layout: a jury table. Left rail = navigation, main column = score sheets and wall-label captions. */
:root {
  --wall: #f3f5f7; --panel: #ffffff; --ink: #141a24; --muted: #5b6676; --line: #d5dbe3;
  --pigment: #1f3fd1; --pigment-ink: #ffffff; --pigment-soft: #e4e9fb;
  --good: #1d7a4f; --good-soft: #dff2e8; --warn: #9a6200; --warn-soft: #fbeed3; --bad: #b3261e; --bad-soft: #fbe3e1;
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: #10141b; --panel: #181e28; --ink: #e9edf3; --muted: #9aa6b6; --line: #2b3442;
    --pigment: #8ea2ff; --pigment-ink: #0b1020; --pigment-soft: #1d2647;
    --good: #5fd09a; --good-soft: #143325; --warn: #f0b755; --warn-soft: #3a2c10; --bad: #ff8a80; --bad-soft: #3d1917;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall: #10141b; --panel: #181e28; --ink: #e9edf3; --muted: #9aa6b6; --line: #2b3442;
  --pigment: #8ea2ff; --pigment-ink: #0b1020; --pigment-soft: #1d2647;
  --good: #5fd09a; --good-soft: #143325; --warn: #f0b755; --warn-soft: #3a2c10; --bad: #ff8a80; --bad-soft: #3d1917;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 15px/1.55 var(--body); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); font-weight: 700; }
h2 { font-size: 1.45rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--pigment); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.label { font: 500 0.72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
:focus-visible { outline: 2px solid var(--pigment); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-block: 20px 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }

.top { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand { font: 700 1.25rem var(--display); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand i { width: 14px; height: 14px; background: var(--pigment); display: inline-block; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-weight: 500; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--wall); }
.demo-flag { font: 500 0.72rem var(--mono); background: var(--warn-soft); color: var(--warn); padding: 4px 8px; border-radius: var(--r); }

button, .btn { font: 600 0.92rem var(--body); border: 1px solid var(--ink); background: var(--panel); color: var(--ink); padding: 8px 14px; border-radius: var(--r); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { background: var(--pigment-soft); }
.primary { background: var(--pigment); border-color: var(--pigment); color: var(--pigment-ink); }
.primary:hover { background: var(--pigment); filter: brightness(1.1); }
.quiet { border-color: var(--line); font-weight: 500; }
.danger { border-color: var(--bad); color: var(--bad); }
button[disabled] { opacity: 0.5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; width: 100%; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 0.86rem; font-weight: 500; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.form .wide { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.checks label { flex-direction: row; align-items: center; font-weight: 400; }
.checks input { width: auto; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.facts div { background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.facts b { font: 700 1.5rem var(--display); }

.pill { font: 500 0.72rem var(--mono); padding: 3px 8px; border-radius: 99px; white-space: nowrap; background: var(--pigment-soft); color: var(--pigment); }
.pill.must, .pill.strong { background: var(--good-soft); color: var(--good); }
.pill.maybe { background: var(--warn-soft); color: var(--warn); }
.pill.low, .pill.skip { background: var(--bad-soft); color: var(--bad); }

/* match list: one score sheet line per call */
.calls { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.call { display: grid; grid-template-columns: 62px minmax(0, 1.5fr) minmax(0, 1fr) 230px; gap: 14px; align-items: center; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; width: 100%; font-weight: 400; }
.call:last-child { border-bottom: 0; }
.call.out { opacity: 0.62; }
.score { font: 700 1.55rem/1 var(--mono); font-variant-numeric: tabular-nums; }
.score small { display: block; font: 500 0.62rem var(--mono); color: var(--muted); margin-top: 4px; letter-spacing: 0.06em; }
.call h3 { margin-bottom: 3px; }
.sub { font-size: 0.84rem; color: var(--muted); }
.best { display: flex; gap: 10px; align-items: center; min-width: 0; }
.best img, .thumb { width: 54px; height: 40px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.due { text-align: right; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
@media (max-width: 720px) {
  .call { grid-template-columns: 52px minmax(0, 1fr); }
  .call .best, .call .due { grid-column: 2; }
  .due { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; }
}

/* score breakdown */
.bars { display: grid; grid-template-columns: minmax(0, 1fr) 120px 48px; gap: 6px 12px; align-items: center; font-size: 0.86rem; }
.bar { height: 8px; background: var(--line); position: relative; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--pigment); }
.rank { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.rank:first-of-type { border-top: 0; }
.rank img { width: 150px; aspect-ratio: 15 / 11; object-fit: cover; border: 1px solid var(--line); }
@media (max-width: 640px) { .rank { grid-template-columns: 1fr; } .bars { grid-template-columns: minmax(0, 1fr) 70px 44px; } }
ul.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; font-size: 0.9rem; }
.yes li::marker { color: var(--good); } .no li::marker { color: var(--bad); }

/* portfolio: wall labels */
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.work { display: flex; flex-direction: column; gap: 10px; }
.work img { width: 100%; aspect-ratio: 15 / 11; object-fit: cover; border: 1px solid var(--line); background: var(--panel); }
.tomb { border-left: 2px solid var(--ink); padding-left: 10px; font-size: 0.86rem; display: flex; flex-direction: column; gap: 1px; }
.tomb b { font: 600 1rem var(--display); }
.tomb i { font-style: italic; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan.on { border-color: var(--pigment); box-shadow: 0 0 0 1px var(--pigment); }
.price { font: 700 2rem var(--display); }
.price small { font: 400 0.85rem var(--body); color: var(--muted); }
.meter { height: 10px; background: var(--line); }
.meter span { display: block; height: 100%; background: var(--pigment); }
.note { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: var(--r); font-size: 0.88rem; }
.err { background: var(--bad-soft); color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--wall); padding: 9px 16px; border-radius: var(--r); font-weight: 500; z-index: 20; }

/* landing */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: center; padding-block: 36px 28px; }
.hero p.lede { font-size: 1.12rem; max-width: 56ch; color: var(--muted); }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.cmp th, .cmp td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp th { font: 500 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.scroll { overflow-x: auto; }
section.band { padding-block: 34px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: no-preference) { .bar span, .meter span { transition: width 0.4s ease; } }
