:root {
  --yellow: #f5cf25;
  --black: #10110f;
  --ink: #171813;
  --paper: #f4f2e9;
  --line: rgba(16,17,15,.2);
  --muted: #706f66;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(25vw - 1px), rgba(16,17,15,.08) 25vw);
}

.shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 24px; position: relative; }
.brandbar { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; }
.mark { width: 52px; height: 52px; background: var(--black); color: var(--yellow); display: grid; place-items: center; font-weight: 950; font-size: 1.1rem; transform: skew(-7deg); }
.eyebrow, .step { margin: 0 0 3px; font-size: .75rem; font-weight: 850; letter-spacing: .15em; }
h1 { margin: 0; font-size: 1.25rem; letter-spacing: -.03em; }
h2 { margin: 4px 0 0; font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: .98; letter-spacing: -.055em; }

.calculator { border-top: 8px solid var(--black); padding: 24px; background: rgba(255,255,255,.42); box-shadow: 0 18px 55px rgba(23,24,19,.07); }
.intro { margin-bottom: 30px; }
.field-grid { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 14px; }
.field { display: grid; gap: 9px; font-size: .88rem; font-weight: 800; }
.control { display: flex; min-height: 68px; align-items: center; border: 2px solid var(--black); background: white; }
.control:focus-within { outline: 4px solid rgba(245,207,37,.65); outline-offset: 2px; }
input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 14px 10px 14px 16px; font: 800 1.55rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: transparent; color: var(--black); }
.control b { align-self: stretch; display: grid; place-items: center; padding: 0 13px; background: var(--black); color: white; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.field small { min-height: 32px; color: var(--muted); font-size: .74rem; line-height: 1.35; font-weight: 600; }
button { width: 100%; border: 0; margin-top: 10px; padding: 19px 22px; background: var(--yellow); color: var(--black); font: 950 1rem/1 Inter, sans-serif; letter-spacing: .05em; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
button:hover { filter: brightness(.96); }
button:focus-visible { outline: 4px solid var(--black); outline-offset: 3px; }
.error { min-height: 23px; color: #a31313; font-size: .86rem; font-weight: 750; padding-top: 3px; }

.results { margin-top: 18px; background: var(--black); color: white; padding: 26px 24px 22px; }
.result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,.2); }
.step.dark { color: var(--yellow); }
.summary { padding: 9px 11px; border: 1px solid rgba(255,255,255,.35); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.result-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1px; background: rgba(255,255,255,.18); margin-top: 1px; }
.metric { min-height: 190px; background: var(--black); padding: 28px 24px; display: flex; flex-direction: column; justify-content: flex-end; }
.metric p { margin: 0 auto auto 0; color: #c9c8bf; font-weight: 700; }
.metric output { display: block; color: var(--yellow); font: 900 clamp(2.8rem, 9vw, 5.8rem)/.88 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.09em; }
.metric:not(.primary) output { font-size: clamp(2.5rem, 7vw, 4.9rem); }
.metric span { margin-top: 12px; color: #a8a79f; font-size: .8rem; font-weight: 700; }
.target-range { margin-top: 20px; padding: 13px 15px; border-left: 3px solid var(--yellow); background: #252620; }
.target-range span { display: block; margin: 0 0 6px; color: #d4d3ca; font-size: .8rem; font-weight: 750; }
.target-range strong { display: block; color: white; font: 850 clamp(1.05rem, 3vw, 1.35rem)/1.15 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.035em; }
.target-range small { display: block; margin-top: 6px; color: #85857d; font-size: .68rem; font-weight: 700; }
.split-block { padding-top: 24px; }
.split-block > p { color: #a8a79f; margin: 0 0 12px; font-size: .72rem; font-weight: 850; letter-spacing: .12em; }
.splits { display: flex; gap: 8px; flex-wrap: wrap; }
.split { padding: 10px 12px; background: #252620; border-left: 3px solid var(--yellow); font: 750 .84rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
footer { display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font-size: .75rem; font-weight: 650; }

@media (max-width: 700px) {
  body::before { background-size: 50vw 100%; }
  .shell { width: min(100% - 20px, 520px); padding-top: 18px; }
  .brandbar { margin-bottom: 22px; }
  .calculator, .results { padding: 20px 16px; }
  .field-grid, .result-grid { grid-template-columns: 1fr; }
  .field small { min-height: 0; }
  .metric { min-height: 155px; padding: 22px 16px; }
  .result-head { align-items: flex-start; }
  footer { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .results { animation: reveal .45s ease both; }
  @keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
}
