/* Concerto docs. Colours follow the terminal UI in src/ui/theme.ts. */

:root {
  --ground: #0E0F12;
  --raised: #16181D;
  --field: #17131F;
  --ink: #ECE9E2;
  --muted: #A3A8B0;
  --brass: #E0A458;
  --on-brass: #17120A;
  --conductor: #B48CFF;
  --soloist: #E8826A;
  --critic: #6AA5FF;
  --section: #4FD08A;
  --scorer: #E0B450;
  --astra: #57C7C1;
  --line: #2C2F37;
  --code: #E6E3DC;

  --font-text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; /* taste-skill-ignore: code only */

  --step-small: 0.9375rem;
  --step-body: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.5625rem);
  --step-head: clamp(2.125rem, 1.4rem + 3vw, 4.25rem);
  --step-display: clamp(4.25rem, 1rem + 13vw, 12.5rem);

  --margin: clamp(1rem, 3vw, 2.5rem);
  --gutter: clamp(1.25rem, 3vw, 3rem);
  --section-gap: clamp(6rem, 12vw, 11rem);
  --max: 1320px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --ground: #F4F4F1;
    --raised: #E8E8E3;
    --field: #ECE7F6;
    --ink: #15161A;
    --muted: #4D5159;
    --brass: #8A5714;
    --on-brass: #FFFFFF;
    --conductor: #6A44C4;
    --soloist: #A8432A;
    --critic: #2457B8;
    --section: #16683F;
    --scorer: #876210;
    --astra: #19807A;
    --line: #CFCFC8;
    --code: #15161A;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, figure, ol, ul, dl, dd, pre, fieldset { margin: 0; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { max-width: 62ch; text-wrap: pretty; }
code, pre { font-family: var(--font-code); }
:not(pre) > code { font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--raised); }
:target { scroll-margin-top: 5rem; }
::selection { background: var(--brass); color: var(--on-brass); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }

.wrap > *, .split > *, .split-text > *, .install > *, .install-main > *, .install-side > *, .config > *, .config-text > *, .cache-grid > *, .conductor-inner > * { min-width: 0; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--margin); }
.head { font-size: var(--step-head); line-height: 1.04; letter-spacing: -0.025em; }
.display { font-size: var(--step-display); line-height: 0.88; letter-spacing: -0.045em; font-weight: 600; }
.lead { font-size: var(--step-lead); line-height: 1.4; max-width: 34ch; }

.skip { position: absolute; left: var(--margin); top: -4rem; padding: 0.6rem 1rem; background: var(--brass); color: var(--on-brass); z-index: 10; }
.skip:focus { top: 0.75rem; }

/* bar */
.bar { display: flex; align-items: center; gap: 2rem; padding-block: 1.1rem; }
.mark { display: inline-flex; align-items: center; text-decoration: none; }
.mark img { display: block; height: 24px; width: auto; image-rendering: pixelated; }
.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; }
.bar nav { display: flex; gap: 1.6rem; margin-left: auto; }
.bar nav a { text-decoration: none; color: var(--muted); transition: color 180ms var(--ease-out); }
.bar nav a:hover { color: var(--ink); }

/* buttons */
.button {
  display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.4rem;
  background: var(--brass); color: var(--on-brass); font-weight: 600; text-decoration: none;
  border-radius: 0; transition: transform 140ms var(--ease-out), background-color 180ms var(--ease-out);
}
.button:hover { background: color-mix(in srgb, var(--brass) 86%, var(--ink)); }
.button:active { transform: translateY(1px) scale(0.98); }
.button-small { min-height: 2.5rem; padding: 0 1rem; font-size: var(--step-small); }
.link { color: var(--ink); text-underline-offset: 0.25em; text-decoration-thickness: 1px; transition: color 180ms var(--ease-out); }
.link:hover { color: var(--brass); }

