/*
 * CC V8 Engine: one screen, the engine at its centre. Nothing on the page
 * scrolls; the sections change in place (assets/js/sections.js). Glass
 * (backdrop blur) is kept to small surfaces: a blur over a canvas that
 * redraws every frame costs a software compositor dearly.
 */
:root {
  --acc: #ef4444;
  --acc-ink: #0a0b0d;
  /* The accent as text and focus rings, readable on each ground (ui.js readableOn). */
  --acc-text: var(--acc-text-dark, var(--acc));
  --bg: #0a0b0d;
  --bg-lift: #17191d;
  --fg: #f3f4f6;
  --fg-2: rgba(243, 244, 246, 0.6);
  --fg-3: rgba(243, 244, 246, 0.38);
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(26, 28, 32, 0.56);
  --glass-solid: rgba(22, 24, 28, 0.9);
  --glass-edge: rgba(255, 255, 255, 0.09);
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.7);
  /* Borrowed by the way back's icon (cc-home.css). */
  --ink: var(--fg);
  --bd: rgba(255, 255, 255, 0.16);
  --intake: #4f8dff;
  --compression: #f2b23a;
  --power: #ff5a36;
  --exhaust: #9aa3ad;
  --edge: clamp(18px, 3.4vw, 52px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* The key light, seen (the sun on its track): its core, the glow round it and the wide haze. */
  --sun-core: #fff6ea;
  --sun-glow: rgba(255, 226, 186, 0.55);
  --sun-haze: rgba(255, 214, 160, 0.13);
  --sun-track: rgba(255, 236, 210, 0.32);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --acc-text: var(--acc-text-light, #bf3636);
  --bg: #e8e9eb;
  --bg-lift: #f7f7f8;
  --fg: #0d0e10;
  --fg-2: rgba(13, 14, 16, 0.6);
  --fg-3: rgba(13, 14, 16, 0.42);
  --line: rgba(0, 0, 0, 0.1);
  --glass: rgba(255, 255, 255, 0.6);
  --glass-solid: rgba(255, 255, 255, 0.92);
  --glass-edge: rgba(0, 0, 0, 0.07);
  --shadow: 0 18px 50px -26px rgba(20, 24, 32, 0.35);
  --bd: rgba(0, 0, 0, 0.16);
  --sun-core: #fff3dc;
  --sun-glow: rgba(255, 160, 60, 0.5);
  --sun-haze: rgba(255, 170, 80, 0.16);
  --sun-track: rgba(150, 90, 20, 0.35);
  color-scheme: light;
}

/* An accent chosen: the sun takes its colour (--sun-tint, ui.js sunTint); the default accent keeps the warm light above. */
:root[data-sun-tint] {
  --sun-core: color-mix(in srgb, var(--sun-tint) 22%, #fff);
  --sun-glow: color-mix(in srgb, var(--sun-tint) 58%, transparent);
  --sun-haze: color-mix(in srgb, var(--sun-tint) 15%, transparent);
  --sun-track: color-mix(in srgb, var(--sun-tint) 40%, transparent);
}

:root[data-theme="light"][data-sun-tint] {
  --sun-core: color-mix(in srgb, var(--sun-tint) 30%, #fff);
  --sun-glow: color-mix(in srgb, var(--sun-tint) 55%, transparent);
  --sun-haze: color-mix(in srgb, var(--sun-tint) 18%, transparent);
  --sun-track: color-mix(in srgb, color-mix(in srgb, var(--sun-tint) 55%, #000) 40%, transparent);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

button,
input,
output {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--acc-text);
  outline-offset: 3px;
}

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

/*
 * The studio: a soft pool of light where the engine stands, with a breath of the accent in it, so
 * the engine's dark outline reads against it. (In the pool's own gradient, not one more layer: a
 * software compositor draws every gradient under the canvas again each frame.)
 */
.studio {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 52% 50% at var(--stage-x, 60%) 50%, color-mix(in srgb, var(--acc) 9%, var(--bg-lift)), transparent 72%),
    radial-gradient(ellipse 120% 80% at 50% 120%, color-mix(in srgb, var(--bg-lift) 60%, transparent), transparent 70%),
    var(--bg);
  transition: background 0.5s var(--ease);
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}

#stage.ready {
  opacity: 1;
}

/* While the engine loads (4 MB): a quiet ring where it will stand, only if that takes a moment. */
.loading {
  position: fixed;
  left: var(--stage-x, 60%);
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--fg-2);
  opacity: 0;
  pointer-events: none;
  animation: loading-in 0.5s 0.7s ease both, loading-turn 0.9s linear infinite;
}

#stage.ready ~ .loading,
#stage[hidden] ~ .loading {
  display: none;
}

@keyframes loading-in {
  to {
    opacity: 1;
  }
}

@keyframes loading-turn {
  to {
    rotate: 1turn;
  }
}

/* Off Explore a sideways drag turns the engine. */
#stage.turnable {
  cursor: grab;
}

