/* Renegade Citizen — site styles.
   Look: Electrician Toolbox's charcoal dark theme with safety yellow. */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url("fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("fonts/barlow-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #141518;          /* app background */
  --surface: #1f2125;     /* cards, result panels */
  --surface-2: #2a2d33;   /* raised / table group rows */
  --border: #2a2d33;      /* card outlines */
  --field-border: #3a3e46;
  --text: #ffffff;
  --muted: #a7abb4;
  --dim: #8a8f99;
  --hivis: #ffc300;
  --on-hivis: #141518;
  --ok: #3dd68c;
  --warn: #ff8a3d;
  --line: 1px solid var(--border);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 38rem;
  --wrap: 72rem;
}

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

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--dim); }
a:hover { text-decoration-color: var(--hivis); }

:focus-visible {
  outline: 3px solid var(--hivis);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--hivis); color: var(--on-hivis); padding: 0.5rem 0.75rem; font-weight: 700; border-radius: 8px;
}
.skip:focus { left: 0.5rem; z-index: 10; }

/* Site header */
.site-header { border-bottom: var(--line); background: #1a1b1f; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4.25rem; flex-wrap: wrap;
}
.wordmark {
  font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: 0.01em;
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.6rem;
}
.wordmark-mark {
  width: 1.9rem; height: 1.9rem; border-radius: 7px;
  background: var(--hivis); display: inline-grid; place-items: center;
}
.site-nav { display: flex; gap: 1.5rem; font-weight: 600; color: var(--muted); }
.site-nav a { text-decoration: none; padding: 0.35rem 0; border-bottom: 3px solid transparent; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--hivis); border-bottom-color: var(--hivis); }

/* Type */
h1, h2 { font-family: var(--display); font-weight: 800; line-height: 0.95; letter-spacing: -0.005em; margin: 0; }
h1 { font-size: clamp(3.2rem, 8.5vw, 6.75rem); }
h2 { font-size: clamp(2.25rem, 4.6vw, 3.4rem); font-weight: 700; }
h3 { font-size: 1.3rem; line-height: 1.2; margin: 0 0 0.35rem; font-weight: 700; }
p { margin: 0 0 1rem; max-width: var(--measure); }
.lede { font-size: 1.3rem; line-height: 1.45; color: var(--muted); max-width: 32rem; }

section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
section + section { border-top: var(--line); }
.section-head { margin-bottom: 2.25rem; }
.section-head p { margin-top: 0.9rem; color: var(--muted); }

