/* Cardo's Pizza of Jackson: shared design system. Page styles live in each page's own sheet. */

/* TOKENS: palette (--ground --ink --second --accent), fonts, gutters, bar height, scallop geometry. */
:root {
  --ground: #B5E09B; --ink: #17421A; --second: #8FCB74; --accent: #00F5FF;
  --ink-rule: color-mix(in srgb, var(--ground) 28%, var(--ink));
  --ink-soft: color-mix(in srgb, var(--ground) 76%, var(--ink));
  --ink-deep: color-mix(in srgb, var(--ink) 80%, #000);
  --display: 'VT323', 'Courier New', monospace;
  --text: 'Lexend', 'Segoe UI', system-ui, sans-serif;
  --gutter: clamp(1rem, 3.2vw, 2.75rem);
  --gap: clamp(.75rem, 1.6vw, 1.5rem);
  --bar-h: 3.5rem;
  --consent-h: 0px;
  --promo-h: 0px;
  --sp: 1.125rem; --sr: .62rem; --so: .36rem;
  --cut-top: radial-gradient(circle var(--sr) at 50% calc(-1 * var(--so)), #0000 96%, #000);
  --cut-bot: radial-gradient(circle var(--sr) at 50% calc(100% + var(--so)), #0000 96%, #000);
  --m-both: var(--cut-top) 50% 0 / var(--sp) 51% repeat-x, var(--cut-bot) 50% 100% / var(--sp) 51% repeat-x;
}

/* BASE: basil ground everywhere, Lexend 400 only (no bold is loaded). */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar-h) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding-bottom: calc(var(--consent-h) + .5rem);
  background: var(--ground); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
}
img, video { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
b, strong { font-weight: 400; text-decoration: underline; text-decoration-thickness: .09em; text-underline-offset: .22em; }
address { font-style: normal; }
[hidden] { display: none !important; }
:focus-visible { outline: .1875rem solid var(--ink); outline-offset: .2rem; }

/* TYPE: h1/h2 (or .h1/.h2) are VT323 capitals; h3/.h3 mixed-case Lexend; .pixel for VT323 readouts; .lead; .fine for price notes. */
h1, h2, .h1, .h2, .pixel {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  letter-spacing: .09em; line-height: 1.02; margin: 0;
}
h1, .h1 { font-size: clamp(1.625rem, 1.1rem + 1.9vw, 2.375rem); }
h2, .h2 { font-size: clamp(1.5rem, 1.25rem + .7vw, 1.75rem); }
h3, .h3 { font: 400 1.25rem/1.3 var(--text); margin: 0; }
.lead { font-size: clamp(1.125rem, 1rem + .5vw, 1.3125rem); line-height: 1.5; }
.fine { font-size: .95rem; line-height: 1.45; }
.measure { max-width: 38rem; }

/* LINKS: plain text links underline in ink and take a leaf ground on hover. */
a { color: inherit; text-decoration-thickness: .09em; text-underline-offset: .22em; }
main a:not([class]):hover { background: var(--second); }

/* LAYOUT: .wrap (page width), .grid (12 columns, 2 on phones), .section (vertical rhythm), .section__head (h2 over a rule with a note at right). */
.wrap { width: min(100% - 2 * var(--gutter), 86rem); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.section { padding-block: clamp(2.5rem, 7vh, 5rem); }
.section__head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .5rem 2rem;
  padding-bottom: .7rem; margin-bottom: clamp(1.25rem, 3vh, 2rem); border-bottom: .125rem solid var(--ink);
}
.section__head p { margin: 0; }

/* RULE and INK BAND: .rule is a straight ink line; .band is a full-bleed deep-green ground with pale type. */
.rule { border: 0; border-top: .125rem solid var(--ink); margin: 0; }
.band { background: var(--ink); color: var(--ground); }
.band :focus-visible { outline-color: var(--ground); }

/* SCALLOP: .scallop cuts the shared shallow curve into top and bottom edges; .scallop--top / .scallop--bottom cut one edge only. Keep 0.75rem+ between cuts and type. */
.scallop, .pic, .label, .btn { -webkit-mask: var(--m-both); mask: var(--m-both); }
.scallop--top { -webkit-mask: var(--cut-top) 50% 0 / var(--sp) 100% repeat-x; mask: var(--cut-top) 50% 0 / var(--sp) 100% repeat-x; }
.scallop--bottom { -webkit-mask: var(--cut-bot) 50% 100% / var(--sp) 100% repeat-x; mask: var(--cut-bot) 50% 100% / var(--sp) 100% repeat-x; }

/* PICTURE: .pic is the scallop-masked photo frame (img fills it, cropped); .pic--tall / --square / --wide set the shape; .cap is a plain caption line. */
.pic { display: block; margin: 0; overflow: hidden; background: var(--second); }
.pic img, .pic video { width: 100%; height: 100%; object-fit: cover; }
.pic--tall { aspect-ratio: 3 / 4; }
.pic--square { aspect-ratio: 1; }
.pic--wide { aspect-ratio: 16 / 9; }
.cap { font-size: 1rem; line-height: 1.45; margin: 0; }

/* THE PINNED LABEL (recurring device): .label with .label__name, .label__price, .label__ask; .label--ink (deep green), .label--tilt (slight angle), .label--pin (pin hole). */
.label {
  display: inline-grid; gap: .2rem; max-width: 22rem; padding: 1.05rem 1.15rem;
  background: var(--second); color: var(--ink);
  font-size: 1.0625rem; line-height: 1.3; text-decoration: none;
}
.label__name, .label__price, .label__ask { margin: 0; }
.label__price { font-size: 1.125rem; font-variant-numeric: tabular-nums; padding-top: .3rem; margin-top: .15rem; border-top: .125rem solid currentColor; }
.label__ask { font-size: 1rem; }
.label--ink { background: var(--ink); color: var(--ground); }
.label--tilt { rotate: -3deg; }
.label--pin { position: relative; padding-top: 1.9rem; }
.label--pin::before {
  content: ""; position: absolute; top: .8rem; left: 50%; translate: -50% 0;
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--ground);
}
a.label:hover, .hang:hover > .label:not(.label--ink), .label.is-called { background: var(--ink); color: var(--ground); }
a.label--ink:hover { background: var(--ink-deep); }
a.label:focus-visible { outline: .1875rem solid currentColor; outline-offset: -.6rem; }

/* HANG: .hang keeps a .pic and its .label together in the green gap; .hang--side puts the label beside the picture, .hang--end hangs it at the right. */
.hang { display: grid; gap: .6rem; align-content: start; margin: 0; }
.hang > .label { justify-self: start; }
.hang--end > .label { justify-self: end; }

/* BUTTONS: .btn is the scalloped deep-green primary; .btn--leaf the leaf-green second; .actions lays buttons and links in a row. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3.5rem; padding: 1.1rem 1.75rem; border: 0; cursor: pointer;
  background: var(--ink); color: var(--ground);
  font: 400 1.125rem/1.2 var(--text); text-decoration: none;
}
.btn:hover { background: var(--ink-deep); }
.btn--leaf { background: var(--second); color: var(--ink); }
.btn--leaf:hover { background: var(--ink); color: var(--ground); }
.btn:focus-visible { outline: .1875rem solid currentColor; outline-offset: -.65rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }

/* PAGE OPENING: .opening (text beside a tall picture; set --opening-pic for its width), .opening__text, .opening__pic on the .pic. */
.opening {
  display: grid; grid-template-columns: minmax(0, 1fr) 27%; gap: var(--gap);
  align-items: start; padding-block: clamp(1.25rem, 4vh, 2.5rem);
}
.opening__text { display: grid; gap: 1rem; align-content: start; justify-items: start; padding-top: clamp(.25rem, 3vh, 2rem); }
.opening__text > * { margin: 0; }
.opening__pic { align-self: stretch; min-height: 12rem; }

/* FACTS: .facts is a dl of ruled rows (each row a div with dt + dd) that runs the width of its column. */
.facts { margin: 0; border-top: .125rem solid var(--ink); font-size: 1.0625rem; }
.facts > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1rem; padding: .8rem 0; border-bottom: .0625rem solid var(--ink); }
.facts dt, .facts dd { margin: 0; }

