/* ==========================================================================
   POLYFIZZ — public website theme on Bootstrap 5
   --------------------------------------------------------------------------
   Bootstrap supplies the grid, components and accessibility behaviour. This
   file supplies the POLYFIZZ look, carried over from the previous site: warm
   paper and ink with a single brass accent, Fraunces for display and Inter for
   text. Bootstrap is themed through its own CSS variables where it exposes
   them, and overridden only where it does not.

     1. tokens            the POLYFIZZ palette, type scale, spacing
     2. Bootstrap theme   mapping the tokens onto --bs-* variables
     3. base typography
     4. layout            sections, header, footer
     5. components        hero, cards, benefits, spec table, FAQ, notices
     6. motion
   ========================================================================== */

/* ---------- 1. tokens ---------------------------------------------------- */
:root {
  --paper:        #fbf9f5;
  --paper-raised: #ffffff;
  --sand:         #f2ede4;
  --sand-deep:    #e8e0d3;
  --line:         #e2dacd;
  --line-strong:  #cdc2b0;

  --ink:          #16120e;
  --ink-body:     #3d3630;
  --ink-muted:    #6b6157;
  --ink-faint:    #8d8377;

  --brass:        #8a6a3d;
  --brass-deep:   #6b5130;
  --brass-tint:   #f4ecdf;

  --positive:     #2f6b46;
  --positive-tint:#e8f2eb;
  --caution:      #8a6410;
  --caution-tint: #faf0d9;
  --critical:     #8f3526;
  --critical-tint:#f8e9e6;

  --step--1: clamp(0.82rem, 0.79rem + 0.13vw, 0.89rem);
  --step-0:  clamp(1rem, 0.96rem + 0.18vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.13rem + 0.34vw, 1.42rem);
  --step-2:  clamp(1.44rem, 1.32rem + 0.6vw, 1.85rem);
  --step-3:  clamp(1.73rem, 1.53rem + 0.98vw, 2.4rem);
  --step-4:  clamp(2.07rem, 1.75rem + 1.57vw, 3.12rem);
  --step-5:  clamp(2.49rem, 1.98rem + 2.45vw, 4.05rem);

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  --radius:    8px;
  --radius-lg: 16px;
  --measure: 62ch;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --duration: 260ms;

  --shadow:    0 2px 10px rgb(22 18 14 / 0.05), 0 1px 2px rgb(22 18 14 / 0.04);
  --shadow-lg: 0 18px 44px rgb(22 18 14 / 0.1), 0 2px 8px rgb(22 18 14 / 0.05);

  /* ---------- 2. Bootstrap theme ----------------------------------------- */
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink-body);
  --bs-body-font-family: var(--font-body);
  --bs-body-font-size: var(--step-0);
  --bs-body-line-height: 1.65;
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--ink-muted);
  --bs-tertiary-bg: var(--sand);
  --bs-border-color: var(--line);
  --bs-border-radius: var(--radius);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-link-color: var(--ink);
  --bs-link-color-rgb: 22, 18, 14;
  --bs-link-hover-color: var(--brass-deep);
  --bs-link-hover-color-rgb: 107, 81, 48;
  --bs-primary: var(--ink);
  --bs-primary-rgb: 22, 18, 14;
  --bs-heading-color: var(--ink);
  --bs-focus-ring-color: rgb(138 106 61 / 0.35);
}

/* ---------- 3. base typography ------------------------------------------- */
html { scroll-padding-top: 6rem; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100dvh; }
h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 460;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { text-wrap: pretty; }
a { text-decoration-color: var(--line-strong); text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--brass); }
strong { font-weight: 600; color: var(--ink); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--brass-tint); color: var(--ink); }

.eyebrow { font-size: var(--step--1); letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); font-weight: 600; margin-bottom: .75rem; }
.lede { font-size: var(--step-1); color: var(--ink-muted); max-width: var(--measure); line-height: 1.55; }
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-2); margin-top: var(--space-6); margin-bottom: .75rem; }
.prose p, .prose ul { margin-bottom: 1rem; }
.text-muted-ink { color: var(--ink-muted) !important; }

