/* B³ — site styles
   Palette sampled directly from the B³ roundel artwork. */

@font-face { font-family: "Marcellus"; src: url("fonts/marcellus-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --cream: #f7f1e7;   /* roundel ground */
  --paper: #eee4d3;   /* deeper cream for alternate sections */
  --ink: #353222;     /* roundel lettering */
  --ink-soft: #5b5846;
  --wheat: #cd9d73;   /* bakes */
  --coffee: #5d3b22;  /* brews */
  --sage: #646854;    /* botanicals */
  --line: rgba(53, 50, 34, .22);
  --focus: #5d3b22;

  --display: "Marcellus", "Trajan Pro", Georgia, serif;
  --text: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--cream); padding: .5rem .9rem; z-index: 10; }
.skip:focus { left: .5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; letter-spacing: .01em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.75rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
sup.cube { font-size: .55em; vertical-align: .75em; line-height: 0; }

/* ---------- Header ---------- */
.site-header { padding: 1.25rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { font-family: var(--display); font-size: 1.75rem; text-decoration: none; line-height: 1; }
.site-nav { display: flex; gap: clamp(1rem, 3vw, 2rem); font-weight: 500; font-size: .98rem; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2rem, 6vw, 5rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { max-width: 12ch; }
.hero .lede { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--ink-soft); margin-top: 1.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .7rem 1.4rem;
  font: 600 1rem/1 var(--text);
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--cream);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--coffee); border-color: var(--coffee); }
.btn--quiet { background: transparent; color: var(--ink); }
.btn--quiet:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* The roundel, shown as the die-cut sticker it becomes on each loaf */
.sticker { justify-self: center; width: min(100%, 26rem); aspect-ratio: 1; position: relative; }
.sticker img {
  width: 100%; border-radius: 50%;
  filter: drop-shadow(0 10px 24px rgba(53,50,34,.10));
}
@media (prefers-reduced-motion: no-preference) {
  .sticker img { animation: press 900ms cubic-bezier(.2,.8,.2,1) 150ms both; }
  @keyframes press { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- Divider ----------
   A double hairline, echoing the double ring of the roundel. */
.rule {
  height: 4px; margin: 0; border: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  opacity: .55;
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--paper { background: var(--paper); }
.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--ink-soft); margin-top: 1rem; }

/* Bread */
.bread-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.steps { list-style: none; padding: 0; margin: 2rem 0 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.25rem 1fr; gap: .75rem; padding: 1rem 0; border-top: 1px solid var(--line); max-width: var(--measure); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step); font-family: var(--display); font-size: 1.5rem; line-height: 1.1; color: var(--coffee); }
.note { font-size: .95rem; color: var(--ink-soft); margin-top: 1.5rem; }

/* Arms */
.arms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.arm { border-top: 2px solid var(--arm); padding-top: 1.25rem; }
.arm--bakes { --arm: var(--wheat); }
.arm--brews { --arm: var(--coffee); }
.arm--botanicals { --arm: var(--sage); }
.arm h3 { margin-bottom: .35rem; }
.arm .status { font-size: .9rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .9rem; }
.arm .status::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .45rem; background: var(--line); vertical-align: .05em; }
.arm--bakes .status::before { background: var(--wheat); }

.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.story blockquote { margin: 0; font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.3; max-width: 22ch; }

