:root {
  --paper: #eef2ff;
  --paper-deep: #e2e8ff;
  --card: #ffffff;
  --ink: #111827;
  --muted: #5f6675;
  --blue: #1542b1;
  --blue-soft: #dbe7ff;
  --orange: #ff6719;
  --orange-soft: #fff0e8;
  --green: #1c8d63;
  --yellow: #ffe37a;
  --border: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 103, 25, 0.09), transparent 24rem),
    radial-gradient(circle at 84% 18%, rgba(21, 66, 177, 0.11), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: 'Google Sans Flex', 'Google Sans', Arial, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  text-shadow: 1px 1px 0 #fff;
}

.brand-kicker {
  position: absolute;
  left: 2px;
  top: -0.48rem;
  font-size: 0.48em;
  letter-spacing: 0;
  color: var(--ink);
}

.brand-indie {
  color: var(--blue);
}

.brand-divider {
  color: var(--orange);
  margin: 0 0.08em;
}

.brand-lab {
  color: var(--orange);
}

nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.92rem;
  font-weight: 700;
}

nav a {
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.nav-support {
  color: var(--blue);
}

main {
  overflow: hidden;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 80px 0 62px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 58px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

h1,
h2,
h3 {
  font-family: 'Roboto Slab', Georgia, serif;
  line-height: 1.05;
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 22px;
  font-size: clamp(3.1rem, 7vw, 6.8rem);
  letter-spacing: -0.055em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.35rem);
  letter-spacing: -0.035em;
}

h3 {
  font-size: 1.35rem;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 730px;
  margin: 0 0 26px;
  color: #333a48;
  font-size: clamp(1.06rem, 2vw, 1.28rem);
}

.marker {
  position: relative;
  display: inline;
  z-index: 0;
}

.marker::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -0.03em;
  right: -0.03em;
  bottom: 0.07em;
  height: 0.31em;
  background: var(--yellow);
  transform: rotate(-1deg);
}

.hero-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: var(--border);
  border-radius: 12px;
  background: var(--orange);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease;
  cursor: pointer;
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.button-secondary {
  background: var(--card);
}

.button-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 3px 3px 0 var(--orange);
}

.lab-note {
  position: relative;
  padding: 28px;
  border: var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  transform: rotate(1.4deg);
}

.lab-note::before {
  content: 'LAB NOTE';
  position: absolute;
  top: -16px;
  left: 22px;
  padding: 5px 10px;
  border: 2px solid var(--ink);
  background: var(--blue);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  transform: rotate(-2deg);
}

.lab-note p {
  margin: 0;
  font-family: 'Roboto Slab', Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.4;
}

.lab-note small {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-family: 'Google Sans Flex', 'Google Sans', Arial, sans-serif;
}

