/* Calculators hub. Scoped to .cah-page. A ruled index of the diagnostics,
   grouped by sector; no card grid. */

.cah-page {
  --cah-paper: #f5f0e4;
  --cah-paper-2: #ebe4d2;
  --cah-ink: #1b1d20;
  --cah-muted: #5a5850;
  --cah-rule: #d0c8b4;
  --cah-green: #1f6a52;
  --cah-brass: #bd964c;
  --cah-night: #1b2227;
  --cah-ease: cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--cah-ink);
  background: var(--cah-paper);
  font-family: "DM Sans Variable", "DM Sans", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: clip;
}
.cah-page *,
.cah-page *::before,
.cah-page *::after { box-sizing: border-box; }
.cah-page ::selection { color: #fff; background: var(--cah-green); }
.cah-page a { text-underline-offset: 0.25em; }
.cah-page a:focus-visible,
.cah-page summary:focus-visible { outline: 2px solid var(--cah-green); outline-offset: 3px; }
.cah-page [id] { scroll-margin-top: 112px; }
:where(.cah-page) :is(h1, h2, h3, p, ul, ol) { margin: 0; }
.cah-page h1,
.cah-page h2,
.cah-page h3 { font-family: "Cormorant Garamond Variable", Georgia, serif; font-weight: 500; text-wrap: balance; }
.cah-wrap { width: min(100%, 1280px); margin-inline: auto; padding-inline: clamp(20px, 5vw, 64px); }
.cah-split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 96px); align-items: start; }

.cah-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; }
.cah-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 10px; background: var(--cah-ink); color: #fff; font-weight: 600; text-decoration: none; transition: background 0.25s var(--cah-ease); }
.cah-btn svg { width: 18px; height: 18px; transition: transform 0.25s var(--cah-ease); }
.cah-btn:hover { background: var(--cah-green); }
.cah-btn:hover svg { transform: translateX(3px); }
.cah-quiet { color: var(--cah-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--cah-brass); text-decoration-thickness: 2px; }
.cah-quiet:hover { color: var(--cah-green); }

.cah-head { max-width: 62ch; margin-bottom: clamp(22px, 3.6vw, 40px); }
.cah-head h2 { font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.06; letter-spacing: -0.015em; }
.cah-head p { margin-top: 14px; color: var(--cah-muted); }
.cah-head a { color: var(--cah-green); font-weight: 600; }

/* Hero */
.cah-hero { padding: 112px 0 clamp(44px, 6vw, 72px); border-bottom: 1px solid var(--cah-rule); }
.cah-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 5vw, 80px); align-items: end; }
.cah-hero h1 { font-size: clamp(2.3rem, 4.2vw, 3.8rem); line-height: 1.04; letter-spacing: -0.02em; max-width: 18ch; }
.cah-lede { margin-top: 20px; max-width: 58ch; font-size: 1.125rem; color: #38362f; }
.cah-model { padding-top: 14px; border-top: 2px solid var(--cah-ink); }
.cah-model h2 { font-size: 1.9rem; line-height: 1.1; }
.cah-model p { margin-top: 8px; color: var(--cah-muted); font-size: 0.9375rem; }
.cah-model ul { list-style: none; padding: 0; margin-top: 12px; border-top: 1px solid var(--cah-rule); }
.cah-model li { border-bottom: 1px solid var(--cah-rule); }
.cah-model li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; color: var(--cah-ink); font-weight: 600; text-decoration: none; }
.cah-model li a:hover { color: var(--cah-green); }
.cah-model svg { width: 17px; height: 17px; color: var(--cah-green); }

