/* ==========================================================================
   Hala Feel — design system
   Palette: deep pine + volt lime on warm paper. Numbers first, decoration last.
   ========================================================================== */

:root {
  --pine-900: #07211c;
  --pine-800: #0a3029;
  --pine-700: #0d4137;
  --pine-600: #12564a;
  --volt: #bdf227;
  --volt-deep: #a3d812;
  --volt-soft: #ecfbcd;

  --ink: #11161a;
  --ink-2: #33423f;
  --muted: #5f716d;
  --line: #dde5e1;
  --line-soft: #edf1ef;
  --paper: #f5f7f4;
  --surface: #ffffff;
  --surface-2: #fbfcf9;

  --clay: #c4553b;
  --sky: #2f6f8f;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(7, 33, 28, 0.06), 0 1px 1px rgba(7, 33, 28, 0.04);
  --shadow: 0 12px 28px -18px rgba(7, 33, 28, 0.35), 0 2px 6px rgba(7, 33, 28, 0.05);
  --shadow-lg: 0 34px 64px -40px rgba(7, 33, 28, 0.55), 0 4px 14px rgba(7, 33, 28, 0.06);

  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  --font-num: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--pine-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--volt-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--pine-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(245, 247, 244, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-size: 1.06rem;
  color: var(--ink);
  flex: 0 0 auto;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--pine-900);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(189, 242, 39, 0.35);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand em {
  font-style: normal;
  color: var(--pine-600);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.main-nav a,
.nav-toggle {
  font: inherit;
  font-size: 0.94rem;
  font-weight: 550;
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: 999px;
  border: 0;
  background: none;
  cursor: pointer;
}

.main-nav a:hover,
.nav-toggle:hover {
  background: rgba(7, 33, 28, 0.06);
  color: var(--ink);
  text-decoration: none;
}

.main-nav a[aria-current="page"] {
  color: var(--pine-900);
  background: rgba(163, 216, 18, 0.18);
}

.main-nav a.header-cta {
  margin-left: 6px;
  background: var(--pine-900);
  color: #f4ffe0 !important;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 650;
}

.header-cta:hover {
  background: var(--pine-700);
  text-decoration: none;
}

/* dropdown */
.nav-menu {
  position: relative;
}

.nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(520px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.nav-menu[data-open="true"] .nav-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.nav-panel a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink-2);
}

.nav-panel a span {
  display: block;
  font-size: 0.76rem;
  font-weight: 450;
  color: var(--muted);
  line-height: 1.35;
}

.nav-panel a:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.menu-btn {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.menu-btn span,
.menu-btn span::before,
.menu-btn span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
}

.menu-btn span::before {
  position: absolute;
  top: -6px;
}

.menu-btn span::after {
  position: absolute;
  top: 6px;
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  padding: clamp(28px, 5vw, 56px) 0 clamp(20px, 3vw, 34px);
  background:
    radial-gradient(900px 340px at 12% -10%, rgba(189, 242, 39, 0.24), transparent 70%),
    radial-gradient(700px 320px at 92% 0%, rgba(18, 86, 74, 0.1), transparent 70%);
}

.hero-inner {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pine-600);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(18, 86, 74, 0.16);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--volt-deep);
}

h1 {
  font-size: clamp(1.95rem, 4.2vw, 3.05rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
  font-weight: 800;
  text-wrap: balance;
}

.hero-lede {
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  color: var(--ink-2);
  margin: 0 0 18px;
  max-width: 64ch;
  text-wrap: pretty;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--muted);
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-points li::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--volt);
  box-shadow: inset 0 0 0 1px rgba(7, 33, 28, 0.14);
  flex: 0 0 auto;
  clip-path: polygon(28% 52%, 42% 66%, 74% 32%, 82% 40%, 42% 82%, 20% 60%);
  background-color: var(--pine-700);
}

/* -------------------------------------------------------------- calc UI -- */