/* hero */
.hero { padding-top: clamp(2.5rem, 7vw, 6rem); }
.hero-text { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
.hero h1 { color: var(--brass); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }
.hero-figure { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.hero-figure img, .wide-figure img { width: 100%; border-radius: 14px; background: #0E0F12; }
.zoom { display: block; border-radius: 14px; transition: opacity 180ms var(--ease-out); }
.zoom:hover { opacity: 0.92; }
figcaption { margin-top: 0.9rem; color: var(--muted); font-size: var(--step-small); max-width: 70ch; }
@media (min-width: 60em) {
  .hero-text { grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: var(--gutter); }
  .hero .lead { max-width: 46ch; }
  .lead { align-self: end; }
}

section + section, main + footer { margin-top: var(--section-gap); }

/* scoring */
.split { display: grid; gap: 3rem; }
.split-text { display: grid; gap: 1.4rem; align-content: start; }
.split-text pre {
  font-size: clamp(0.8rem, 0.7rem + 0.4vw, 1rem); line-height: 1.6; padding: 1.25rem 1.4rem;
  background: var(--raised); color: var(--scorer); overflow-x: auto; border-radius: 6px;
}
@media (min-width: 60em) {
  .split { grid-template-columns: 1.15fr 1fr; column-gap: var(--gutter); align-items: start; }
}

.calc { background: var(--raised); padding: clamp(1.25rem, 3vw, 2rem); border-radius: 10px; display: grid; gap: 1.1rem; }
.calc-title { font-size: 1.3rem; }
.calc fieldset { border: 0; padding: 0; min-width: 0; }
.calc legend { padding: 0; margin-bottom: 0.5rem; color: var(--muted); font-size: var(--step-small); }
.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding: 0 0.6rem;
  font-family: var(--font-code); font-size: 0.95rem; background: var(--ground); border-radius: 6px;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.seg label:hover span { background: color-mix(in srgb, var(--ground) 70%, var(--scorer)); }
.seg input:checked + span { background: var(--scorer); color: var(--on-brass); font-weight: 600; }
.seg input:active + span { transform: scale(0.94); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--soloist); margin: 0; }
.calc-out { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; padding-top: 0.6rem; }
.calc-score {
  font-family: var(--font-code); font-size: clamp(3.5rem, 2rem + 4vw, 5.5rem); line-height: 1; font-weight: 600;
  min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink);
}
.calc-score.is-high { color: var(--soloist); }
.calc-out dl { display: grid; gap: 0.6rem; }
.calc-out dt { color: var(--muted); font-size: var(--step-small); }
.calc-out dd { font-weight: 500; }

.dot { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; margin-right: 0.5em; vertical-align: 0.05em; }
.dot-soloist { background: var(--soloist); }
.dot-critic { background: var(--critic); }
.dot-astra { background: var(--astra); }

.wide-figure { margin-top: clamp(3rem, 6vw, 5rem); }
.table-wrap { margin-top: 3rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--step-body); }
caption { text-align: left; font-weight: 600; font-size: 1.3rem; margin-bottom: 0.9rem; }
th, td { text-align: left; padding: 0.85rem 1rem 0.85rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: var(--step-small); }
.note { margin-top: 1.5rem; color: var(--muted); }

/* backends */
.backends-head { display: grid; gap: 1.4rem; }
@media (min-width: 60em) {
  .backends-head { grid-template-columns: 1fr 1fr; column-gap: var(--gutter); align-items: end; }
}
.backend-list { list-style: none; padding: 0; margin-top: 3rem; display: grid; gap: 0.5rem; }
.backend-list li { background: var(--raised); padding: clamp(1.25rem, 3vw, 2.25rem); border-radius: 10px; display: grid; gap: 0.5rem 2rem; }
.backend-list h3 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); letter-spacing: -0.02em; line-height: 1.1; }
.backend-account { color: var(--brass); font-weight: 500; }
@media (min-width: 52em) {
  .backend-list li { grid-template-columns: 19rem 1fr; grid-template-rows: auto auto; }
  .backend-list h3 { grid-row: 1; grid-column: 1; }
  .backend-account { grid-row: 2; grid-column: 1; }
  .backend-list li > p:last-child { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
}

/* conductor field */
.conductor { background: var(--field); padding-block: clamp(4.5rem, 9vw, 8rem); }
.conductor-inner { display: grid; gap: 3rem; }
.conductor-text { display: grid; gap: 1.4rem; }
.conductor h2 { color: var(--conductor); }
.gates { list-style: none; padding: 0; display: grid; gap: 2.25rem; }
.gates h3 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem); line-height: 1.1; letter-spacing: -0.02em; }
.gates p { color: var(--muted); font-size: var(--step-lead); margin-top: 0.35rem; }
.gates li { padding-left: 1.25rem; border-left: 4px solid var(--conductor); }
.conductor-cost { color: var(--muted); }
@media (min-width: 60em) {
  .conductor-inner { grid-template-columns: 1fr 1.2fr; column-gap: var(--gutter); }
  .conductor-text { grid-row: span 2; align-content: start; }
}

