/* Bakeward launch site. Palette, type and motion follow docs/site/BRIEF.md. */

:root {
  --bw-bg: #f7f1e6; /* flour */
  --bw-surface: #fffbf4; /* cream */
  --bw-sunken: #f1e8d8;
  --bw-border: #e3d6c0;
  --bw-text: #2e2219;
  --bw-muted: #6f5d4c;
  --bw-crust: #9a5a2b; /* primary accent, buttons */
  --bw-crust-strong: #7c4520; /* hover */
  --bw-crust-soft: #f3e1cc;
  --bw-on-crust: #fffaf2;
  --bw-oven: #2a1c14; /* dark bands */
  --bw-oven-text: #f2e8da;
  --bw-dawn: #e9a25c; /* clock arcs, highlights on dark */
  --bw-night: #3d4a7a; /* "Night" badge and night arc of the clock */
  --bw-night-soft: #e5e8f5;
  --bw-focus: #c47a3a;

  --bw-shadow: 0 1px 2px rgb(74 48 24 / 0.06), 0 18px 40px -16px rgb(74 48 24 / 0.28);
  --bw-shadow-deep: 0 1px 2px rgb(74 48 24 / 0.08), 0 28px 56px -18px rgb(74 48 24 / 0.38);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --rhythm: clamp(5rem, 10vw, 9rem);
  --ring: 0 0 0 3px color-mix(in srgb, var(--bw-focus) 40%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bw-bg: #1c1612;
    --bw-surface: #261e18;
    --bw-sunken: #1f1813;
    --bw-border: #3b2f25;
    --bw-text: #f2e8da;
    --bw-muted: #b8a690;
    --bw-crust: #e0a46c;
    --bw-crust-strong: #f0bb87;
    --bw-crust-soft: #3e2c1d;
    --bw-on-crust: #24180f;
    --bw-oven: #120d0a;
    --bw-oven-text: #f2e8da;
    --bw-dawn: #f0b070;
    --bw-night: #aeb9ec;
    --bw-night-soft: #262b45;
    --bw-focus: #e0a46c;

    --bw-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 40px -16px rgb(0 0 0 / 0.6);
    --bw-shadow-deep: 0 1px 2px rgb(0 0 0 / 0.45), 0 28px 56px -18px rgb(0 0 0 / 0.7);
  }
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bw-bg);
  color: var(--bw-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

svg {
  display: block;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bw-focus) 40%, transparent);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--bw-crust);
  color: var(--bw-on-crust);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "SOFT" 50, "opsz" 144;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bw-crust);
}

.section-title {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  margin-top: 0.75rem;
}

.lead,
.body-lg {
  font-size: 1.1875rem;
  margin-top: 1.25rem;
  max-width: 38rem;
  color: var(--bw-muted);
}

.small-print {
  font-size: 0.875rem;
  color: var(--bw-muted);
}

.section {
  position: relative;
  padding-block: calc(var(--rhythm) / 2);
}

.section-head {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head-centre {
  text-align: center;
}

.section-head-centre .lead {
  margin-inline: auto;
}

/* Logo mark, shared through <use href="#mark"> */
.m-loaf {
  fill: var(--bw-crust);
  stroke: var(--bw-crust);
}

.m-score {
  fill: none;
  stroke: var(--bw-bg);
}

.m-arrow {
  fill: none;
  stroke: var(--bw-crust);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ---------- Links and buttons ---------- */

.text-link {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 250ms var(--ease-out), color 200ms ease;
  border-radius: 2px;
}

.text-link:hover {
  background-size: 100% 1px;
}

.text-link:active {
  transform: scale(0.98);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    transform 200ms var(--ease-out),
    box-shadow 200ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-pill {
  border-radius: 999px;
}

.btn-primary {
  background: var(--bw-crust);
  color: var(--bw-on-crust);
  box-shadow: 0 1px 2px rgb(74 48 24 / 0.12), 0 8px 18px -10px rgb(74 48 24 / 0.5);
}

.btn-primary:hover {
  background: var(--bw-crust-strong);
  transform: translateY(-1px);
}

.btn-primary:active,
.btn-dawn:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  border-color: var(--bw-border);
  border-radius: 999px;
  background: var(--bw-surface);
  color: var(--bw-text);
}

.btn-secondary:hover {
  border-color: var(--bw-crust);
  color: var(--bw-crust);
}

.btn-dawn {
  background: var(--bw-dawn);
  color: var(--bw-oven);
}

.btn-dawn:hover {
  background: color-mix(in srgb, var(--bw-dawn) 82%, var(--bw-oven-text));
  transform: translateY(-1px);
}

.btn-lg {
  min-height: 56px;
  padding-inline: 2rem;
  font-size: 1.125rem;
}

/* ---------- Header ---------- */

.scroll-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 24px;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bw-bg) 85%, transparent);
  border-bottom: 1px solid var(--bw-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 200ms ease;
}