.section {
  padding: 62px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading p {
  color: var(--muted);
  font-size: 1.05rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.tool-card {
  position: relative;
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 24px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.tool-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.tool-card.live {
  background: linear-gradient(145deg, #fff, var(--orange-soft));
}

.tool-card h3 {
  margin-bottom: 10px;
}

.tool-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.tool-card .tool-link {
  margin-top: auto;
  font-weight: 800;
  color: var(--blue);
}

.tool-tag {
  align-self: flex-start;
  margin-bottom: 24px;
  padding: 4px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--blue-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.tool-tag.orange {
  background: var(--orange);
}

.tool-tag.soon {
  background: #f4f4f5;
  color: #666b76;
}

.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.philosophy-card {
  padding: 22px;
  border-top: 4px solid var(--orange);
  background: rgba(255,255,255,0.55);
}

.philosophy-card strong {
  display: block;
  margin-bottom: 7px;
  font-family: 'Roboto Slab', Georgia, serif;
  font-size: 1.1rem;
}

.philosophy-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.page-head {
  padding: 68px 0 34px;
}

.page-head h1 {
  max-width: 900px;
  margin-bottom: 16px;
  font-size: clamp(2.7rem, 6vw, 5.7rem);
}

.page-head > p {
  max-width: 740px;
  color: var(--muted);
  font-size: 1.13rem;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 28px;
  align-items: start;
  padding-bottom: 80px;
}

.calculator-card,
.result-card {
  border: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 5px 5px 0 var(--ink);
}

.calculator-card {
  padding: 28px;
}

.form-row {
  margin-bottom: 26px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.label-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 8px;
}

label {
  font-weight: 800;
}

.field-help {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.input-wrap {
  display: flex;
  align-items: stretch;
}

.input-prefix,
.input-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: var(--border);
  background: var(--paper);
  font-weight: 800;
}

.input-prefix {
  border-right: 0;
  border-radius: 10px 0 0 10px;
}

.input-suffix {
  border-left: 0;
  border-radius: 0 10px 10px 0;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.input-wrap input {
  border-radius: 0 10px 10px 0;
}

.input-wrap input.with-suffix {
  border-radius: 10px 0 0 10px;
}

.field-mini {
  width: auto;
  min-width: 88px;
}

details.help {
  margin-top: 9px;
  font-size: 0.87rem;
}

details.help summary {
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

details.help p {
  margin: 8px 0 0;
  color: var(--muted);
}

.form-inline {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 10px;
}

.result-card {
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.result-top {
  padding: 34px;
  background: var(--ink);
  color: white;
}

.result-top .eyebrow {
  color: #a8c2ff;
}

.big-result {
  display: block;
  margin: 10px 0 6px;
  color: var(--orange);
  font-family: 'Roboto Slab', Georgia, serif;
  font-size: clamp(3.6rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
}

.result-top p {
  max-width: 560px;
  margin: 12px 0 0;
  color: #e5e7eb;
}

.result-body {
  padding: 28px 34px 34px;
}

.result-explain {
  padding: 16px;
  border-left: 5px solid var(--orange);
  background: var(--orange-soft);
  font-weight: 600;
}

.breakdown {
  margin: 24px 0;
  display: grid;
  gap: 10px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #b8becb;
}

.breakdown-row strong {
  white-space: nowrap;
}

.math-box {
  margin-top: 22px;
  padding: 18px;
  border: 1.5px dashed var(--ink);
  border-radius: 12px;
  background: var(--paper);
}

.math-box summary {
  font-weight: 800;
  cursor: pointer;
}

.math-box p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tip {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: #183160;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 28px;
}

.support-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  padding: 32px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--orange);
  box-shadow: var(--shadow);
}

.support-card h2 {
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.support-card p:not(.eyebrow) {
  max-width: 760px;
  margin-bottom: 0;
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 4px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 900px) {
  .hero,
  .calculator-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 48px;
  }

  .lab-note {
    max-width: 560px;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .philosophy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-card {
    position: static;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
  }

  nav {
    gap: 12px;
    font-size: 0.8rem;
  }

  nav a:not(.nav-support) {
    display: none;
  }

  .hero {
    gap: 34px;
  }

  h1 {
    font-size: clamp(2.85rem, 15vw, 4.5rem);
  }

  .tool-grid,
  .philosophy-grid,
  .support-card {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 220px;
  }

  .support-card .button {
    width: 100%;
  }

  .footer-meta {
    flex-direction: column;
  }

  .calculator-card,
  .result-top,
  .result-body {
    padding-left: 20px;
    padding-right: 20px;
  }
}


.form-section-label {
  margin: 34px 0 18px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--ink);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.inline-tool-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 800;
  text-underline-offset: 3px;
}

.book-rows {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.book-input-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.book-number {
  font-family: 'Roboto Slab', Georgia, serif;
  font-weight: 800;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.muted-action {
  color: var(--muted);
}

.mini-warning {
  margin: 0;
  padding: 14px 16px;
  border: 1.5px dashed var(--ink);
  border-radius: 10px;
  background: #fff9d8;
  color: #554b1e;
  font-size: 0.88rem;
}

.series-bars {
  display: grid;
  gap: 16px;
  margin: 26px 0;
}

.series-bar-row {
  display: grid;
  gap: 5px;
}

.series-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.series-bar-track {
  height: 16px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.series-bar-track span {
  display: block;
  height: 100%;
  border-right: 1.5px solid var(--ink);
  background: var(--orange);
  transition: width 180ms ease;
}

.series-bar-row small {
  color: var(--muted);
  font-size: 0.74rem;
}

.next-tools {
  margin: 8px 0 54px;
  padding: 30px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.next-tools h2 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
}


/* V2 calculator visuals: one explanatory graphic per result, never dashboard clutter. */
.result-visual {
  margin: 24px 0;
}

.compare-track {
  height: 18px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.compare-track > span {
  display: block;
  height: 100%;
  background: var(--orange);
}

.compare-track.blue > span {
  background: var(--blue);
}

.compare-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 700;
}

.compare-pair {
  display: grid;
  gap: 14px;
}

.threshold {
  position: relative;
  height: 18px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-soft) 0 50%, var(--orange-soft) 50% 100%);
}

.threshold-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 26px;
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(-2px);
}

.visual-caption {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.scenario-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.scenario-item {
  min-width: 0;
  padding: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
}

.scenario-item strong,
.scenario-item span {
  display: block;
}

.scenario-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.goal-progress {
  height: 20px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.goal-progress > span {
  display: block;
  height: 100%;
  background: var(--orange);
  transition: width 180ms ease;
}

.compact-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 620px) {
  .scenario-strip {
    grid-template-columns: 1fr;
  }
}


.tool-group + .tool-group {
  margin-top: 46px;
  padding-top: 42px;
  border-top: 1px solid rgba(17, 24, 39, 0.18);
}

.tool-group-heading {
  max-width: 720px;
  margin-bottom: 20px;
}

.tool-group-heading h3 {
  margin: 0 0 7px;
  font-family: 'Roboto Slab', Georgia, serif;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.tool-group-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.tool-grid-short {
  grid-template-columns: minmax(0, 380px);
}

@media (max-width: 900px) {
  .tool-grid-short {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }
}


.method-grid {
  display: grid;
  gap: 18px;
  margin-top: -18px;
}

.method-card {
  padding: 24px 26px;
  border-top: 1px solid rgba(17, 24, 39, 0.18);
}

.method-card:first-child {
  border-top: 0;
}

.method-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.method-card p {
  max-width: 850px;
  margin: 8px 0 0;
  color: #333a48;
}

.method-card a {
  color: var(--blue);
  font-weight: 700;
}

/* Reliability states and quieter supporting UI. */
[hidden] { display: none !important; }
.calculator-status { margin: 0; padding: 28px; font-weight: 600; }
[aria-invalid="true"] { border-color: #a52222; outline-color: #a52222; }
.tool-name { color: var(--blue); font-size: .8rem; font-weight: 800; margin-bottom: 14px; }
.page-head { padding-top: 34px; padding-bottom: 24px; }
.page-head h1 { max-width: 980px; font-size: clamp(2.25rem, 4.5vw, 3.8rem); }
.calculator-card { border-color: #aeb6c6; box-shadow: none; }
.tip { background: #f1f5fc; border-radius: 8px; }
.math-box { border: 0; border-top: 1px solid #c8ced9; border-radius: 0; background: transparent; padding: 16px 0 0; }
.next-tools { background: transparent; border: 0; border-top: 1px solid #c8ced9; border-radius: 0; padding: 28px 0; }
.next-tools .button { margin: 0 10px 12px 0; }
.big-result { overflow-wrap: anywhere; }
.breakdown-row { flex-wrap: wrap; }
input, select { min-width: 0; }
button:disabled { opacity: .5; cursor: default; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