/* Popular fits */
.cah-popular { padding: clamp(44px, 6vw, 80px) 0; border-bottom: 1px solid var(--cah-rule); background: var(--cah-paper-2); }
.cah-fits { list-style: none; padding: 0; border-top: 2px solid var(--cah-ink); }
.cah-fits li { border-bottom: 1px solid #bdb59f; }
.cah-fits a { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) 22px; gap: clamp(14px, 3vw, 40px); align-items: center; padding: 18px 0; color: inherit; text-decoration: none; transition: padding 0.3s var(--cah-ease), background 0.3s var(--cah-ease); }
.cah-fits a:hover { padding-inline: 12px; background: #e2dac5; }
.cah-fits b { font-family: "Cormorant Garamond Variable", Georgia, serif; font-size: 1.6rem; line-height: 1.1; font-weight: 500; }
.cah-fits span { color: var(--cah-muted); font-size: 0.9375rem; }
.cah-fits svg { width: 18px; height: 18px; color: var(--cah-green); transition: transform 0.3s var(--cah-ease); }
.cah-fits a:hover svg { transform: translateX(4px); }

/* Library */
.cah-library { padding: clamp(48px, 7vw, 92px) 0; border-bottom: 1px solid var(--cah-rule); }
.cah-group { margin-top: clamp(28px, 4vw, 44px); }
.cah-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--cah-ink); }
.cah-group-head h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.1; }
.cah-group-head small { font-size: 0.8125rem; color: var(--cah-muted); }
.cah-rows { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(20px, 4vw, 56px); }
.cah-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--cah-rule); color: inherit; text-decoration: none; cursor: pointer; transition: padding 0.3s var(--cah-ease), background 0.3s var(--cah-ease); }
.cah-row:hover { padding-inline: 10px; background: var(--cah-paper-2); }
.cah-row-main { display: grid; gap: 2px; }
.cah-row-main b { font-weight: 700; line-height: 1.35; }
.cah-row-main small { font-size: 0.875rem; color: var(--cah-muted); line-height: 1.5; }
.cah-row-go { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 700; color: var(--cah-green); white-space: nowrap; }
.cah-row-go svg { width: 16px; height: 16px; transition: transform 0.3s var(--cah-ease); }
.cah-row:hover .cah-row-go svg { transform: translateX(3px); }

/* About */
.cah-about { padding: clamp(48px, 7vw, 92px) 0; background: var(--cah-paper-2); border-bottom: 1px solid var(--cah-rule); }
.cah-about .cah-head { margin-bottom: 0; }
.cah-limits { list-style: none; padding: 0; margin-top: 22px; border-top: 1px solid #bdb59f; }
.cah-limits li { padding: 10px 0; border-bottom: 1px solid #bdb59f; font-size: 0.9375rem; color: var(--cah-muted); }
.cah-about details { border-bottom: 1px solid #bdb59f; }
.cah-about details:first-child { border-top: 1px solid #bdb59f; }
.cah-about summary { list-style: none; display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; font-weight: 600; cursor: pointer; }
.cah-about summary::-webkit-details-marker { display: none; }
.cah-about summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--cah-green); transition: transform 0.25s var(--cah-ease); }
.cah-about details[open] summary::after { transform: rotate(45deg); }
.cah-about details p { padding: 0 0 22px; max-width: 64ch; color: #38362f; }

/* Close */
.cah-close { padding: clamp(48px, 7vw, 88px) 0; background: var(--cah-night); color: #eef0ee; }
.cah-close-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: clamp(24px, 5vw, 80px); align-items: center; }
.cah-close h2 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; }
.cah-close p { margin-top: 12px; max-width: 54ch; color: #c8d0d3; }
.cah-close .cah-btn { background: #e6cd96; color: var(--cah-ink); }
.cah-close .cah-btn:hover { background: #fff; }
.cah-close a:focus-visible { outline-color: #e6cd96; }
.cah-crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; padding-block: 22px 34px; font-size: 0.9rem; color: var(--cah-muted); }
.cah-crumbs a { color: var(--cah-green); }

@media (max-width: 1000px) {
  .cah-hero-grid, .cah-split, .cah-close-grid { grid-template-columns: 1fr; }
  .cah-rows { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cah-hero { padding-top: 96px; }
  .cah-hero h1 { font-size: 2.2rem; }
  .cah-lede { margin-top: 14px; font-size: 1rem; line-height: 1.55; }
  .cah-actions { margin-top: 18px; }
  .cah-fits a { grid-template-columns: minmax(0, 1fr) 20px; }
  .cah-fits span { grid-column: 1; }
  .cah-fits svg { grid-row: 1; grid-column: 2; }
  .cah-row:hover, .cah-fits a:hover { padding-inline: 0; background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .cah-page * { transition-duration: 0.01ms !important; }
}