/* HAND-OFF: .handoff is the last block before the footer, a leaf-green strip ruled into link cells (a.handoff__cell > .handoff__go + .handoff__say). */
.handoff { display: grid; background: var(--second); border-block: .125rem solid var(--ink); margin-top: clamp(1.5rem, 5vh, 3.5rem); }
.handoff__cell { display: grid; gap: .35rem; align-content: center; min-height: 6.5rem; padding: 1.25rem var(--gutter); text-decoration: none; border-top: .125rem solid var(--ink); }
.handoff__cell:first-child { border-top: 0; }
.handoff__go { font: 400 1.75rem/1 var(--display); text-transform: uppercase; letter-spacing: .09em; }
.handoff__say { font-size: 1.0625rem; line-height: 1.4; }
.handoff__cell:hover { background: var(--ink); color: var(--ground); }
.handoff__cell:focus-visible { outline-offset: -.4rem; }

/* REVEAL: add .reveal to a block below the first window; the script hides only what starts off-screen (.is-waiting) and lets it settle once. */
.reveal { transition: opacity .35s ease-out, translate .35s ease-out; }
.reveal.is-waiting { opacity: 0; translate: 0 .6rem; }

/* HELPERS: .vh hides text visually; .skip is the skip link. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: .5rem; top: -6rem; z-index: 90; padding: .9rem 1.1rem; background: var(--second); color: var(--ink); }
.skip:focus { top: .5rem; }

/* LOGO MARK: .mark is the tilted note with the pixel C; basil note on dark bands, add .mark--ink on the green ground. */
.mark { flex: none; width: 2rem; height: 2rem; }
.mark__note { fill: var(--ground); }
.mark__c { fill: var(--ink); }
.mark--ink .mark__note { fill: var(--ink); }
.mark--ink .mark__c { fill: var(--ground); }

