/* ==========================================================================
   Northbound Coffee Roasters - hand-authored, token-driven design system
   No framework, no build step, no preprocessor. Deliberately NOT a reskin
   of this pipeline's other builds - see README.md "Design notes" for how
   both the token values and the page structure were redecided from scratch.
   Both colour schemes verified programmatically for WCAG AA contrast - see
   README.md "Verified in QA".
   ========================================================================== */

/* -------------------------------------------------------------------------
   Tokens
   ------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Brand: near-black ink + neutral paper + one saturated cobalt accent -
     "pure monochrome plus a single pop colour", not the earthy/warm palette
     used on Fieldstone Outdoor Living or the navy/bone/amber used on
     Graceview Builders. See design notes in README.md. */
  --ink: #17181A;
  --paper: #F4F4F1;
  --paper-2: #FFFFFF;
  --paper-3: #E8E8E3;
  --muted: #5B5D57;
  --line: #D8D8D2;
  --cobalt-600: #2F5FD9;
  --cobalt-700: #2447AD;

  --btn-primary-bg: var(--cobalt-600);
  --btn-primary-bg-hover: var(--cobalt-700);
  --btn-primary-fg: #FFFFFF;
  --btn-secondary-bg: transparent;
  --btn-secondary-border: var(--ink);
  --btn-secondary-fg: var(--ink);
  --btn-secondary-bg-hover: rgba(23, 24, 26, 0.06);

  --shadow-soft: 0 16px 36px -20px rgba(15, 16, 18, 0.35);
  --shadow-lift: 0 24px 50px -18px rgba(15, 16, 18, 0.4);

  /* One sharp, graphic radius system - deliberately not the soft rounded
     system used on Fieldstone Outdoor Living. Pill on buttons only;
     everything else stays close to square, like printed packaging. */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-pill: 999px;

  /* Fixed, scheme-independent - --ink/--paper flip meaning in dark mode, so
     anything that must stay a dark surface regardless of scheme (footer,
     header mark) needs its own pair instead of borrowing a flipping token -
     see lessons-learned.md "one colour token doing two jobs". */
  --surface-dark: #17181A;
  --on-dark: #F0F0ED;

  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #F0F0ED;
    --paper: #121214;
    --paper-2: #1B1B1D;
    --paper-3: #202023;
    --muted: #A6A8A1;
    --line: #2E2E30;
    --cobalt-600: #5C86F5;
    --cobalt-700: #7EA0FF;

    --btn-primary-bg: var(--cobalt-600);
    --btn-primary-bg-hover: var(--cobalt-700);
    --btn-primary-fg: #0B0F1A;
    --btn-secondary-border: var(--ink);
    --btn-secondary-fg: var(--ink);
    --btn-secondary-bg-hover: rgba(240, 240, 237, 0.08);

    --shadow-soft: 0 16px 36px -18px rgba(0, 0, 0, 0.55);
    --shadow-lift: 0 24px 50px -16px rgba(0, 0, 0, 0.6);
  }
}