.site-header.is-scrolled::before {
  opacity: 1;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: none;
  border-radius: 8px;
}

.logo:active {
  transform: scale(0.98);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav ul {
  display: flex;
  gap: 1.75rem;
  font-weight: 500;
  font-size: 0.9375rem;
}

.site-nav ul a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background-position: 0 calc(100% - 10px);
}

.btn-header {
  min-height: 44px;
  padding-inline: 1.25rem;
  font-size: 0.9375rem;
}

.label-short {
  display: none;
}

@media (max-width: 719.98px) {
  .site-nav ul {
    display: none;
  }

  .label-long {
    display: none;
  }

  .label-short {
    display: inline;
  }
}

/* ---------- 1. Hero ---------- */

.hero {
  overflow-x: clip;
  padding-block: clamp(2.5rem, 6vw, 5rem) calc(var(--rhythm) / 2);
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.75rem, 1.6rem + 5.2vw, 6rem);
  font-weight: 500;
  margin-top: 1rem;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--bw-crust);
}

.br-desktop {
  display: none;
}

.hero-sub {
  max-width: 34ch;
  margin-top: 1.5rem;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--bw-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  margin-top: 2rem;
}

.quiet-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  color: var(--bw-muted);
  background-position: 0 calc(100% - 10px);
}

.quiet-link:hover {
  color: var(--bw-text);
}

.hero .small-print {
  margin-top: 1.25rem;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.clock-glow {
  position: absolute;
  inset: -12%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bw-dawn) 18%, transparent), transparent);
  pointer-events: none;
}

.clock {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1;
  container-type: inline-size;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 400ms var(--ease-out);
}

.clock-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.clock-face {
  fill: var(--bw-surface);
  filter: drop-shadow(0 18px 30px rgb(74 48 24 / 0.16));
}

.clock-ring {
  fill: none;
  stroke: var(--bw-border);
  stroke-width: 1.5;
}

.clock-ticks {
  fill: none;
  stroke: var(--bw-muted);
  stroke-width: 1.25;
  stroke-linecap: round;
  opacity: 0.6;
}

.clock-ticks-long {
  stroke-width: 2.25;
  opacity: 1;
}

.clock-labels text {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  fill: var(--bw-muted);
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}

.clock-track {
  fill: none;
  stroke: var(--bw-border);
  stroke-width: 2;
}

.arc {
  fill: none;
  stroke-width: 12;
}

.arc-bake {
  stroke: var(--bw-crust);
}

.arc-preheat {
  stroke: var(--bw-dawn);
  stroke-opacity: 0.6;
}

.arc-fridge {
  stroke: var(--bw-night);
  stroke-width: 10;
}

.arc-shape {
  stroke: var(--bw-crust-strong);
}

.arc-bulk {
  stroke: var(--bw-dawn);
}

.arc-levain-edge {
  stroke: var(--bw-crust);
}

.arc-levain {
  stroke: var(--bw-crust-soft);
  stroke-width: 9;
}

.clock-notches {
  stroke: var(--bw-surface);
  stroke-width: 2;
  stroke-linecap: round;
}

.oven-halo {
  fill: var(--bw-crust);
  opacity: 0.2;
}

.oven-dot {
  fill: var(--bw-crust);
  stroke: var(--bw-surface);
  stroke-width: 2.5;
}