/* TICKER NAVIGATION (chrome): .ticker band, .ticker__name fixed left, .ticker__view/.ticker__track/.ticker__set of links, .ticker__dot, .ticker__menu, .ticker__call. */
.ticker {
  position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: stretch;
  min-height: var(--bar-h); background: var(--ink); color: var(--ground);
}
.ticker :focus-visible { outline-color: var(--ground); outline-offset: -.3rem; }
.ticker__name {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: .6rem;
  min-height: var(--bar-h); padding-inline: var(--gutter) .5rem;
  font-size: 1rem; white-space: nowrap; text-decoration: none;
}
.ticker__name span { overflow: hidden; text-overflow: ellipsis; }
.ticker__call {
  flex: none; display: flex; align-items: center; justify-content: center;
  min-height: var(--bar-h); padding-inline: 1.1rem;
  border-left: .0625rem solid var(--ink-rule);
  font-size: 1.0625rem; white-space: nowrap; text-decoration: none;
}
.ticker__call:hover { background: var(--ink-rule); }
.ticker__menu, .ticker__pause {
  flex: none; min-width: 5rem; min-height: var(--bar-h); padding-inline: 1.1rem; cursor: pointer;
  background: var(--ink); color: var(--ground); border: 0; border-left: .0625rem solid var(--ink-rule);
  font: 400 1.0625rem/1 var(--text);
}
.ticker__menu[aria-expanded="true"] { background: var(--ground); color: var(--ink); }
.ticker__menu[aria-expanded="true"]:focus-visible { outline-color: var(--ink); }
.ticker__pause { display: none; }
.ticker__view { flex: 0 0 100%; border-top: .0625rem solid var(--ink-rule); }
.js .ticker__view { display: none; }
.js .ticker.is-open .ticker__view { display: block; }
.ticker__set { display: grid; grid-template-columns: 1fr 1fr; list-style: none; margin: 0; padding: 0; }
.ticker__set a {
  display: flex; align-items: center; min-height: 3.25rem; padding-inline: var(--gutter);
  font-size: 1.125rem; text-decoration: none; border-bottom: .0625rem solid var(--ink-rule);
}
.ticker__set a:hover { background: var(--ink-rule); }
.ticker__set a[aria-current] { text-decoration: underline; text-decoration-thickness: .125rem; text-underline-offset: .35em; }
.ticker__dot { display: none; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); margin-inline: 1.5rem; }