#stage.pointing {
  cursor: pointer;
}

/*
 * The key light, seen: a sun the visitor drags along its track over the engine (sun.js). Placed
 * with translate (written per move), brightened with the key (--sun-on, written per change). Only
 * the core takes the pointer; the glow and the haze let everything under them be clicked.
 */
.sun {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  translate: var(--sun-x, -100px) var(--sun-y, -100px);
  opacity: var(--sun-on, 0);
  cursor: grab;
  touch-action: none;
  outline: none;
  transition: opacity 0.6s var(--ease);
}

.sun.dragging {
  cursor: grabbing;
}

.sun-halo,
.sun-core {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
}

.sun-halo {
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  background: radial-gradient(circle, var(--sun-glow) 0, var(--sun-haze) 22%, transparent 62%);
}

/* A portrait stage: the track keeps between the text and the engine, so a smaller glow (sun.js). */
@media (max-aspect-ratio: 85/100) {
  .sun-halo {
    width: 260px;
    height: 260px;
    margin: -130px 0 0 -130px;
  }
}

.sun-core {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background: var(--sun-core);
  box-shadow: 0 0 10px 3px var(--sun-core), 0 0 34px 10px var(--sun-glow);
  transition: transform 0.4s var(--ease);
}

.sun:hover .sun-core,
.sun.dragging .sun-core {
  transform: scale(1.25);
}

.sun:focus-visible .sun-core {
  outline: 2px solid var(--acc-text);
  outline-offset: 6px;
}

/* Its track: a faint dotted arc while the sun is pointed at, focused or dragged. */
#sun-track {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

#sun-track path {
  fill: none;
  stroke: var(--sun-track);
  stroke-width: 1.5;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.sun:is(:hover, :focus-visible, .dragging) + #sun-track {
  opacity: 1;
}

.sun[hidden],
.sun[hidden] + #sun-track {
  display: none;
}

#stage.grabbing {
  cursor: grabbing;
}

.fallback {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.nojs {
  position: fixed;
  inset: auto 0 40%;
  text-align: center;
  color: var(--fg-2);
}

/* ---- The top bar ---- */

.top {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 18px);
  left: var(--edge);
  right: var(--edge);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  margin-right: auto;
  color: var(--fg);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand span {
  font-weight: 400;
  color: var(--fg-2);
}

.round {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  transition: background-color 0.25s ease, scale 0.18s ease, border-color 0.25s ease;
}

.round:hover {
  background: color-mix(in srgb, var(--fg) 12%, var(--glass));
}

.round:active {
  scale: 0.94;
}

.round.small {
  width: 30px;
  height: 30px;
}

.round svg,
.pill svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.round .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--acc), color-mix(in srgb, var(--acc) 40%, var(--fg)), var(--acc));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--acc) 30%, transparent);
}

.cta {
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--acc);
  color: var(--acc-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--acc) 70%, transparent);
  transition: filter 0.2s ease, scale 0.18s ease, background-color 0.4s var(--ease);
}

.cta:hover {
  filter: brightness(1.08);
}

.cta:active {
  scale: 0.97;
}

/* ---- Popovers (appearance, parts) ---- */

.pop {
  position: fixed;
  z-index: 30;
  padding: 14px;
  border-radius: 18px;
  background: var(--glass-solid);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
  animation: pop-in 0.28s var(--ease) both;
}

