/* Sparrowmill Bakehouse (demo). Bread cools on blue gingham: the cloth's blue is the one accent, its check is
   the order counter's field. Young Serif for the shop's voice, Inter for the rest. Phone first. */

@font-face { font-family: "Young Serif"; src: url("/fonts/YoungSerif-latin.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-latin.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  --paper: #fafaf9;
  --ink: #1d1712;
  --muted: #62584e;
  --surface: #efeeec;
  --blue: #1f48a3;
  --blue-deep: #17377d;
  --on-blue: #ffffff;
  --serif: "Young Serif", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --m: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* the cloth: two translucent bands crossing, darker where they meet */
  --gingham: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Crect width='28' height='28' fill='%23ffffff'/%3E%3Crect width='14' height='28' fill='%231f48a3' fill-opacity='.38'/%3E%3Crect width='28' height='14' fill='%231f48a3' fill-opacity='.38'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, figure, address { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; }
ul { list-style: none; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
address { font-style: normal; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.muted { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--blue); color: var(--on-blue);
  font: 500 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease);
}
.btn:hover { background: var(--blue-deep); }
.btn:active { transform: scale(0.97); }
.btn-quiet { background: var(--surface); color: var(--ink); }
.btn-quiet:hover { background: #e7e2d9; }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 15px; }

/* ---------- Demo notice and bar ---------- */
.demo-bar { padding: 8px max(var(--m), calc(50% - 36ch)); background: var(--ink); color: #efefed; font-size: 13px; line-height: 1.4; text-align: center; }
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--m); background: var(--paper);
}
.brand, .foot-brand { font: 400 24px/1 var(--serif); text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.brand span, .foot-brand span { font: 500 13px/1 var(--sans); color: var(--muted); }
.top nav { display: flex; align-items: center; gap: 24px; }
.top nav a:not(.btn) { display: none; text-decoration: none; font-size: 15px; }
.top nav .btn { display: none; }
.top nav a:not(.btn):hover { color: var(--blue); }

/* ---------- Hero: the loaf first on a phone, beside the words on a desk ---------- */
.hero { display: grid; }
.hero-pic { order: -1; width: 100%; height: 52svh; object-fit: cover; object-position: 50% 60%; }
.hero-text { display: grid; gap: 20px; padding: 32px var(--m) 56px; }
.hero h1 { font-size: clamp(44px, 11vw, 88px); max-width: 12ch; }
.lead { font-size: 17px; max-width: 34ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.open { font-size: 15px; color: var(--muted); }
.open strong { color: var(--ink); font-weight: 500; }

/* ---------- Menu ---------- */
.menu { padding: 72px var(--m); }
.section-head { display: grid; gap: 12px; margin-bottom: 40px; max-width: 40rem; }
.section-head h2 { font-size: clamp(38px, 9vw, 64px); }
.menu-grid { display: grid; gap: 56px; }
.menu-col img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; margin-bottom: 20px; }
.menu-col h3 { font-size: 32px; margin-bottom: 12px; }
.items { display: grid; gap: 16px; }
.items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; }
.items .name { font-weight: 500; }
.items .price { font-variant-numeric: tabular-nums; }
.items .desc { grid-column: 1 / -1; color: var(--muted); font-size: 15px; }

/* ---------- The morning band ---------- */
.band { position: relative; display: grid; }
.band img { grid-area: 1 / 1; width: 100%; height: 60svh; object-fit: cover; }
.band p {
  grid-area: 1 / 1; align-self: end; justify-self: start;
  margin: 0 var(--m) 24px; padding: 18px 22px; max-width: 26ch;
  background: var(--paper); border-radius: 14px;
  font: 400 24px/1.25 var(--serif);
}

/* ---------- Order: a counter on the cloth ---------- */
.order { padding: 56px var(--m); background: var(--gingham) 0 0 / 28px 28px; }
.order-panel { max-width: 44rem; margin: 0 auto; padding: 32px 22px; background: var(--paper); border-radius: 20px; }
.order .section-head { margin-bottom: 24px; }
.order-form { display: grid; gap: 20px; }
.picker { display: grid; gap: 4px; }
.picker li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 0; }
.picker .name { font-weight: 500; }
.picker .price { color: var(--muted); font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface); }
.qty button {
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); font: 500 17px/1 var(--sans); cursor: pointer;
  transition: background-color 140ms ease, transform 140ms var(--ease);
}
.qty button:hover { background: #e2ddd3; }
.qty button:active { transform: scale(0.9); }
.qty output { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.picker li.has .name { color: var(--blue); }
.when { display: grid; gap: 16px; }
.when label { display: grid; gap: 6px; font-size: 15px; font-weight: 500; }
.when select, .when input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1.5px solid #d9d3c8; border-radius: 12px; background: var(--paper); color: var(--ink);
  font: 400 16px/1 var(--sans);
}
.when select:focus, .when input:focus { outline: none; border-color: var(--blue); }
.total-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; }
.total { display: flex; align-items: baseline; gap: 10px; }
.total > span { color: var(--muted); font-size: 15px; }
.total strong { font: 400 32px/1 var(--serif); font-variant-numeric: tabular-nums; }
.note { font-size: 15px; color: var(--muted); }
.note.is-error { color: #b42318; }
.note.is-done { color: var(--ink); }

/* ---------- Hours and visit ---------- */
.info { display: grid; gap: 48px; padding: 72px var(--m); }
.info h2 { font-size: clamp(38px, 9vw, 64px); margin-bottom: 20px; }
.hours { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.hours th, .hours td { padding: 12px 0; text-align: left; font-weight: 400; border-bottom: 1px solid #e4dfd6; }
.hours td { text-align: right; }
.hours tr.today th, .hours tr.today td { font-weight: 600; color: var(--blue); }
#visit address { font: 400 24px/1.3 var(--serif); margin-bottom: 12px; }
#visit p { margin-bottom: 8px; }

/* ---------- Footer ---------- */
.foot { display: grid; gap: 16px; justify-items: start; padding: 48px var(--m) 112px; background: var(--ink); color: #e7e6e3; font-size: 15px; }
.foot-brand { font-size: 32px; color: #fff; }
.foot-brand span { color: #a9a7a2; }
.foot p { max-width: 70ch; }
.credits { color: #a9a7a2; font-size: 13px; }

/* ---------- Phone: the order button rides along until the order counter is on screen ---------- */
.sticky-order {
  position: fixed; left: var(--m); right: var(--m); bottom: 16px; z-index: 6;
  transition: transform 300ms var(--ease), opacity 300ms ease;
}
.sticky-order.is-hidden { transform: translateY(140%); opacity: 0; pointer-events: none; }

/* ---------- Entrances ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.js .hero-text > * { animation: rise 800ms var(--ease) both; }
.js .hero-text > *:nth-child(2) { animation-delay: 80ms; }
.js .hero-text > *:nth-child(3) { animation-delay: 160ms; }
.js .hero-text > *:nth-child(4) { animation-delay: 240ms; }
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Wider screens ---------- */
@media (min-width: 760px) {
  :root { --m: 40px; }
  .top { padding: 16px var(--m); }
  .top nav a:not(.btn) { display: inline; }
  .top nav .btn { display: inline-flex; }
  .when { grid-template-columns: 1fr 1fr; }
  .order-panel { padding: 48px; }
  .info { grid-template-columns: 1fr 1fr; gap: 64px; }
  .sticky-order { display: none; }
  .foot { padding-bottom: 48px; }
}
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); min-height: calc(100svh - 110px); }
  .hero-pic { order: 0; height: 100%; }
  .hero-text { align-content: center; padding: 48px var(--m); }
  .menu { padding: 120px var(--m); }
  .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
  .band img { height: 72svh; }
  .band p { margin: 0 var(--m) 40px; font-size: 32px; max-width: 24ch; }
  .order { padding: 120px var(--m); }
  .info { padding: 120px var(--m); max-width: 1100px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
