/* Tidewell, Painted style (DESIGN.md). Palette sampled from the dawn-bay painting. */
@font-face { font-family: "Plus Jakarta Sans"; src: url("../../../_shared/fonts/plus-jakarta-var.woff2?v=1") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../../../_shared/fonts/jetbrains-mono-var.woff2?v=1") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #0B1A22; --surface: #10242E; --raised: #163240;
  --text: #FCE8C8; --muted: #A9BDC2;
  --accent: #FF8A65; --on-accent: #0B1A22;
  --teal: #9ED9CF; --teal-ink: #1F6F78; --teal-chip: #24303E;
  --warn: #FCBB00;
  --line: rgba(252, 232, 200, .12); --line-2: rgba(252, 232, 200, .26);
  --glass: rgba(11, 26, 34, .58);
  --focus: #FF8A65;
  --link: #FF8A65;
  --shadow: rgba(4, 10, 14, .5);
  --radius-card: 20px; --radius-input: 12px;
  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F6EFE2; --surface: #FCF8EF; --raised: #EFE6D5;
  --text: #0B1A22; --muted: #52626B;
  --accent: #A63C15; --on-accent: #FCF8EF;
  --teal: #1F6F78; --teal-ink: #1F6F78; --teal-chip: #C8D6D2;
  --warn: #8A6400;
  --line: rgba(11, 26, 34, .14); --line-2: rgba(11, 26, 34, .3);
  --glass: rgba(246, 239, 226, .78);
  --focus: #1F6F78;
  --link: #1F6F78;
  --shadow: rgba(11, 26, 34, .16);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1.04; }
h2 { font-size: clamp(2.2rem, 4.6vw, 4rem); text-wrap: balance; }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
a[href], button, summary, label[for], input[type="range"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 90; background: var(--text); color: var(--bg); padding: 0 18px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.mist { color: var(--muted); } .small { font-size: .9rem; } .accent { color: var(--accent); }
.ph { font-size: 1.15em; vertical-align: -0.15em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.wrap-wide { max-width: 1360px; margin: 0 auto; padding: 0 28px; }

/* Logo mark: a tide line under a dawn sun, cropped to its box. */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.4rem; letter-spacing: -0.04em; min-height: 44px; flex: none; }
.logo svg { flex: none; overflow: visible; }
.logo-tide { stroke: var(--teal); stroke-width: 2.6; stroke-linecap: round; }
.logo-sun { fill: var(--accent); }

/* Header (site) */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; transition: background-color 220ms var(--ease), border-color 220ms var(--ease); border-bottom: 1px solid transparent; }
.nav.solid, .nav.open { background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; min-height: 84px; gap: 24px; max-width: 1360px; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0 auto; padding: 0; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 1.02rem; transition: background-color 160ms var(--ease); }
.nav-links a:hover { background: rgba(252, 232, 200, .08); }
[data-theme="light"] .nav-links a:hover { background: rgba(11, 26, 34, .06); }
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-right .menu-btn, .only-menu { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent; font: 700 1rem var(--sans); text-decoration: none; color: var(--text); background: transparent; transition: transform 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease); white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-cream { background: var(--accent); color: var(--on-accent); }
.btn-cream:hover { background: var(--accent); filter: brightness(1.07); }
[data-theme="light"] .btn-cream:hover { filter: brightness(.96); }
.btn-ghost { border-color: var(--line-2); background: rgba(252, 232, 200, .05); }
.btn-ghost:hover { background: rgba(252, 232, 200, .12); border-color: var(--line-2); }
[data-theme="light"] .btn-ghost { background: rgba(11, 26, 34, .04); }
[data-theme="light"] .btn-ghost:hover { background: rgba(11, 26, 34, .09); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: .95rem; }
/* PA6: outline buttons on art carry their own dark ground. */
.artband .btn-ghost, .hero .btn-ghost { background: rgba(11, 26, 34, .6); border-color: rgba(252, 232, 200, .3); color: #FCE8C8; }
.artband .btn-ghost:hover, .hero .btn-ghost:hover { background: rgba(11, 26, 34, .78); }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; text-align: center; overflow: hidden; isolation: isolate; padding: 120px 24px 130px; }
.hero .art { position: absolute; inset: 0 0 auto; height: max(100%, 43vw); z-index: -2; -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent); mask-image: linear-gradient(180deg, #000 72%, transparent); }
@media (min-aspect-ratio: 16/11) { .hero .art { height: 43vw; } }
.hero .art img { width: 100%; height: 110%; object-fit: cover; object-position: 50% 18%; will-change: transform; }
.hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 140px; z-index: -1; background: linear-gradient(180deg, rgba(11, 26, 34, .66), rgba(11, 26, 34, 0)); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 60% 16% at 50% 40%, rgba(11, 26, 34, .62), rgba(11, 26, 34, .42) 75%, transparent 100%),
              radial-gradient(ellipse 44% 26% at 50% 62%, rgba(11, 26, 34, .72), rgba(11, 26, 34, .4) 55%, transparent 80%),
              linear-gradient(180deg, rgba(11, 26, 34, .38) 0%, rgba(11, 26, 34, 0) 26%, rgba(11, 26, 34, 0) 60%, rgba(11, 26, 34, .84) 92%, var(--bg) 100%); }
