:root {
  color-scheme: light;
  --navy: #14122f;
  --navy-2: #241e62;
  --green: #22e07a;
  --green-deep: #0b6b3a;
  --ink: #17182b;
  --muted: #5c6478;
  --line: #e3e6f0;
  --paper: #f3f5fb;
  --card: #ffffff;
  --danger: #9d1230;
  --danger-bg: #fff1f4;
  --shadow: 0 12px 40px rgba(20, 18, 47, 0.08);
  --radius: 16px;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 1.05rem;
}

a { color: var(--navy-2); }

a:hover { color: var(--green-deep); }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: #fff;
  color: var(--navy);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  z-index: 5;
}

.skip:focus { top: 0.75rem; }

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(90deg, var(--navy-2), var(--navy));
  border-bottom: 4px solid var(--green);
  color: #fff;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
  padding: 0.7rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 1.15rem;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.site-header nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-header nav a:hover { color: #fff; }

.preview {
  margin: 0;
  padding: 0.55rem 1rem;
  text-align: center;
  background: #fff4cc;
  color: #3a2a00;
}

main.home { padding-bottom: 1rem; }

main.page,
main.report {
  width: min(820px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

main.report { width: min(980px, calc(100% - 2rem)); }

.hero {
  color: #fff;
  background-color: var(--navy);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(155deg, #2a2578 0%, var(--navy-2) 38%, var(--navy) 100%);
  background-size: 28px 28px, 28px 28px, cover;
  padding: 2.15rem 0 2.2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  grid-template-rows: auto 1fr;
  column-gap: 2rem;
  row-gap: 0.5rem;
  align-items: start;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.03em; }

.hero h1 {
  margin: 0.25rem 0 0.3rem;
  font-size: clamp(2rem, 4vw, 3.15rem);
  max-width: 16ch;
}

.hero .subline {
  margin: 0 0 0.65rem;
  font-size: clamp(1.2rem, 2.05vw, 1.42rem);
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 22em;
}

.hero-copy { grid-column: 1; grid-row: 1; }
.hero-form { grid-column: 2; grid-row: 1 / span 2; }
.why { grid-column: 1; grid-row: 2; align-self: start; }
.why h2 { margin: 0 0 0.5rem; font-size: 1.05rem; color: #fff; letter-spacing: -0.01em; }
.why ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.why li { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.95rem; line-height: 1.35; color: rgba(255, 255, 255, 0.88); }
.why li strong { color: #fff; }
.why-icon { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: rgba(34, 224, 122, 0.18); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; align-self: flex-start; margin-top: 0.05rem; }
.why .short { display: none; }
@media (max-width: 600px) {
  .why { margin-top: 0; }
  .why h2 { font-size: 0.95rem; margin-bottom: 0.3rem; }
  .why ul { gap: 0.15rem; }
  .why li { font-size: 0.9rem; gap: 0.45rem; line-height: 1.3; align-items: center; }
  .why .long { display: none; }
  /* Above the fold on a phone: headline, subline, the four points, then the start of the form. */
  .hero-copy .deck, .hero-copy .eyebrow { display: none; }
  .hero { padding: 0.9rem 0 1.3rem; }
  .hero h1 { font-size: 1.62rem; margin: 0 0 0.2rem; }
  .hero .subline { font-size: 1.08rem; font-weight: 650; margin: 0 0 0.5rem; max-width: none; line-height: 1.25; }
  .why { order: 2; }
  .hero-form { order: 3; }
  .why .short { display: inline; }
  .why-icon { width: 1.1rem; height: 1.1rem; font-size: 0.65rem; margin-top: 0; align-self: center; }
}

.deck { font-size: 1.12rem; color: rgba(255, 255, 255, 0.88); max-width: 42rem; }

.headline {
  margin: 0.2rem 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--muted);
}

.headline.ready {
  font-size: 1.55rem;
  font-weight: 750;
  color: var(--navy);
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack { padding: 2.4rem 0 3rem; }

.stack > section,
.page > section,
.report > section { margin: 0 0 1.6rem; }

.card, .engine, .info-card, .price, .example, details, .problem {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* The card sits inside the white-text hero, so it must set its own text color or its labels vanish. */
.card { color: var(--ink); }

form.card, .price, .example, .problem { padding: 1.15rem 1.2rem 1.25rem; }

form.card {
  display: grid;
  gap: 0.75rem;
}

.form-title { margin: 0.15rem 0 0.2rem; font-size: 1.35rem; }

form.card label,
.combo {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

form.card input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
form.card select,
.combo-search {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #b7bdd2;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 48px;
  appearance: none;
}

form.card select {
  background-image: linear-gradient(45deg, transparent 50%, var(--navy-2) 50%), linear-gradient(135deg, var(--navy-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

form.card input:not([type="checkbox"]):not([type="hidden"]):focus,
form.card select:focus,
.combo-search:focus {
  border-color: var(--navy-2);
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.combo { position: relative; min-width: 0; }

.combo:not(.is-ready) .combo-search,
.combo:not(.is-ready) .combo-menu { display: none; }

.combo.is-ready select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.combo-free { gap: 0.35rem; }

.combo.is-ready .combo-search,
.combo-free.is-ready input { padding-right: 48px; text-overflow: ellipsis; }

.combo-toggle { display: none; }
.combo.is-ready .combo-toggle {
  display: block;
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
}
.combo.is-ready .combo-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -6px 0 0 -4px;
  border-right: 2px solid var(--navy-2);
  border-bottom: 2px solid var(--navy-2);
  transform: rotate(45deg);
}
.combo.is-open .combo-toggle::after { margin-top: -2px; transform: rotate(225deg); }
.combo-free:not(.is-ready) .combo-menu { display: none; }
.combo-menu[hidden] { display: none; }

.combo-menu {
  position: absolute;
  z-index: 50;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  margin: 0;
  padding: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid #b7bdd2;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.combo-menu .combo-option {
  display: flex;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: 16px;
  font-weight: 550;
  justify-content: flex-start;
  text-align: left;
}

.combo-menu .combo-option[aria-selected="true"],
.combo-menu .combo-option:hover {
  background: #eef1f8;
  color: var(--ink);
}

label.check {
  flex-direction: row;
  align-items: flex-start;
  font-weight: 550;
}

label.check input { width: 1.15rem; height: 1.15rem; min-height: 0; margin-top: 0.15rem; }

.hint, .source, .note, .meter-label { color: var(--muted); font-size: 0.92rem; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--green);
  color: var(--navy);
  font-family: inherit;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 12px 18px;
  cursor: pointer;
}

button:focus-visible, .button:focus-visible {
  outline: 3px solid var(--navy-2);
  outline-offset: 2px;
}

form.card button[type="submit"] { width: 100%; }

button:hover, .button:hover { background: #49f196; }

.button.secondary, button.secondary {
  background: transparent;
  color: var(--navy-2);
  box-shadow: inset 0 0 0 1.5px #c9cee0;
}

.button.secondary:hover, button.secondary:hover { background: #eef1f8; }

.form-error { color: var(--danger); font-weight: 700; margin: 0; }

.form-error[hidden], [hidden] { display: none !important; }

ol.steps, .cards, .info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 0;
  margin: 0 0 1.4rem;
  list-style: none;
}

ol.steps { counter-reset: step; }

ol.steps li, .info-card, .engine {
  padding: 1rem 1rem 1.1rem;
}

ol.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.7rem;
  border-radius: 999px;
  background: var(--navy-2);
  color: #fff;
  font-weight: 750;
}

.engine h2, .info-card h3, .example h2, .price h2 { margin: 0 0 0.35rem; }

.count { margin: 0.2rem 0 0.7rem; font-weight: 650; }

.meter-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
}

.meter {
  height: 0.5rem;
  border-radius: 999px;
  background: #e6e9f4;
  overflow: hidden;
}

.meter > span, .meter > [data-bar] {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--navy-2), var(--green));
  border-radius: inherit;
}

.meter > [data-w="1"] { width: 10%; }
.meter > [data-w="2"] { width: 20%; }
.meter > [data-w="3"] { width: 30%; }
.meter > [data-w="4"] { width: 40%; }
.meter > [data-w="5"] { width: 50%; }
.meter > [data-w="6"] { width: 60%; }
.meter > [data-w="7"] { width: 70%; }
.meter > [data-w="8"] { width: 80%; }
.meter > [data-w="9"] { width: 90%; }
.meter > [data-w="10"] { width: 100%; }

.spin {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid rgba(36, 30, 98, 0.2);
  border-top-color: var(--navy-2);
  display: none;
}

.engine.is-busy .spin { display: inline-block; animation: spin 0.8s linear infinite; }
.tick { display: none; color: var(--green-deep); font-weight: 700; line-height: 1; }
.engine.is-done:not(.is-busy) .tick { display: inline-block; animation: none; }
.engine.is-done:not(.is-busy) .spin { display: none; animation: none; }
.engine.is-done:not(.is-busy) .meter > span { width: 100%; animation: none; }

.engine.is-skeleton .meter > span {
  width: 40% !important;
  background: linear-gradient(90deg, #e6e9f4, #f7f8fc, #e6e9f4);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spin, .engine.is-skeleton .meter > span { animation: none; }
}

.example { margin: 0.4rem 0 1.6rem; }

.badge {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e8fff3;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.price {
  display: grid;
  gap: 0.35rem;
  background: linear-gradient(180deg, #fff, #f4fff8);
}

.price-figure {
  margin: 0;
  font-size: 3rem;
  font-weight: 750;
  letter-spacing: -0.04em;
  color: var(--navy);
}

details { padding: 0.85rem 1rem; margin: 0.55rem 0; }

summary { cursor: pointer; font-weight: 750; }

.problem {
  border-color: #f3c2cc;
  background: var(--danger-bg);
  margin: 0 0 1rem;
}

.problem h2 { margin-top: 0; }

.note {
  margin-top: 1.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.82);
  padding: 2rem 0 2.4rem;
}

.site-footer a { color: #fff; }

.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }

.footer-brand { color: #fff; font-weight: 750; margin-bottom: 0.35rem; }

pre.sample, .kit pre {
  overflow: auto;
  background: var(--navy);
  color: #e7ebf8;
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.cta {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
}

ul.plain { padding-left: 1.15rem; }

ul.plain li { margin: 0.35rem 0; }

.kit-fixes-label {
  margin: 0.85rem 0 0.15rem;
  font-weight: 750;
}

.kit-fixes {
  margin: 0.15rem 0 0;
}

.kit-fixes li {
  margin: 0.28rem 0;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-rows: none; row-gap: 1rem; }
  .hero-copy, .hero-form, .why { grid-column: 1; grid-row: auto; }
  .hero h1 { max-width: none; }
  form.card { width: 100%; }
}

@media (max-width: 900px) {
  ol.steps, .cards, .info-grid { grid-template-columns: 1fr; }
  .hero { padding: 1.5rem 0 1.7rem; }
}

.answers-in { font-weight: 600; margin: 0.25rem 0 0.75rem; }
li[data-state="waiting"] > p:first-child { color: var(--muted); }
li[data-state="waiting"] > p:first-child strong { display: inline-block; animation: row-pulse 1.2s ease-in-out infinite; }
li[data-state="in"] > p:first-child strong { animation: row-in 0.4s ease-out; }
@keyframes row-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes row-in { from { opacity: 0.3; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { li[data-state] > p:first-child strong { animation: none; } }

li[data-state="skipped"], li[data-state="skipped"] > p { color: var(--muted); }
li[data-state="skipped"] > p:first-child strong { font-weight: 500; }

.answer-meta {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--muted);
  font-weight: 400;
}
@media (max-width: 600px) {
  .answer-meta { font-size: 0.72rem; margin-top: 0.1rem; }
}


.writing { color: var(--muted); animation: row-pulse 1.2s ease-in-out infinite; }

button[aria-disabled="true"] { opacity: 0.65; cursor: progress; }
button:disabled, .button:disabled { opacity: 0.55; cursor: not-allowed; }

/* Paid answers: safe HTML from engine text, and short source chips. */
.answer-text { margin: 0.35rem 0 0.5rem; padding-left: 0.85rem; border-left: 3px solid var(--line); }
.answer-text p { margin: 0 0 0.5rem; }
.answer-text ul, .answer-text ol { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.answer-text a { overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.8rem; }
a.chip {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}
a.chip:hover { color: var(--ink); border-color: var(--muted); }