.calc-shell {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.calc-panel {
  position: sticky;
  top: 84px;
  padding: 16px;
}

.results-panel {
  padding: 20px;
  min-height: 320px;
  background: linear-gradient(180deg, #fff, var(--surface-2));
}

.field-group {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
}

.field-group > legend,
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
  padding: 0;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 5px 0 0;
  line-height: 1.45;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--line-soft);
  border-radius: 12px;
}

.segmented label {
  flex: 1 1 0;
  position: relative;
  text-align: center;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 8px 6px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label:hover {
  color: var(--ink);
}

.segmented input:checked + label,
.segmented label:has(input:checked) {
  background: var(--pine-900);
  color: #f6ffe6;
  box-shadow: var(--shadow-sm);
}

.segmented input:focus-visible + label {
  outline: 3px solid var(--volt-deep);
  outline-offset: 1px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.chip:hover {
  border-color: var(--pine-600);
  color: var(--pine-800);
}

.chip[aria-pressed="true"],
.chip.is-active {
  background: var(--volt-soft);
  border-color: var(--volt-deep);
  color: var(--pine-900);
}

.chip small {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.input-unit {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.input-unit:focus-within {
  border-color: var(--pine-600);
  box-shadow: 0 0 0 3px rgba(163, 216, 18, 0.25);
}

.input-unit input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 13px 14px;
  font: inherit;
  font-size: 1.24rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  background: transparent;
  color: var(--ink);
}

.input-unit input:focus {
  outline: none;
}

.input-unit .suffix {
  display: grid;
  place-items: center;
  padding: 0 13px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border-left: 1px solid var(--line);
}

.input-unit select {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  padding: 13px 34px 13px 14px;
  width: 100%;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.input-unit select:focus {
  outline: none;
}

.btn {
  font: inherit;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 13px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--volt);
  color: var(--pine-900);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 10px 20px -14px rgba(122, 168, 0, 0.9);
  font-size: 1rem;
}

.btn-primary:hover {
  background: var(--volt-deep);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
}

.btn-ghost:hover {
  border-color: var(--pine-600);
  color: var(--pine-800);
}

.btn-dark {
  background: var(--pine-900);
  color: #f2ffdb;
}

.btn-dark:hover {
  background: var(--pine-700);
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row .btn-primary {
  flex: 1 1 auto;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}

/* results */
.result-hero {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 160px at 100% 0%, rgba(189, 242, 39, 0.35), transparent 62%),
    linear-gradient(160deg, #ffffff, #f6faf0);
  padding: 22px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.result-hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -70px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 26px solid rgba(7, 33, 28, 0.05);
}

.result-label {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.result-value {
  font-family: var(--font-num);
  font-size: clamp(2.6rem, 6vw, 3.9rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--pine-900);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.result-value .unit {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.result-sub {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.result-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--pine-700);
  background: rgba(18, 86, 74, 0.08);
  border-radius: 999px;
  padding: 4px 11px;
  font-variant-numeric: tabular-nums;
}

.mode-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--line-soft);
  border-radius: 12px;
  margin-bottom: 14px;
}

.mode-switch button {
  flex: 1 1 0;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  padding: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.mode-switch button[aria-selected="true"] {
  background: var(--surface);
  color: var(--pine-900);
  box-shadow: var(--shadow-sm);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 10px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.section-head .note {
  font-size: 0.78rem;
  color: var(--muted);
}

/* tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

table.data th,
table.data td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

table.data th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface-2);
  position: sticky;
  top: 0;
}

table.data tbody tr:hover {
  background: #f9fbf6;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data td.num,
table.data th.num {
  text-align: right;
}

table.data td strong {
  color: var(--pine-900);
}

table.data tr.is-highlight td {
  background: rgba(189, 242, 39, 0.16);
  font-weight: 650;
}

table.data caption {
  caption-side: bottom;
  text-align: left;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 8px 12px;
}

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  overflow-x: auto;
}

.tabs button {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.tabs button[aria-selected="true"] {
  color: var(--pine-900);
  border-bottom-color: var(--volt-deep);
}

.tabpanel[hidden] {
  display: none;
}

/* level bars */
.level-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 86px;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.level-row:last-child {
  border-bottom: 0;
}

.level-name {
  font-size: 0.88rem;
  font-weight: 650;
}

.level-track {
  position: relative;
  height: 9px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}

.level-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pine-600), var(--volt-deep));
  width: 0;
  transition: width 0.7s var(--ease);
}

.level-val {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--pine-800);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--volt-soft);
  color: var(--pine-800);
  border: 1px solid rgba(163, 216, 18, 0.5);
}

.badge.neutral {
  background: var(--line-soft);
  color: var(--ink-2);
  border-color: var(--line);
}

.badge.warn {
  background: #fdf1ed;
  color: var(--clay);
  border-color: #f3d2c8;
}

/* accordion */
details.acc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 8px;
  overflow: hidden;
}

