/**
 * GearBuddy — style.css
 * Mobile-First Ergonomic Workspace Peripherals Guide
 * Base styles target 320px–430px phones, enhanced via min-width queries.
 */

/* ==========================================================================
   1. FONTS & SELF-HOSTED @FONT-FACE (WOFF2)
   ========================================================================== */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/atkinson-hyperlegible-400-italic.woff2') format('woff2');
}

/* ==========================================================================
   2. DESIGN TOKENS & COLOR PALETTE
   ========================================================================== */

:root {
  /* Light Palette */
  --bg: #EEF1F4;
  --text: #1B2430;
  --surface: #FFFFFF;
  --felt: #1F3347;
  --teal: #0B6E75;
  --teal-hover: #085257;
  --teal-active: #063d41;
  --amber: #F2B33D;

  /* Neutrals & Borders */
  --border: #D5DDE4;
  --border-strong: #B0BECB;
  --text-muted: #4B5A6B;
  --disclosure-bg: #E4EAF0;
  --disclosure-border: #CBD5E1;
  --disclosure-text: #1E2D3D;

  /* Focus & Tap */
  --focus-ring: #0B6E75;
  --tap-highlight: rgba(11, 110, 117, 0.12);

  /* Typography */
  --font-heading: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-text-width: 68ch;

  /* Sizing & Spacing */
  --radius-sm: 4px;
  --radius-md: 6px;
  --container-max: 1120px;
  --header-height: 60px;
  --gutter: clamp(1rem, 4vw, 1.25rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark Palette */
    --bg: #14202B;
    --text: #E8EDF2;
    --surface: #1C2C3A;
    --felt: #0F1A24;
    --teal: #4FB8C0;
    --teal-hover: #6EC6CD;
    --teal-active: #8CD6DC;
    --amber: #F2B33D;

    /* Neutrals */
    --border: #2B3D4F;
    --border-strong: #3D556C;
    --text-muted: #9BB0C1;
    --disclosure-bg: #182736;
    --disclosure-border: #2C4054;
    --disclosure-text: #D2DFEB;

    --focus-ring: #4FB8C0;
    --tap-highlight: rgba(79, 184, 192, 0.15);
  }
}

/* ==========================================================================
   3. MOBILE-FIRST BASE STYLES & RESET (320px–430px Base)
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px; /* 18px minimum body size on mobile */
  line-height: 1.6;
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem; /* 18px */
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden; /* Strict horizontal overflow prevention */
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Word-wrap & text-wrap prevention */
p, h1, h2, h3, h4, h5, h6, li, td, th, dt, dd, span, a {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Headings scale fluidly with clamp() */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
  text-transform: none; /* Sentence case, no all-caps */
}

h1 {
  font-size: clamp(1.75rem, 5vw + 0.5rem, 2.75rem);
  letter-spacing: -0.02em;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: clamp(1.35rem, 3.5vw + 0.3rem, 1.85rem);
  letter-spacing: -0.015em;
  margin-top: 2rem;
  margin-bottom: 0.65rem;
}

h3 {
  font-size: clamp(1.15rem, 2.5vw + 0.2rem, 1.35rem);
  margin-top: 1.35rem;
  margin-bottom: 0.45rem;
}

h4 {
  font-size: 1rem;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

p, ul, ol, dl, table, blockquote {
  margin-bottom: 1.15rem;
  max-width: var(--max-text-width);
}

ul, ol {
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.4rem;
}

a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  touch-action: manipulation;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover, a:focus {
  color: var(--teal-hover);
}

a:active {
  color: var(--teal-active);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Visible keyboard & tap focus */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -120px;
  left: 1rem;
  background: var(--felt);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
  font-weight: 700;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.skip-link:focus {
  top: 1rem;
}

/* Fluid responsive container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ==========================================================================
   4. NAVIGATION & MOBILE FULL-WIDTH DRAWER
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1rem;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  touch-action: manipulation;
}

.site-logo:hover {
  color: var(--teal);
}

/* Menu toggle button on phones (>= 44x44px target) */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle:active {
  background-color: var(--tap-highlight);
}

/* Full-width drawer on mobile (< 640px) */
.primary-nav,
#primary-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background-color: var(--surface);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 0.75rem var(--gutter) 1.25rem;
  z-index: 190;
}

.primary-nav.nav-open,
#primary-nav.nav-open {
  display: block;
}

