/* =====================================================================
   Wren & Kettle — sample cafe site (Haney Web Starter template)

   REBRANDING FOR A REAL CLIENT — change these, in this order:
   1. Colours: the five "inks" below (--paper, --sheet, --ink, --rule,
      --red, --carbon). Keep --ink dark enough for 4.5:1 on --sheet.
   2. Fonts: --font-display / --font-body / --font-hand, and the Google
      Fonts <link> in index.html's <head>.
   3. In index.html: business name, phone (tel: links), address, hours
      table, menu items + prices, Maps link, photo alt text.
   4. In script.js: the HOURS object (drives "Open now") and FORM_ENDPOINT.
   5. Remove the "Sample site" strip and footer line once it's a real site.
   ===================================================================== */
:root {
  /* Brand inks — the guest-check palette */
  --paper:   #d5e6d0;  /* page ground: the pad backing */
  --sheet:   #ecf5e8;  /* each check / sheet */
  --sheet-2: #f6faf3;  /* customer copy (carbon sheet) */
  --ink:     #143a2c;  /* body text */
  --rule:    #2f6e55;  /* printed rules, column heads, borders */
  --rule-soft: rgb(47 110 85 / .28);
  --red:     #b3261c;  /* numbering-machine red: serials, stamps, primary action */
  --red-deep:#8f1c14;
  --carbon:  #22358f;  /* ballpoint blue: handwriting, typed input */
  --steel:   #8e9997;  /* ticket rail */
  --steel-dk:#5b6664;
  --steel-lt:#d0d6d4;

  /* Brand type */
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Roboto, sans-serif;
  --font-hand: "Reenie Beanie", "Segoe Print", cursive;

  /* Rhythm: the check's rule pitch */
  --row: 2.75rem;
  --gutter: clamp(16px, 4.5vw, 56px);
  --wrap: 1180px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  color-scheme: light;
  scroll-padding-top: 96px;
  scrollbar-color: var(--rule) var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  caret-color: var(--carbon);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
::selection { background: var(--carbon); color: var(--sheet-2); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-color: var(--red); }
:focus-visible { outline: 3px solid var(--carbon); outline-offset: 3px; border-radius: 4px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: absolute; left: 12px; top: -80px; z-index: 30;
  background: var(--red); color: #fff; padding: 10px 16px; border-radius: 4px; font-weight: 700; text-decoration: none;
}
.skip:focus { top: calc(10px + env(safe-area-inset-top, 0px)); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Demo strip ---------- */
.demo {
  background: var(--ink); color: var(--sheet);
  font-size: .875rem; text-align: center;
  padding: 8px var(--gutter);
}
.demo a { color: var(--sheet); font-weight: 700; }

/* ---------- Ticket rail (nav) ---------- */
.rail { position: relative; z-index: 20; padding-top: 6px; }
.rail__bar, .hang__bar {
  height: 14px; border-radius: 3px;
  background: linear-gradient(var(--steel-lt), var(--steel) 55%, var(--steel-dk));
  box-shadow: 0 3px 6px -2px rgb(20 58 44 / .45);
}
.rail__bar { margin-inline: calc(var(--gutter) * -.5); }
.rail__tickets {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px;
  margin-top: -6px;
}
.ticket {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 14px 14px 8px;
  background: var(--sheet); color: var(--ink);
  border: 1.5px solid var(--rule); border-top: 0;
  border-radius: 0 0 3px 3px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.125rem;
  letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
  box-shadow: 0 6px 10px -8px rgb(20 58 44 / .6);
  transform-origin: 50% 0;
  transition: transform .5s var(--ease-out);
}
.ticket::before { /* clip on the rail */
  content: ""; position: absolute; top: -2px; left: 50%; width: 22px; height: 9px;
  margin-left: -11px; border-radius: 0 0 3px 3px;
  background: var(--steel-dk);
}
a.ticket:hover { transform: rotate(-2deg); }
.ticket--brand { font-size: 1.5rem; font-weight: 800; letter-spacing: .02em; color: var(--rule); margin-right: auto; }
.ticket--call { background: var(--red); border-color: var(--red-deep); color: #fff; }
.ticket--call::before { background: var(--red-deep); }
.rail__links { display: flex; gap: 10px; order: 3; width: 100%; }
.rail__links .ticket { flex: 1; justify-content: center; font-size: 1rem; }

@media (min-width: 760px) {
  .rail { position: sticky; top: 0; padding-top: calc(6px + env(safe-area-inset-top, 0px)); background: linear-gradient(var(--paper) 70%, rgb(213 230 208 / 0)); }
  .rail__links { order: 0; width: auto; }
  .rail__links .ticket { flex: none; }
}

/* ---------- Check (the core component) ---------- */
.check {
  position: relative;
  background: var(--sheet);
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 18px 34px -22px rgb(20 58 44 / .55), 0 2px 4px -2px rgb(20 58 44 / .25);
}
.check__head {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 16px;
  padding: 16px 18px 12px;
  border-bottom: 1.5px solid var(--rule);
}
.serial {
  font-family: var(--font-display); font-weight: 700; color: var(--red);
  font-size: 1.25rem; letter-spacing: .06em; white-space: nowrap;
}
.check__title {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  color: var(--rule); font-size: clamp(1.75rem, 5vw, 2.25rem); line-height: 1; letter-spacing: .01em;
}
.perf { /* perforation between stub and body */
  height: 10px; position: relative;
  background: radial-gradient(circle at 6px 5px, var(--paper) 2.6px, transparent 3.2px) 0 0 / 12px 10px repeat-x;
}
.boxes { /* the printed table/guests/server boxes */
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-bottom: 1.5px solid var(--rule);
}
.boxes > div { padding: 6px 12px 8px; border-right: 1px solid var(--rule); min-width: 0; }
.boxes > div:last-child { border-right: 0; }
.boxes dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rule); font-weight: 700; }
.boxes dd { font-family: var(--font-hand); color: var(--carbon); font-size: 1.5rem; line-height: 1.1; }

/* Ruled item lines */
.lines { width: 100%; border-collapse: collapse; }
.lines th { text-align: left; }
.lines thead th {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rule);
  padding: 8px 12px 6px; border-bottom: 1.5px solid var(--rule); font-weight: 700;
}
.lines td, .lines tbody th {
  padding: 0 12px; height: var(--row); vertical-align: middle;
  border-bottom: 1px solid var(--rule-soft); font-weight: 400;
}
.lines tbody th { font-weight: 700; }
.lines .desc { display: block; font-weight: 400; font-size: .9rem; color: color-mix(in srgb, var(--ink) 78%, var(--sheet)); line-height: 1.3; padding-bottom: 6px; }
.lines tbody th:has(.desc) { padding-top: 8px; }
.lines .price, .lines thead .price {
  text-align: right; width: 1%; white-space: nowrap;
  border-left: 1px solid var(--rule);
}
.lines td.price { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.lines tfoot th, .lines tfoot td { border-top: 1.5px solid var(--rule); border-bottom: 0; padding: 10px 12px; height: auto; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(20px, 4vw, 48px) clamp(40px, 6vw, 80px); }
.hero__grid { display: grid; gap: 28px; align-items: start; }
.hero .check { transform: rotate(-.6deg); }
.brand {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(3.1rem, 15vw, 6rem); line-height: .86; letter-spacing: -.005em;
  color: var(--rule);
  text-wrap: balance;
}
.brand .amp { color: var(--red); }
.hero .check__head { padding: 18px 18px 16px; gap: 10px 16px; }
.hero__lede { grid-column: 1 / -1; font-size: 1.125rem; max-width: 36ch; }
.hero .serial { align-self: start; }
.total { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .05em; color: var(--rule); font-size: 1.125rem; }
.stamp {
  display: inline-block;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  font-size: 1.25rem; line-height: 1.1;
  color: var(--red); border: 2.5px solid var(--red); border-radius: 4px;
  padding: 4px 10px; transform: rotate(-3deg);
  text-align: center;
}
.stamp.is-closed { color: var(--rule); border-color: var(--rule); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 12px 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 20px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .05em;
  text-decoration: none; border-radius: 4px; border: 2px solid var(--red);
  background: var(--red); color: #fff; cursor: pointer;
  transition: background .2s, transform .2s var(--ease-out);
  flex: 1 1 12rem;
}
.btn:hover { background: var(--red-deep); }
.btn:active { transform: translateY(1px); }
.btn--line { background: transparent; color: var(--rule); border-color: var(--rule); }
.btn--line:hover { background: var(--rule); color: var(--sheet); }
.hand {
  font-family: var(--font-hand); color: var(--carbon); font-size: 1.75rem; line-height: 1;
}
.note { /* ballpoint margin note */
  display: flex; align-items: flex-end; gap: 6px; padding: 4px 16px 0;
}
.note svg { width: 54px; height: 38px; flex: none; stroke: var(--carbon); fill: none; stroke-width: 2; stroke-linecap: round; }

@media (min-width: 900px) {
  :root { --row: 2.5rem; }
  .hero { padding-top: 20px; }
  .hero .check__head { grid-template-columns: 1fr; padding-top: 44px; }
  .hero .serial { position: absolute; top: 14px; right: 18px; }
  .hero__lede { max-width: 48ch; }
  .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 4vw, 64px); }
  .hero .photo { margin-top: 36px; }
}