.hero-inner { max-width: 1100px; display: grid; justify-items: center; gap: 24px; }
.hero h1 { font-size: clamp(2.9rem, 7.2vw, 6.8rem); letter-spacing: -0.045em; line-height: .98; text-wrap: balance; max-width: 13ch; text-shadow: 0 2px 30px rgba(4, 10, 14, .6); }
.hero .sub { font-size: clamp(1.1rem, 1.6vw, 1.4rem); max-width: 40ch; color: #FCE8C8; text-wrap: balance; text-shadow: 0 1px 18px rgba(4, 10, 14, .9); }
.hero-note { margin-top: 6px; color: rgba(252, 232, 200, .78); font-size: .88rem; max-width: 58ch; text-shadow: 0 1px 12px rgba(4, 10, 14, .95); }

.livebar { margin-top: 6px; display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--line); max-width: 100%; }
.livebar .seg { display: grid; gap: 1px; padding: 4px 16px; text-align: left; border-right: 1px solid var(--line); min-width: 0; }
.livebar .seg:last-of-type { border-right: 0; }
.livebar .k { font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; }
.livebar .v { font: 600 1.02rem var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; }
.livebar .btn { margin-left: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--teal); margin-right: 8px; flex: none; }
.dot.off { background: var(--muted); } .dot.warn { background: var(--warn); }