/* ---------- 4. layout ---------------------------------------------------- */
@media (min-width: 1200px) { .container { max-width: 1180px; } }
.container-narrow { max-width: 760px; }
.section { padding-block: var(--space-9); }
.section-tight { padding-block: var(--space-8); }
.section-sand { background: var(--sand); }
.section-ink { background: var(--ink); color: #e9e3da; }
.section-ink h2, .section-ink h3 { color: var(--paper); }
.section-ink .lede { color: #c2b8ab; }
.section-head { max-width: 46rem; margin-bottom: var(--space-7); }

.skip-link { position: absolute; left: 1rem; top: -100%; z-index: 1100; background: var(--ink); color: var(--paper); padding: .75rem 1.5rem; border-radius: var(--radius); }
.skip-link:focus { top: 1rem; color: var(--paper); }

/* --- header: Bootstrap navbar, restyled --- */
.site-header {
  position: sticky; top: 0; z-index: 1030;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .navbar { min-height: 4.5rem; padding-block: .5rem; }
.wordmark {
  font-family: var(--font-display); font-size: 1.32rem; font-weight: 600;
  letter-spacing: 0.18em; color: var(--ink) !important; text-decoration: none; text-transform: uppercase;
}
.wordmark span { color: var(--brass); }
.site-header .nav-link {
  font-size: var(--step--1); font-weight: 500; color: var(--ink-muted);
  border-bottom: 1.5px solid transparent; padding-inline: 0 !important; margin-inline: .75rem;
}
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--ink); border-bottom-color: var(--brass); }
.site-header .navbar-toggler { border-color: var(--line-strong); padding: .45rem .6rem; }
.site-header .navbar-toggler:focus { box-shadow: 0 0 0 3px var(--brass-tint); }
@media (max-width: 991.98px) {
  .site-header .nav-link { margin-inline: 0; padding-block: .7rem !important; border-bottom: 0; }
}
@media (max-width: 34rem) {
  .wordmark { font-size: 1.12rem; letter-spacing: 0.14em; }
  .label-long { display: none; }
}

/* --- footer --- */
.site-footer { background: var(--ink); color: #b8aea2; padding-block: var(--space-8) var(--space-6); margin-top: var(--space-9); }
.site-footer a { color: #d8d0c5; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer h2 { color: var(--paper); font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase; font-family: var(--font-body); font-weight: 600; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: .75rem; font-size: var(--step--1); }
.site-footer address { font-style: normal; font-size: var(--step--1); }
.footer-bottom { margin-top: var(--space-8); padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / 0.12); font-size: var(--step--1); color: #8e8376; }

/* ---------- 5. components ------------------------------------------------ */
/* Buttons: Bootstrap's .btn, in POLYFIZZ's pill shape and palette. */
.btn {
  --bs-btn-padding-x: 1.6rem; --bs-btn-padding-y: .82rem;
  --bs-btn-font-size: var(--step--1); --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 999px;
  letter-spacing: .02em; min-height: 2.9rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn-sm { --bs-btn-padding-x: 1rem; --bs-btn-padding-y: .45rem; min-height: 2.2rem; }
.btn-primary {
  --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-color: var(--paper);
  --bs-btn-hover-bg: var(--brass-deep); --bs-btn-hover-border-color: var(--brass-deep); --bs-btn-hover-color: var(--paper);
  --bs-btn-active-bg: var(--brass-deep); --bs-btn-active-border-color: var(--brass-deep);
  --bs-btn-disabled-bg: var(--ink); --bs-btn-disabled-border-color: var(--ink);
  --bs-btn-focus-shadow-rgb: 138, 106, 61;
}
.btn-outline-dark {
  --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-bg: var(--sand); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--ink);
  --bs-btn-active-bg: var(--sand-deep); --bs-btn-active-color: var(--ink);
}
.btn-link-quiet { color: var(--ink-muted); text-decoration: none; padding-inline: .75rem; font-weight: 600; font-size: var(--step--1); }
.btn-link-quiet:hover { color: var(--ink); }
.btn-on-ink { --bs-btn-bg: var(--paper); --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--brass-tint); --bs-btn-hover-color: var(--ink); }

/* Cards */
.card {
  --bs-card-bg: var(--paper-raised); --bs-card-border-color: var(--line); --bs-card-border-radius: var(--radius-lg);
  --bs-card-spacer-x: 2rem; --bs-card-spacer-y: 2rem;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.card-link-wrap { text-decoration: none; color: inherit; display: block; height: 100%; }
.card-link-wrap:hover .card { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.product-card { overflow: hidden; height: 100%; }
.product-card__media { aspect-ratio: 4 / 3; background: linear-gradient(170deg, var(--sand) 0%, var(--sand-deep) 100%); display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card .card-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; }
.product-card h3 { font-size: var(--step-1); }
.product-card__meta { margin-top: auto; padding-top: 1rem; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; border-top: 1px solid var(--line); font-size: var(--step--1); }
.product-card__price { font-weight: 600; color: var(--ink); }

.benefit__icon { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: var(--radius); background: var(--brass-tint); color: var(--brass-deep); font-size: 1.15rem; margin-bottom: .75rem; }
.benefit h3 { font-size: var(--step-1); }
.benefit p { color: var(--ink-muted); font-size: var(--step--1); line-height: 1.6; }
.step { padding-top: 1rem; border-top: 2px solid var(--ink); }
.step__number { font-family: var(--font-display); font-size: var(--step-1); color: var(--brass); }

/* Hero */
.hero { padding-block: clamp(3rem, 2rem + 6vw, 7rem) var(--space-9); }
.hero h1 { max-width: 14ch; margin-bottom: 1.5rem; }
.hero__media { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--sand); box-shadow: var(--shadow-lg); }
.hero__trust { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: var(--space-7); padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--ink-muted); }
.hero__trust strong { display: block; font-size: var(--step-1); font-family: var(--font-display); color: var(--ink); font-weight: 500; }

/* Forms: Bootstrap controls in the POLYFIZZ palette */
.form-label { font-size: var(--step--1); font-weight: 600; color: var(--ink); }
.form-control, .form-select { padding: .78rem 1rem; border-color: var(--line-strong); background-color: var(--paper-raised); color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-tint); }
.form-text { color: var(--ink-faint); }
.is-invalid, .form-control.is-invalid { border-color: var(--critical) !important; }
.invalid-feedback { color: var(--critical); }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }

