@font-face {
  font-family: "Mona Sans";
  src: url("../public/fonts/MonaSans-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mona Sans";
  src: url("../public/fonts/MonaSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mona Sans";
  src: url("../public/fonts/MonaSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #080808;
  --paper: #f3f3f3;
  --white: #fff;
  --muted: #686868;
  --line: rgba(8, 8, 8, .18);
  --dark-line: rgba(255, 255, 255, .18);
  --gradient: linear-gradient(110deg, #77d8d3 0%, #8d83cf 28%, #d781ad 51%, #d3aa78 72%, #77d8d3 100%);
  --display: "Mona Sans", "Helvetica Neue", Arial, sans-serif;
  --page: min(calc(100% - 64px), 1440px);
}

* { box-sizing: border-box; }

html { background: var(--ink); scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}

body::selection { color: var(--ink); background: #d781ad; }
a { color: inherit; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: var(--page);
  margin: 0 auto;
  padding: 25px 0;
  color: var(--paper);
  border-bottom: 1px solid var(--dark-line);
}

.wordmark,
.footer-wordmark { text-decoration: none; }
.wordmark b,
.wordmark em,
.footer-wordmark b,
.footer-wordmark em { display: block; }
.wordmark b { font-size: 17px; line-height: 1; letter-spacing: -.04em; }
.wordmark em { margin-top: 3px; font-family: "Iowan Old Style", Baskerville, serif; font-size: 24px; font-weight: 400; line-height: .88; letter-spacing: -.04em; }
.site-header p { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

.calculator-hero {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  padding: 170px max(32px, calc((100% - min(calc(100% - 64px), 1440px)) / 2)) 64px;
  color: var(--paper);
  background: var(--ink);
}

.hero-copy { position: relative; z-index: 2; }
.eyebrow { margin: 0; font-size: 10px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.calculator-hero h1 {
  max-width: 1040px;
  margin: 0;
  font-size: clamp(88px, 10vw, 160px);
  font-weight: 300;
  line-height: .79;
  letter-spacing: -.075em;
}
.calculator-hero h1 em {
  color: transparent;
  background: var(--gradient);
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  font-family: "Iowan Old Style", Baskerville, serif;
  font-weight: 400;
  animation: shimmer 8s ease-in-out infinite alternate;
}
.hero-intro { max-width: 610px; margin: 46px 0 0; color: #aaa; font-size: clamp(18px, 1.6vw, 24px); line-height: 1.4; letter-spacing: -.03em; }

.hero-rings { position: absolute; z-index: 1; top: 40px; right: -12vw; width: 54vw; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.hero-rings i { position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.hero-rings i:nth-child(1) { inset: 10%; }
.hero-rings i:nth-child(2) { inset: 22%; }
.hero-rings i:nth-child(3) { inset: 34%; }
.hero-rings i:nth-child(4) { inset: 44%; background: radial-gradient(circle, rgba(215,129,173,.17), transparent 68%); }

.calculator-shell { padding: clamp(84px, 9vw, 140px) 0 0; background: var(--paper); }
.mode-bar { padding: 58px clamp(28px, 4vw, 64px) clamp(64px, 7vw, 104px) max(32px, calc((100vw - min(calc(100vw - 64px), 1440px)) / 2)); }
.mode-bar h2 { margin: 0; font-size: clamp(52px, 5.5vw, 84px); font-weight: 300; line-height: .9; letter-spacing: -.065em; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(480px, .78fr); align-items: start; }
.control-column { min-width: 0; }
.controls { min-width: 0; padding: 0 0 96px max(32px, calc((100vw - min(calc(100vw - 64px), 1440px)) / 2)); }
.fixed-baseline { padding: 28px clamp(28px, 4vw, 64px) 30px 0; border-bottom: 1px solid var(--line); }
.fixed-baseline span { display: block; color: #737373; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.fixed-baseline p { max-width: 720px; margin: 12px 0 0; color: #303030; font-size: clamp(19px, 1.7vw, 25px); font-weight: 300; line-height: 1.25; letter-spacing: -.035em; }
.input-section { padding: 58px clamp(28px, 4vw, 64px) 64px 0; border-bottom: 1px solid var(--line); }
.control-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 40px clamp(28px, 4vw, 64px) 0 0; }
.control-actions button { padding: 12px 16px; color: var(--ink); background: transparent; border: 1px solid var(--ink); cursor: pointer; font-size: 12px; font-weight: 600; }
.control-actions p { margin: 0; color: #777; font-size: 11px; }

.results { position: sticky; top: 0; min-height: 100vh; padding: 58px max(32px, calc((100vw - min(calc(100vw - 64px), 1440px)) / 2)) 72px clamp(36px, 4vw, 64px); color: var(--paper); background: var(--ink); }
.results::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 5px; background: var(--gradient); background-size: 220% 100%; animation: shimmer 8s ease-in-out infinite alternate; }
.primary-result { margin-top: 52px; padding: 26px 0 28px; border-top: 1px solid var(--dark-line); border-bottom: 1px solid var(--dark-line); }
.primary-result > span { display: block; color: #8d8d8d; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.primary-result strong { display: inline-block; margin-top: 12px; font-size: clamp(70px, 7vw, 112px); font-weight: 300; line-height: .9; letter-spacing: -.075em; }
.primary-result > b { margin-left: 8px; color: #888; font-size: 18px; font-weight: 400; }
.model-note { max-width: 520px; margin: 34px 0 0; color: #6e6e6e; font-size: 10px; line-height: 1.5; }

footer { position: relative; display: grid; grid-template-columns: 1fr auto auto; gap: 64px; align-items: end; min-height: 420px; padding: 74px max(32px, calc((100% - min(calc(100% - 64px), 1440px)) / 2)) 48px; color: var(--ink); background: var(--white); border-top: 1px solid var(--line); }
footer > p { margin: 0; font-size: 14px; line-height: 1.35; }
.footer-wordmark b { font-size: clamp(26px, 3vw, 44px); line-height: .9; letter-spacing: -.05em; }
.footer-wordmark em { margin-top: 5px; font-family: "Iowan Old Style", Baskerville, serif; font-size: clamp(38px, 4.5vw, 66px); font-weight: 400; line-height: .85; letter-spacing: -.05em; }
footer > a:last-child { font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

[hidden] { display: none !important; }

@keyframes shimmer { to { background-position: 100% 50%; } }

@media (max-width: 1100px) {
  .calculator-hero { min-height: 620px; }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(400px, .85fr); }
}

@media (max-width: 860px) {
  :root { --page: calc(100% - 40px); }
  .calculator-hero { min-height: auto; padding: 150px 20px 56px; }
  .calculator-hero h1 { font-size: clamp(68px, 14vw, 104px); }
  .hero-rings { top: 120px; right: -35vw; width: 95vw; }
  .mode-bar { padding: 0 20px 64px; }
  .workspace { display: block; }
  .controls { padding-left: 20px; }
  .results { position: relative; min-height: auto; padding-right: 20px; padding-left: 20px; }
}

@media (max-width: 600px) {
  :root { --page: calc(100% - 32px); }
  .site-header { padding: 18px 0; }
  .site-header p { max-width: 120px; text-align: right; line-height: 1.4; }
  .calculator-hero { padding: 132px 16px 40px; }
  .calculator-hero h1 { font-size: clamp(58px, 17vw, 76px); }
  .hero-intro { margin-top: 34px; font-size: 17px; }
  .calculator-shell { padding-top: 76px; }
  .mode-bar { padding: 0 16px 56px; }
  .mode-bar h2 { font-size: 48px; }
  .controls { padding-left: 16px; }
  .input-section { padding: 44px 16px 48px 0; }
  .fixed-baseline { padding: 24px 16px 25px 0; }
  .fixed-baseline p { margin-top: 10px; font-size: 18px; line-height: 1.35; }
  .control-actions { align-items: flex-start; flex-direction: column; padding: 32px 16px 0 0; }
  .results { padding: 52px 16px 58px; }
  .primary-result { margin-top: 42px; }
  .primary-result strong { font-size: 76px; }
  footer { grid-template-columns: 1fr; gap: 44px; min-height: auto; padding: 64px 16px 30px; }
  footer > a:last-child { justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

.platter-preview { margin-top: 36px; }
.platter-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.platter-preview-head p { margin: 0; color: #ccc; font-size: 13px; line-height: 1.4; }
.platter-preview-head button { flex-shrink: 0; padding: 8px 10px; background: transparent; color: #ccc; border: 1px solid #555; font-size: 10px; cursor: pointer; }
.platter-preview-head button:hover { color: #fff; border-color: #aaa; }
.platter-map { display: block; width: 100%; max-width: 540px; margin: 18px auto 8px; overflow: visible; }
.platter-svg-label { fill: #aaa; font-size: 11px; font-family: var(--display); }
.platter-rotation { transform-origin: 190px 176px; animation: platter-turn 12s linear infinite; }
.active-sensor { animation: sensor-read 1.6s ease-in-out infinite; }
.platter-preview.is-paused .platter-rotation, .platter-preview.is-paused .active-sensor { animation-play-state: paused; }
.platter-legend { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 11px; color: #bbb; }
.platter-legend span { display: inline-flex; gap: 8px; align-items: center; }
.platter-legend i { width: 6px; height: 6px; background: #9594a5; border-radius: 50%; }
.platter-legend span:last-child i { background: #77d8d3; }
.platter-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; margin: 24px 0 0; padding: 24px 0; border-top: 1px solid var(--dark-line); border-bottom: 1px solid var(--dark-line); }
.platter-stats div { min-width: 0; }
.platter-stats dt { color: #aaa; font-size: 10px; line-height: 1.4; }
.platter-stats dd { margin: 8px 0 0; font-size: clamp(17px, 1.7vw, 23px); font-weight: 300; letter-spacing: -.035em; overflow-wrap: anywhere; }
.platter-caption { margin: 16px 0 0; color: #999; font-size: 11px; line-height: 1.6; }
@keyframes platter-turn { to { transform: rotate(360deg); } }
@keyframes sensor-read { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (max-width: 600px) {
  .platter-preview-head { align-items: flex-start; }
  .platter-preview-head p { max-width: 180px; }
  .platter-stats { gap: 18px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .platter-rotation, .active-sensor { animation: none; }
}

/* Single-variable bandwidth model. */
.calculator-hero { min-height: 520px; }
.calculator-shell { padding-top: 80px; }
.mode-bar { padding-top: 40px; padding-bottom: 56px; }
.results { position: relative; min-height: 0; padding-top: 40px; }
.primary-result { margin-top: 0; border-top: 0; padding-top: 0; }
.baseline-values { margin: 22px 0 0; }
.baseline-values div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.baseline-values dt { color: var(--muted); font-size: 14px; }
.baseline-values dd { margin: 0; font-size: 22px; font-weight: 300; letter-spacing: -.03em; }
.fixed-baseline .baseline-note { margin-top: 22px; color: var(--muted); font-size: 13px; line-height: 1.6; letter-spacing: 0; }
.station-field { display: block; font-size: clamp(24px, 2.5vw, 36px); font-weight: 300; letter-spacing: -.04em; }
.station-input { display: flex; align-items: center; border-bottom: 1px solid var(--ink); margin-top: 20px; }
.station-input input { width: 100%; min-width: 0; padding: 12px 0; border: 0; color: var(--ink); background: transparent; font-size: clamp(52px, 6vw, 80px); font-weight: 300; letter-spacing: -.06em; }
.station-input span { font-size: 40px; color: var(--muted); }
.station-input input:invalid { color: #aa3b3b; }
#station-help { margin: 20px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.formula { padding: 32px clamp(28px, 4vw, 64px) 0 0; }
.formula p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.formula strong { display: block; margin: 14px 0; font-size: clamp(30px, 3vw, 44px); font-weight: 300; letter-spacing: -.045em; overflow-wrap: anywhere; }
.formula strong span { color: var(--muted); }
.formula strong b { font-weight: 300; }
.model-note { padding-right: 32px; font-size: 12px; line-height: 1.6; }
footer { grid-template-columns: 1fr auto auto auto; }
@media (max-width: 860px) {
  .calculator-hero { min-height: 0; }
  .mode-bar { padding-top: 0; }
  .results { padding-top: 36px; }
  .controls { padding-bottom: 56px; }
  footer { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 600px) {
  .calculator-shell { padding-top: 56px; }
  .mode-bar { padding-bottom: 32px; }
  .formula { padding-right: 16px; }
  footer { grid-template-columns: 1fr; }
}