/* ---------- Forms ---------- */
.form-panel { background: var(--cream); border: 1px solid var(--line); border-radius: 2px; box-shadow: 0 0 0 5px var(--cream), 0 0 0 6px var(--line); margin: 6px; }
.form-body { padding: clamp(1.25rem, 3.5vw, 2.25rem); }
form { display: grid; gap: 1.1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.field { display: grid; gap: .35rem; align-content: start; }
label, legend { font-weight: 500; font-size: .98rem; }
.hint { font-size: .88rem; color: var(--ink-soft); font-weight: 400; }
.optional { font-weight: 400; color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: #fffdf8; border: 1px solid rgba(53,50,34,.45); border-radius: 4px;
  padding: .7rem .8rem; min-height: 3rem;
}
textarea { min-height: 6.5rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: #8a2d1c; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; min-width: 0; }
legend { padding: 0; margin-bottom: .35rem; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 2.6rem; padding: .5rem 1rem;
  border: 1px solid rgba(53,50,34,.45); border-radius: 999px; background: #fffdf8;
  font-size: .95rem; cursor: pointer; user-select: none;
}
.choice input:checked + span { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.check { display: grid; grid-template-columns: 1.25rem 1fr; gap: .65rem; align-items: start; font-weight: 400; font-size: .95rem; }
.check input { width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; accent-color: var(--ink); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: .25rem; }
.form-error { color: #8a2d1c; font-weight: 500; font-size: .95rem; margin: 0; }
.honey { display: none; }

.confirmation { display: grid; gap: .75rem; }
.confirmation h3 { font-size: 1.75rem; }
.confirmation[hidden] { display: none; }

/* ---------- Order form: products, code, summary ---------- */
.small-head { font-size: 1.35rem; margin: 2.25rem 0 .75rem; }
.terms { padding-left: 1.1rem; margin: 0; max-width: var(--measure); color: var(--ink-soft); font-size: .97rem; }
.terms li { margin-bottom: .5rem; }
.products { display: grid; gap: 0; border-top: 1px solid var(--line); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.product-name { font-weight: 600; font-size: 1.02rem; }
.product-price { font-weight: 400; color: var(--ink-soft); white-space: nowrap; }
.product-desc, .product-allergens, .product-suits { margin: .2rem 0 0; font-size: .88rem; color: var(--ink-soft); }
.product-allergens { color: var(--ink); }
.stepper { justify-self: start; display: inline-grid; grid-template-columns: 2.5rem 3.25rem 2.5rem; align-items: stretch; border: 1px solid rgba(53,50,34,.45); border-radius: 999px; overflow: hidden; background: #fffdf8; }
.stepper .step { font: 600 1.15rem/1 var(--text); border: 0; background: transparent; color: var(--ink); cursor: pointer; min-height: 2.75rem; }
.stepper .step:hover { background: var(--paper); }
.stepper input[type="number"] { border: 0; border-radius: 0; min-height: 2.75rem; padding: .3rem 0; text-align: center; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.address { gap: 1.1rem; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; }
.code-row input { text-transform: uppercase; letter-spacing: .05em; }
.btn--small { min-height: 3rem; padding: .6rem 1.1rem; }
#or-code-status.ok { color: #2f5a2a; font-weight: 500; }
.summary { border: 1px solid var(--line); background: #fffdf8; padding: 1rem 1.1rem; border-radius: 4px; }
.summary[hidden] { display: none; }
.summary dl { margin: 0 0 .5rem; display: grid; gap: .3rem; }
.summary dl > div { display: flex; justify-content: space-between; gap: 1rem; }
.summary dt, .summary dd { margin: 0; }
.summary .summary-total { font-weight: 600; border-top: 1px solid var(--line); padding-top: .4rem; margin-top: .2rem; }
.summary .hint { margin: 0; }
@media (max-width: 420px) {
  .product { grid-template-columns: 1fr; gap: .6rem; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--cream); padding: 2.5rem 0 3rem; font-size: .95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: center; }
.site-footer .wordmark { font-size: 1.5rem; }
.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer p { margin: 0; }

/* ---------- Simple pages ---------- */
.page { padding: clamp(2rem, 6vw, 4rem) 0 clamp(4rem, 8vw, 6rem); }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.25rem); margin-bottom: 1.5rem; }
.page h2 { font-size: 1.5rem; margin: 2.25rem 0 .75rem; }
.page ul { max-width: var(--measure); padding-left: 1.2rem; }
.page li { margin-bottom: .4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero .wrap, .bread-grid, .story { grid-template-columns: 1fr; }
  .hero .sticker { order: -1; width: min(70%, 17rem); }
  .arms { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .site-nav { gap: 1rem; font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