.clock-hand line {
  stroke: var(--bw-text);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.clock-hand circle {
  fill: var(--bw-text);
}

.clock-centre {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.clock-centre .eyebrow {
  font-size: clamp(0.5625rem, 2.9cqi, 0.8125rem);
  color: var(--bw-muted);
}

.clock-time-main,
.clock-time-start {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 50, "opsz" 144;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.clock-time-main {
  font-size: min(3rem, 10.6cqi);
  margin-bottom: 2.5cqi;
}

.clock-time-start {
  font-size: min(2rem, 7.2cqi);
  color: var(--bw-muted);
  transition: opacity 500ms var(--ease-out);
}

.clock-time-start.is-pending {
  opacity: 0;
}

.clock-hairline {
  width: 22cqi;
  height: 1px;
  margin-bottom: 2.5cqi;
  background: var(--bw-border);
}

.clock-pill {
  margin-top: 2cqi;
  padding: 0.2em 0.75em;
  border-radius: 999px;
  background: var(--bw-crust-soft);
  color: var(--bw-crust-strong);
  font-size: clamp(0.6875rem, 2.9cqi, 0.8125rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  .clock-pill {
    color: var(--bw-crust);
  }
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  }

  .hero-copy {
    container-type: inline-size;
  }

  .hero h1 {
    font-size: min(6rem, 12cqi);
  }

  .br-desktop {
    display: inline;
  }

  .clock {
    max-width: 440px;
  }
}

/* ---------- Dark bands ---------- */

.band {
  position: relative;
  color: var(--bw-oven-text);
  background: var(--bw-oven);
}

.band .eyebrow {
  color: var(--bw-dawn);
}

.band .lead {
  color: color-mix(in srgb, var(--bw-oven-text) 75%, transparent);
}

/* ---------- 2. Backwards, one step at a time ---------- */

.band-steps {
  margin-block: calc(var(--rhythm) / 2);
  padding-block: calc(120px + var(--rhythm) / 2);
  background: linear-gradient(
    to bottom,
    var(--bw-bg),
    var(--bw-oven) 120px,
    var(--bw-oven) calc(100% - 120px),
    var(--bw-bg)
  );
}

.steps {
  display: grid;
  gap: 2rem;
}

.readout {
  display: none;
}

.step-list {
  position: relative;
  display: grid;
  gap: 2rem;
}

/* The vertical rail, one dot per card */
.step-list::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 7px;
  width: 1px;
  background: color-mix(in srgb, var(--bw-oven-text) 18%, transparent);
}

.step {
  position: relative;
  padding-left: 2.25rem;
}

.step::before {
  content: "";
  position: absolute;
  top: 1.6rem;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bw-oven);
  border: 2px solid var(--bw-dawn);
}

.step-card {
  padding: 1.5rem 1.5rem 1.625rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bw-oven-text) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--bw-oven-text) 10%, transparent);
  transition:
    opacity 300ms ease,
    border-color 300ms ease;
}

.step-time {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 50, "opsz" 144;
  font-size: clamp(1.875rem, 1.4rem + 2vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--bw-dawn);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.5rem;
}

.step h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
}

.step-card p:last-child {
  margin-top: 0.375rem;
  color: color-mix(in srgb, var(--bw-oven-text) 75%, transparent);
}

.night-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--bw-oven-text) 28%, transparent);
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--bw-oven-text) 72%, transparent);
}

.badge-night {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--bw-night-soft);
  color: var(--bw-night);
  font-size: 0.8125rem;
  font-weight: 600;
}