/* -------------------------------------------------------------------------
   Reset & base
   ------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
em { font-style: normal; color: var(--cobalt-600); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--surface-dark); color: var(--on-dark);
  padding: 12px 18px; border-radius: var(--radius-sm);
  z-index: 200; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

::selection { background: rgba(47, 95, 217, 0.22); color: var(--ink); }

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.95rem;
  padding: 14px 26px;
  border: 1.5px solid transparent;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--btn-primary-bg-hover); transform: translateY(-2px); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-fg); border-color: var(--btn-secondary-border); }
.btn-secondary:hover { background: var(--btn-secondary-bg-hover); transform: translateY(-2px); }
.btn-sm { padding: 10px 20px; font-size: 0.85rem; }
.btn:focus-visible { outline: 2.5px solid var(--cobalt-600); outline-offset: 3px; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--paper-2); color: var(--ink);
  flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--cobalt-600); color: var(--cobalt-600); }
.btn-icon:focus-visible { outline: 2.5px solid var(--cobalt-600); outline-offset: 2px; }
.btn-icon svg { width: 18px; height: 18px; }

.logomark { display: block; flex-shrink: 0; }
.logomark-ring, .logomark-crack { stroke: var(--ink); }
.logomark-bean { fill: var(--cobalt-600); }
.footer-brand .logomark-ring, .footer-brand .logomark-crack { stroke: var(--on-dark); }

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 244, 241, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(18, 18, 20, 0.88); }
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 80px; gap: 20px; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark-text { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--ink); letter-spacing: -0.01em; }
.wordmark-text span { color: var(--cobalt-600); }

.main-nav { display: none; }
.main-nav ul { display: flex; align-items: center; gap: 24px; }
.main-nav a { font-size: 0.95rem; font-weight: 500; color: var(--muted); text-decoration: none; transition: color .15s ease; }
.main-nav a:hover { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.header-phone { display: none; font-size: 0.95rem; font-weight: 600; color: var(--ink); text-decoration: none; }

@media (max-width: 480px) {
  .header-actions .btn-primary { display: none; }
}

.menu-toggle {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: transparent; border: 1.5px solid var(--line); color: var(--ink);
}
.menu-toggle-bars { width: 20px; height: 14px; position: relative; }
.menu-toggle-bars span { position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; border-radius: 2px; }
.menu-toggle-bars span:nth-child(1) { top: 0; }
.menu-toggle-bars span:nth-child(2) { top: 6px; }
.menu-toggle-bars span:nth-child(3) { top: 12px; }

.mobile-nav { display: none; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.mobile-nav.is-open { display: block; }
.mobile-nav ul { padding: 10px 24px 20px; display: flex; flex-direction: column; }
.mobile-nav a:not(.btn) { display: block; padding: 13px 4px; font-size: 1.02rem; font-weight: 500; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-nav li:last-child a { border-bottom: none; }
.mobile-nav-cta { margin-top: 14px; }

@media (min-width: 1040px) {
  .main-nav { display: block; }
  .header-phone { display: inline; }
  .menu-toggle { display: none; }
  .mobile-nav { display: none !important; }
  .wordmark-text { white-space: nowrap; }
}

/* -------------------------------------------------------------------------
   Eyebrow / section heading
   ------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cobalt-600);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--cobalt-600); border-radius: 2px; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); margin-top: 12px; }
.section-head p:not(.eyebrow) { margin-top: 14px; color: var(--muted); font-size: 1.05rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.on-dark h2 { color: var(--on-dark); }
.section-head.on-dark p:not(.eyebrow) { color: rgba(240, 240, 237, 0.7); }

section { padding: 88px 0; }
@media (max-width: 640px) { section { padding: 60px 0; } }

/* -------------------------------------------------------------------------
   Hero - full-width poster headline, stats inline, then a full-bleed photo
   band beneath (not a side-by-side split like Fieldstone Outdoor Living).
   ------------------------------------------------------------------------- */
.hero { padding: 56px 0 0; }
.hero-copy { max-width: 780px; }
.hero-copy .eyebrow { margin-bottom: 18px; }
.hero-copy h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); }
.hero-copy p:not(.eyebrow) { margin-top: 22px; font-size: 1.15rem; color: var(--muted); max-width: 56ch; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 28px 40px; }
.hero-stat strong { font-family: var(--font-display); font-size: clamp(1.6rem, 2.8vw, 2rem); color: var(--ink); display: block; }
.hero-stat span { font-size: 0.85rem; color: var(--muted); }

.hero-banner { margin-top: 56px; width: 100%; aspect-ratio: 21 / 9; overflow: hidden; }
.hero-banner img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 700px) { .hero-banner { aspect-ratio: 4 / 5; } }

/* -------------------------------------------------------------------------
   Beans / menu - an editorial divided list, not a card grid or feature rows.
   ------------------------------------------------------------------------- */