details.acc > summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: 0.94rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

details.acc > summary::-webkit-details-marker {
  display: none;
}

details.acc > summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
}

details.acc[open] > summary::after {
  content: "–";
}

details.acc[open] > summary {
  border-bottom: 1px solid var(--line-soft);
}

details.acc .acc-body {
  padding: 14px;
}

/* ------------------------------------------------------------- content -- */

.page-main {
  padding-bottom: clamp(40px, 7vw, 76px);
}

.prose {
  max-width: 78ch;
}

.prose h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.72rem);
  letter-spacing: -0.025em;
  margin: 2.1em 0 0.5em;
  line-height: 1.2;
  text-wrap: balance;
}

.prose h3 {
  font-size: clamp(1.08rem, 1.6vw, 1.22rem);
  letter-spacing: -0.015em;
  margin: 1.7em 0 0.4em;
}

.prose h4 {
  font-size: 1rem;
  margin: 1.4em 0 0.3em;
}

.prose p,
.prose li {
  color: #1f2b28;
}

.prose p {
  margin: 0 0 1em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 0.35em;
}

.prose li::marker {
  color: var(--pine-600);
}

.prose strong {
  color: var(--ink);
  font-weight: 700;
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 4px solid var(--volt-deep);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-2);
  font-size: 0.97rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
  margin: 1.2em 0 1.6em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: table;
}

.prose table th,
.prose table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.prose table th {
  background: var(--surface-2);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose code {
  font-family: var(--font-num);
  font-size: 0.88em;
  background: var(--line-soft);
  padding: 2px 6px;
  border-radius: 5px;
}

.prose code.formula,
code.formula {
  font-family: var(--font-num);
  font-size: 1rem;
  background: var(--pine-900);
  color: #e9ffb8;
  padding: 12px 16px;
  border-radius: var(--radius);
  display: block;
  margin: 0.9em 0;
  overflow-x: auto;
  white-space: nowrap;
}

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--pine-600);
  margin: 1.3em 0;
  font-size: 0.94rem;
  color: var(--ink-2);
}

.callout.tip {
  border-left-color: var(--volt-deep);
  background: #fbfdf4;
}

.callout.warn {
  border-left-color: var(--clay);
  background: #fdf8f6;
}

.callout strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin: 1.4em 0 2em;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), border-color 0.16s var(--ease);
}

.tool-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(18, 86, 74, 0.3);
}

.tool-card .tc-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--pine-900);
  color: var(--volt);
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tool-card h3,
.tool-card h4 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.tool-card p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.5;
}

.tool-card .tc-meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--pine-600);
  letter-spacing: 0.02em;
}

/* breadcrumbs */
.crumbs {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 14px 0 0;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--line);
}

.crumbs a {
  color: var(--muted);
}

/* FAQ */
.faq {
  margin: 1.4em 0 0;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}

.faq details > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.98rem;
  padding: 12px 26px 12px 0;
  position: relative;
  list-style: none;
}

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

.faq details > summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 1.15rem;
}

.faq details[open] > summary::after {
  content: "–";
}

