/* FirstCase — OR supply waste calculator
   Palette: deep clinical navy, warm paper, a single teal accent. */

:root {
  --navy-900: #071a30;
  --navy-800: #0b2545;
  --navy-700: #133a63;
  --navy-500: #2d5a8e;
  --teal: #0d9488;
  --teal-bright: #4cc9c0;
  --teal-soft: #e6f6f4;
  --amber: #b45309;
  --paper: #fbfaf8;
  --white: #ffffff;
  --ink: #14202e;
  --ink-soft: #4a5b6e;
  --ink-faint: #7d8b9a;
  --rule: #e3e6ea;
  --rule-strong: #ccd3da;
  --shadow: 0 1px 2px rgba(11, 37, 69, .06), 0 8px 28px rgba(11, 37, 69, .07);
  --radius: 12px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.021em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
a { color: var(--navy-700); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 248, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy-800); }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--navy-800);
  position: relative; flex: none;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; background: var(--teal-bright); border-radius: 2px;
}
.brand-mark::before { left: 9.5px; top: 4px; width: 3px; height: 14px; }
.brand-mark::after { top: 9.5px; left: 4px; height: 3px; width: 14px; }
.brand-text { font-weight: 400; font-size: 1.16rem; letter-spacing: -0.02em; }
.brand-text strong { font-weight: 700; }
.brand-text.small { font-size: 1rem; color: var(--white); }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: .93rem; font-weight: 500; }
.nav-links a:hover { color: var(--navy-800); }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1100px 460px at 12% -10%, #16406e 0%, transparent 62%),
    linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: #e8eef5;
  padding: clamp(64px, 10vw, 116px) 0 clamp(72px, 11vw, 124px);
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .13em; font-size: .74rem; font-weight: 600;
  color: var(--teal-bright); margin-bottom: 1.4rem;
}
.hero h1 { color: var(--white); max-width: 15ch; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: #b9c9db; max-width: 60ch; margin-bottom: 2rem; }
.hero-note { margin-top: 1.6rem; font-size: .88rem; color: #7e94ac; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 9px;
  font-weight: 600; font-size: .97rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.btn-primary { background: var(--teal); color: var(--white); box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.btn-primary:hover { background: #0f7f76; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-block { display: block; width: 100%; text-align: center; margin-top: 22px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- section headers ---------- */
.section-head { max-width: 68ch; margin-bottom: 40px; }
.section-head p { color: var(--ink-soft); }

/* ---------- calculator ---------- */
.calc-section { padding: clamp(56px, 8vw, 92px) 0; }
.calc {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: start;
}
.calc-inputs {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.field { margin-bottom: 28px; }
.field:last-child { margin-bottom: 4px; }
label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-weight: 600; font-size: .95rem; margin-bottom: 10px; color: var(--ink);
}
.unit { font-weight: 500; font-size: .85rem; color: var(--teal); font-variant-numeric: tabular-nums; }
.opt { font-weight: 400; font-size: .8rem; color: var(--ink-faint); }

input[type="number"], input[type="text"], input[type="email"], select {
  width: 100%; padding: 11px 13px; font-size: 1rem; font-family: inherit; color: var(--ink);
  background: var(--white); border: 1px solid var(--rule-strong); border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
input[type="number"]:focus, input[type="text"]:focus, input[type="email"]:focus, select:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a5b6e' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

.input-row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: var(--rule-strong); border-radius: 3px; outline: none; margin: 8px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal); border: 3px solid var(--white); box-shadow: 0 1px 4px rgba(11,37,69,.3); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--teal);
  border: 3px solid var(--white); box-shadow: 0 1px 4px rgba(11,37,69,.3); cursor: pointer;
}

.hint { font-size: .82rem; color: var(--ink-faint); line-height: 1.5; margin: 8px 0 0; }
.hint strong { color: var(--ink-soft); }

.scale {
  display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-faint);
  margin-top: 2px;
}
.scale-mark { color: var(--ink-soft); }

/* ---------- output ---------- */
.calc-output {
  position: sticky; top: 88px;
  background: linear-gradient(165deg, var(--navy-800), var(--navy-900));
  color: #dce6f0; border-radius: var(--radius); padding: 30px;
  box-shadow: 0 10px 40px rgba(11, 37, 69, .18);
}
.out-label {
  text-transform: uppercase; letter-spacing: .11em; font-size: .7rem; font-weight: 600;
  color: var(--teal-bright); margin-bottom: 6px;
}
.out-hero {
  font-size: clamp(2.3rem, 4.4vw, 3.1rem); font-weight: 700; color: var(--white);
  letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 6px; font-variant-numeric: tabular-nums;
}
.out-sub { font-size: .88rem; color: #93a8c0; margin-bottom: 22px; }

.out-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.out-cell {
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px; padding: 13px 14px; display: flex; flex-direction: column; gap: 3px;
}
.cell-label {
  text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; font-weight: 600; color: #8fa6bf;
}
.cell-value { font-size: 1.28rem; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cell-value.big { font-size: 1.95rem; color: var(--teal-bright); }
.cell-note { font-size: .76rem; color: #8fa6bf; }

.out-highlight {
  background: rgba(76, 201, 192, .1); border: 1px solid rgba(76, 201, 192, .28);
  border-radius: 9px; padding: 15px 16px; display: flex; flex-direction: column; gap: 3px;
}

.out-equiv {
  font-size: .87rem; color: #a9bcd2; margin: 16px 0 0; padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.out-equiv strong { color: var(--white); font-weight: 600; }

.math { margin-top: 14px; }
.math summary {
  cursor: pointer; font-size: .82rem; color: var(--teal-bright); font-weight: 600;
  padding: 6px 0; list-style: none;
}
.math summary::-webkit-details-marker { display: none; }
.math summary::before { content: "▸ "; }
.math[open] summary::before { content: "▾ "; }
.math-body {
  font-size: .8rem; color: #a9bcd2; line-height: 1.85; padding: 10px 0 2px;
  font-variant-numeric: tabular-nums;
}
.math-body .eq { color: var(--white); }
.math-body .row { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dotted rgba(255,255,255,.12); padding: 3px 0; }

.out-disclaimer { font-size: .73rem; color: #7e94ac; margin: 12px 0 0; text-align: center; }

/* ---------- method ---------- */
.method { background: var(--white); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: clamp(56px, 8vw, 92px) 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; margin-bottom: 52px; }
.card { border-left: 3px solid var(--teal); padding: 2px 0 2px 20px; }
.card h3 { color: var(--navy-800); margin-bottom: .4em; }
.card p { color: var(--ink-soft); font-size: .95rem; margin: 0; }

.assumptions {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 30px; max-width: 78ch;
}
.assumptions h3 { color: var(--navy-800); }
.assumptions p { color: var(--ink-soft); font-size: .95rem; }
.fineprint { font-size: .84rem !important; color: var(--ink-faint) !important; margin-bottom: 0 !important; }

/* ---------- report ---------- */
.report { padding: clamp(56px, 8vw, 92px) 0; }
.report-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.report-copy p { color: var(--ink-soft); }
.ticks { list-style: none; padding: 0; margin: 0 0 18px; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: 11px; color: var(--ink-soft); font-size: .95rem; }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: .5em; width: 11px; height: 6px;
  border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal);
  transform: rotate(-45deg);
}
.report-form {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.report-form .field { margin-bottom: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { font-size: .88rem; margin: 14px 0 0; text-align: center; min-height: 1.2em; }
.form-status.ok { color: var(--teal); font-weight: 600; }
.form-status.err { color: var(--amber); font-weight: 600; }

/* ---------- about ---------- */
.about { background: var(--white); border-top: 1px solid var(--rule); padding: clamp(56px, 8vw, 92px) 0; }
.about-lede { max-width: 70ch; color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 36px; }
.lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.line { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; }
.line h3 { color: var(--navy-800); }
.line p { color: var(--ink-soft); font-size: .93rem; margin: 0; }

/* ---------- footer ---------- */
.footer { background: var(--navy-900); color: #7e94ac; padding: 44px 0; margin-top: 0; }
.footer-inner p { font-size: .82rem; max-width: 72ch; margin: 14px 0 0; }
.footer .copy { margin-top: 18px; font-size: .8rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .calc { grid-template-columns: 1fr; }
  .calc-output { position: static; }
  .report-wrap { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: .85rem; }
  .input-row { grid-template-columns: 1fr; gap: 8px; }
  .scale .scale-mark:nth-child(2), .scale .scale-mark:nth-child(4) { display: none; }
  .calc-inputs, .report-form, .assumptions, .calc-output { padding: 22px; }
}
@media (max-width: 400px) {
  .out-grid { grid-template-columns: 1fr; }
}
