/* AURORA FIELD: lush data weather. Noto Sans display/body, Atkinson Hyperlegible for explanatory and trust copy. One voltage: vivid violet for action. */
@layer base {
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light dark;
  --ground: #FAFAFC; --ground-calm: #FAFAFC; --surface: #FFFFFF; --surface-2: #F0EEF9;
  --ink: #1B1437; --muted: #4A4468; --hairline: #D8D3EC;
  --action: #5B34E8; --action-hover: #4A27C9; --on-action: #FFFFFF;
  --violet: #7C5CFF; --accent-text: #5B34E8;
  --panel: rgb(250 250 252 / 0.95); --head-bg: rgb(250 250 252 / 0.92);
  --error: #B00020; --error-bg: #FDECEC; --ok: #0B6B4F;
  --chip-bg: #F0EEF9; --track: #D8D3EC;
  --teal: #0E7C6B; --magenta: #B02A8F;
  --mesh-opacity: 0.32; --mesh-sat: 55%;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0B0714; --ground-calm: #0F0A1E; --surface: #1A1230; --surface-2: #241842;
    --ink: #F4F1FF; --muted: #C9C2E8; --hairline: #3A2C5E;
    --action: #6D4DF5; --action-hover: #7C5CFF; --on-action: #FFFFFF;
    --accent-text: #B7A6FF;
    --panel: rgb(11 7 20 / 0.94); --head-bg: rgb(11 7 20 / 0.92);
    --error: #FFB4B4; --error-bg: #3A1428; --ok: #7FE7C4;
    --chip-bg: #241842; --track: #3A2C5E;
    --teal: #2DD4BF; --magenta: #E879F9;
    --mesh-opacity: 1; --mesh-sat: 140%;
  }
}
:root[data-theme="dark"] {
  --ground: #0B0714; --ground-calm: #0F0A1E; --surface: #1A1230; --surface-2: #241842;
  --ink: #F4F1FF; --muted: #C9C2E8; --hairline: #3A2C5E;
  --action: #6D4DF5; --action-hover: #7C5CFF; --on-action: #FFFFFF;
  --accent-text: #B7A6FF;
  --panel: rgb(11 7 20 / 0.94); --head-bg: rgb(11 7 20 / 0.92);
  --error: #FFB4B4; --error-bg: #3A1428; --ok: #7FE7C4;
  --chip-bg: #241842; --track: #3A2C5E;
  --teal: #2DD4BF; --magenta: #E879F9;
  --mesh-opacity: 1; --mesh-sat: 140%;
}
:root[data-theme="light"] {
  --ground: #FAFAFC; --ground-calm: #FAFAFC; --surface: #FFFFFF; --surface-2: #F0EEF9;
  --ink: #1B1437; --muted: #4A4468; --hairline: #D8D3EC;
  --action: #5B34E8; --action-hover: #4A27C9; --on-action: #FFFFFF;
  --violet: #7C5CFF; --accent-text: #5B34E8;
  --panel: rgb(250 250 252 / 0.95); --head-bg: rgb(250 250 252 / 0.92);
  --error: #B00020; --error-bg: #FDECEC; --ok: #0B6B4F;
  --chip-bg: #F0EEF9; --track: #D8D3EC;
  --teal: #0E7C6B; --magenta: #B02A8F;
  --mesh-opacity: 0.32; --mesh-sat: 55%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ground-calm); color: var(--ink);
  font-family: "Noto Sans", system-ui, sans-serif; font-size: 1rem; line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 72rem; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 760px) { .wrap { padding-inline: 32px; } }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 0.6rem; }