/* Buttons and badges */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 1.75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.5rem; padding: 0 1.4rem; border-radius: 14px;
  font-family: var(--display); font-weight: 700; font-size: 1.35rem; text-decoration: none;
  background: var(--hivis); color: var(--on-hivis);
}
.btn:hover { background: #ffd23f; }
.btn-quiet { background: var(--surface); color: var(--text); border: 1px solid var(--field-border); }
.btn-quiet:hover { background: var(--surface-2); }
/* Apple's official badge. Keep its proportions and clear space; don't recolour it. */
.store-badge { display: inline-flex; flex-direction: column; gap: 0.4rem; text-decoration: none; }
.store-badge img { height: 3.5rem; width: auto; }
.store-badge span { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.price-note { font-weight: 600; color: var(--muted); margin: 0; }

/* Hero */
.hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.hero-grid { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: start; }
.hero h1 { margin-bottom: 1.4rem; }
.hero-icon { width: 5rem; height: 5rem; border-radius: 22%; border: 1px solid var(--field-border); margin-bottom: 1.5rem; }

/* Live voltage drop calculator (mirrors the app's dark screen) */
.calc { border: var(--line); border-radius: 26px; padding: 0.75rem; background: #1a1b1f; }
.calc-caption { font-weight: 700; font-size: 1rem; margin: 0.25rem 0.4rem 0.7rem; display: flex; justify-content: space-between; gap: 1rem; max-width: none; }
.calc-caption span { font-weight: 500; color: var(--muted); }
.readout { background: var(--surface); border: var(--line); color: var(--text); border-radius: 20px; padding: 1rem 1.1rem 1.1rem; }
.readout-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.readout-label { font-size: 0.9rem; font-weight: 600; color: var(--muted); margin: 0; }
.readout-pct {
  font-family: var(--display); font-weight: 800; font-size: clamp(4rem, 10vw, 5.5rem); line-height: 0.95;
  font-variant-numeric: tabular-nums; color: var(--hivis); margin: 0.15rem 0 0.5rem;
}
.readout-pct small { font-size: 0.45em; margin-left: 0.08em; }
.readout[data-state="over"] .readout-pct { color: var(--warn); }
.status {
  font-weight: 700; font-size: 0.95rem; padding: 0.3rem 0.75rem; border-radius: 999px; white-space: nowrap;
  background: #173826; color: var(--ok);
}
.readout[data-state="over"] .status { background: #3a2618; color: var(--warn); }
.readout[data-state="empty"] .status { background: var(--surface-2); color: var(--muted); }

.drop-range { width: 100%; margin: 0.4rem 0 0.15rem; height: 2.75rem; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.drop-range::-webkit-slider-runnable-track { height: 14px; border-radius: 7px; background: var(--track, #2a2d33); }
.drop-range::-moz-range-track { height: 14px; border-radius: 7px; background: var(--track, #2a2d33); }
.drop-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 32px; height: 32px; margin-top: -9px; border-radius: 50%;
  background: #fff; border: 4px solid var(--thumb, var(--ok));
}
.drop-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--thumb, var(--ok)); }
.drop-range:focus-visible { outline-offset: 0; }
.ticks { position: relative; height: 1.1rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }
.range-hint { font-size: 0.92rem; color: var(--muted); margin: 0.5rem 0 0; max-width: none; }
.range-hint strong { color: var(--text); }
.readout-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0.9rem 0 0; padding-top: 0.8rem; border-top: var(--line); }
.readout-stats dt { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.readout-stats dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.readout-stats dd small { font-size: 0.55em; color: var(--muted); margin-left: 0.15em; }
.readout-stats .at-load { color: var(--hivis); }

.calc-controls { display: grid; gap: 0.6rem; margin-top: 0.75rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px;
  border: var(--line); border-radius: 16px; background: var(--surface); margin: 0; min-width: 0;
}
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: grid; place-items: center; min-height: 2.9rem; border-radius: 11px; border: 2px solid transparent;
  font-weight: 600; font-size: 1rem;
}
.seg input:checked + span { background: var(--hivis); color: var(--on-hivis); border-color: var(--hivis); font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 1px; }
.field {
  display: flex; flex-direction: column; justify-content: center; gap: 0.05rem;
  border: 2px solid var(--field-border); border-radius: 16px; padding: 0.4rem 0.9rem; min-height: 4rem; background: var(--surface);
}
.field label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field-row { display: flex; align-items: baseline; gap: 0.4rem; }
.field input, .field select {
  border: 0; background: transparent; font: inherit; font-family: var(--display); font-weight: 800;
  font-size: 1.7rem; line-height: 1.1; padding: 0; width: 100%; min-width: 0; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.field select { cursor: pointer; }
.field select option { background: var(--surface); color: var(--text); }
.field input:focus, .field select:focus { outline: none; }
.field:focus-within { border-color: var(--hivis); }
.field .unit { font-weight: 700; color: var(--muted); }
.calc-foot { font-size: 0.85rem; color: var(--dim); margin: 0.8rem 0.4rem 0.2rem; max-width: none; }

/* Screens */
.screens { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(13rem, 1fr); gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; }
.screens figure { margin: 0; scroll-snap-align: start; }
.screens img { border: 2px solid var(--field-border); border-radius: 30px; width: 100%; }
.screens figcaption { margin-top: 0.75rem; font-weight: 600; font-size: 1rem; }
.screens figcaption span { display: block; font-weight: 400; color: var(--muted); }

/* Tools table */
.tools { width: 100%; border-collapse: separate; border-spacing: 0; border: var(--line); border-radius: 20px; overflow: hidden; font-size: 1.05rem; background: var(--surface); }
.tools th, .tools td { text-align: left; padding: 0.95rem 1rem; vertical-align: top; border-bottom: var(--line); }
.tools tbody tr:last-child th, .tools tbody tr:last-child td { border-bottom: 0; }
.tools thead th { color: var(--muted); font-weight: 600; font-size: 0.95rem; background: #1a1b1f; }
.tools tbody th { font-family: var(--display); font-weight: 700; font-size: 1.4rem; line-height: 1.1; width: 13rem; }
.tools td { color: var(--muted); }
.tools tr.group th { background: var(--surface-2); font-family: var(--body); font-size: 1rem; font-weight: 700; padding: 0.55rem 1rem; color: var(--text); }
.tools tr.group-pro th { color: var(--hivis); }
.table-scroll { overflow-x: auto; }

/* Field features */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.feature svg { width: 2.25rem; height: 2.25rem; margin-bottom: 0.9rem; color: var(--hivis); }
.feature p { color: var(--muted); font-size: 1.05rem; }

/* Pricing — the one yellow block on the page */
.pricing {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start;
  background: var(--hivis); color: var(--on-hivis); border-radius: 26px; padding: clamp(1.5rem, 4vw, 2.75rem);
}
.pricing h2 { margin-bottom: 1rem; }
.pricing p { color: #2a2a2a; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.65rem; font-weight: 600; }
.checks li { display: flex; gap: 0.7rem; align-items: flex-start; }
.checks svg { flex: none; width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; }

/* FAQ */
.faq { max-width: 48rem; }
.faq details { border-bottom: var(--line); }
.faq details:first-of-type { border-top: var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 2.5rem 1.1rem 0; position: relative;
  font-weight: 700; font-size: 1.2rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 0.4rem; top: 50%; width: 0.75rem; height: 0.75rem;
  border-right: 3px solid var(--hivis); border-bottom: 3px solid var(--hivis); transform: translateY(-70%) rotate(45deg);
}
.faq details[open] summary::after { transform: translateY(-20%) rotate(-135deg); }
.faq details p { padding-bottom: 1rem; color: var(--muted); }

/* Prose pages (support, privacy) */
.prose { max-width: 44rem; padding: clamp(2.5rem, 6vw, 4.5rem) 0 4rem; }
.prose h1 { font-size: clamp(2.75rem, 7vw, 4.5rem); margin-bottom: 1rem; }
.prose h2 { font-size: 2rem; margin: 2.5rem 0 0.75rem; }
.prose p { color: #d4d6db; }
.prose .lede { color: var(--muted); }
.prose .updated { color: var(--dim); font-weight: 600; }
.contact-box { border: var(--line); border-radius: 20px; padding: 1.25rem 1.4rem; background: var(--surface); margin: 1.5rem 0 0.5rem; max-width: 36rem; }
.contact-box p { margin: 0 0 0.25rem; color: var(--muted); }
.contact-box a { font-weight: 700; font-size: 1.25rem; color: var(--hivis); }

/* Studio home */
.studio-hero h1 { max-width: 13ch; }
.app-entry {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.5rem; align-items: center;
  border: var(--line); border-radius: 26px; padding: 1.5rem; text-decoration: none; background: var(--surface);
}
.app-entry:hover { border-color: var(--field-border); background: #24262b; }
.app-entry img { width: 5.5rem; height: 5.5rem; border-radius: 22%; border: 1px solid var(--field-border); }
.app-entry h3 { font-family: var(--display); font-size: 2.1rem; font-weight: 800; margin: 0 0 0.25rem; }
.app-entry p { margin: 0; color: var(--muted); }
.app-entry .btn { pointer-events: none; }
.more-apps { margin-top: 1.25rem; color: var(--dim); }

/* Footer */
.site-footer { border-top: var(--line); padding: 2.5rem 0 3rem; font-size: 1rem; background: #1a1b1f; }
.site-footer .wrap { display: grid; gap: 1.25rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; font-weight: 600; }
.disclaimer { color: var(--dim); font-size: 0.95rem; max-width: 46rem; }

/* Responsive */
@media (max-width: 56rem) {
  .hero-grid, .pricing { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; gap: 2rem; }
  .tools tbody th { width: auto; }
}
@media (max-width: 34rem) {
  body { font-size: 1.0625rem; }
  .site-nav { gap: 1.1rem; font-size: 1rem; }
  .app-entry { grid-template-columns: auto minmax(0, 1fr); }
  .app-entry .btn { grid-column: 1 / -1; }
  .tools thead { display: none; }
  .tools, .tools tbody, .tools tr, .tools th, .tools td { display: block; width: 100%; }
  .tools tbody tr:not(.group) { border-bottom: var(--line); padding: 0.85rem 1rem; }
  .tools tbody tr:not(.group) th, .tools tbody tr:not(.group) td { border: 0; padding: 0.1rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