.bean-list { border-top: 1px solid var(--line); }
.bean-row {
  display: grid; gap: 6px 24px;
  grid-template-columns: 1fr auto;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.bean-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.bean-origin { grid-column: 1; font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.bean-roast {
  grid-column: 2; grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 12px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--line); white-space: nowrap;
}
.bean-notes { grid-column: 1 / -1; margin-top: 10px; color: var(--muted); font-size: 0.98rem; max-width: 64ch; }
@media (min-width: 640px) {
  .bean-row { grid-template-columns: 1fr auto; }
}

/* -------------------------------------------------------------------------
   Roasting process - vertical typographic steps, no photos, no connecting
   line/timeline (that pattern belongs to Fieldstone Outdoor Living).
   ------------------------------------------------------------------------- */
.process-steps { display: flex; flex-direction: column; }
.process-step {
  display: grid; grid-template-columns: auto 1fr; gap: 24px;
  padding: 36px 0; border-top: 1px solid var(--line);
}
.process-step:last-child { border-bottom: 1px solid var(--line); }
.process-step-num { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 700; color: var(--cobalt-600); line-height: 1; }
.process-step h3 { font-size: 1.3rem; }
.process-step p { margin-top: 10px; color: var(--muted); font-size: 1rem; max-width: 60ch; }
@media (max-width: 560px) {
  .process-step { grid-template-columns: 1fr; gap: 8px; }
}

/* -------------------------------------------------------------------------
   Gallery - CSS masonry-style grid with varied spans, not a filmstrip or a
   uniform grid.
   ------------------------------------------------------------------------- */
.masonry {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 140px;
  gap: 14px;
}
.masonry-item { overflow: hidden; border-radius: var(--radius-md); }
.masonry-item img { width: 100%; height: 100%; object-fit: cover; }
.masonry-item:nth-child(1) { grid-column: span 2; grid-row: span 3; }
.masonry-item:nth-child(2) { grid-row: span 2; }
.masonry-item:nth-child(3) { grid-row: span 2; }
.masonry-item:nth-child(4) { grid-column: span 2; grid-row: span 2; }
.masonry-item:nth-child(5) { grid-column: span 2; grid-row: span 2; }
.masonry-item:nth-child(6) { grid-column: span 2; grid-row: span 2; }
@media (min-width: 760px) {
  .masonry { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 120px; }
  .masonry-item:nth-child(1) { grid-column: span 2; grid-row: span 3; }
  .masonry-item:nth-child(2) { grid-column: span 2; grid-row: span 2; }
  .masonry-item:nth-child(3) { grid-column: span 1; grid-row: span 2; }
  .masonry-item:nth-child(4) { grid-column: span 1; grid-row: span 2; }
  .masonry-item:nth-child(5) { grid-column: span 2; grid-row: span 2; }
  .masonry-item:nth-child(6) { grid-column: span 2; grid-row: span 2; }
}

/* -------------------------------------------------------------------------
   Testimonials - continuous horizontal marquee, not a card grid or a
   single pull-quote slider.
   ------------------------------------------------------------------------- */
.marquee-wrap { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; gap: 20px; width: max-content; animation: marquee-scroll 42s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.quote-chip {
  flex: 0 0 auto; width: min(80vw, 380px);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 26px 24px;
}
.quote-chip .quote-stars { color: var(--cobalt-600); font-size: 0.9rem; letter-spacing: 0.14em; }
.quote-chip blockquote { margin: 14px 0 0; font-size: 1rem; line-height: 1.5; }
.quote-chip footer { margin-top: 16px; font-size: 0.85rem; color: var(--muted); }

/* -------------------------------------------------------------------------
   Visit / hours - address + hours table + directions, its own section
   (Fieldstone Outdoor Living folded this into the contact form instead).
   ------------------------------------------------------------------------- */
.visit-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
.visit-info h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); }
.visit-info p:not(.eyebrow) { margin-top: 14px; color: var(--muted); }
.hours-table { margin-top: 28px; border-top: 1px solid var(--line); }
.hours-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.98rem; }
.hours-row span:first-child { color: var(--muted); }
.hours-row span:last-child { font-weight: 600; }
.visit-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px; }

