/* Backroads Coffee: a back-road stop at dusk. Night ground, pink and turquoise neon,
   weathered wood signs, and cream paper for anything you write on. Shared tokens and parts. */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo/archivo-latin-standard-normal.woff2') format('woff2-variations'),
       url('/fonts/archivo/archivo-latin-standard-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Kalam';
  src: url('/fonts/kalam/kalam-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Kalam';
  src: url('/fonts/kalam/kalam-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Rye';
  src: url('/fonts/rye/rye-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  /* the world */
  --night: #170d1e;          /* dusk-night ground */
  --night-2: #23142d;        /* raised night */
  --night-3: #321c3f;        /* lifted panel */
  --dusk: #4a2160;
  --pink: #ff2e9a;           /* neon pink: primary action */
  --pink-hi: #ff5cb2;
  --pink-deep: #c0136f;      /* pink ink on paper */
  --teal: #2ee8d4;           /* neon turquoise */
  --teal-deep: #0b6670;      /* turquoise ink on paper */
  --sun: #ff8a3d;
  --wood: #8a5833;
  --wood-dark: #5a371d;
  --wood-light: #b8834f;
  --cream: #f6eedc;          /* enamel cream: paper */
  --cream-2: #ede0c4;
  --copy: #f7e9b8;           /* the customer's carbon copy */

  /* roles, night context */
  --ground: var(--night);
  --ink: #f6eedc;
  --ink-2: #cdb9d3;
  --print: #ff6bb8;          /* printed form ink */
  --rule: rgb(255 46 154 / 0.32);
  --rule-strong: rgb(255 46 154 / 0.7);
  --hand: var(--teal);       /* what the customer writes */
  --hand-soft: rgb(46 232 212 / 0.12);
  --sheet: var(--night-2);

  --action: var(--pink);
  --action-hi: var(--pink-hi);
  --on-action: #1a0b17;

  /* type */
  --face: 'Archivo', 'Arial Narrow', sans-serif;
  --display: 'Rye', 'Archivo', serif;
  --script: 'Kalam', 'Segoe Print', cursive;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --step-4: clamp(2.5rem, 1.3rem + 4.6vw, 5rem);

  /* space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --row: 3.25rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sheet-shadow: 0 1px 1px rgb(0 0 0 / 0.25), 0 14px 30px -10px rgb(0 0 0 / 0.6), 0 40px 70px -30px rgb(0 0 0 / 0.7);
  --neon-pink: 0 0 0 2px var(--pink), 0 6px 18px -6px rgb(255 46 154 / 0.7);
  --neon-teal: 0 0 0 2px var(--teal), 0 6px 18px -6px rgb(46 232 212 / 0.6);

  color-scheme: dark;
  accent-color: var(--pink);
}

/* Paper: the check, the copy, tickets, tags. Same roles, re-inked for cream stock. */
.paper {
  --ground: var(--cream);
  --sheet: var(--cream);
  --ink: #26142a;
  --ink-2: #5d4760;
  --print: var(--pink-deep);
  --rule: rgb(192 19 111 / 0.36);
  --rule-strong: rgb(192 19 111 / 0.75);
  --hand: var(--teal-deep);
  --hand-soft: rgb(11 102 112 / 0.1);
  color-scheme: light;
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--dusk) var(--night);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--face);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--ink);
  background: var(--night);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
/* Centered page blocks sit in a flex column, so they need an explicit width to fill it. */
.pad, main.story, main.visit, main.lost, main.copy-wrap { width: 100%; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

a { color: var(--teal); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
.paper a { color: var(--teal-deep); }

::selection { background: var(--pink); color: var(--on-action); }
input, textarea { caret-color: var(--hand); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}
.paper :focus-visible { outline-color: var(--teal-deep); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgb(205 185 211 / 0.35); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--pink); color: var(--on-action); padding: var(--s-2) var(--s-4);
  text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: var(--s-4); }

.demo-strip {
  margin: 0;
  padding: 6px var(--s-4);
  background: #0d0711;
  color: var(--ink-2);
  font-size: var(--step--1);
  font-stretch: 85%;
  letter-spacing: 0.02em;
  text-align: center;
}
.demo-strip a { color: var(--teal); }

/* Icons are Lucide SVGs used as masks so they take the current ink. */
.icon {
  display: inline-block;
  width: 1.25em; height: 1.25em;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}
.i-plus { --i: url('/icons/plus.svg'); }
.i-minus { --i: url('/icons/minus.svg'); }
.i-x { --i: url('/icons/x.svg'); }
.i-check { --i: url('/icons/check.svg'); }
.i-bike { --i: url('/icons/bike.svg'); }
.i-store { --i: url('/icons/store.svg'); }
.i-bell { --i: url('/icons/bell.svg'); }
.i-bell-off { --i: url('/icons/bell-off.svg'); }
.i-clock { --i: url('/icons/clock.svg'); }
.i-pin { --i: url('/icons/map-pin.svg'); }
.i-up { --i: url('/icons/chevron-up.svg'); }
.i-down { --i: url('/icons/chevron-down.svg'); }
.i-trash { --i: url('/icons/trash-2.svg'); }
.i-arrow { --i: url('/icons/arrow-right.svg'); }
.i-out { --i: url('/icons/log-out.svg'); }
.i-receipt { --i: url('/icons/receipt.svg'); }
.i-coffee { --i: url('/icons/coffee.svg'); }
.i-bag { --i: url('/icons/shopping-bag.svg'); }
.i-truck { --i: url('/icons/truck.svg'); }
.i-package { --i: url('/icons/package.svg'); }
.i-phone { --i: url('/icons/phone.svg'); }
.i-soldout { --i: url('/icons/package-x.svg'); }
.i-edit { --i: url('/icons/pencil.svg'); }

/* ---------- printed form parts ---------- */

.form-label {
  font-stretch: 75%;
  font-weight: 650;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--print);
}

.serial {
  font-stretch: 70%;
  font-weight: 750;
  color: var(--print);
  letter-spacing: 0.02em;
}

.hand {
  font-family: var(--script);
  color: var(--hand);
}

/* A printed tick box, the customer's check mark in hand ink. */
.tick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 36px;
  cursor: pointer;
  font-weight: 650;
  font-stretch: 85%;
  font-size: var(--step-1);
}
.tick input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.tick-box {
  position: relative;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1.5px solid var(--print);
  background: transparent;
}
.tick-box::after {
  content: '';
  position: absolute;
  inset: -6px -8px -2px -2px;
  background: var(--hand);
  -webkit-mask: url('/icons/check.svg') center / contain no-repeat;
  mask: url('/icons/check.svg') center / contain no-repeat;
  transform: rotate(-8deg) scale(0.4);
  opacity: 0;
  transition: transform 220ms var(--ease-out), opacity 120ms;
}
.tick input:checked + .tick-box::after { opacity: 1; transform: rotate(-8deg) scale(1); }
.tick input:focus-visible + .tick-box { outline: 2px solid var(--hand); outline-offset: 2px; }
.tick input:disabled ~ * { opacity: 0.45; }
.tick-text { display: inline-flex; align-items: center; gap: 6px; }
.tick-text .icon { width: 1.05em; height: 1.05em; color: var(--ink-2); }

/* ---------- paper sheets with real punched holes ---------- */

/* The sheet's top row is punched through, so whatever is behind shows in the holes. */
.punched {
  -webkit-mask:
    radial-gradient(circle at 7px 0, transparent 3.5px, #000 4px) 0 0 / 14px 10px repeat-x,
    linear-gradient(#000 0 0) 0 9px / 100% calc(100% - 9px) no-repeat;
  mask:
    radial-gradient(circle at 7px 0, transparent 3.5px, #000 4px) 0 0 / 14px 10px repeat-x,
    linear-gradient(#000 0 0) 0 9px / 100% calc(100% - 9px) no-repeat;
}
.lifted { filter: drop-shadow(0 16px 22px rgb(0 0 0 / 0.5)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.3)); }
.perf {
  height: 18px;
  border-bottom: 1px dashed var(--rule-strong);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 0; border-radius: 4px;
  background: var(--action); color: var(--on-action);
  font-weight: 750; font-stretch: 85%; font-size: var(--step-1);
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 8px 20px -8px rgb(255 46 154 / 0.75);
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.btn:hover:not(:disabled) { background: var(--action-hi); box-shadow: 0 10px 24px -8px rgb(255 46 154 / 0.85); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: var(--night-3); color: var(--ink-2); box-shadow: none; }
.paper .btn { box-shadow: 0 6px 16px -8px rgb(192 19 111 / 0.7); }
.paper .btn:disabled { background: var(--cream-2); color: var(--ink-2); box-shadow: none; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 2px solid var(--teal); border-radius: 4px;
  background: transparent; color: var(--teal);
  font-weight: 750; font-stretch: 85%; font-size: var(--step-1);
  text-decoration: none;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.btn-ghost:hover { background: var(--teal); color: var(--on-action); }

.btn-quiet {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-3);
  border: 1px solid var(--rule-strong); border-radius: 3px;
  background: transparent; color: var(--ink);
  font-weight: 600; font-stretch: 85%;
  text-decoration: none;
}
.btn-quiet:hover { background: var(--hand-soft); }

.btn-text {
  min-height: 44px;
  padding: 0 var(--s-2);
  border: 0;
  background: none;
  color: var(--hand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.btn-text:hover { text-decoration-thickness: 2px; }

/* ---------- wood signs ---------- */

/* Weathered plank: the grain texture over the wood color, two nail heads. Used for nav and signposts. */
.plank, .sign, .value-sign, .board-tab, .post {
  background-color: var(--wood);
  background-image: url('/img/wood.webp');
  background-size: 512px auto;
  text-shadow: 0 1px 0 rgb(40 22 10 / 0.75);
}
.plank {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--s-5);
  border: 1px solid var(--wood-dark);
  border-bottom-width: 3px;
  border-radius: 3px;
  color: var(--cream);
  font-weight: 750;
  font-stretch: 78%;
  font-size: var(--step-0);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 260ms var(--ease-out), box-shadow 200ms var(--ease-out), background-color 200ms;
}
.plank::before,
.plank::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: #6b3418;
  box-shadow: inset 1px 1px 0 rgb(255 200 150 / 0.25), 0 0 0 1px rgb(40 22 10 / 0.4);
}
.plank::before { left: 8px; }
.plank::after { right: 8px; }
.plank:hover { filter: brightness(1.18); transform: rotate(-1.5deg); }
.plank[aria-current='page'] { box-shadow: var(--neon-pink); }

/* ---------- site header ---------- */

.site-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-5);
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: var(--s-4) var(--s-6);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--ink);
  text-decoration: none;
}
.brand-badge {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 0 10px rgb(255 46 154 / 0.35));
}
.brand-words { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-family: var(--display);
  font-size: 1.375rem;
  color: var(--cream);
  letter-spacing: 0.01em;
}
.brand-sub {
  margin-top: 3px;
  font-size: var(--step--1);
  font-weight: 650;
  font-stretch: 80%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}
.planks {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
}
.head-carts { display: flex; gap: var(--s-2); justify-content: flex-end; }
.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 var(--s-3);
  border: 1.5px solid var(--teal);
  border-radius: 999px;
  color: var(--teal);
  font-weight: 700;
  font-stretch: 85%;
  text-decoration: none;
}
.cart-link:hover { background: var(--teal); color: var(--on-action); }
.cart-count {
  min-width: 1.5em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--on-action);
  text-align: center;
  font-size: var(--step--1);
  line-height: 1.6;
}