/* FOOTER LEDGER (chrome): .ledger of ruled .ledger__cell, each with a .ledger__head; every cell is wide enough for its own text. */
.ledger { background: var(--ink); color: var(--ground); font-size: .9375rem; line-height: 1.5; }
.ledger :focus-visible { outline-color: var(--ground); outline-offset: .1rem; }
.ledger__row { display: flex; flex-wrap: wrap; align-items: stretch; min-width: 0; }
.ledger__cell { flex: 1 1 12rem; min-width: 0; max-width: none; padding: 1.4rem 1.25rem 1.6rem; border-left: .0625rem solid var(--ink-rule); overflow-wrap: anywhere; }
.ledger__cell:first-child { border-left: 0; padding-left: var(--gutter); }
.ledger__cell:last-child { padding-right: var(--gutter); }
.ledger__cell--name { flex: 1 1 15rem; }
.ledger__cell--addr { flex: 1 1 13rem; }
.ledger__cell--hours { flex: 1 1 11rem; }
.ledger__cell--reach { flex: 1 1 14rem; }
.ledger__cell--pages { flex: 1 1 10rem; }
.ledger__cell--small { flex: 1 1 12rem; }
.ledger__head { color: var(--ink-soft); margin: 0 0 .4rem; }
/* The name wraps inside its own cell instead of running across the Address cell beside it. */
.ledger__name { display: inline-flex; align-items: center; gap: .6rem; min-height: 2.75rem; margin-bottom: .5rem; font-size: 1.0625rem; text-decoration: none; }
.ledger__name span { min-width: 0; overflow-wrap: anywhere; }
.ledger p { margin: 0 0 .6rem; }
.ledger ul { list-style: none; margin: 0; padding: 0; }
.ledger li a, .ledger li button, .ledger address + a {
  display: inline-block; padding-block: .625rem;
  max-width: 100%; overflow-wrap: anywhere; position: relative; z-index: 1;
}
.ledger button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-thickness: .09em; text-underline-offset: .22em; }
.ledger a:hover, .ledger button:hover { color: var(--ink-soft); }

/* CONSENT BAND (chrome): #consent docks at the foot of the window in ledger colours; two equal straight buttons. Nothing else is pinned above it. */
#consent {
  position: fixed; inset: auto 0 0 0; z-index: 70;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem;
  padding: .55rem var(--gutter); background: var(--ink); color: var(--ground);
  border-top: .0625rem solid var(--ink-rule); font-size: .95rem; line-height: 1.3;
}
#consent p { flex: 1 1 14rem; margin: 0; }
#consent :focus-visible { outline-color: var(--ground); }
.consent__choices { display: flex; gap: .4rem; }
.consent__choices button {
  min-width: 5.75rem; min-height: 2.75rem; padding: 0 .9rem; cursor: pointer;
  background: var(--ink); color: var(--ground); border: .125rem solid var(--ground);
  font: 400 1rem/1 var(--text);
}
.consent__choices button:hover { background: var(--ground); color: var(--ink); }

/* FROM 40rem: desk type size, 12-column grid, side-hung labels, wider opening picture, hand-off in a row. */
@media (min-width: 40rem) {
  body { font-size: 1.125rem; }
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .hang--side { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .opening { grid-template-columns: minmax(0, 1fr) var(--opening-pic, 36%); }
  .opening__pic { align-self: start; height: clamp(16rem, calc(100vh - var(--bar-h) - 7rem), 38rem); }
  .handoff { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .handoff__cell { border-top: 0; border-left: .125rem solid var(--ink); padding-inline: clamp(1.25rem, 2.4vw, 2.75rem); }
  .handoff__cell:first-child { border-left: 0; }
  .ledger li a, .ledger li button, .ledger address + a { padding-block: .3rem; }
  #consent { font-size: 1rem; }
}

/* FROM 60rem: the band becomes one set of links with the cyan dot; the Menu button goes away and the call link takes the right end. */
@media (min-width: 60rem) {
  .ticker { flex-wrap: nowrap; }
  .ticker__name { flex: none; padding-right: 1.5rem; font-size: 1.0625rem; border-right: .0625rem solid var(--ink-rule); }
  .ticker__menu { display: none; }
  .ticker__call { order: 3; padding-inline: 1.35rem; }
  .ticker__view, .js .ticker__view, .js .ticker.is-open .ticker__view {
    display: flex; order: 2; align-items: center; flex: 1; min-width: 0; overflow: hidden; border-top: 0;
  }
  .ticker__track { display: flex; align-items: center; width: max-content; }
  .ticker__set { display: flex; }
  .ticker__set a { min-height: var(--bar-h); padding-inline: 1.5rem; border-bottom: 0; white-space: nowrap; }
  .ticker__dot { display: block; }
}

/* REDUCED MOTION: nothing settles. */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; }
  .reveal.is-waiting { opacity: 1; translate: none; }
}

/* A page never scrolls sideways. */
html, body { overflow-x: clip; }
/* Past a full-HD window the whole page grows with the window - type, gaps and pictures
   together - so a very wide screen (or a page zoomed far out) shows the same composition,
   not a small column of text lost in an enormous picture. */
@media (min-width: 1921px) { html { font-size: calc(100vw / 120); } }
/* What can be pressed in the chrome lies above the page: a huge headline's line box reaching
   into the navigation must not swallow the clicks meant for the links. */
header a, header button, nav a, nav button { position: relative; z-index: 2; }
/* A visitor who asked the system for less motion gets none, whatever a page forgot. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
