/* DAYBREAK PROVISIONS main stylesheet. Layout, components, motion.
   Tokens live in tokens.css. The page is a day: six sky bands, 05:00 to 20:00. */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  background: var(--sky);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* sky-live: JS + motion allowed. The whole viewport becomes one sky at a
   time; the root semantic set steps with [data-sky] and cross-fades. */
html.sky-live body {
  transition: background-color var(--dur-sky) ease, color var(--dur-sky) ease;
}
html.sky-live .dayband { background: transparent; }

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.bakery-top :focus-visible,
.ovendoor :focus-visible { outline-color: var(--chrome-focus); }

::selection { background: var(--accent-raw); color: var(--btn-ink); }

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: var(--z-skip);
  padding: var(--s-3) var(--s-5);
  background: var(--espresso);
  color: var(--flour);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-pill);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; outline-color: #ffdca8; }

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

/* ---------- text roles ---------- */
.timecode {
  font-family: var(--font-display);
  font-size: var(--t-time);
  font-weight: 650;
  letter-spacing: var(--track-time);
  text-transform: uppercase;
  color: var(--muted);
}
.timecode--accent { color: var(--accent); }
.timecode .tc-hour { color: var(--accent); }

.band-title,
.sheet-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--t-h2);
  line-height: var(--lh-heading);
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
.daybreak-display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--t-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.daybreak-display em,
.band-title em {
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
}

.bake-name, .step-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-h3);
  line-height: 1.15;
  margin: 0;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.45;
  max-width: var(--measure);
  margin: 0;
}
.prose { max-width: var(--measure); color: var(--muted); text-wrap: pretty; margin: 0; }
.prose strong { color: var(--fg); }
.prose a { color: var(--fg); }

/* ---------- layout ---------- */
.counter {
  width: min(100% - 2 * var(--edge), var(--max-w));
  margin-inline: auto;
}

.dayband {
  background: var(--sky);
  color: var(--fg);
  padding-block: var(--band-pad);
}
.dayband + .dayband { border-top: 1px solid var(--line); }
.dayband--open {
  min-height: 92svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--band-pad) + 3.5rem);
}

.band-head {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-7);
}
.band-head .band-note { color: var(--muted); font-size: var(--t-small); max-width: var(--measure); }

/* ---------- header: masthead + bakery clock ---------- */
.bakery-top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-clock);
  color: var(--chrome-fg);
  padding-block: var(--s-4);
  pointer-events: none;
}
.bakery-top > .counter {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.bakery-top a,
.bakery-top button,
.bakery-top .clockworks { pointer-events: auto; }
html:not(.js) .bakery-top { position: absolute; }

.masthead {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-right: auto;
}
.masthead svg { width: 26px; height: 26px; color: var(--chrome-accent); }
.masthead .masthead-word { white-space: nowrap; }

.clockworks {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.clockface { width: 42px; height: 42px; }
.clockface-rim { fill: none; stroke: currentColor; stroke-width: 2; opacity: 0.75; }
.clockface-tick { stroke: currentColor; stroke-width: 1.6; opacity: 0.45; }
.clock-hand line { stroke: var(--chrome-accent); stroke-width: 2.6; stroke-linecap: round; }
.clock-hand { transform-origin: 24px 24px; }
.clock-pin { fill: currentColor; }
.clock-readout {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--t-time);
  letter-spacing: var(--track-time);
  min-width: 5ch;
  font-variant-numeric: tabular-nums;
}

.bakery-nav { display: flex; gap: var(--s-5); }
.bakery-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-small);
  text-decoration: none;
  opacity: 0.85;
}
.bakery-nav a:hover,
.bakery-nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 0.3em; }

.top-order {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-small);
  text-decoration: none;
  background: var(--accent-raw);
  color: var(--btn-ink);
  padding: 0.55em 1.1em;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.top-order:hover { filter: brightness(1.08); }

