/* Shared page chrome and reading components: header, footer, titles, buttons, cards.
   Used by the content pages and by Orbital Teapot. */
/* Colours, type and shapes come from tokens.css, loaded first. */
:root {
  scroll-padding-top: 5.5rem;
  font: 400 1.0625rem/1.65 var(--font-body);
  color: var(--text);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--peach); text-underline-offset: .18em; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--peach); outline-offset: 3px; }
img { max-width: 100%; height: auto; }

.header-sentinel {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 2rem;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  margin-bottom: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  transition: padding .22s ease, margin-bottom .22s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.site-header.is-stuck {
  padding-block: .5rem;
  /* Compensate the shrunken header height in normal flow so page content never jumps. */
  margin-bottom: 1.875rem;
  background: var(--bg-glass);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.site-header .home {
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -.04em;
  text-decoration: none;
  transform-origin: left center;
  transition: transform .22s ease;
}
.site-header.is-stuck .home { transform: scale(.92); }
.site-header .home span { color: var(--amber); }
.site-header .tools { display: flex; align-items: center; gap: clamp(.4rem, 1.5vw, 1.15rem); }

/* Same button base as the homepage, so the shared soundtrack controls look identical. */
.landing-soundtrack button {
  min-height: 2.75rem;
  padding: .65rem 1.15rem;
  color: var(--bg);
  background: var(--peach);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: 650 .95rem/1.2 var(--font-body);
  cursor: pointer;
}
.landing-soundtrack button:hover { background: var(--text); }

.wrap { width: min(100% - 2 * var(--gutter), 46rem); margin-inline: auto; }
.wrap.wide { width: min(100% - 2 * var(--gutter), 68rem); }

.crumbs { margin: 2rem 0 0; font-size: .9rem; color: var(--muted); }
.crumbs a { color: inherit; }

.page-title {
  margin: 1rem 0 .75rem;
  font: 400 clamp(2.8rem, 8vw, 5.5rem) / .95 var(--font-display);
  letter-spacing: -.05em;
  text-wrap: balance;
}
.page-title em { color: var(--peach); }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 2.25rem 0 0;
  color: var(--amber);
  font-size: .85rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.kicker i, .swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; background: var(--swatch, var(--amber)); box-shadow: 0 0 0 3px #ffffff14; }
.lede { margin: 0 0 2rem; font-size: clamp(1.15rem, 2.4vw, 1.35rem); line-height: 1.55; color: var(--text); }

h2 {
  margin: 2.75rem 0 .75rem;
  font: 400 clamp(1.8rem, 4vw, 2.4rem) / 1.1 var(--font-display);
  letter-spacing: -.03em;
}
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1px;
  margin: 0 0 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--line);
}
.facts div { padding: .85rem 1rem; background: var(--panel); }
.facts dt { color: var(--amber); font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.facts dd { margin: .2rem 0 0; }

.brew { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.brew li { position: relative; margin: 0 0 .85rem; padding: .1rem 0 0 3rem; counter-increment: step; }
.brew li::before {
  position: absolute;
  inset: 0 auto auto 0;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  content: counter(step);
  color: var(--bg);
  background: var(--peach);
  border-radius: 50%;
  font-weight: 750;
}

.verdict {
  margin: 2.75rem 0 0;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--peach);
  border-radius: 1rem;
  background: var(--panel);
}
.verdict h2 { margin-top: 0; font-size: 1.6rem; }
.verdict p:last-child { margin: 0; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .65rem 1.15rem;
  color: var(--bg);
  background: var(--peach);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: 650 .95rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { color: var(--bg); background: var(--text); }
.button.ghost { color: var(--text); background: transparent; border-color: var(--line); }
.button.ghost:hover { background: var(--panel-2); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.5rem 0 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--panel);
  transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--amber); }
.card h2, .card h3 { margin: .7rem 0 .35rem; font: 400 1.75rem/1.1 var(--font-display); letter-spacing: -.03em; }
.card a { color: var(--text); text-decoration: none; }
.card a::after { position: absolute; inset: 0; content: ""; border-radius: inherit; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .kind { color: var(--amber); font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }

.site-footer {
  margin-top: 4rem;
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: .9rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0 0 .75rem; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--peach); }
.site-footer p { margin: 0; }

/* Quiz */
.quiz { margin: 2rem 0 0; }
.quiz-progress { height: .4rem; margin: 0 0 1.5rem; overflow: hidden; border-radius: 1rem; background: var(--panel-2); }
.quiz-progress span { display: block; height: 100%; width: 0; background: var(--peach); transition: width .25s; }
.quiz fieldset { margin: 0; padding: 0; border: 0; }
.quiz legend { margin: 0 0 1rem; font: 400 clamp(1.8rem, 4.5vw, 2.6rem) / 1.1 var(--font-display); letter-spacing: -.03em; }
.answers { display: grid; gap: .6rem; }
.answers button {
  padding: .95rem 1.15rem;
  color: var(--text);
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: .9rem;
  font: inherit;
  cursor: pointer;
}
.answers button:hover { border-color: var(--peach); background: var(--panel-2); }
.result-card {
  margin: 2rem 0 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--swatch, #c87a29) 35%, transparent), transparent 60%), var(--panel);
}
.result-card .page-title { margin-top: .25rem; font-size: clamp(2.4rem, 7vw, 4.2rem); }
.result-card .tagline { color: var(--peach); font-size: 1.2rem; font-style: italic; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header .home, .card, .quiz-progress span { transition: none; }
  .card:hover { transform: none; }
}