/* ---------- Photos with designed placeholders ---------- */
.photo {
  position: relative; overflow: hidden;
  background: var(--sheet);
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 18px 34px -22px rgb(20 58 44 / .55);
}
.photo img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.photo--hero { aspect-ratio: 4 / 5; transform: rotate(1.2deg); }
.photo--wide { aspect-ratio: 3 / 2; }
.photo--square { aspect-ratio: 1; }
.photo__ph {
  display: none;
  position: absolute; inset: 10px; padding: 14px;
  border: 1.5px dashed var(--rule-soft); border-radius: 2px;
  flex-direction: column; justify-content: flex-end; gap: 4px;
}
.photo.is-missing .photo__ph { display: flex; }
.photo__ph svg { width: 44px; height: 44px; stroke: var(--rule); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: auto; }
.photo__ph .hand { font-size: 1.6rem; }
.photo__ph small { font-size: .8125rem; color: var(--ink); font-weight: 700; letter-spacing: .02em; }
.clip { /* binder clip holding a photo to the rail */
  position: absolute; top: -10px; left: 50%; z-index: 3; width: 56px; height: 34px; margin-left: -28px;
}
.photo-hang { position: relative; padding-top: 10px; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section__head { max-width: 40rem; margin-bottom: clamp(28px, 4vw, 44px); }
.h2 {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.5rem, 8vw, 4.25rem); line-height: .92; color: var(--rule); letter-spacing: 0;
  text-wrap: balance; margin-bottom: 14px;
}
.section__head p { font-size: 1.125rem; max-width: 60ch; }
.sample-flag { color: var(--red); font-weight: 700; }