.ovendoor-btn {
  display: none;
  font: 600 var(--t-small) var(--font-display);
  color: inherit;
  background: none;
  border: 1.5px solid currentColor;
  border-radius: var(--r-pill);
  padding: 0.45em 1em;
  cursor: pointer;
}

@media (max-width: 63.9rem) {
  .bakery-nav, .top-order { display: none; }
  .ovendoor-btn { display: inline-block; }
  .clockworks { margin-left: auto; }
  .clock-readout { display: none; }
}
@media (max-width: 30rem) {
  .masthead .masthead-word span { display: none; } /* "Daybreak" only on tiny screens */
}

/* ---------- ovendoor: the mobile menu overlay (focus-trapped dialog) ---------- */
.ovendoor {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-ovendoor);
  background: var(--sky-0500);
  color: var(--flour);
  padding: calc(var(--s-8) + var(--s-4)) var(--edge) var(--s-7);
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s-6);
}
.ovendoor.is-open { display: flex; overflow-y: auto; overscroll-behavior: contain; }
.ovendoor nav { display: flex; flex-direction: column; gap: var(--s-2); }
.ovendoor nav a {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 8vw, 3rem);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}
.ovendoor nav a .timecode { color: var(--meal-dark); }
.ovendoor-close {
  position: absolute;
  top: var(--s-4);
  right: var(--edge);
  font: 600 var(--t-small) var(--font-display);
  color: inherit;
  background: none;
  border: 1.5px solid currentColor;
  border-radius: var(--r-pill);
  padding: 0.45em 1em;
  cursor: pointer;
}
.ovendoor .ovendoor-foot { color: var(--meal-dark); font-size: var(--t-small); }

/* ---------- buttons ---------- */
.crust-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  background: var(--accent-raw);
  color: var(--btn-ink);
  border: none;
  border-radius: var(--r-pill);
  padding: 0.8em 1.5em;
  cursor: pointer;
}
.crust-btn:hover { filter: brightness(1.07); }
.crust-btn:active { transform: translateY(1px); }
.crust-btn--ghost {
  background: transparent;
  color: inherit;
  border: 1.5px solid currentColor;
}
.crust-btn--ghost:hover { filter: none; background: color-mix(in srgb, currentColor 10%, transparent); }
.btn-sun { font-weight: 400; }

/* ---------- hero (05:00) ---------- */
.firstlight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  margin-bottom: var(--s-6);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-6); }
.hero-base { margin-top: var(--s-6); display: flex; flex-direction: column; gap: 0; max-width: 46rem; }

.oven-ticker {
  margin-top: var(--s-8);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  border-top: 1px solid var(--line);
  padding-top: var(--s-4);
}
.oven-ticker .timecode { color: var(--muted); }
.oven-ticker .timecode .tc-hour { color: var(--accent); }

/* ---------- bake lists ---------- */
.bakelist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.bake {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  gap: var(--s-2) var(--s-5);
  align-items: baseline;
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--line);
}
.bake-out { font-variant-numeric: tabular-nums; }
.bake-note { color: var(--muted); font-size: var(--t-small); max-width: 34rem; margin: 0; grid-column: 2; }
.bake-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  grid-row: 1;
  grid-column: 3;
}
@media (max-width: 40rem) {
  .bake { grid-template-columns: 1fr auto; }
  .bake-out { grid-column: 1 / -1; order: -1; }
  .bake-note { grid-column: 1; }
}

/* the crumb: a SAMPLE / placeholder chip */
.crumb {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 0.15em 0.7em;
  vertical-align: 0.2em;
  margin-left: 0.5em;
  white-space: nowrap;
}

/* half-price tag on the day-old rack */
.rack-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-small);
  background: var(--fg);
  color: var(--sky);
  border-radius: var(--r-1);
  padding: 0.2em 0.7em;
  transform: rotate(-2deg);
}

