/* "Corner Bracket" — consumer-watchdog spec sheet. Tokens + rules in DESIGN.md.
   White page, black 2px rules, condensed all-caps display type, safety orange as a
   precision highlight (verdict numbers, corner brackets, buttons, focus states). */
:root {
  --color-bg: #FFFFFF;
  --color-surface: #F6F6F4;
  --color-text: #17181A;
  --color-muted: #55585E;
  --color-primary: #C7500B;
  --color-primary-dark: #A94408;
  --color-accent: #17181A;
  --color-hairline: #D9D9D6;
  --rule: 2px solid var(--color-accent);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --space: 1rem;
  --max-width: 64rem;
  --content-width: 44rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* ---------- Nav: black 2px bottom-rule bar, numbered 01–05 tool ladder ---------- */
.nav-bar { border-bottom: var(--rule); }

.site-nav {
  display: flex;
  gap: 0 1.5rem;
  flex-wrap: wrap;
  counter-reset: tool;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.site-nav a {
  color: var(--color-text);
  text-decoration: none;
  counter-increment: tool;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 3px solid transparent;
}
.site-nav a::before {
  content: counter(tool, decimal-leading-zero);
  color: var(--color-primary);
  font-weight: 700;
  margin-right: 0.375rem;
}
.site-nav a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--color-primary); }
.site-nav a:hover { border-bottom-color: var(--color-accent); }

/* ---------- Hero: oversized condensed caps, compact ---------- */
.hero { padding-top: 1.25rem; }

h1, h2, h3, legend {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  line-height: 0.95;
}
h2 { font-size: 1.5rem; margin: 2.5rem 0 0.75rem; line-height: 1.05; }
h3 { font-size: 1.1875rem; margin: 1.5rem 0 0.375rem; line-height: 1.1; }

.tagline { color: var(--color-muted); margin: 0.5rem 0 0; }

.disclaimer {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
}
.disclaimer strong {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
}

/* ---------- Links (body copy) ---------- */
main a, .hero a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
main a:hover, .hero a:hover { color: var(--color-primary-dark); }

/* ---------- Tool: two-zone spec sheet ---------- */
#tool {
  border-bottom: var(--rule);
  padding: 1.25rem 0 2rem;
  margin-bottom: 0.5rem;
}
@media (min-width: 900px) {
  #tool {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
  }
  #tool > form { grid-column: 1; }
  #tool > .verdict-zone { grid-column: 2; position: sticky; top: 1rem; }
}

fieldset {
  border: none;
  border-top: var(--rule);
  margin: 1.25rem 0 0;
  padding: 0.25rem 0 0.5rem;
}
fieldset:first-child { margin-top: 0; }
legend { font-weight: 700; font-size: 1.125rem; padding: 0 0.5rem 0 0; }

.fieldset-grid { display: grid; gap: 0 2rem; grid-template-columns: 1fr 1fr; margin-top: 1.25rem; }
@media (max-width: 640px) { .fieldset-grid { grid-template-columns: 1fr; } }
.fieldset-grid fieldset { margin-top: 0; margin-bottom: 0; }
@media (max-width: 640px) { .fieldset-grid fieldset + fieldset { margin-top: 1.25rem; } }

label {
  display: block;
  margin: 1rem 0 0.125rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9375rem;
}
.help { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--color-muted); }

/* Inputs: underline-only fields — no boxes on a spec sheet */
input, select {
  font: inherit;
  width: 100%;
  max-width: 100%;
  padding: 0.375rem 0;
  border: none;
  border-bottom: 2px solid var(--color-accent);
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
}
input:focus, select:focus {
  outline: none;
  border-bottom-color: var(--color-primary);
  box-shadow: 0 2px 0 0 var(--color-primary);
}

button {
  font: inherit;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.0625rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 0;
  cursor: pointer;
  margin-top: 1.25rem;
  min-height: 48px;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 1rem;
  transition: background-color 150ms ease;
}
button:hover { background: var(--color-primary-dark); }

:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

.link-btn {
  display: inline-block;
  background: none;
  color: var(--color-text);
  border: 2px solid var(--color-accent);
  width: auto;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  margin-top: 0.75rem;
}
.link-btn:hover { background: var(--color-surface); }

.bookmark-hint { font-size: 0.875rem; color: var(--color-muted); margin-top: 0.5rem; }

