/*
 * clearowe.com design tokens, shared by the home page (landing.css) and the guides and calculators
 * (content.css): Red Hat Display for headings, the app's signal blue, light by default with a
 * remembered dark switch (data-theme on <html>).
 */
@font-face { font-family: 'Red Hat Display'; font-weight: 700; font-display: swap; src: url('/fonts/RedHatDisplay-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Red Hat Display'; font-weight: 600; font-display: swap; src: url('/fonts/RedHatDisplay-SemiBold.ttf') format('truetype'); }

:root {
  --bg: #F2F4F9;
  --surface: #FFFFFF;
  --raised: #E9EDF6;
  --text: #0D1426;
  --text-2: #4F5A70;
  --text-3: #7E889C;
  --line: rgba(15, 23, 42, 0.09);
  --accent: #2F6BFF;
  --accent-ink: #1F57E6;
  --accent-soft: #E3EBFF;
  --owed: #0B8A60;
  --owed-tint: rgba(14, 159, 110, 0.12);
  --owe: #D9443C;
  --owe-tint: rgba(229, 83, 75, 0.12);
  --warn: #B26B00;
  --warn-tint: rgba(194, 120, 3, 0.14);
  --hero-a: #3E7BFF;
  --hero-b: #2459F2;
  --hero-c: #1638B8;
  --on-hero: #FFFFFF;
  --on-hero-2: rgba(255, 255, 255, 0.78);
  --mark: #1B2133;
  /* Ink and muted ink for text on surfaces that stay white in both themes (pills, the chosen plan). */
  --on-white: #0D1426;
  --on-white-2: #4F5A70;
  --frame: #0F1630;
  --shadow: 0 1px 2px rgba(20, 40, 110, 0.06), 0 24px 56px -12px rgba(20, 40, 110, 0.22);
  --r-lg: 28px;
  --r-md: 18px;
  --display: 'Red Hat Display', ui-rounded, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
/* Light unless the visitor picks dark with the header switch (data-theme on <html>, remembered). */
:root[data-theme='dark'] {
  --bg: #070B15; --surface: #0F1626; --raised: #16203A; --text: #ECF0FB; --text-2: #A3ADC2; --text-3: #737E95;
  --line: rgba(226, 232, 255, 0.09); --accent: #5B8CFF; --accent-ink: #7AA2FF; --accent-soft: #15214A;
  --owed: #34D399; --owed-tint: rgba(52, 211, 153, 0.14); --owe: #FF7A70; --owe-tint: rgba(255, 122, 112, 0.14);
  --warn: #F5B544; --warn-tint: rgba(245, 181, 68, 0.14); --hero-a: #3366FF; --hero-b: #1E46D8; --hero-c: #0F2582;
  --frame: #273150; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 56px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* The light/dark switch shows the mode it switches to, centred in its circle: the icon is a block
   in a grid cell, so no line box nudges it off the middle. Each header sets the icon's size. */
.mode .moon, .mode .sun { display: grid; place-items: center; }
.mode .sun, :root[data-theme='dark'] .mode .moon { display: none; }
:root[data-theme='dark'] .mode .sun { display: grid; }
.mode .icon { display: block; }
.mode .icon svg { display: block; width: 100%; height: 100%; }

/*
 * Header menus on every page: Calculators and Guides drop down from the header, and on phones one Menu
 * button opens a sheet with everything. They're <details>, so they work without JavaScript; site.js
 * closes them on Escape, on a click elsewhere and when a link is followed. Each header colours its
 * own summaries and sets --header-h, where the phone sheet starts.
 */
.menu { position: relative; }
.menu > summary, .menu-mobile > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; -webkit-user-select: none; user-select: none; }
.menu > summary::-webkit-details-marker, .menu-mobile > summary::-webkit-details-marker { display: none; }
.menu > summary .icon { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.menu[open] > summary .icon { transform: rotate(180deg); }
.menu .panel { position: absolute; top: calc(100% + 10px); inset-inline-start: -8px; z-index: 40; min-width: 264px; display: grid; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }
.menu .panel a { display: block; padding: 10px 14px; border-radius: 12px; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.3; text-decoration: none; white-space: nowrap; }
.menu .panel a:hover { background: var(--raised); color: var(--text); }
.menu .panel a.all { position: relative; margin-top: 9px; color: var(--accent-ink); }
.menu .panel a.all::before { content: ''; position: absolute; inset: -5px 14px auto; border-top: 1px solid var(--line); }
.menu-mobile { display: none; }
.menu-mobile > summary { height: 40px; padding: 0 16px 0 12px; border-radius: 999px; }
.menu-mobile > summary .icon { width: 20px; height: 20px; }
.menu-mobile .sheet { position: fixed; inset: var(--header-h, 64px) 0 0; z-index: 40; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 28px; padding: 20px max(20px, env(safe-area-inset-right)) 48px max(20px, env(safe-area-inset-left)); background: var(--bg); color: var(--text); border-top: 1px solid var(--line); }
.menu-mobile .sheet .label { margin: 0 0 4px; font: 700 12px/1.2 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.menu-mobile .sheet a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: 17px; font-weight: 600; text-decoration: none; }
.menu-mobile .sheet a:hover { color: var(--accent-ink); }
.menu-mobile .sheet a.all { color: var(--accent-ink); border-bottom: 0; }
body:has(.menu-mobile[open]) { overflow: hidden; }

/* Every calculator and guide, linked from the footer of every page. */
.foot-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; width: 100%; }
.foot-links .label { margin: 0; font: 700 12px/1.2 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.foot-links .label a { color: inherit; font-size: inherit; text-decoration: none; }
.foot-links ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.foot-links a { color: var(--text-2); text-decoration: none; font-size: 15px; }
.foot-links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .foot-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-links > div:last-child { grid-column: 1 / -1; } }
@media (max-width: 359px) { .foot-links { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 380px) {
  .menu-mobile > summary { width: 40px; padding: 0; justify-content: center; }
  .menu-mobile > summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