@media (min-width: 960px) {
  .steps {
    grid-template-columns: 5fr 7fr;
    gap: 4rem;
    align-items: start;
  }

  .readout {
    position: sticky;
    top: 20vh;
    display: flex;
    gap: 1.75rem;
  }

  .readout-rail {
    position: relative;
    flex: none;
    width: 11px;
    height: 15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
  }

  .readout-rail::before,
  .readout-fill {
    content: "";
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: 1px;
    background: color-mix(in srgb, var(--bw-oven-text) 18%, transparent);
  }

  .readout-fill {
    background: var(--bw-dawn);
    transform-origin: top;
    transform: scaleY(1);
    transition: transform 400ms var(--ease-out);
  }

  .readout-rail i {
    position: relative;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bw-oven);
    border: 2px solid color-mix(in srgb, var(--bw-oven-text) 30%, transparent);
    transition: border-color 300ms ease, background-color 300ms ease;
  }

  .readout-rail i.is-on {
    border-color: var(--bw-dawn);
    background: var(--bw-dawn);
  }

  .readout-day {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--bw-oven-text) 70%, transparent);
  }

  .readout-time {
    display: grid;
    margin-top: 0.5rem;
    font-family: var(--font-display);
    font-variation-settings: "SOFT" 50, "opsz" 144;
    font-size: clamp(3.5rem, 2rem + 3vw, 5rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.02;
    font-variant-numeric: tabular-nums;
  }

  .readout-time > span {
    grid-area: 1 / 1;
    transition:
      opacity 240ms ease,
      transform 240ms var(--ease-out);
  }

  .readout-time > .is-leaving {
    opacity: 0;
    transform: translateY(-12px);
  }

  .readout-time > .is-entering {
    opacity: 0;
    transform: translateY(12px);
  }

  .readout-end {
    max-width: 18rem;
    margin-top: 1.25rem;
    color: var(--bw-dawn);
    font-weight: 500;
    transition:
      opacity 400ms ease,
      transform 400ms var(--ease-out);
  }

  /* Static state: no JavaScript or reduced motion */
  .steps:not(.is-live) .readout-time {
    font-size: clamp(2.25rem, 1.4rem + 1.6vw, 3rem);
  }

  .steps:not(.is-live) .readout-day {
    display: none;
  }

  /* Live state: the readout follows the scroll */
  .steps.is-live .step-time {
    display: none;
  }

  .steps.is-live .step-list {
    gap: 0;
    padding-block: 10vh 30vh;
  }

  .steps.is-live .step-list::before,
  .steps.is-live .step::before {
    display: none;
  }

  .steps.is-live .step {
    min-height: 60vh;
    padding-left: 0;
  }

  .steps.is-live .step:last-child {
    min-height: 0;
  }

  .steps.is-live .step.reveal {
    opacity: 1;
    transform: none;
  }

  .steps.is-live .step-card,
  .steps.is-live .night-note {
    opacity: 0.45;
  }

  .steps.is-live .step.is-active .step-card,
  .steps.is-live .step.is-active .night-note {
    opacity: 1;
  }

  .steps.is-live .step.is-active .step-card {
    border-left-color: var(--bw-dawn);
  }

  .steps.is-live .readout-end {
    opacity: 0;
    transform: translateY(8px);
  }

  .steps.is-live.is-end .readout-end {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 3. Three things ---------- */

.three-title {
  margin-bottom: 2.5rem;
  text-align: center;
}

.three {
  display: grid;
  gap: 3rem;
}

.three-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  column-gap: 1rem;
}

.three-num {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 50, "opsz" 144;
  font-size: 4rem;
  line-height: 0.9;
  color: color-mix(in srgb, var(--bw-crust) 35%, transparent);
}

.diagram {
  justify-self: end;
  fill: none;
  stroke: var(--bw-crust);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagram .fill,
.icon .fill {
  fill: var(--bw-crust);
  stroke: none;
}

.three-item h3 {
  grid-column: 1 / -1;
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 50, "opsz" 72;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.three-item p {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  color: var(--bw-muted);
}

@media (min-width: 800px) {
  .three {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
  }

  .three-item {
    padding-top: 1.5rem;
    border-top: 1px solid var(--bw-border);
  }
}

/* ---------- 4. Features ---------- */

.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: clamp(3rem, 6vw, 5rem);
  }

  .split-reverse .split-copy {
    order: 2;
  }
}

.card {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: 20px;
  background: var(--bw-surface);
  border: 1px solid var(--bw-border);
  box-shadow: var(--bw-shadow);
}

/* 4a. Instrument */

.instrument-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.instrument-label {
  font-weight: 600;
}

.instrument-readout {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 50, "opsz" 144;
  font-size: clamp(2.5rem, 2rem + 2vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--bw-crust);
}

input[type="range"] {
  --thumb: 28px;
  display: block;
  width: 100%;
  height: 44px;
  margin: 1rem 0 0.5rem;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"][hidden] {
  display: none;
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--bw-night-soft), var(--bw-dawn));
  border: 1px solid var(--bw-border);
}