/* Notices and badges */
.alert { font-size: var(--step--1); border-radius: var(--radius); }
.alert-success { --bs-alert-bg: var(--positive-tint); --bs-alert-color: var(--positive); --bs-alert-border-color: color-mix(in srgb, var(--positive) 32%, transparent); }
.alert-warning { --bs-alert-bg: var(--caution-tint); --bs-alert-color: var(--caution); --bs-alert-border-color: color-mix(in srgb, var(--caution) 32%, transparent); }
.alert-danger  { --bs-alert-bg: var(--critical-tint); --bs-alert-color: var(--critical); --bs-alert-border-color: color-mix(in srgb, var(--critical) 32%, transparent); }
.alert-secondary { --bs-alert-bg: var(--sand); --bs-alert-color: var(--ink-body); --bs-alert-border-color: var(--line-strong); }
.badge { padding: .32rem .7rem; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border: 1px solid; }
.badge-positive { background: var(--positive-tint); color: var(--positive); border-color: color-mix(in srgb, var(--positive) 30%, transparent); }
.badge-caution  { background: var(--caution-tint); color: var(--caution); border-color: color-mix(in srgb, var(--caution) 30%, transparent); }
.badge-critical { background: var(--critical-tint); color: var(--critical); border-color: color-mix(in srgb, var(--critical) 30%, transparent); }
.badge-neutral  { background: var(--sand); color: var(--ink-muted); border-color: var(--line-strong); }

/* Specification table */
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.spec-table th, .spec-table td { text-align: left; padding: 1rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { width: 40%; color: var(--ink-muted); font-weight: 500; }
.spec-table td { color: var(--ink); font-weight: 500; }

/* FAQ on <details>: works with no JavaScript at all */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary { cursor: pointer; list-style: none; padding: 1.5rem 2rem 1.5rem 0; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: '+'; font-family: var(--font-display); font-size: var(--step-2); color: var(--brass); line-height: 1; transition: transform var(--duration) var(--ease); }
.faq-item[open] > summary::after { transform: rotate(45deg); }
.faq-item__body { padding-bottom: 1.5rem; color: var(--ink-muted); max-width: var(--measure); }

/* Breadcrumbs: Bootstrap's, in brass */
.breadcrumb { --bs-breadcrumb-divider-color: var(--line-strong); --bs-breadcrumb-item-active-color: var(--ink-faint); font-size: var(--step--1); padding-block: 1.5rem; margin: 0; }
.breadcrumb a { text-decoration: none; color: var(--ink-muted); }
.breadcrumb a:hover { color: var(--brass); text-decoration: underline; }

/* Dealer locator */
.dealer-card { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); height: 100%; }
.dealer-card h3 { font-size: var(--step-1); }
.dealer-card address { font-style: normal; color: var(--ink-muted); font-size: var(--step--1); margin: 0; }

/* Warranty verification result */
.verify-result { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-raised); overflow: hidden; }
.verify-result__head { padding: 1.5rem 2rem; background: var(--positive-tint); border-bottom: 1px solid var(--line); }
.verify-result__head.is-missing { background: var(--critical-tint); }
.verify-result__head h2 { font-size: var(--step-2); margin: 0; }
.verify-result__body { padding: 2rem; }
.dealer-shortcut { border: 1px dashed var(--brass); background: var(--brass-tint); border-radius: var(--radius); padding: 1rem 1.25rem; }

/* Honeypot: in the DOM, invisible and unreachable to a real person */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 6. motion ----------------------------------------------------- */
/* Scroll-driven, transform only: content is never invisible, in a capture,
   in print, or to anything reading the page without scrolling it. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: reveal-in linear both; animation-timeline: view(); animation-range: entry 5% cover 22%; }
  }
}
@keyframes reveal-in { from { transform: translateY(16px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .skip-link { display: none !important; }
  body { background: #fff; }
}

/* Wide gutters are for wide screens: on a phone a 3rem gutter is wider than
   the container padding and would push the page sideways. */
@media (max-width: 991.98px) {
  .g-5, .gx-5 { --bs-gutter-x: 1.5rem; }
  .g-4, .gx-4 { --bs-gutter-x: 1.5rem; }
}
.site-footer .wordmark { color: var(--paper) !important; }