.faq details > div {
  padding: 0 0 14px;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* related */
.related {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.related h2 {
  font-size: 1.1rem;
  margin: 0 0 14px;
}

/* table of contents */
.toc {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.toc p {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding-left: 1.1em;
  columns: 2;
  column-gap: 22px;
}

.toc li {
  margin: 0 0 5px;
  break-inside: avoid;
}

.toc a {
  color: var(--ink-2);
  font-weight: 500;
}

/* ---------------------------------------------------------------- footer -- */

.site-footer {
  background: var(--pine-900);
  color: #c8d8cf;
  padding: clamp(36px, 5vw, 56px) 0 26px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px 22px;
}

.site-footer h3 {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8fae9d;
  margin: 0 0 12px;
}

.site-footer a {
  color: #dfe9e2;
  font-size: 0.9rem;
  display: block;
  padding: 3px 0;
}

.site-footer a:hover {
  color: var(--volt);
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #a9c0b3;
  max-width: 34ch;
}

.footer-brand .brand {
  color: #f4ffe0;
  margin-bottom: 10px;
}

.footer-brand .brand em {
  color: var(--volt);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 30px;
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #8fae9d;
}

.footer-bottom p {
  margin: 0;
}

/* ------------------------------------------------------------- utilities -- */

.stack-2 > * + * {
  margin-top: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.stat b {
  display: block;
  font-family: var(--font-num);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--pine-900);
  line-height: 1.1;
}

.stat span {
  font-size: 0.78rem;
  color: var(--muted);
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 260px;
  color: var(--muted);
  gap: 8px;
  padding: 24px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 1rem;
}

.is-hidden {
  display: none !important;
}

.reveal {
  animation: rise 0.4s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1040px) {
  .calc-shell {
    grid-template-columns: 1fr;
  }

  .calc-panel {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 10px var(--gutter) 16px;
    gap: 2px;
    box-shadow: var(--shadow-lg);
  }

  .main-nav[data-open="true"] {
    display: flex;
  }

  .main-nav a,
  .nav-toggle {
    padding: 11px 8px;
    border-radius: 10px;
    text-align: left;
  }

  .header-cta {
    margin: 6px 0 0;
    text-align: center;
  }

  .nav-panel {
    position: static;
    width: 100%;
    display: block;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    border: 0;
    padding: 0 0 0 10px;
  }

  .menu-btn {
    display: inline-flex;
  }

  .toc ol {
    columns: 1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .results-panel {
    padding: 14px;
  }

  .result-hero {
    padding: 16px;
  }

  .level-row {
    grid-template-columns: 84px minmax(0, 1fr) 64px;
    gap: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  table.data th,
  table.data td {
    padding: 8px 9px;
    font-size: 0.84rem;
  }
}

/* ---------------------------------------------------------------- print -- */

@media print {
  .site-header,
  .site-footer,
  .calc-panel,
  .related,
  .menu-btn,
  .btn-row,
  .toc,
  .crumbs {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .panel,
  .result-hero,
  .table-wrap {
    box-shadow: none;
    border-color: #bbb;
  }

  .calc-shell {
    grid-template-columns: 1fr;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666;
  }
}

/* -------------------------------------------------- home two-column body -- */

.home-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.home-body > .prose {
  max-width: 74ch;
}

.rail {
  position: sticky;
  top: 88px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  box-shadow: var(--shadow-sm);
}

.rail h2 {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

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

.rail li + li {
  border-top: 1px solid var(--line-soft);
}

.rail a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink-2);
  text-decoration: none;
}

.rail a:hover .rail-name {
  color: var(--pine-600);
}

.rail-go {
  color: var(--volt-deep);
}

.rail-all {
  display: block;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--pine-600);
  text-decoration: none;
}

.rail-all:hover {
  text-decoration: underline;
}

@media (max-width: 1080px) {
  .home-body {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rail {
    position: static;
    margin-top: clamp(26px, 4vw, 40px);
  }
}