/* Sections */
section { position: relative; padding: 140px 0; }
.head { display: grid; gap: 18px; margin-bottom: 56px; max-width: 760px; }
.head.center { margin-left: auto; margin-right: auto; text-align: center; justify-items: center; }
.head p { color: var(--muted); font-size: 1.18rem; max-width: 56ch; }
.kicker { font: 600 .85rem var(--mono); color: var(--accent); letter-spacing: .02em; display: inline-flex; align-items: center; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.glass { background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border: 1px solid var(--line); border-radius: var(--radius-card); }
.actions, .actions-left { display: flex; flex-wrap: wrap; gap: 12px; }
.actions { justify-content: center; }

/* Live instrument */
.inst { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.board { padding: 24px; display: grid; gap: 18px; align-content: start; }
.board-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.board-top .title { font-weight: 700; font-size: 1.08rem; display: flex; align-items: center; }
.skel { display: grid; gap: 14px; }
.row.skeleton { height: 56px; border-radius: 12px; background: linear-gradient(90deg, rgba(252, 232, 200, .04), rgba(252, 232, 200, .09), rgba(252, 232, 200, .04)); background-size: 200% 100%; }
[data-theme="light"] .row.skeleton { background: linear-gradient(90deg, rgba(11, 26, 34, .04), rgba(11, 26, 34, .09), rgba(11, 26, 34, .04)); background-size: 200% 100%; }
.chart-axis { display: flex; justify-content: space-between; font: 500 .78rem var(--mono); color: var(--muted); }
.chart-read { max-width: 60ch; }
#chart, .app-chart { width: 100%; height: auto; display: block; }
#chart .chart-grid { stroke: var(--line); stroke-width: 1; }
#chart #chart-line, #app-chart #app-chart-line { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
#chart #chart-area, #app-chart #app-chart-area { fill: url(#swell-fill); stroke: none; }
#chart line, .chart-base { stroke: var(--line-2); stroke-width: 1; }
.inst-side { display: grid; gap: 20px; align-content: start; }
.panel { padding: 22px; display: grid; gap: 16px; }
.panel h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.panel h3 .ph { font-size: 1.35rem; color: var(--accent); }
.panel p { color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; font: 500 .98rem var(--mono); margin: 0; }
.kv dt { color: var(--muted); font-family: var(--sans); }
.kv dd { margin: 0; text-align: right; }
.state { padding: 26px 8px; display: grid; gap: 12px; justify-items: center; text-align: center; color: var(--muted); }
.state .ph { font-size: 2rem; color: var(--warn); }
.state.wide { padding: 18px 8px; }
.credit-line { border-top: 1px solid var(--line); padding-top: 14px; }
.credit-line a { color: var(--link); }

/* Concepts */
.concepts { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.concept { padding: 30px; display: grid; gap: 14px; align-content: start; }
.concept .ico { font-size: 50px; color: var(--accent); line-height: 1; }
.concept p { color: var(--muted); }
.concept.w7 { grid-column: span 7; } .concept.w5 { grid-column: span 5; }
.concept.w7:first-child { background: linear-gradient(160deg, rgba(31, 111, 120, .24), var(--surface) 58%); }

/* Art bands */
.artband { position: relative; isolation: isolate; overflow: hidden; }
.artband .art { position: absolute; inset: 0; z-index: -2; }
.artband .art img { width: 100%; height: 110%; object-fit: cover; object-position: 50% 42%; }
.artband::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--bg) 0%, rgba(11, 26, 34, .5) 18%, rgba(11, 26, 34, .5) 82%, var(--bg) 100%); }
.artband.left::after { background: linear-gradient(90deg, rgba(11, 26, 34, .88) 0%, rgba(11, 26, 34, .6) 48%, rgba(11, 26, 34, .18) 100%), linear-gradient(180deg, var(--bg) 0%, transparent 15%, transparent 85%, var(--bg) 100%); }
.artband .head { color: #FCE8C8; }
.artband .head p { color: rgba(252, 232, 200, .85); }
.bandrow { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: stretch; margin-bottom: 28px; }
.frame-list ul { list-style: none; margin: 0; padding: 8px 18px; display: grid; }
.frame-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 16px 6px; border-bottom: 1px solid var(--line); }
.frame-list li:last-child { border-bottom: 0; }
.frame-list .ph { font-size: 1.5rem; color: var(--accent); }
.frame-list b { display: block; font-weight: 700; color: #FCE8C8; }
.frame-list span { color: rgba(252, 232, 200, .75); font-size: .98rem; }
.panel-on-art { padding: 24px; display: grid; gap: 6px; justify-items: start; align-content: center; }
.panel-on-art .big-num { font: 600 2.4rem var(--mono); letter-spacing: -0.02em; color: #FCE8C8; }
.panel-on-art .kicker { color: var(--accent); }
.panel-on-art .mono.small { color: rgba(252, 232, 200, .78); }
.glass-note { margin-top: 10px; font-size: .84rem; color: rgba(252, 232, 200, .6); }

/* FAQ */
.faq { max-width: 860px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 700; font-size: 1.1rem; padding: 14px 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ph { transition: transform 200ms var(--ease); color: var(--accent); flex: none; }
.faq details[open] summary .ph { transform: rotate(45deg); }
.faq .a { padding: 0 0 26px; color: var(--muted); max-width: 70ch; }

/* Final band */
.final { min-height: 78svh; display: grid; place-items: center; text-align: center; padding: 140px 24px; }
.final::after { background: linear-gradient(180deg, var(--bg) 0%, rgba(11, 26, 34, .34) 22%, rgba(11, 26, 34, .2) 55%, rgba(11, 26, 34, .6) 85%, var(--bg) 100%); }
.final .inner { display: grid; gap: 22px; justify-items: center; max-width: 820px; }
.final h2 { font-size: clamp(2.6rem, 6vw, 5.4rem); letter-spacing: -0.045em; text-shadow: 0 2px 30px rgba(4, 10, 14, .6); }
.final p { color: #FCE8C8; font-size: 1.25rem; max-width: 46ch; text-wrap: balance; text-shadow: 0 1px 16px rgba(4, 10, 14, .9); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 56px 0 40px; }
.foot > .wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 32px; }
.foot h4 { margin: 0 0 12px; font: 600 .78rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.foot ul a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.foot ul a:hover { color: var(--link); }
.foot .small { color: var(--muted); margin-top: 12px; max-width: 42ch; }
.foot a { color: var(--link); }

/* App */
body.app { background: var(--bg); }
.appbar { position: sticky; top: 0; z-index: 50; background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); }
.appbar-in { max-width: 1360px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; gap: 20px; min-height: 64px; }
.appnav { display: flex; gap: 4px; margin: 0 auto; }
.appnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .98rem; color: var(--muted); }
.appnav a:hover { color: var(--text); background: rgba(252, 232, 200, .08); }
[data-theme="light"] .appnav a:hover { background: rgba(11, 26, 34, .06); }
.appnav a[aria-current="page"] { color: var(--text); background: rgba(31, 111, 120, .18); }
.appnav a[aria-current="page"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-right: 9px; }
.appbar-right { display: flex; gap: 8px; margin-left: auto; }
.app-note { padding: 10px 28px; text-align: center; font-size: .84rem; color: var(--muted); border-bottom: 1px solid var(--line); }

.banner { position: relative; overflow: hidden; height: 200px; }
.banner img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 26, 34, .78), rgba(11, 26, 34, .2) 62%, transparent), linear-gradient(180deg, rgba(11, 26, 34, .2), rgba(11, 26, 34, .6) 80%, var(--bg)); }
.banner-in { position: absolute; z-index: 1; inset: auto 28px 18px; max-width: 1200px; margin: 0 auto; left: 0; right: 0; display: grid; gap: 4px; }
.banner-h { font-size: clamp(1.8rem, 3.4vw, 2.6rem); color: #FCE8C8; letter-spacing: -0.03em; text-shadow: 0 1px 16px rgba(4, 10, 14, .8); }
.banner .kicker { color: #FCE8C8; }
.banner .kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 4px; }
.banner-status { color: rgba(252, 232, 200, .85); font-size: .82rem; }

body.app section { padding: 64px 0; }
body.app .head { margin-bottom: 32px; }
body.app .head p { font-size: 1.05rem; }
.win-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.win { padding: 22px; display: grid; gap: 12px; align-content: start; }
.win-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.win-when { font: 600 1.5rem var(--mono); letter-spacing: -0.02em; }
.win-score { font: 600 .8rem var(--mono); color: var(--on-score, var(--text)); background: var(--teal-chip); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.win-score.hi { background: var(--accent); color: var(--on-accent); }
.win .kv { font-size: .92rem; }
.win-note { color: var(--muted); font-size: .88rem; }
.skel-card { gap: 10px; padding: 18px; }
.skel-card .row.skeleton { height: 22px; border-radius: 7px; }

.hours .n, .log .n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 560px; }
.t caption { text-align: left; font-weight: 700; padding-bottom: 12px; }
.t th { text-align: left; font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line-2); }
.t tbody th { font: 700 .95rem var(--sans); text-transform: none; letter-spacing: 0; color: var(--text); border-bottom: 1px solid var(--line); text-align: left; }
.t td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.t tbody tr:hover { background: rgba(252, 232, 200, .04); }
[data-theme="light"] .t tbody tr:hover { background: rgba(11, 26, 34, .03); }
.t td.blank { color: var(--muted); }
.t tr.is-best th, .t tr.is-best td { border-bottom-color: var(--line-2); }
.t tr.is-best th::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 9px; vertical-align: .1em; }
.app-chart { max-height: 160px; }
.sample-note { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text); background: var(--teal-chip); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.sample-note .ph { color: var(--teal); }
.log-note { padding: 14px 18px 4px; border-top: 1px solid var(--line); }
.app-foot { padding: 40px 0; }
.app-foot .small + .small { margin-top: 6px; }