.pop[hidden] {
  display: none;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

.look {
  top: calc(env(safe-area-inset-top) + 64px);
  right: var(--edge);
  width: 232px;
}

.pop-title {
  margin: 2px 2px 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.pop-title + .seg {
  width: 100%;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.swatches button {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: scale 0.18s ease, box-shadow 0.2s ease;
}

.swatches button:hover {
  scale: 1.08;
}

.swatches button[aria-checked="true"] {
  box-shadow: 0 0 0 2px var(--glass-solid), 0 0 0 3.5px var(--c);
}

.custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 14px;
  font-size: 13px;
  color: var(--fg-2);
}

.custom input {
  width: 34px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.custom input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.custom input::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}

.custom input::-moz-color-swatch {
  border: 0;
  border-radius: 5px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.seg button {
  flex: 1;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-2);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.seg button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}

.parts {
  width: 248px;
  max-height: min(440px, 60vh);
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.parts ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: part;
}

.parts li {
  display: flex;
  align-items: center;
  gap: 4px;
  counter-increment: part;
}

.parts li > button:first-child {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  text-align: left;
  font-size: 13px;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.parts li > button:first-child::before {
  content: counter(part, decimal-leading-zero);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-3);
}

.parts li > button:first-child:hover,
.parts li > button[aria-current="true"] {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.parts li.off > button:first-child {
  opacity: 0.4;
}

.parts .eye {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--fg-3);
}

.parts .eye:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.parts .eye svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

/* ---- The section panels ---- */

.panel {
  position: fixed;
  left: var(--edge);
  top: 50%;
  z-index: 10;
  width: min(380px, 32vw);
  translate: 0 -46%;
  pointer-events: none;
}

.panel[hidden] {
  display: none;
}

.panel > * {
  pointer-events: auto;
}

/* In: each line rises out of a soft blur, one after another. Out: they lift and fade. */
.panel.entering > * {
  animation: rise 0.9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms + 120ms);
}

.panel.leaving > * {
  animation: lift 0.38s cubic-bezier(0.4, 0, 1, 1) both;
  animation-delay: calc(var(--i, 0) * 25ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(8px);
  }
}

@keyframes lift {
  to {
    opacity: 0;
    transform: translateY(-12px);
    filter: blur(6px);
  }
}

.kicker {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc-text);
}

.lead {
  margin: 0 0 18px;
  font-size: clamp(30px, 3.3vw, 50px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.lead span {
  display: block;
}

.lead .dim {
  color: var(--fg-3);
}

.body {
  margin: 0 0 26px;
  max-width: 34ch;
  font-size: 15px;
  color: var(--fg-2);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 0.25s ease, border-color 0.25s ease, scale 0.18s ease;
}

.pill:hover {
  background: color-mix(in srgb, var(--fg) 7%, transparent);
}

.pill:active {
  scale: 0.97;
}

.pill.primary {
  background: var(--fg);
  border-color: transparent;
  color: var(--bg);
}

.pill.primary:hover {
  background: color-mix(in srgb, var(--fg) 88%, var(--bg));
}

/* The first screen's figures. */
.stats {
  display: flex;
  gap: 30px;
  margin: 34px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
}

.stats dt {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.stats dd {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stats dd small {
  margin-left: 3px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--fg-2);
}

/* Explore's controls. */
.slider {
  display: grid;
  grid-template-columns: auto 1fr 3.2em;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.slider output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--fg-2);
}

.slider input {
  --p: 0%;
  width: 100%;
  height: 22px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.slider input::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--acc) var(--p), color-mix(in srgb, var(--fg) 16%, transparent) var(--p));
}

.slider input::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--fg) 16%, transparent);
}

.slider input::-moz-range-progress {
  height: 3px;
  border-radius: 3px;
  background: var(--acc);
}

.slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.slider input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Four-stroke's crank: the two turns of one cycle, coloured by cylinder 1's strokes; dragged, it turns the engine by hand. */
.slider.cycle {
  --track: linear-gradient(
    90deg,
    color-mix(in srgb, var(--power) 78%, transparent) 0 24.6%,
    transparent 24.6% 25.4%,
    color-mix(in srgb, var(--exhaust) 62%, transparent) 25.4% 49.6%,
    transparent 49.6% 50.4%,
    color-mix(in srgb, var(--intake) 78%, transparent) 50.4% 74.6%,
    transparent 74.6% 75.4%,
    color-mix(in srgb, var(--compression) 78%, transparent) 75.4%
  );
  margin-bottom: 20px;
}

.slider.cycle input::-webkit-slider-runnable-track {
  height: 5px;
  background: var(--track);
}

.slider.cycle input::-moz-range-track {
  height: 5px;
  background: var(--track);
}

.slider.cycle input::-moz-range-progress {
  background: none;
}

