/*
 * CalcPrism — Editorial Page Styles
 * ==================================
 * Mockup-aligned layout: single 1280px container,
 * editorial hero, tinted category grid, dark how-it-works.
 */

/* ═══════════════════════════════════════════
   Page container — wraps all homepage/category content
   ═══════════════════════════════════════════ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ═══════════════════════════════════════════
   Homepage — Hero (editorial, two-column on desktop)
   Tokens: --surface/--surface-2/--line/--ink/--ink-2/--ink-3
           --accent/--accent-soft, --amber-soft, --rose, --blue, --violet, --violet-soft
           --radius-lg/--radius-xl, --shadow/--shadow-sm/--shadow-lg
   ═══════════════════════════════════════════ */

.hero {
  padding: 72px 0 48px;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.hero-copy { min-width: 0; }

/* Editorial "new" pill above the hero headline */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3bb273;
  box-shadow: 0 0 0 3px color-mix(in srgb, #3bb273 25%, transparent);
}

.hero-badge strong { color: var(--ink); font-weight: 600; }

.hero-title {
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 700;
  margin: 0 0 22px;
  color: var(--ink);
}

.hero-title .serif {
  color: var(--accent);
  font-size: 1.02em;
}

.hero-sub {
  font-size: 19px;
  color: var(--ink-2);
  max-width: 560px;
  line-height: 1.5;
  margin: 0 0 28px;
}

/* Hero search — styled trigger that opens the existing overlay on click/focus */
.hero-search {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  max-width: 560px;
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow);
  transition: border-color .2s ease, box-shadow .2s ease;
  cursor: pointer;
}

.hero-search:hover,
.hero-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow);
}

.hero-search-icon {
  display: inline-flex;
  align-items: center;
  color: var(--ink-3);
  margin-inline-end: 8px;
  flex-shrink: 0;
}

.hero-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  padding: 12px 0;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}

.hero-search input::placeholder { color: var(--ink-3); }

.hero-search kbd {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  font-family: inherit;
  margin-right: 6px;
  flex-shrink: 0;
}

.hero-search-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.hero-search-btn:hover { background: color-mix(in srgb, var(--accent) 85%, black); }

/* Hero pills — quick-access category shortcuts */
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-pill-label {
  font-size: 12px;
  color: var(--ink-3);
  margin-inline-end: 4px;
  align-self: center;
}

.hero-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.hero-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Hero visual — decorative stacked preview cards (desktop only) */
.hero-visual {
  position: relative;
  height: 440px;
}

.preview-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 60% 40%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, var(--amber-soft) 0%, transparent 55%);
  filter: blur(40px);
  opacity: .6;
  pointer-events: none;
}

.preview-main {
  position: absolute;
  top: 20px;
  inset-inline-end: 0;
  width: 380px;
  background: linear-gradient(135deg, #1e2d28 0%, #2e5d4e 55%, #4a8672 100%);
  color: #fff;
  border-radius: 20px;
  padding: 26px 28px;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
  overflow: hidden;
}

.preview-main::before {
  content: '';
  position: absolute;
  top: -40%;
  inset-inline-end: -30%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14) 0%, transparent 65%);
}

.preview-inner { position: relative; z-index: 1; }

.preview-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, .7);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7fe0a8;
  box-shadow: 0 0 0 3px rgba(127, 224, 168, .25);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.preview-value {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.preview-value .c { font-size: 20px; color: rgba(255, 255, 255, .7); }

.preview-meta { font-size: 13px; color: rgba(255, 255, 255, .7); }

.preview-bars {
  margin-top: 22px;
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 64px;
}

.preview-bar {
  flex: 1;
  background: rgba(255, 255, 255, .25);
  border-radius: 3px;
  transform-origin: bottom;
}

.preview-bar--accent { background: rgba(255, 255, 255, .9); }

.preview-side {
  position: absolute;
  bottom: 30px;
  inset-inline-start: 10px;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-lg);
  transform: rotate(-3deg);
}