.nav-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  width: 100%;
}

.nav-list li {
  margin: 0;
  width: 100%;
}

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 48px; /* 48px tap height on mobile */
  padding: 0.65rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  touch-action: manipulation;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-list a:active {
  background-color: var(--tap-highlight);
}

.nav-list a[aria-current="page"] {
  background-color: var(--felt);
  color: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  .nav-list a[aria-current="page"] {
    background-color: #243B50;
    color: #FFFFFF;
  }
}

/* Tablet & Desktop Header Enhancement (>= 640px) */
@media (min-width: 640px) {
  .nav-toggle {
    display: none;
  }

  .primary-nav,
  #primary-nav {
    display: flex !important;
    position: static;
    width: auto;
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    padding: 0;
  }

  .nav-list {
    flex-direction: row;
    gap: 0.5rem;
    width: auto;
  }

  .nav-list li {
    width: auto;
  }

  .nav-list a {
    min-height: 44px;
    font-size: 0.95rem;
    padding: 0.5rem 0.85rem;
  }
}

/* ==========================================================================
   5. DISCLOSURE STRIP (DIRECTLY BELOW HEADER ON AFFILIATE PAGES)
   ========================================================================== */

.disclosure-strip {
  width: 100%;
  background-color: var(--disclosure-bg);
  border-bottom: 1px solid var(--disclosure-border);
  color: var(--disclosure-text);
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 0.65rem 0;
}

.disclosure-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.disclosure-inner p {
  margin: 0;
  max-width: none;
}

.disclosure-info-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
  flex-shrink: 0;
  font-style: italic;
}

/* Fallback inner disclosure box */
.disclosure-box {
  background-color: var(--disclosure-bg);
  border: 1px solid var(--disclosure-border);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  color: var(--disclosure-text);
  font-size: 0.9rem;
}

.disclosure-box p {
  margin: 0;
}

/* ==========================================================================
   6. RULER TICK-MARK DIVIDER (CSS ONLY)
   ========================================================================== */

.ruler-divider {
  display: block;
  width: 100%;
  height: 12px;
  margin: 2.5rem 0;
  border-top: 1px solid var(--border);
  background-image:
    repeating-linear-gradient(90deg, var(--border) 0, var(--border) 1px, transparent 1px, transparent 10px),
    repeating-linear-gradient(90deg, var(--border-strong) 0, var(--border-strong) 1.5px, transparent 1.5px, transparent 50px);
  background-size: 100% 6px, 100% 12px;
  background-position: left top, left top;
  background-repeat: no-repeat;
}

/* ==========================================================================
   7. BUTTONS & TOUCH TARGETS (44px MINIMUM, TOUCH-ACTION)
   ========================================================================== */

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px; /* 48px touch height */
  width: 100%; /* Full width on mobile */
  padding: 0.75rem 1.4rem;
  background-color: var(--teal);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  text-align: center;
  text-transform: none; /* Sentence case */
  transition: transform 0.1s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Visible pressed state */
.cta-button:active {
  background-color: var(--teal-active);
  transform: scale(0.98);
}

@media (min-width: 640px) {
  .cta-button {
    width: auto;
    font-size: 0.95rem;
    min-height: 44px;
    padding: 0.65rem 1.4rem;
  }
}

@media (prefers-color-scheme: dark) {
  .cta-button {
    background-color: var(--teal);
    color: #0F1A24;
    font-weight: 700;
  }
  .cta-button:active {
    background-color: var(--teal-active);
    color: #0F1A24;
  }
}