.slider.cycle input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
}

.slider.cycle input::-moz-range-thumb {
  width: 16px;
  height: 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  position: relative;
  overflow: hidden;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.chip:hover {
  background: color-mix(in srgb, var(--fg) 7%, transparent);
}

.chip[aria-pressed="true"],
.chip[aria-expanded="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: transparent;
}

/* The tour's progress, a hairline along the chip's foot. */
.chip i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: var(--progress, 0%);
  background: var(--acc);
}

.chip span {
  position: relative;
}

.views {
  display: flex;
  gap: 2px;
}

.views button {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--fg-2);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.views button:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 7%, transparent);
}

/* The four-stroke's legend and firing order. */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--fg-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend li.on {
  color: var(--fg);
}

.legend li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.legend [data-stroke="intake"] {
  --c: var(--intake);
}

.legend [data-stroke="compression"] {
  --c: var(--compression);
}

.legend [data-stroke="power"] {
  --c: var(--power);
}

.legend [data-stroke="exhaust"] {
  --c: var(--exhaust);
}

.firing {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
}

.firing span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--fg-2);
  background: color-mix(in srgb, var(--c, var(--fg)) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--fg)) 28%, transparent);
  transition: background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.firing span.fire {
  color: #fff;
  background: var(--power);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--power) 30%, transparent), 0 0 22px var(--power);
}

/* Specs. */
.specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 22px;
  margin: 0 0 22px;
}

.specs div {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.specs dt {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.specs dd {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.note {
  margin: 0;
  max-width: 38ch;
  font-size: 12.5px;
  color: var(--fg-3);
}

/* ---- A part's card (Explore) ---- */

.card {
  position: fixed;
  right: var(--edge);
  top: 50%;
  z-index: 15;
  width: 300px;
  translate: 0 -50%;
  padding: 18px 18px 14px;
  border-radius: 20px;
  background: var(--glass-solid);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
  animation: card-in 0.5s var(--ease) both;
}

.card[hidden] {
  display: none;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-n {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acc-text);
}

.card h3 {
  margin: 6px 0 2px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-sub {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--fg-3);
}

.card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg-2);
}

.card-why {
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.card-nav {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* ---- Anatomy's labels ---- */

#leaders {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}

#leaders line {
  stroke: color-mix(in srgb, var(--fg) 34%, transparent);
  stroke-width: 1;
}

#leaders circle {
  fill: var(--fg);
}

#callouts {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.callout {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  background: var(--glass-solid);
  border: 1px solid var(--glass-edge);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.4s var(--ease), background-color 0.2s ease;
  will-change: transform;
}

.callout.shown {
  opacity: 1;
}

.callout i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--acc) 22%, transparent);
  color: var(--acc-text);
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.callout:hover,
.callout:focus-visible {
  background: var(--fg);
  color: var(--bg);
}

/* ---- The bottom: a caption and the sections ---- */

.caption {
  position: fixed;
  left: var(--edge);
  bottom: calc(env(safe-area-inset-bottom) + 30px);
  z-index: 10;
  margin: 0;
  max-width: 26ch;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--fg-3);
  transition: opacity 0.35s ease;
}

.caption.changing {
  opacity: 0;
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 22px);
  z-index: 20;
  display: flex;
  translate: -50% 0;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  box-shadow: var(--shadow);
}

.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--fg-2);
  transition: color 0.35s var(--ease);
  align-items: center;
}

.tab i {
  font-style: normal;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-3);
  transition: color 0.35s var(--ease);
}

.tab:hover {
  color: var(--fg);
}

.tab[aria-selected="true"] {
  color: var(--bg);
}

.tab[aria-selected="true"] i {
  color: color-mix(in srgb, var(--bg) 55%, transparent);
}

/* The sliding mark behind the chosen tab. */
.tab-mark {
  position: absolute;
  top: 4px;
  left: 0;
  height: 38px;
  width: var(--w, 0px);
  border-radius: 999px;
  background: var(--fg);
  translate: var(--x, 0px) 0;
  transition: translate 0.6s var(--ease), width 0.6s var(--ease), background-color 0.4s ease;
}

/* ---- Smaller screens ---- */

@media (max-width: 1100px) {
  .tab {
    padding: 0 13px;
  }

  /* (The figures' row is wider than the text's column here: it would run under the engine.) */
  .caption,
  .stats {
    display: none;
  }
}