h1 { font-size: clamp(2.1rem, 6.2vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 4px; }
.explain, .trust, .lede, .hint, .receipt, .fine { font-family: "Atkinson Hyperlegible", "Noto Sans", sans-serif; }
.lede { font-size: 1.13rem; max-width: 44rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 20px; top: -60px; z-index: 60; background: var(--action); color: var(--on-action); padding: 0.7rem 1.1rem; border-radius: 0 0 12px 12px; font-weight: 700; }
.skip-link:focus-visible { top: 0; }

/* Header: translucent chrome (M26) */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--head-bg); backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid var(--hairline); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-dot { color: var(--violet); }
.head-nav { display: flex; align-items: center; gap: 1rem; }
.head-nav > a { font-weight: 500; white-space: nowrap; }
.theme-wrap { position: relative; }
.theme-btn { width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform 150ms ease, background 150ms ease; }
.theme-btn:hover { background: var(--surface-2); }
.theme-btn:active { transform: scale(0.97); }
.theme-menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(19rem, calc(100vw - 40px)); background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 0.8rem; z-index: 60; }
.theme-menu button { display: block; width: 100%; text-align: left; padding: 0.7rem 0.8rem; margin-top: 0.3rem; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; transition: transform 150ms ease, background 150ms ease; }
.theme-menu button:hover { background: var(--surface-2); }
.theme-menu button:active { transform: scale(0.97); }
.theme-menu button[aria-checked="true"] { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.menu-note { color: var(--muted); font-size: 0.92rem; margin: 0 0 0.4rem; }

/* Aurora hero with one hard diagonal (M25, M20) */
.aurora { position: relative; overflow: hidden; background: var(--ground); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 44px), 0 100%); padding: 3.2rem 0 5rem; }
.aurora-mesh { position: absolute; inset: -25%; pointer-events: none; opacity: var(--mesh-opacity);
  background:
    radial-gradient(42% 55% at 18% 30%, #2DD4BF 0%, transparent 70%),
    radial-gradient(48% 60% at 55% 15%, #7C5CFF 0%, transparent 72%),
    radial-gradient(45% 58% at 85% 45%, #E879F9 0%, transparent 70%),
    radial-gradient(38% 50% at 40% 85%, #4F46E5 0%, transparent 70%);
  filter: blur(46px) saturate(var(--mesh-sat));
  animation: aurora-drift 30s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  from { transform: translate3d(-2.5%, -1.5%, 0) scale(1) rotate(0deg); }
  to { transform: translate3d(2.5%, 2%, 0) scale(1.07) rotate(2deg); }
}
.hero-panel { position: relative; background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); padding: clamp(1.4rem, 4vw, 2.6rem); max-width: 52rem; }
.kicker { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 0.9rem; }
.two-tone span { color: var(--muted); }
.btn { display: inline-block; background: var(--action); color: var(--on-action); font-weight: 700; font-size: 1.05rem; padding: 0.95rem 1.5rem; border: 0; border-radius: 999px; text-decoration: none; cursor: pointer; font-family: inherit; transition: transform 150ms ease, background 150ms ease; }
.btn:hover { background: var(--action-hover); color: var(--on-action); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); }
.btn.secondary:hover { background: var(--surface-2); }
.receipt { color: var(--muted); margin-top: 0.8rem; margin-bottom: 0; max-width: 38rem; }
.spinner { display: inline-block; width: 1em; height: 1em; margin-right: 0.5em; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; vertical-align: -0.15em; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Proof strip (M27) directly under the diagonal */
.proof { background: var(--surface); border-bottom: 1px solid var(--hairline); }
.proof .wrap { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; padding-top: 1rem; padding-bottom: 1rem; }
.proof p { margin: 0; font-weight: 500; }
.proof strong { color: var(--accent-text); }

/* Category tabs (M5) */
.tabs { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.4rem 0 0.8rem; scrollbar-width: thin; }
.tab { flex: 0 0 auto; padding: 0.65rem 1.1rem; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; transition: transform 150ms ease, background 150ms ease; }
.tab:hover { background: var(--surface-2); }
.tab:active { transform: scale(0.97); }
.tab[aria-selected="true"] { background: var(--action); border-color: var(--action); color: var(--on-action); font-weight: 700; }

/* Bento grid (M4) */
.tools-section { padding: 2.6rem 0 3rem; }
.bento { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.2rem; }
@media (min-width: 700px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1020px) { .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); } .card.span2 { grid-column: span 2; } .card.span4 { grid-column: span 4; } }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.3rem; display: flex; flex-direction: column; gap: 0.4rem; }
.card p { color: var(--muted); margin: 0; }
.card a { font-weight: 700; margin-top: auto; padding-top: 0.6rem; }
.card .tag { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.card.featured { background: var(--surface-2); border-color: var(--action); }
.group-title { margin-top: 2.2rem; font-size: 1.3rem; }
.mini { border-top: 1px solid var(--hairline); padding-top: 0.9rem; margin-top: 0.6rem; display: grid; gap: 0.6rem; }
.mini label { font-weight: 500; font-size: 0.95rem; display: block; margin-bottom: 0.3rem; } .mini-field { display: grid; gap: 0.2rem; }
.mini output { font-weight: 700; font-size: 1.25rem; color: var(--accent-text); }
.mini-bars { display: grid; gap: 0.35rem; }
.mini-bar { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.mini-fill { height: 100%; border-radius: 999px; }
.fill-teal { background: var(--teal); } .fill-violet { background: var(--violet); } .fill-magenta { background: var(--magenta); }

input[type="number"], input[type="text"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 10px; padding: 0.7rem 0.8rem;
}
input[type="number"]:hover, select:hover { border-color: var(--accent-text); }
input[aria-invalid="true"] { border: 2px solid var(--error); background: var(--error-bg); }
input[type="range"] { width: 100%; accent-color: var(--action); height: 2rem; cursor: pointer; background: transparent; border: 0; padding: 0; }
input[type="range"]:active { transform: scale(0.99); }
input[type="range"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* Calculator */
.calc-hero { padding-bottom: 7rem; }
.panel-astride { position: relative; z-index: 5; margin-top: -5.5rem; }
.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: 22px; padding: clamp(1.2rem, 3.5vw, 2.2rem); }
fieldset { border: 1px solid var(--hairline); border-radius: 14px; padding: 1.1rem; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 700; padding: 0 0.4rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.field.check { display: flex; gap: 0.6rem; align-items: center; }
.field.check label { margin: 0; }
.field.check input { width: 1.4rem; height: 1.4rem; accent-color: var(--action); }
.hint { color: var(--muted); font-size: 0.95rem; margin: 0.4rem 0 0; }
.field-error { color: var(--error); font-weight: 700; margin: 0.4rem 0 0; }
.cols2 { display: grid; gap: 0 1rem; }
@media (min-width: 700px) { .cols2 { grid-template-columns: 1fr 1fr; } }
.result-card { background: var(--surface-2); border: 1px solid var(--action); border-radius: 18px; padding: 1.4rem; margin-bottom: 1.2rem; }
.result-card .big { font-size: clamp(2.4rem, 7vw, 3.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; color: var(--accent-text); }
.verdict h3 { font-size: 1.45rem; }
.chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.9rem 0; }
.chip { padding: 0.55rem 1rem; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; transition: transform 150ms ease, background 150ms ease; }
.chip:hover { background: var(--chip-bg); }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--action); border-color: var(--action); color: var(--on-action); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(10.5rem, 100%), 1fr)); gap: 0.8rem; margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 0.9rem; }
.stat-label { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 1.45rem; font-weight: 700; }
.bars { display: grid; gap: 0.8rem; margin: 0.8rem 0 1.4rem; }
.bar-top { display: flex; justify-content: space-between; gap: 1rem; font-weight: 500; }
.bar-amt { font-weight: 700; }
.track { height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--violet), var(--magenta)); transition: width 250ms ease; }
.fill.keep { background: var(--violet); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 700; padding-bottom: 0.6rem; }
th, td { text-align: right; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--hairline); }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.trust { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 14px; padding: 1.2rem; margin-top: 1.2rem; }
.trust p, .trust li { font-family: "Atkinson Hyperlegible", "Noto Sans", sans-serif; }
footer { border-top: 1px solid var(--hairline); padding: 2rem 0 2.6rem; margin-top: 3rem; background: var(--surface); }
.fine { color: var(--muted); font-size: 0.92rem; }
.actions-row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora-mesh { animation: none; }
  .spinner { animation-duration: 1400ms; }
  .fill, .btn, .tab, .chip, .theme-btn, .theme-menu button { transition: none; }
}
}