input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--bw-night-soft), var(--bw-dawn));
  border: 1px solid var(--bw-border);
}

input[type="range"]::-webkit-slider-thumb {
  width: var(--thumb);
  height: var(--thumb);
  margin-top: calc((10px - var(--thumb)) / 2 - 1px);
  border-radius: 50%;
  background: var(--bw-crust);
  border: 3px solid var(--bw-surface);
  box-shadow: 0 2px 6px rgb(74 48 24 / 0.35);
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow 200ms ease;
}

input[type="range"]::-moz-range-thumb {
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  background: var(--bw-crust);
  border: 3px solid var(--bw-surface);
  box-shadow: 0 2px 6px rgb(74 48 24 / 0.35);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: var(--ring), 0 2px 6px rgb(74 48 24 / 0.35);
}

input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: var(--ring), 0 2px 6px rgb(74 48 24 / 0.35);
}

.bars {
  display: grid;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.375rem 1rem;
}

.bar-label {
  font-weight: 500;
}

.bar-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  grid-column: 1 / -1;
  height: 12px;
  border-radius: 999px;
  background: var(--bw-sunken);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to right, var(--bw-crust-soft), var(--bw-crust));
  transition: width 200ms ease;
}

/* 4b. Scale ticket */

.ticket {
  font-variant-numeric: tabular-nums;
}

.ticket-head {
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--bw-border);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--bw-muted);
}

.ticket-group {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bw-crust);
}

.grams {
  margin-top: 0.5rem;
}

.grams div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-block: 0.25rem;
}

/* Dotted leader between label and number */
.grams div::after {
  content: "";
  order: 1;
  flex: 1;
  border-bottom: 2px dotted var(--bw-border);
  transform: translateY(-0.3em);
}

.grams dd {
  order: 2;
  min-width: 4.5ch;
  text-align: right;
  font-weight: 600;
}

.ticket-total {
  margin: 1.5rem calc(-1 * clamp(1.5rem, 3vw, 2.25rem)) calc(-1 * clamp(1.5rem, 3vw, 2.25rem));
  padding: 1rem clamp(1.5rem, 3vw, 2.25rem);
  border-radius: 0 0 19px 19px;
  background: var(--bw-crust-soft);
}

/* 4c. Tiles */

.tiles {
  display: grid;
  gap: 1rem;
}

@media (min-width: 560px) {
  .tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .tiles {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.tile {
  padding: 1.75rem;
  border-radius: 16px;
  background: var(--bw-surface);
  border: 1px solid var(--bw-border);
  box-shadow: 0 1px 2px rgb(74 48 24 / 0.05);
  transition:
    transform 200ms var(--ease-out),
    box-shadow 200ms ease,
    opacity 500ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--bw-shadow);
  }
}

.icon {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--bw-crust);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile h3 {
  margin-top: 1.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.tile p {
  margin-top: 0.375rem;
  color: var(--bw-muted);
  font-size: 1rem;
  line-height: 1.55;
}

/* ---------- 5. The real app ---------- */

.section-app {
  overflow-x: clip;
}

.section-app .container {
  position: relative;
}

.sunday {
  display: none;
}

@media (min-width: 960px) {
  .sunday {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    font-family: var(--font-display);
    font-variation-settings: "SOFT" 50, "opsz" 144;
    font-style: italic;
    font-size: 18vw;
    line-height: 1;
    letter-spacing: -0.04em;
    color: color-mix(in srgb, var(--bw-crust) 6%, transparent);
    pointer-events: none;
    user-select: none;
    translate: -50% -60%;
  }

  @supports (animation-timeline: view()) {
    .sunday {
      animation: drift linear both;
      animation-timeline: view();
    }
  }
}

@keyframes drift {
  from {
    transform: translateY(20px);
  }
  to {
    transform: translateY(-20px);
  }
}

.app-frame {
  overflow: hidden;
  border-radius: 20px;
  background: var(--bw-surface);
  border: 1px solid var(--bw-border);
  box-shadow: var(--bw-shadow-deep);
}

.app-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding-inline: 1rem;
  border-bottom: 1px solid var(--bw-border);
  background: var(--bw-sunken);
}