.preview-side h4 {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.preview-side .bmi-val {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
}

.preview-side .bmi-cat { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.bmi-gauge {
  display: flex;
  gap: 2px;
  margin-top: 10px;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.bmi-gauge div:nth-child(1) { background: var(--blue); flex: 1; }
.bmi-gauge div:nth-child(2) { background: var(--accent); flex: 2; position: relative; }
.bmi-gauge div:nth-child(3) { background: var(--amber); flex: 1.5; }
.bmi-gauge div:nth-child(4) { background: var(--rose); flex: 1; }

.bmi-gauge div:nth-child(2)::after {
  content: '';
  position: absolute;
  top: -2px;
  right: 30%;
  width: 2px;
  height: 10px;
  background: var(--ink);
}

.preview-side-2 {
  position: absolute;
  top: 0;
  inset-inline-start: 40px;
  width: 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  transform: rotate(-4deg);
}

.preview-side-2 .tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--violet-soft);
  color: var(--violet);
  margin-bottom: 8px;
}

.preview-side-2 .expr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-2);
}

.preview-side-2 .res {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

/* ═════ Stats band ═════ */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 36px 40px;
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  /* Reserve height to avoid CLS as fonts swap (stat-value 32px + gap + label 13px) */
  min-height: 124px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 52px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.stat-value .serif { color: var(--accent); }

.stat-value__suffix {
  font-size: .7em;
  color: var(--ink-3);
  font-weight: 600;
}

.stat-label {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   Homepage — Section Wrapper
   ═══════════════════════════════════════════ */

.home-section {
  padding: 80px 0 0;
}

.home-section--full { padding-inline: 0; }

.home-section__inner { padding: 0; }

/* Legacy centered-heading utility (kept for category/calculator pages).
   Disabled inside .section-head so editorial heads are left-aligned. */
.section-heading {
  text-align: center;
  margin-bottom: var(--space-6);
}

.section-head .section-heading {
  text-align: start;
  margin-bottom: 0;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--ink);
  margin: 0 0 var(--space-3);
}

.section-heading .gradient-text { color: var(--accent); }

.section-heading p {
  font-size: var(--text-base);
  color: var(--ink-2);
  max-width: 560px;
  margin: 0 auto;
  line-height: var(--leading-relaxed);
}

/* Editorial section heading (large, left-aligned) used inside .section-head */
.section-head h2,
.section-head .section-heading {
  font-size: clamp(30px, 3.5vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  max-width: 620px;
}

.section-head h2 .serif,
.section-head .section-heading .serif { color: var(--accent); }

/* ═══════════════════════════════════════════
   Homepage — Category Grid
   ═══════════════════════════════════════════ */

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1023px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .category-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

/* ═══════════════════════════════════════════
   Homepage — Most Popular (editorial muted panel)
   ═══════════════════════════════════════════ */

.pop-section {
  background: var(--surface-2);
  border-radius: var(--radius-xl);
  padding: 48px;
  margin: 80px 0 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.section-head > div:first-child {
  min-width: 0;
  max-width: 620px;
}

.section-lead {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.section-intro {
  margin: 0;
  max-width: 420px;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.6;
}

.pop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ═══════════════════════════════════════════
   Homepage — Value Props (editorial vp-grid)
   ═══════════════════════════════════════════ */

.vp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.vp-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.vp-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
}

.vp-icon.green  { background: var(--accent-soft); color: var(--accent); }
.vp-icon.amber  { background: var(--amber-soft);  color: var(--amber); }
.vp-icon.blue   { background: var(--blue-soft);   color: var(--blue); }
.vp-icon.rose   { background: var(--rose-soft);   color: var(--rose); }
.vp-icon.violet { background: var(--violet-soft); color: var(--violet); }
.vp-icon.teal   { background: var(--teal-soft);   color: var(--teal); }

.vp-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 8px;
}

.vp-desc {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0;
}

/* ═══════════════════════════════════════════
   Homepage — How it works (dark forest gradient card)
   ═══════════════════════════════════════════ */

.how-section {
  background: linear-gradient(140deg, #1e2d28 0%, #2e5d4e 60%, #4a8672 100%);
  border-radius: var(--radius-xl);
  padding: 72px 48px;
  color: #fff;
  margin: 80px 0 0;
  position: relative;
  overflow: hidden;
}

.how-section::before {
  content: '';
  position: absolute;
  top: -40%;
  inset-inline-end: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 65%);
  pointer-events: none;
}

.how-section::after {
  content: '';
  position: absolute;
  bottom: -50%;
  inset-inline-start: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 65%);
  pointer-events: none;
}

.how-section > * { position: relative; z-index: 1; }

.section-head--on-dark .section-lead { color: #a4c9ba; }
.section-head--on-dark h2,
.section-head--on-dark .section-heading { color: #fff; }
.section-head--on-dark h2 .serif,
.section-head--on-dark .section-heading .serif { color: #a4c9ba; }
.section-head--on-dark .section-intro { color: rgba(255, 255, 255, 0.75); }

.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.how-step {
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.how-num {
  font-style: italic;
  font-size: 44px;
  line-height: 1;
  color: #a4c9ba;
  margin-bottom: 14px;
  display: block;
}

.how-step h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.how-step p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
  margin: 0;
}

/* ═══════════════════════════════════════════
   Homepage — Full catalog index (3×3 grid)
   ═══════════════════════════════════════════ */

.index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.index-col {
  border-inline-end: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 24px 26px;
}

.index-col:nth-child(3n) { border-inline-end: 0; }

.index-col h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 700;
  margin: 0 0 12px;
}

.index-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.index-col li a {
  font-size: 14px;
  color: var(--ink-2);
  padding: 5px 0;
  display: block;
  text-decoration: none;
  transition: color 0.12s ease;
}

.index-col li a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════
   Homepage — CTA (radial green glow card)
   ═══════════════════════════════════════════ */

.cta {
  padding: 80px 0;
  text-align: center;
}

.cta-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 64px 40px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -70%);
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 60%);
  pointer-events: none;
}