.map-panel {
  background: var(--surface-dark); color: var(--on-dark);
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center; padding: 32px;
}
.map-panel svg { width: 40px; height: 40px; color: var(--cobalt-600); }
.map-panel strong { font-family: var(--font-display); font-size: 1.1rem; }
.map-panel span { font-size: 0.88rem; opacity: 0.75; max-width: 32ch; }

@media (min-width: 900px) { .visit-grid { grid-template-columns: 1fr 0.9fr; align-items: center; } }

/* -------------------------------------------------------------------------
   FAQ accordion
   ------------------------------------------------------------------------- */
.faq-list { max-width: 780px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 4px; font-weight: 600; font-size: 1.05rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-plus { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); position: relative; transition: transform .2s ease; }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; background: var(--ink); }
.faq-plus::before { left: 6px; right: 6px; top: 12px; height: 2px; }
.faq-plus::after { top: 6px; bottom: 6px; left: 12px; width: 2px; }
.faq-item[open] .faq-plus { transform: rotate(45deg); }
.faq-answer { padding: 0 4px 22px; color: var(--muted); max-width: 62ch; }

/* -------------------------------------------------------------------------
   Contact - single centered column (wholesale/catering leads only; general
   visit info already lives in its own section above), not a split form.
   ------------------------------------------------------------------------- */
.contact-band { background: var(--paper-2); border-top: 1px solid var(--line); }
.contact-form-wrap { max-width: 640px; margin: 0 auto; }

.field-group { margin-bottom: 18px; }
.field-label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 7px; }
.field {
  width: 100%; padding: 13px 15px; font: inherit;
  border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink);
}
.field:focus { outline: none; border-color: var(--cobalt-600); box-shadow: 0 0 0 3px rgba(47, 95, 217, 0.16); }
textarea.field { resize: vertical; min-height: 120px; }
.field-row { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-error { display: none; color: #C0392B; font-size: 0.84rem; margin-top: 6px; }
.field[aria-invalid="true"] { border-color: #C0392B; }
.field[aria-invalid="true"] + .field-error { display: block; }

.form-status { margin-top: 16px; font-size: 0.92rem; padding: 12px 16px; border-radius: var(--radius-sm); display: none; }
.form-status.is-visible { display: block; }
.form-status.is-success { background: rgba(47, 95, 217, 0.1); color: var(--cobalt-700); }
.form-status.is-error { background: rgba(192, 57, 43, 0.1); color: #C0392B; }

.captcha-wrap { min-height: 65px; margin: 6px 0 18px; }
.captcha-wrap:empty { display: none; margin: 0; }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer { background: var(--surface-dark); color: rgba(240, 240, 237, 0.82); padding: 56px 0 28px; }
.footer-grid { display: grid; gap: 34px; grid-template-columns: 1fr; }
.footer-brand .wordmark-text, .footer-brand .wordmark-text span { color: var(--on-dark); }
.footer-brand p { margin-top: 14px; font-size: 0.92rem; max-width: 34ch; color: rgba(240, 240, 237, 0.65); }
.footer-col h4 { font-family: var(--font-body); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(240, 240, 237, 0.5); margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: rgba(240, 240, 237, 0.82); text-decoration: none; font-size: 0.94rem; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(240, 240, 237, 0.14); font-size: 0.84rem; color: rgba(240, 240, 237, 0.55); display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

/* -------------------------------------------------------------------------
   Scroll reveals - IntersectionObserver driven, no scroll listeners
   ------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn { transition: none !important; }
  .marquee-track { animation: none !important; }
}