.app-dots {
  position: absolute;
  left: 1rem;
  display: flex;
  gap: 6px;
}

.app-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bw-border);
}

.app-address {
  padding: 0.2rem 1rem;
  border-radius: 999px;
  background: var(--bw-surface);
  font-size: 0.8125rem;
  color: var(--bw-muted);
}

.app-frame iframe {
  display: block;
  width: 100%;
  height: min(860px, 80vh);
  border: 0;
  background: var(--bw-bg);
}

.btn-full {
  display: none;
}

@media (max-width: 719.98px) {
  .app-frame {
    max-width: 390px;
    margin-inline: auto;
    border-radius: 32px;
  }

  .app-dots {
    display: none;
  }

  .app-frame iframe {
    height: 640px;
  }

  .btn-full {
    display: flex;
    width: 100%;
    max-width: 390px;
    margin: 1.5rem auto 0;
  }
}

/* ---------- 6. Closing call to action ---------- */

.band-close {
  margin-top: calc(var(--rhythm) / 2);
  padding-block: clamp(5rem, 12vw, 10rem);
  background: linear-gradient(to bottom, var(--bw-bg), var(--bw-oven) 120px);
  text-align: center;
}

.close-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.steam-loaf {
  margin-bottom: 2rem;
}

.steam path {
  fill: none;
  stroke: var(--bw-oven-text);
  stroke-width: 1.25;
  stroke-linecap: round;
  opacity: 0.6;
  animation: steam 4s ease-out infinite;
}

.steam path:nth-child(2) {
  animation-delay: 1.3s;
}

.steam path:nth-child(3) {
  animation-delay: 2.6s;
}

@keyframes steam {
  0% {
    opacity: 0.6;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.close-title {
  font-size: clamp(2.75rem, 1.6rem + 5.2vw, 6rem);
  max-width: 14ch;
}

.close-sub {
  margin-top: 1.5rem;
  font-size: 1.25rem;
  color: color-mix(in srgb, var(--bw-oven-text) 75%, transparent);
}

.band-close .btn-lg {
  margin-top: 2.5rem;
}

.close-small {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--bw-oven-text) 70%, transparent);
}

/* ---------- 7. Footer ---------- */

.site-footer {
  padding-block: 2.5rem 3rem;
  background: var(--bw-oven);
  color: var(--bw-oven-text);
}

.site-footer .container {
  padding-top: 2.5rem;
  border-top: 1px solid color-mix(in srgb, var(--bw-oven-text) 10%, transparent);
}

.footer-row {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-note {
  color: color-mix(in srgb, var(--bw-oven-text) 80%, transparent);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--bw-dawn);
  font-weight: 600;
  background-position: 0 calc(100% - 10px);
}

.footer-small {
  margin-top: 2rem;
  font-size: 0.8125rem;
  color: color-mix(in srgb, var(--bw-oven-text) 62%, transparent);
}

@media (min-width: 800px) {
  .footer-row {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .footer-note {
    text-align: center;
  }

  .footer-link {
    justify-self: end;
  }
}

/* ---------- Reveal on entering view ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 500ms var(--ease-out),
    transform 500ms var(--ease-out);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

.js .reveal-rise {
  transform: translateY(24px);
}

.js .tile.reveal {
  transition:
    opacity 500ms var(--ease-out),
    transform 500ms var(--ease-out),
    box-shadow 200ms ease;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal,
  .js .reveal-rise {
    opacity: 1;
    transform: none;
  }

  .clock {
    transform: none;
  }

  .clock-time-start.is-pending {
    opacity: 1;
  }

  .steam path {
    opacity: 0.6;
    transform: none;
  }
}