/* ---------- proof steps (how ordering works) ---------- */
.proof-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
  counter-reset: proof;
}
.proof-step {
  counter-increment: proof;
  border-top: 2px solid var(--line-strong);
  padding-top: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.proof-step::before {
  content: counter(proof, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--accent);
}
.proof-step p { margin: 0; color: var(--muted); font-size: var(--t-small); max-width: 26rem; }
@media (max-width: 47.9rem) { .proof-steps { grid-template-columns: 1fr; } }

/* ---------- two-column band body (copy + list) ---------- */
.band-split {
  display: grid;
  grid-template-columns: minmax(16rem, 2fr) 3fr;
  gap: var(--s-7);
  align-items: start;
}
@media (max-width: 55rem) { .band-split { grid-template-columns: 1fr; } }

/* ---------- hours slate + visit block (19:00) ---------- */
.hours-slate {
  width: 100%;
  border-collapse: collapse;
  max-width: 30rem;
  font-variant-numeric: tabular-nums;
}
.hours-slate caption {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  padding-bottom: var(--s-3);
}
.hours-slate th, .hours-slate td {
  text-align: left;
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.hours-slate td { text-align: right; }
.hours-slate .is-closed td { color: var(--muted); }

.visit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--s-7);
  align-items: start;
}
.visit-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.visit-lines a { color: inherit; }
.visit-lines .timecode { display: block; margin-bottom: 0.2em; }

/* last call CTA row */
.last-call {
  margin-top: var(--s-8);
  border-top: 1px solid var(--line);
  padding-top: var(--s-7);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}

/* ---------- footer ---------- */
.lastlight {
  margin-top: var(--s-8);
  border-top: 1px solid var(--line);
  padding-top: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--t-small);
}
.lastlight nav { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.lastlight a { color: inherit; }

/* ---------- interior banner ---------- */
.sheet-banner { padding-top: calc(var(--band-pad) + 3rem); }
.sheet-crumbtrail {
  display: flex;
  gap: 0.6em;
  list-style: none;
  margin: 0 0 var(--s-4);
  padding: 0;
  font-size: var(--t-small);
  color: var(--muted);
}
.sheet-crumbtrail a { color: inherit; }
.sheet-crumbtrail li + li::before { content: "/"; margin-right: 0.6em; opacity: 0.6; }

/* ---------- order sheet (the form) ---------- */
.order-sheet { max-width: 44rem; }
.sheet-field { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-5); }
.sheet-field label { font-family: var(--font-display); font-weight: 650; }
.sheet-field .field-hint { color: var(--muted); font-size: var(--t-small); }
.sheet-field input,
.sheet-field select,
.sheet-field textarea {
  font: inherit;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: 0.6em 0.8em;
  max-width: 30rem;
}
.sheet-field textarea { min-height: 7.5rem; max-width: none; resize: vertical; }
.sheet-field input:focus-visible,
.sheet-field select:focus-visible,
.sheet-field textarea:focus-visible { outline-offset: 1px; }
.sheet-field.is-burnt input,
.sheet-field.is-burnt select,
.sheet-field.is-burnt textarea { border-color: var(--accent); border-width: 2px; }
.field-err { color: var(--accent); font-weight: 500; font-size: var(--t-small); }

.sheet-row { display: flex; flex-wrap: wrap; gap: 0 var(--s-6); }
.sheet-row .sheet-field { flex: 1 1 14rem; }

/* the bake picker: quantity per loaf */
.sheet-bakes { border: 1px solid var(--line-strong); border-radius: var(--r-2); padding: var(--s-5) var(--s-5) var(--s-2); margin: 0 0 var(--s-5); }
.sheet-bakes legend { font-family: var(--font-display); font-weight: 650; padding-inline: var(--s-2); }
.sheet-bakes .bakes-hint { color: var(--muted); font-size: var(--t-small); margin: 0 0 var(--s-4); }
.bake-qty {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--s-4);
  align-items: center;
  padding-block: var(--s-3);
  border-top: 1px solid var(--line);
}
.bake-qty label { font-weight: 500; }
.bake-qty label .qty-price { color: var(--muted); font-size: var(--t-small); white-space: nowrap; }
.bake-qty input {
  width: 4.5rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: 0.35em 0.4em;
}