/* ---------- dusk sky ---------- */

/* The sunset band that sits behind page openers. */
.sky {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
/* Once the header has scrolled away, the sticky check can use the full height. */
@media (min-width: 961px) { .scrolled .check-sheet { max-height: calc(100dvh - 2 * var(--s-5)); } }

/* Inner-page openers shade the sky behind the header so it stays readable. */
.opener::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgb(23 13 30 / 0.92), rgb(23 13 30 / 0.55) 40%, rgb(23 13 30 / 0) 75%);
  pointer-events: none;
}
.sky-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- footer ---------- */

.site-foot {
  margin-top: var(--s-9);
  color: var(--ink-2);
}
.foot-ridge {
  display: block;
  width: 100%;
  height: 90px;
  color: #0d0711;
}
.foot-inner {
  padding: var(--s-6) var(--s-6) var(--s-8);
  background: #0d0711;
}
.foot-grace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  text-align: center;
}
.foot-tagline {
  font-family: var(--script);
  font-weight: 700;
  font-size: var(--step-3);
  line-height: 1.15;
  color: var(--pink);
  text-shadow: 0 0 18px rgb(255 46 154 / 0.45);
}
.foot-cross { width: 120px; height: 32px; color: var(--teal); }
.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
  max-width: 1080px;
  margin: var(--s-7) auto 0;
}
.foot-cols ul { margin: 0; padding: 0; list-style: none; }
.foot-cols li { margin-bottom: 4px; }
.foot-cols a { color: var(--ink); text-decoration: none; }
.foot-cols a:hover { color: var(--teal); text-decoration: underline; }
.foot-head {
  margin-bottom: var(--s-2);
  font-family: var(--display);
  font-size: var(--step-1);
  color: var(--cream);
}
.foot-signs {
  max-width: 1080px;
  margin: var(--s-7) auto 0;
  padding-top: var(--s-4);
  border-top: 1px solid rgb(205 185 211 / 0.18);
  font-size: var(--step--1);
  font-weight: 650;
  font-stretch: 80%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-2);
}

/* ---------- small screens ---------- */

@media (max-width: 960px) {
  .site-head {
    grid-template-columns: 1fr auto;
    padding: var(--s-3) var(--s-4) var(--s-2);
    row-gap: var(--s-3);
  }
  .brand-badge { width: 52px; height: 52px; }
  .brand-name { font-size: 1.125rem; }
  .planks {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: var(--s-2);
    overflow-x: auto;
    padding: 2px 2px var(--s-2);
    scrollbar-width: none;
  }
  .planks::-webkit-scrollbar { display: none; }
  .plank { flex: none; padding: 0 var(--s-4); font-size: var(--step--1); }
  .cart-text { display: none; }
  .foot-inner { padding: var(--s-5) var(--s-4) 120px; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-cols > :first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