@media (max-height: 700px) {
  .caption,
  .note {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --edge: 18px;
  }

  .top {
    top: calc(env(safe-area-inset-top) + 12px);
    gap: 10px;
  }

  .cta {
    height: 34px;
    padding: 0 14px;
  }

  .round {
    width: 34px;
    height: 34px;
  }

  .look {
    top: calc(env(safe-area-inset-top) + 56px);
  }

  .panel {
    top: calc(env(safe-area-inset-top) + 66px);
    left: var(--edge);
    right: var(--edge);
    width: auto;
    translate: none;
  }

  .kicker {
    margin-bottom: 8px;
    font-size: 11px;
  }

  .lead {
    margin-bottom: 10px;
    font-size: clamp(26px, 7.4vw, 34px);
  }

  .body {
    margin-bottom: 14px;
    font-size: 14px;
    max-width: none;
  }

  /* (The figures are in Specs; here the band under the text is the sun's and the engine's.) */
  .stats {
    display: none;
  }

  /* The panel's controls sit low, over the tabs, leaving the middle to the engine. */
  .panel .row,
  .panel .slider,
  .panel .chips,
  .panel .views,
  .panel .legend,
  .panel .firing {
    position: fixed;
    left: var(--edge);
    right: var(--edge);
  }

  #p-overview .row {
    bottom: calc(env(safe-area-inset-bottom) + 84px);
    justify-content: center;
  }

  #p-explore .slider {
    bottom: calc(env(safe-area-inset-bottom) + 172px);
    margin: 0;
  }

  #p-explore .chips {
    bottom: calc(env(safe-area-inset-bottom) + 126px);
    margin: 0;
    justify-content: center;
  }

  #p-explore .views {
    bottom: calc(env(safe-area-inset-bottom) + 86px);
    justify-content: center;
  }

  #p-strokes .legend {
    bottom: calc(env(safe-area-inset-bottom) + 182px);
    justify-content: center;
    margin: 0;
  }

  #p-strokes .firing {
    bottom: calc(env(safe-area-inset-bottom) + 134px);
    justify-content: center;
    margin: 0;
  }

  #p-strokes .row {
    bottom: calc(env(safe-area-inset-bottom) + 84px);
    justify-content: center;
  }

  .firing span {
    width: 30px;
    height: 30px;
  }

  .specs {
    gap: 10px 16px;
    margin-bottom: 12px;
  }

  .specs dd {
    font-size: 13.5px;
  }

  .note {
    display: none;
  }

  .tabs {
    left: 10px;
    right: 10px;
    translate: none;
    justify-content: space-between;
  }

  .tab {
    flex: 1;
    justify-content: center;
    height: 36px;
    padding: 0 4px;
    font-size: 12px;
  }

  .tab i {
    display: none;
  }

  .tab-mark {
    height: 36px;
  }

  .card {
    left: var(--edge);
    right: var(--edge);
    top: auto;
    bottom: calc(env(safe-area-inset-bottom) + 76px);
    width: auto;
    translate: none;
    max-height: 46vh;
    overflow-y: auto;
  }

  .parts {
    left: var(--edge);
    right: var(--edge);
    bottom: calc(env(safe-area-inset-bottom) + 76px);
    width: auto;
  }

  .callout {
    height: 22px;
    font-size: 10.5px;
    padding: 0 8px 0 3px;
  }

  .callout i {
    width: 15px;
    height: 15px;
    font-size: 9px;
  }
}

/* Short screens (a phone on its side): the panel keeps to its headline. */
@media (max-height: 520px) and (min-width: 600px) {
  .panel {
    width: min(320px, 34vw);
  }

  .lead {
    font-size: 26px;
    margin-bottom: 10px;
  }

  .body,
  .note,
  .legend,
  .stats {
    display: none;
  }

  .specs {
    gap: 8px 14px;
  }

  .specs dd {
    font-size: 13px;
  }

  .tab {
    height: 32px;
  }

  .tab-mark {
    height: 32px;
  }

  .tabs {
    bottom: calc(env(safe-area-inset-bottom) + 12px);
  }

  .top {
    top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel.entering > *,
  .panel.leaving > * {
    animation-duration: 0.01ms;
    animation-delay: 0s;
  }

  .loading {
    display: none;
  }

  .tab-mark,
  #stage {
    transition: none;
  }
}