.cta-button-secondary {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.cta-button-secondary:active {
  background-color: var(--tap-highlight);
  transform: scale(0.98);
}

/* ==========================================================================
   8. HERO SECTION (MOBILE-FIRST: HEADLINE -> BUTTON -> ILLUSTRATION)
   ========================================================================== */

.hero {
  padding: 1.75rem 0 1.25rem;
  background-color: var(--bg);
}

.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.hero-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.hero-title {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.hero-intro {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* Desk illustration scaled to full width on mobile */
.hero-illustration {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.desk-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

/* Monitor light bar glow animation */
@keyframes lightBarGlowIn {
  from {
    opacity: 0;
    transform: scaleY(0.92);
  }
  to {
    opacity: 0.9;
    transform: scaleY(1);
  }
}

.desk-light-glow {
  transform-origin: top center;
  animation: lightBarGlowIn 1.4s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .desk-light-glow {
    animation: none;
    opacity: 0.9;
  }
}

/* Desktop enhancement (>= 960px) */
@media (min-width: 960px) {
  .hero {
    padding: 3rem 0 2rem;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 2.5rem;
    align-items: center;
  }

  .hero-actions {
    flex-direction: row;
    align-items: center;
  }

  .hero-illustration {
    max-width: 500px;
  }
}

/* ==========================================================================
   9. PROBLEM-BASED GUIDE LIST (HOMEPAGE FIXES)
   ========================================================================== */

.problem-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
  list-style: none;
  padding: 0;
  width: 100%;
  max-width: none;
}

.problem-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.15rem 1.2rem;
  min-height: 56px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  touch-action: manipulation;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.problem-row:active {
  background-color: var(--tap-highlight);
  border-color: var(--teal);
}

.problem-meta {
  width: 100%;
}

.problem-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.3rem 0;
  text-transform: none;
}

.problem-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.problem-action {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--teal);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

@media (min-width: 640px) {
  .problem-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
  .problem-action {
    flex-shrink: 0;
    align-self: auto;
  }
}

/* ==========================================================================
   10. PRODUCT CARDS (MOBILE: VERTICALLY STACKED, FULL-WIDTH BUTTON)
   ========================================================================== */

.product-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0;
  width: 100%;
  max-width: none;
}

.product-card {
  display: flex;
  flex-direction: column; /* Stacked on mobile */
  gap: 1.25rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: none;
}

.product-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  width: 100%;
  min-height: 160px;
}

.product-card-media img {
  max-height: 140px;
  width: auto;
  object-fit: contain;
}

.product-card-body {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.product-card h3 {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 0.35rem;
  text-transform: none;
}

.best-for {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Pros and cons in single column on mobile, 2 columns on >= 640px */
.pros-cons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.pros-cons h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 0.35rem;
  text-transform: none;
}

.pros-list,
.cons-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.pros-list li,
.cons-list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.35rem;
}

.pros-list li::before {
  content: "+";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--teal);
  font-family: monospace;
}

.cons-list li::before {
  content: "-";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--text-muted);
  font-family: monospace;
}

.product-card-actions {
  margin-top: auto;
  padding-top: 0.5rem;
  width: 100%;
}

.product-card-actions .cta-button {
  width: 100%;
}

/* Enhanced 2-column layout on tablet & desktop (>= 640px) */
@media (min-width: 640px) {
  .product-card {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 1.5rem;
    align-items: start;
    padding: 1.5rem;
  }

  .pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  .product-card-actions .cta-button {
    width: auto;
  }
}

/* ==========================================================================
   11. GUIDE LAYOUT & RESPONSIVE "ON THIS PAGE" (COLLAPSED ON MOBILE)
   ========================================================================== */

.guide-reviewed {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: -0.25rem;
  margin-bottom: 1.25rem;
}