/* ---------- Verdict zone: corner-bracketed panel ---------- */
.corner-frame { position: relative; }
.corner-frame::before, .corner-frame::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid var(--color-primary);
  pointer-events: none;
  transition: top 150ms ease, left 150ms ease, right 150ms ease, bottom 150ms ease;
}
.corner-frame::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.corner-frame::after { bottom: 0; right: 0; border-left: none; border-top: none; }
.corner-frame:hover::before { top: -4px; left: -4px; }
.corner-frame:hover::after { bottom: -4px; right: -4px; }

.verdict-zone { padding: 1.5rem 1.25rem; min-height: 9rem; margin-top: 1.25rem; }
@media (min-width: 900px) { .verdict-zone { margin-top: 0; } }

/* CSS-only placeholder while no result has been computed yet */
.verdict-zone:has(> #result[hidden]):has(> #offer:empty) .verdict-placeholder,
.verdict-zone:has(> #results[hidden]):has(> #offer:empty) .verdict-placeholder { display: block; }
.verdict-placeholder {
  display: none;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

#results, #result { display: block; }

/* Verdict: one black sentence, orange numbers — instant and factual, no animation */
.verdict {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.75rem;
}
.verdict strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6em;
  line-height: 1;
  color: var(--color-primary);
  white-space: nowrap;
}

.error {
  border: 2px solid var(--color-primary);
  padding: 0.625rem 0.875rem;
  font-weight: 600;
  margin: 0;
}

/* ---------- Tables: ruled like a consumer report ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap.corner-frame { padding: 1rem; } /* content pages: bracketed worked-example frame */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space) 0;
  border-top: var(--rule);
  font-size: 0.9375rem;
}
.compare-table th, .compare-table td {
  border-bottom: 1px solid var(--color-hairline);
  padding: 0.5rem 0.625rem;
  text-align: left;
  vertical-align: top;
}
.compare-table th {
  background: var(--color-surface);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.compare-table .total-row td {
  font-weight: 700;
  background: var(--color-accent);
  color: #fff;
  border-bottom-color: var(--color-accent);
}

.breakdown { margin: 0.5rem 0; }
.breakdown summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.note { font-size: 0.875rem; color: var(--color-muted); }

/* Formula: ruled monospace block */
.formula {
  background: var(--color-surface);
  border-top: var(--rule);
  border-bottom: var(--rule);
  padding: 0.625rem 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-x: auto;
}
.formula-inline { font-family: var(--font-mono); font-size: 0.875rem; }

/* ---------- Content column ---------- */
#content { max-width: var(--content-width); padding-bottom: 2rem; }

/* ---------- Offer slot: black-ruled card, orange CTA ---------- */
#offer:empty { display: none; margin: 0; }
.offer-card {
  border: 2px solid var(--color-accent);
  background: var(--color-bg);
  padding: var(--space);
  margin: var(--space) 0 0;
}
.offer-kicker {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8125rem;
  color: var(--color-primary);
  margin: 0 0 0.25rem;
}
.offer-headline {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
}
.offer-body { margin: 0 0 0.75rem; }
.offer-cta {
  display: inline-block;
  background: var(--color-primary);
  color: #fff !important;
  text-decoration: none !important;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.625rem 1.25rem;
  min-height: 44px;
  line-height: 1.5;
  transition: background-color 150ms ease;
}
.offer-cta:hover { background: var(--color-primary-dark); }
.offer-disclosure { font-size: 0.8125rem; color: var(--color-muted); margin: 0.5rem 0 0; }

/* ---------- Footer: black band, white condensed links ---------- */
footer {
  background: var(--color-accent);
  color: #B9BBC0;
  font-size: 0.875rem;
  margin-top: 2rem;
  padding: 1.5rem 0;
}
footer a {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-bottom: 2px solid var(--color-primary);
}
footer a:hover { color: #E06222; } /* lighter orange: 5.0:1 on the black band (AA); token orange is only 3.9:1 here */
footer p { margin: 0.25rem 0; }
.freshness { font-size: 0.8125rem; }

/* ---------- Mobile fold (375×812): compact header, tool immediately visible ---------- */
@media (max-width: 600px) {
  .site-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0 1rem;
    font-size: 0.9375rem;
  }
  .site-nav a { white-space: nowrap; }
  .hero { padding-top: 0.75rem; }
  h1 { font-size: 1.75rem; }
  .tagline { font-size: 0.875rem; margin-top: 0.25rem; }
  .disclaimer { font-size: 0.75rem; margin-top: 0.375rem; }
  #tool { padding-top: 0.75rem; }
  label { margin-top: 0.75rem; }
  .verdict-zone { padding: 1.25rem 1rem; min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