.cta-card > * { position: relative; z-index: 1; }

.cta h2 {
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 16px;
  color: var(--ink);
}

.cta h2 .serif { color: var(--accent); }

.cta p {
  color: var(--ink-2);
  max-width: 480px;
  margin: 0 auto 28px;
  font-size: 16px;
  line-height: 1.6;
}

.cta-buttons {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.cta-buttons .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 12px;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}

.cta-buttons .btn-primary {
  background: var(--accent);
  color: #fff;
}

.cta-buttons .btn-primary:hover {
  background: #244a3e;
  transform: translateY(-1px);
}

.cta-buttons .btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.cta-buttons .btn-ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

/* ═══════════════════════════════════════════
   Calculator Page — Top Bar
   ═══════════════════════════════════════════ */

.calc-page-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8) 0;
}

/* ═══════════════════════════════════════════
   Category Page
   ═══════════════════════════════════════════ */

/* Category page hero — tinted accent strip with icon + title + description + count.
   Color variants (.green/.amber/.rose/.blue/.violet/.teal) follow the same --cc/--cc-strong
   pattern as .cat-card, so the hero matches each category's mapped color throughout the page. */
.cat-hero {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  margin: 24px 0 0;
  padding: 40px;
}

.cat-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  inset-inline-end: -15%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cc, var(--accent-soft)) 0%, transparent 65%);
  opacity: 0.6;
  pointer-events: none;
}

.cat-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  max-width: 820px;
}

.cat-hero__icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--cc, var(--accent-soft));
  color: var(--cc-strong, var(--accent));
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.cat-hero .section-lead {
  color: var(--cc-strong, var(--accent));
  margin-bottom: 8px;
}

.cat-hero__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 12px;
}

.cat-hero__desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 16px;
  max-width: 620px;
}