/* Dialog */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(4, 10, 14, .6); z-index: 70; }
.dialog { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; }
.dialog-in { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-card); width: min(440px, 100%); padding: 24px; display: grid; gap: 20px; box-shadow: 0 24px 60px var(--shadow); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-top h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.field { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.field legend { font-weight: 700; padding: 0; margin-bottom: 2px; }
.seg-toggle { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(252, 232, 200, .06); border: 1px solid var(--line); }
[data-theme="light"] .seg-toggle { background: rgba(11, 26, 34, .05); }
.seg-toggle button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 .95rem var(--sans); }
.seg-toggle button:hover { color: var(--text); }
.seg-toggle button[aria-checked="true"] { background: var(--text); color: var(--bg); }
.hint { color: var(--muted); font-size: .88rem; }
.dialog-foot { display: flex; justify-content: flex-end; }

/* Motion: each has a purpose in DESIGN.md. Reduced motion removes all. */
.flash { animation: flash 600ms var(--ease); }
@keyframes flash { from { color: var(--accent); } }
.draw path.line-anim, path.line-anim { stroke-dasharray: var(--len, 4000); stroke-dashoffset: var(--len, 4000); }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .rise { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
    @keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  }
  .row.skeleton { animation: shimmer 1.4s linear infinite; }
  @keyframes shimmer { to { background-position: -200% 0; } }
  .line-anim { animation: draw 2.2s var(--ease) forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* Responsive */
@media (max-width: 1100px) {
  .inst { grid-template-columns: 1fr; }
  .concept.w7, .concept.w5 { grid-column: 1 / -1; }
  .bandrow { grid-template-columns: 1fr; }
  .win-grid { grid-template-columns: 1fr; }
  section { padding: 110px 0; }
}
@media (max-width: 900px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 12px; right: 12px; flex-direction: column; padding: 10px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 18px 50px var(--shadow); }
  .nav.open .nav-links { display: flex; }
  .only-menu { display: list-item; }
  .nav-right .menu-btn { display: inline-flex; }
  .livebar .hide-sm { display: none; }
  .appnav { display: none; }
}
@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  section { padding: 84px 0; }
  .hero { padding: 16svh 16px 110px; align-items: start; }
  .hero h1 { font-size: clamp(2.5rem, 11vw, 3.4rem); }
  .livebar { flex-wrap: wrap; justify-content: center; border-radius: 24px; padding: 10px; }
  .livebar .seg { border-right: 0; text-align: center; padding: 4px 12px; }
  .livebar .btn { width: 100%; margin-left: 0; }
  .board { padding: 18px 14px; }
  .concept { padding: 24px; }
  .final .btn { width: 100%; }
  .final .actions { width: 100%; }
  .foot > .wrap { grid-template-columns: 1fr 1fr; }
  .foot > .wrap > div:first-child { grid-column: 1 / -1; }
  body.app section { padding: 48px 0; }
  .banner { height: 180px; }
  .banner-in { left: 16px; right: 16px; }
  .appbar-in { padding: 0 16px; }
  .app-note { padding: 10px 16px; }
}
/* PA2: portrait screens get the 9:16 painting, pushed down so the text sits in the calm sky. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 1100px) {
  .hero .art { inset: 22svh 0 auto; height: 100%; -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 70%, transparent); mask-image: linear-gradient(180deg, transparent, #000 14%, #000 70%, transparent); }
  .hero .art img { object-position: 50% 8%; }
  .hero::after { background: linear-gradient(180deg, transparent 58%, rgba(11, 26, 34, .85) 92%, var(--bg) 100%); }
  .hero .livebar { background: rgba(11, 26, 34, .86); }
  .hero::before { display: none; }
  .hero-note { color: rgba(252, 232, 200, .72); }
}
@media (max-width: 480px) {
  .menu-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .menu-btn { width: 44px; padding: 0; }
  .hide-xs { display: none; }
  .foot > .wrap { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .line-anim { stroke-dasharray: none; stroke-dashoffset: 0; }
}

/* The sample reading card sits at the top of its column instead of stretching to the list's height. */
.panel-on-art { align-self: start; }