/* cache */
.cache-grid { display: grid; gap: 3rem; margin-top: clamp(3rem, 6vw, 4.5rem); }
.cache-copy { display: grid; gap: 0.6rem; align-content: start; }
.cache-copy h3 { font-size: 1.3rem; }
.cache-copy h3:not(:first-child) { margin-top: 1.4rem; }
.figures { display: grid; gap: 2.5rem; align-content: start; }
.figures p { display: grid; gap: 0.5rem; max-width: 30ch; }
.big { display: block; }
.big { font-size: clamp(3.75rem, 2rem + 6vw, 7.5rem); line-height: 0.95; letter-spacing: -0.04em; font-weight: 600; color: var(--section); font-variant-numeric: tabular-nums; }
.was { color: var(--muted); }
@media (min-width: 60em) {
  .cache-grid { grid-template-columns: 1fr 1fr; column-gap: var(--gutter); }
}

/* install */
.install { display: grid; gap: 3rem; }
.install-main, .install-side { display: grid; gap: 1.4rem; align-content: start; }
.install-side h3 { font-size: 1.3rem; }
.install-side h3:not(:first-child) { margin-top: 1rem; }
.code-block { background: var(--raised); border-radius: 8px; }
.code-bar { display: flex; justify-content: flex-end; padding: 0.6rem 0.6rem 0; }
.code-block pre { padding: 0.4rem 1.5rem 1.4rem; overflow-x: auto; font-size: clamp(0.8rem, 0.72rem + 0.3vw, 0.95rem); line-height: 1.7; color: var(--code); }
.copy {
  font: inherit; font-size: var(--step-small);
  background: var(--ground); color: var(--ink); border: 0; padding: 0.45rem 0.8rem; border-radius: 6px; cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.copy:hover { background: var(--line); }
.copy:active { transform: scale(0.95); }
.flags { display: grid; gap: 1rem; }
.flags div { display: grid; gap: 0.2rem; }
.flags code { font-size: 1rem; color: var(--brass); background: none; padding: 0; }
@media (min-width: 60em) {
  .install { grid-template-columns: 1.3fr 1fr; column-gap: var(--gutter); }
}

/* config */
.config { display: grid; gap: 2.5rem; }
.config-text { display: grid; gap: 1.4rem; align-content: start; }
.config-code { background: var(--raised); border-radius: 10px; padding: clamp(1.25rem, 3vw, 2rem); overflow-x: auto; font-size: clamp(0.75rem, 0.68rem + 0.3vw, 0.92rem); line-height: 1.65; color: var(--code); }
.t-k { color: var(--critic); }
.t-s { color: var(--section); }
.t-n { color: var(--soloist); }
.t-p { color: var(--muted); }
@media (min-width: 60em) {
  .config { grid-template-columns: 1fr 1.35fr; column-gap: var(--gutter); }
}

/* quality */
.quality-cols { display: grid; gap: 2.5rem; margin-top: 2.5rem; }
.quality-cols h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.quality-cols h3 a { text-decoration-thickness: 2px; text-underline-offset: 0.18em; text-decoration-color: var(--brass); transition: color 180ms var(--ease-out); }
.quality-cols h3 a:hover { color: var(--brass); }
@media (min-width: 52em) {
  .quality-cols { grid-template-columns: 1fr 1fr; column-gap: var(--gutter); }
}

/* footer */
.foot { padding-bottom: 2.5rem; }
.foot-name { font-size: clamp(4.5rem, 1rem + 15vw, 15rem); line-height: 0.85; letter-spacing: -0.05em; font-weight: 600; color: var(--brass); max-width: none; }
.foot-row { display: grid; gap: 1.25rem; margin-top: 2rem; color: var(--muted); }
.foot-row ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; }
.foot-row a { color: var(--ink); text-underline-offset: 0.25em; transition: color 180ms var(--ease-out); }
.foot-row a:hover { color: var(--brass); }
@media (min-width: 52em) {
  .foot-row { grid-template-columns: 1fr auto; align-items: center; }
}

/* phone */
@media (max-width: 40em) {
  .bar { gap: 1rem; }
  .bar nav { display: none; }
  .bar .button-small { margin-left: auto; }
  .calc-out { grid-template-columns: 1fr; gap: 0.75rem; }
  .calc-score { text-align: left; }
  th, td { padding-right: 0.75rem; font-size: 0.95rem; }
}

/* entrances: only when script runs and motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 700ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: var(--d, 0ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

.lede-sm { max-width: 62ch; margin: 0 0 2rem; color: var(--muted); }
.lede-sm a { color: inherit; text-underline-offset: 3px; }
.affiliate { margin-top: 1.25rem; padding: 0.9rem 1rem; border-left: 2px solid var(--muted); color: var(--muted); }
.affiliate a { color: inherit; text-underline-offset: 3px; }

.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.shot-grid img { width: 100%; height: auto; border-radius: 12px; background: #0E0F12; }
.shot-grid figure { margin: 0; }
