/* FrostLine — cold-region engineering toolkit. Hand-written, no framework. */

:root {
  --ink: #0f1b2d;
  --ink-soft: #3a4a60;
  --muted: #6b7a90;
  --line: #dbe3ee;
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --frost: #1b6fb5; /* primary */
  --frost-deep: #0d4f86;
  --ice: #e8f3fb;
  --accent: #15a0c4;
  --ok: #1f8a4c;
  --warn: #b4451f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 8px 24px rgba(15, 27, 45, 0.06);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--frost-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--frost-deep); color: #fff; padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* --- header --- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(160%) blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--ink); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--frost); font-size: 1.3rem; }
.site-nav { display: flex; gap: 1.4rem; }
.site-nav a { color: var(--ink-soft); font-weight: 500; }
.site-nav a[aria-current="page"] { color: var(--frost-deep); }

/* --- hero --- */
.hero {
  background: radial-gradient(1200px 400px at 70% -10%, var(--ice), transparent),
    linear-gradient(180deg, #fbfdff, var(--bg));
  padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--line);
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 700; color: var(--frost); margin: 0 0 0.75rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 1rem; max-width: 16ch; }
.hero-sub { font-size: 1.2rem; color: var(--ink-soft); max-width: 56ch; margin: 0 0 1.75rem; }
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero-note { margin-top: 1.25rem; font-size: 0.85rem; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  border: 1px solid transparent; cursor: pointer; transition: transform 0.05s ease, box-shadow 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--frost-deep); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--frost); }
.btn-ghost { background: #fff; color: var(--frost-deep); border-color: var(--line); }

/* --- sections --- */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: 1.6rem; margin: 0 0 0.35rem; }
.section-lede { color: var(--ink-soft); margin: 0 0 1.5rem; max-width: 60ch; }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: 2.2rem; margin: 0 0 0.5rem; }

/* --- calculator cards --- */
.calc-grid {
  display: grid; gap: 1rem; margin-bottom: 2.5rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.calc-card {
  display: flex; gap: 1rem; padding: 1.15rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.08s ease;
}
.calc-card:hover { text-decoration: none; border-color: var(--frost); transform: translateY(-2px); }
.calc-card-icon {
  flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--ice);
  display: grid; place-items: center; font-size: 1.4rem; color: var(--frost-deep);
}
.calc-card-body { display: flex; flex-direction: column; gap: 0.15rem; }
.calc-card-name { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.calc-card-std { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--frost); font-weight: 700; }
.calc-card-blurb { color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.25rem; }

/* --- why section --- */
.why { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; align-items: start; }
.why p { color: var(--ink-soft); }
.why-list { list-style: none; margin: 0; padding: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.why-list li { padding: 0.6rem 0; border-bottom: 1px dashed var(--line); color: var(--ink-soft); }
.why-list li:last-child { border-bottom: 0; }
.why-list strong { color: var(--ink); }

/* --- calculator page --- */
.calc { padding: 2.5rem 0 3.5rem; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.calc-head { margin-bottom: 1.5rem; }
.calc-head h1 { font-size: 2rem; display: inline-block; margin: 0 0.5rem 0 0; }
.chip {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--ice); color: var(--frost-deep); vertical-align: middle;
}
.chip-est { background: #fff3e8; color: var(--warn); }
.lede { color: var(--ink-soft); margin: 0.9rem 0 0; max-width: 60ch; }

.calc-form {
  display: grid; gap: 1rem; padding: 1.5rem; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.field .unit { color: var(--muted); font-weight: 400; }
.field input, .field select {
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--frost); outline-offset: 1px; border-color: var(--frost); }
.field .hint { color: var(--muted); font-size: 0.78rem; }

.results-panel { margin-top: 0.5rem; grid-column: 1 / -1; }
.calc-note { font-size: 0.85rem; color: var(--muted); margin: 0 0 2rem; }

/* results table */
.results { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.results th, .results td { padding: 0.6rem 0.9rem; text-align: left; border-bottom: 1px solid var(--line); }
.results th { font-weight: 500; color: var(--ink-soft); }
.results td { font-variant-numeric: tabular-nums; font-weight: 600; }
.results td.u { color: var(--muted); font-weight: 400; width: 6rem; }
.results tr:last-child th, .results tr:last-child td { border-bottom: 0; }
.results .row-strong { background: var(--ice); }
.results .row-strong th, .results .row-strong td { color: var(--frost-deep); font-weight: 800; }

.error { color: var(--warn); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

/* frost-heave verdict */
.verdict { display: flex; align-items: baseline; gap: 1rem; padding: 1.25rem 1.5rem; border-radius: var(--radius); color: #fff; }
.verdict-group { font-size: 2.4rem; font-weight: 800; }
.verdict-label { font-size: 1.2rem; font-weight: 600; }
.verdict-nfs { background: #2f7d46; }
.verdict-f1 { background: #4a8f3c; }
.verdict-f2 { background: #b88a16; }
.verdict-f3 { background: #c2611c; }
.verdict-f4 { background: #b1331f; }
.basis { margin: 0.9rem 0 0; color: var(--ink-soft); }

/* unit converter output */
.convert-out { padding: 1.25rem 1.5rem; background: var(--ice); border-radius: var(--radius); }
.convert-out .big { font-size: 2.2rem; font-weight: 800; color: var(--frost-deep); font-variant-numeric: tabular-nums; }
.convert-out .u { font-size: 1.1rem; color: var(--ink-soft); }

/* method + prose */
.method { margin-top: 0.5rem; }
.method h2 { font-size: 1.3rem; }
.method .formula {
  font-family: var(--mono); background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.75rem 1rem; font-size: 1rem; overflow-x: auto;
}
.method ul { color: var(--ink-soft); }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2rem; font-size: 1.4rem; }
.prose .callout, .callout {
  background: #fff8f1; border: 1px solid #f0d9c4; border-left: 4px solid var(--warn);
  padding: 1rem 1.25rem; border-radius: 8px; color: var(--ink-soft);
}

/* --- footer --- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 2rem 0; margin-top: 2rem; }
.site-footer .disclaimer { font-size: 0.85rem; color: var(--ink-soft); max-width: 80ch; margin: 0 0 0.75rem; }
.site-footer .disclaimer strong { color: var(--warn); }

@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; }
  .why { grid-template-columns: 1fr; }
  .site-nav { gap: 1rem; font-size: 0.95rem; }
  .hero { padding: 3.5rem 0 2.5rem; }
}