/* On mobile: Collapsed details dropdown near the top */
.guide-toc {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.guide-toc summary {
  padding: 0.85rem 1.15rem;
  min-height: 48px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  touch-action: manipulation;
  user-select: none;
}

.guide-toc summary::-webkit-details-marker {
  display: none;
}

.guide-toc summary::after {
  content: "+";
  font-family: monospace;
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 700;
}

.guide-toc[open] summary::after {
  content: "-";
}

.guide-toc-content {
  padding: 0.5rem 1.15rem 1rem;
}

.guide-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-toc li {
  margin-bottom: 0.35rem;
}

.guide-toc a {
  display: flex;
  align-items: center;
  min-height: 44px; /* 44px tap target */
  padding: 0.25rem 0;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
}

.guide-toc a:active {
  color: var(--teal);
}

/* Desktop enhancement: Sticky sidebar (>= 960px) */
@media (min-width: 960px) {
  .guide-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
    margin-top: 1.5rem;
  }

  .guide-toc {
    display: block;
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    margin-bottom: 0;
    padding: 1.25rem;
  }

  .guide-toc summary {
    display: none; /* Hide summary marker on desktop */
  }

  .guide-toc-heading-desktop {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
  }

  .guide-toc-content {
    display: block !important;
    padding: 0;
  }

  .guide-toc a {
    min-height: 38px;
    font-size: 0.9rem;
  }
}

@media (max-width: 959px) {
  .guide-toc-heading-desktop {
    display: none;
  }
}

/* ==========================================================================
   12. COMPARISON TABLES (STACKED CARDS ON MOBILE FOR > 3 COLUMNS)
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius-md);
}

/* Stacked card representation on phones (< 640px) */
@media (max-width: 639px) {
  .comparison-table-stacked thead {
    display: none;
  }

  .comparison-table-stacked,
  .comparison-table-stacked tbody,
  .comparison-table-stacked tr,
  .comparison-table-stacked td {
    display: block;
    width: 100%;
  }

  .comparison-table-stacked tr {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 0.85rem 1rem;
  }

  .comparison-table-stacked td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    min-height: 40px;
  }

  .comparison-table-stacked td:last-child {
    border-bottom: none;
  }

  .comparison-table-stacked td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.88rem;
    padding-right: 0.75rem;
    text-align: left;
    flex-shrink: 0;
  }

  .comparison-table-stacked td:first-child {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.65rem;
    margin-bottom: 0.35rem;
    display: block;
  }

  .comparison-table-stacked td:first-child::before {
    display: none;
  }
}

/* Regular table layout on tablet & desktop (>= 640px) */
@media (min-width: 640px) {
  .table-responsive {
    border: 1px solid var(--border);
    background-color: var(--surface);
  }

  .comparison-table,
  .comparison-table-stacked {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
  }

  .comparison-table th,
  .comparison-table td,
  .comparison-table-stacked th,
  .comparison-table-stacked td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
  }

  .comparison-table th,
  .comparison-table-stacked th {
    background-color: var(--bg);
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text);
  }

  .comparison-table tr:last-child td,
  .comparison-table-stacked tr:last-child td {
    border-bottom: none;
  }

  .comparison-table tbody tr:hover,
  .comparison-table-stacked tbody tr:hover {
    background-color: var(--bg);
  }
}

/* ==========================================================================
   13. ACCORDIONS / FAQS (GENEROUS TOUCH TARGETS)
   ========================================================================== */