/* honeypot: visually removed, still focusable-off */
.sheet-glaze {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* error summary */
.sheet-errors {
  border: 2px solid var(--accent);
  border-radius: var(--r-2);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
  max-width: 30rem;
}
.sheet-errors h2 { font: 700 1.05rem var(--font-display); margin: 0 0 var(--s-2); }
.sheet-errors ul { margin: 0; padding-left: 1.2em; }
.sheet-errors a { color: var(--accent); font-weight: 500; }

.sheet-status { min-height: 1.5em; margin-top: var(--s-3); font-weight: 500; max-width: var(--measure); }

/* fallback: copy the sheet by hand */
.sheet-fallback {
  margin-top: var(--s-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-2);
  padding: var(--s-5);
}
.sheet-fallback h3 { margin: 0 0 var(--s-2); font: 700 1.05rem var(--font-display); }
.sheet-fallback p { margin: 0 0 var(--s-3); color: var(--muted); font-size: var(--t-small); }
.sheet-fallback textarea {
  width: 100%;
  min-height: 9rem;
  font: 0.9rem/1.5 ui-monospace, Menlo, monospace;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: var(--s-3);
}
.sheet-fallback .fallback-acts { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-3); }

.order-aside { color: var(--muted); font-size: var(--t-small); max-width: var(--measure); }
.order-aside a { color: var(--fg); }

/* the scriptless notice: the sure path, shown only when main.js never landed */
.sheet-nojs { display: none; }
html:not(.js) .sheet-nojs {
  display: block;
  max-width: var(--measure);
  margin: 0 0 var(--s-6);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-2);
  color: var(--fg);
  font-size: var(--t-small);
  line-height: var(--lh-body);
}
html:not(.js) .sheet-nojs .timecode { display: block; color: var(--accent); margin-bottom: var(--s-2); }
html:not(.js) .sheet-nojs a { color: var(--fg); font-weight: 500; }

/* ---------- 404: the bare shelf ---------- */
.bare-shelf { min-height: 100svh; display: flex; align-items: center; }
.bare-shelf .counter { display: flex; flex-direction: column; gap: var(--s-5); }
.shelf-svg { width: min(22rem, 70vw); color: var(--muted); }
.shelf-svg .shelf-accent { color: var(--accent); }

code {
  font: 0.88em ui-monospace, Menlo, monospace;
  background: color-mix(in srgb, currentColor 9%, transparent);
  border-radius: 4px;
  padding: 0.08em 0.35em;
}

/* ---------- styleguide ---------- */
.sg-swatchrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--s-4); }
.sg-swatch { border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.sg-swatch-sky { height: 5.5rem; }
.sg-swatch dl { margin: 0; padding: var(--s-3) var(--s-4); font-size: var(--t-small); }
.sg-swatch dt { font-family: var(--font-display); font-weight: 700; }
.sg-swatch dd { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.sg-typerow { display: flex; flex-direction: column; gap: var(--s-5); }
.sg-pairs { display: flex; flex-direction: column; gap: var(--s-6); }
.sg-note { color: var(--muted); font-size: var(--t-small); max-width: var(--measure); }
.sg-demo { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }

/* ---------- rise reveals (IO adds .is-risen; no-JS shows everything) ---------- */
html.js .rise {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
html.js .rise.is-risen { opacity: 1; transform: none; }
html.js .rise[data-delay="1"] { transition-delay: 120ms; }
html.js .rise[data-delay="2"] { transition-delay: 240ms; }
html.js .rise[data-delay="3"] { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  html.js .rise {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html.sky-live body { transition: none; }
  .crust-btn:active { transform: none; }
}

/* ---------- print: the day, flattened ---------- */
@media print {
  .bakery-top, .ovendoor, .skip-link { display: none; }
  .dayband { background: #fff !important; color: #000 !important; padding-block: 1.5rem; min-height: 0; }
  body { background: #fff; color: #000; }
}