/* ---------- Menu: checks hanging from a second rail ---------- */
.hang { position: relative; }
.hang__bar { position: relative; z-index: 2; }
.hang__checks { display: grid; gap: 28px; margin-top: -4px; }
.hang__checks > * { position: relative; }
.hang__checks .check { border-top: 0; border-radius: 0 0 3px 3px; }
.hang__checks .check::before {
  content: ""; position: absolute; top: -4px; left: 50%; width: 30px; height: 12px; margin-left: -15px;
  background: var(--steel-dk); border-radius: 0 0 4px 4px;
}
.hang__checks .check .photo { margin: 12px; box-shadow: none; }
@media (min-width: 900px) {
  .hang__checks { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: clamp(20px, 2.4vw, 36px); }
  .hang__checks > :nth-child(1) .check { transform: rotate(-.8deg); }
  .hang__checks > :nth-child(2) .check { transform: rotate(.5deg); margin-top: 18px; }
  .hang__checks > :nth-child(3) .check { transform: rotate(-.3deg); margin-top: 6px; }
}
.menu-foot { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }

/* ---------- Visit ---------- */
.visit { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .visit { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 4vw, 64px); } }
.hours tbody tr { position: relative; }
.hours tbody tr.is-today th, .hours tbody tr.is-today td { color: var(--red); font-weight: 700; }
.today-ring {
  position: absolute; pointer-events: none; z-index: 2;
  stroke: var(--carbon); stroke-width: 2.2; fill: none; stroke-linecap: round;
}
.today-ring path { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 1.1s .4s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.addr { padding: 16px 12px 4px; display: grid; gap: 6px; }
.addr p { display: flex; gap: 10px; align-items: flex-start; }
.addr .icon { color: var(--rule); margin-top: 2px; }
.quote { padding: 22px 22px 18px; }
.quote blockquote { margin: 0; font-family: var(--font-hand); color: var(--carbon); font-size: 2rem; line-height: 1.05; }
.quote figcaption { margin-top: 10px; font-size: .875rem; color: var(--rule); font-weight: 700; }
.visit__side { display: grid; gap: 28px; }

/* ---------- Catering form check ---------- */
.order { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .order { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 4vw, 64px); } }
.order__copy ul { display: grid; gap: 8px; margin-top: 20px; }
.order__copy li { display: flex; gap: 10px; align-items: flex-start; }
.order__copy li .icon { color: var(--red); margin-top: 3px; }
.pad { position: relative; display: grid; }
.pad > * { grid-area: 1 / 1; }
.copy { /* the carbon customer copy underneath */
  background: var(--sheet-2); border: 1.5px dashed var(--rule); border-radius: 3px;
  padding: 24px 22px; align-self: start;
  visibility: hidden;
}
.pad.is-sent .copy { visibility: visible; }
.copy .stamp { margin-bottom: 18px; }
.copy p { margin-top: 10px; max-width: 46ch; }
.copy .hand { font-size: 2rem; display: block; margin-top: 8px; }
.form { z-index: 1; }
.form.is-torn { animation: tear .9s var(--ease-out) forwards; pointer-events: none; }
@keyframes tear {
  0% { transform: rotate(0); opacity: 1; }
  25% { transform: rotate(-1.5deg) translateY(-6px); }
  100% { transform: translate(-6%, -40px) rotate(-7deg); opacity: 0; visibility: hidden; }
}
.fields { padding: 4px 0 0; }
.field {
  display: grid; grid-template-columns: 1fr; padding: 8px 14px 6px;
  border-bottom: 1px solid var(--rule-soft);
}
.field label, .field legend {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rule); font-weight: 700;
}
.field input, .field select, .field textarea {
  font: inherit; font-size: 1.125rem; color: var(--carbon);
  background: transparent; border: 0; border-radius: 0; padding: 6px 0 4px;
  min-height: 44px; width: 100%;
}
.field textarea {
  resize: vertical; min-height: calc(var(--row) * 3); line-height: var(--row); padding: 0;
  background: repeating-linear-gradient(transparent 0 calc(var(--row) - 1px), var(--rule-soft) calc(var(--row) - 1px) var(--row));
}
.field select { appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f6e55' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center / 20px; padding-right: 28px; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--carbon) 55%, var(--sheet)); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; }
.field:focus-within { background: var(--sheet-2); box-shadow: inset 0 -2px 0 var(--carbon); }
.field.has-error { background: color-mix(in srgb, var(--red) 7%, var(--sheet)); box-shadow: inset 0 -2px 0 var(--red); }
.field .err { color: var(--red); font-size: .9rem; font-weight: 700; min-height: 0; }
.field .err:empty { display: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; }
.row2 .field + .field { border-left: 1px solid var(--rule); }
.form__foot { padding: 16px 14px 18px; display: grid; gap: 12px; }
.form__status { font-weight: 700; }
.form__status.is-error { color: var(--red); }
.btn[aria-busy="true"] { opacity: .75; cursor: progress; }
.hp { position: absolute; left: -9999px; }

/* ---------- Footer stub ---------- */
.foot { padding-block: 8px 40px; }
.foot .check { transform: none; }
.foot__grid { display: grid; gap: 18px; padding: 20px 18px; }
@media (min-width: 760px) { .foot__grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.foot .brand { font-size: 2.5rem; }
.foot h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rule); margin-bottom: 6px; }
.foot__demo { border-top: 1.5px solid var(--rule); padding: 12px 18px; font-size: .9375rem; }
.foot__demo a { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .today-ring path { stroke-dashoffset: 0; }
}
.note--foot { padding: 0 16px 18px; margin-top: -4px; }
.note--foot svg { transform: scaleY(-1); }
.today { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