.faq-list {
  margin: 1.25rem 0 2rem;
  width: 100%;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 1.1rem 1.25rem;
  min-height: 52px; /* Generous touch area */
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: monospace;
  font-size: 1.35rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-left: 1rem;
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.6;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   14. TRUST & CREDIBILITY GRID
   ========================================================================== */

.trust-section {
  padding: 2rem 0;
}

.trust-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.trust-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.trust-item h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.trust-item p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .trust-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 960px) {
  .trust-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   15. BREADCRUMBS
   ========================================================================== */

.breadcrumb {
  padding: 0.75rem 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumb li + li::before {
  content: "/";
  padding-right: 0.5rem;
  color: var(--border-strong);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.breadcrumb a:active {
  color: var(--teal);
}

.breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

/* ==========================================================================
   16. FOOTER (DEEP FELT COLOR)
   ========================================================================== */

.site-footer {
  margin-top: auto;
  background-color: var(--felt);
  color: #D2DFEB;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.5rem 0 calc(2rem + env(safe-area-inset-bottom));
  font-size: 0.92rem;
  line-height: 1.6;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-disclosure {
  max-width: var(--max-text-width);
  color: #B9CBDC;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.footer-links {
  display: flex;
  flex-direction: column; /* Stacked links on phones */
  gap: 0.65rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  color: #FFFFFF;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  min-height: 44px; /* 44px target */
  display: inline-flex;
  align-items: center;
  touch-action: manipulation;
}

.footer-links a:active {
  color: var(--amber);
}

.footer-copyright {
  color: #8CA3B8;
  font-size: 0.85rem;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.25rem;
}

.footer-copyright a {
  color: #B9CBDC;
}

@media (min-width: 640px) {
  .footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   17. FORMS & CONTACT
   ========================================================================== */

.contact-form {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  max-width: 600px;
  margin: 1.5rem 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  font-family: var(--font-body);
  font-size: 1rem; /* 16px+ prevents iOS zoom on focus */
  color: var(--text);
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 48px; /* 48px touch target */
}

.form-group input:focus,
.form-group textarea:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--teal);
}

/* Back to top button */
#back-to-top {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  right: 1.25rem;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  min-height: 48px;
  min-width: 48px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 150;
  display: none;
  touch-action: manipulation;
}

#back-to-top.visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#back-to-top:active {
  background-color: var(--felt);
  color: #FFFFFF;
}

/* ==========================================================================
   18. PRINT STYLES
   ========================================================================== */

@media print {
  body {
    background: white;
    color: black;
  }
  .site-header,
  .site-footer,
  .disclosure-strip,
  .nav-toggle,
  #back-to-top,
  .cta-button {
    display: none !important;
  }
}

/* Image caption helper */
.image-caption {
  display: block;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.45rem;
  margin-bottom: 1.35rem;
}

figure.guide-figure {
  margin: 1.5rem 0;
  width: 100%;
}

figure.guide-figure img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ==========================================================================
   19. PAGE SPECIFIC STYLES (404, CONTACT, LEGAL)
   ========================================================================== */

/* 404 Error Page */
.error-page {
  text-align: center;
  padding: 3rem 1rem 5rem;
}

.error-code {
  font-family: var(--font-heading);
  font-size: clamp(4.5rem, 18vw, 8.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--felt);
  opacity: 0.2;
  margin: 0;
  pointer-events: none;
  user-select: none;
}

.error-page h1 {
  margin-top: -0.75rem;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.error-page .error-message {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0.75rem auto 2rem;
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  justify-content: center;
  margin-bottom: 2.75rem;
  width: 100%;
}

@media (min-width: 640px) {
  .error-actions {
    flex-direction: row;
    align-items: center;
  }
  .error-actions .cta-button {
    width: auto;
  }
}

.error-guides {
  text-align: left;
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.error-guides h2 {
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 0.85rem;
  color: var(--text);
  text-transform: none;
}

.error-guides ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.error-guides li {
  margin: 0;
}

.error-guides li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error-guides li a:hover,
.error-guides li a:active {
  color: var(--teal);
}

/* Contact Page Methods & Success Message */
.contact-wrapper {
  max-width: 680px;
  margin: 0 auto;
}

.contact-methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .contact-methods {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-method {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.contact-method h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: none;
}

.contact-method a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  color: var(--teal);
}

.success-message {
  display: none;
  background-color: var(--disclosure-bg);
  border: 1px solid var(--teal);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.success-message.visible {
  display: block;
}

/* Legal Page Table of Contents & Sections */
.legal-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.legal-toc h2 {
  font-size: 0.95rem;
  text-transform: none;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.legal-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.legal-toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--text);
}

.legal-toc a:hover {
  color: var(--teal);
}

.legal-section {
  margin-bottom: 2.75rem;
  padding-bottom: 2.75rem;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-of-type {
  border-bottom: none;
}

.legal-section h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  margin-bottom: 0.5rem;
}

.legal-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.legal-section p,
.legal-section ul,
.legal-section ol {
  max-width: var(--max-text-width);
}

.legal-section li {
  margin-bottom: 0.5rem;
}

.disclosure-highlight {
  background: var(--disclosure-bg);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  max-width: var(--max-text-width);
  color: var(--disclosure-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.contact-privacy-note {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