.cat-hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cat-hero__count {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--cc, var(--accent-soft));
  color: var(--cc-strong, var(--accent));
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.cat-hero.green  { --cc: var(--accent-soft); --cc-strong: var(--accent); }
.cat-hero.amber  { --cc: var(--amber-soft);  --cc-strong: var(--amber); }
.cat-hero.rose   { --cc: var(--rose-soft);   --cc-strong: var(--rose); }
.cat-hero.blue   { --cc: var(--blue-soft);   --cc-strong: var(--blue); }
.cat-hero.violet { --cc: var(--violet-soft); --cc-strong: var(--violet); }
.cat-hero.teal   { --cc: var(--teal-soft);   --cc-strong: var(--teal); }

/* Related categories grid — uses .category-grid base; modifier tightens vertical rhythm. */
.category-grid--related {
  margin-top: 20px;
}

/* ═══════════════════════════════════════════
   Dark Mode — Page Overrides
   ═══════════════════════════════════════════ */

/* Hero dark-mode: covered by --surface / --line / --ink* token flips in variables.css. */

/* Category hero uses --surface/--line/--cc tokens that flip automatically in dark mode. */

/* .how-section uses its own fixed dark gradient, so no dark-mode overrides are needed there. */
/* .index-col borders use --line which flips automatically via variables.css. */

/* ═══════════════════════════════════════════
   Responsive — Tablet (1024px)
   ═══════════════════════════════════════════ */

@media (max-width: 719px) {
  .hero { padding: 56px 0 40px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { display: none; }
}

@media (max-width: 1024px) {
  .home-section { padding: 64px 0 0; }
}

/* Editorial responsive (mockup: 960/720/560) */
@media (max-width: 960px) {
  .pop-grid,
  .vp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .how-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .index-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .index-col:nth-child(3n) { border-inline-end: 1px solid var(--line); }
  .index-col:nth-child(2n) { border-inline-end: 0; }
}

@media (max-width: 720px) {
  .pop-section {
    padding: 32px 24px;
  }
  .how-section {
    padding: 48px 28px;
  }
  .section-head {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
  }
}

@media (max-width: 560px) {
  .pop-grid,
  .vp-grid {
    grid-template-columns: 1fr;
  }
  .how-grid {
    grid-template-columns: 1fr;
  }
  .index-grid {
    grid-template-columns: 1fr;
  }
  .index-col,
  .index-col:nth-child(3n),
  .index-col:nth-child(2n) { border-inline-end: 0; }
  .cta-card {
    padding: 48px 28px;
  }
}

/* ═══════════════════════════════════════════
   Responsive — Mobile (768px)
   ═══════════════════════════════════════════ */

@media (max-width: 719px) {
  .hero { padding: 40px 0 32px; }
  .hero-sub { font-size: 16px; }

  .stats-band {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 28px;
  }
}

@media (max-width: 768px) {
  .home-section { padding: 48px 0 0; }

  .container { padding: 0 20px; }

  .section-heading {
    margin-bottom: var(--space-5);
  }

  .calc-page-top {
    padding: var(--space-4) var(--space-4) 0;
  }

  .cat-hero {
    padding: 28px 24px;
  }

  .cat-hero__inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .how-step {
    padding: 20px;
  }
  .how-num {
    font-size: 36px;
  }
}

/* ═══════════════════════════════════════════
   Print
   ═══════════════════════════════════════════ */

@media print {
  .hero { padding: var(--space-8) var(--space-4); }
  .hero-search,
  .hero-visual,
  .preview-main,
  .preview-side,
  .preview-side-2,
  .preview-bg { display: none; }

  .hero-pill {
    background: #f3f4f6;
    border: 1px solid #ddd;
  }

  .home-section {
    padding: var(--space-8) var(--space-4);
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .vp-card,
  .pop-card,
  .how-step,
  .card-category,
  .card-calculator {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .section-heading .gradient-text {
    -webkit-text-fill-color: var(--accent);
    color: var(--accent);
  }
}

@media (hover: none) {
  .hero-pill:hover,
  .vp-card:hover,
  .pop-card:hover {
    transform: none;
  }
}

/* ═══════════════════════════════════════════
   System Dark Mode — Page Overrides
   ═══════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  /* Hero: covered by token flips in variables.css. */

  /* Category hero — tokens flip via variables.css. */
}
