:root {
  --navy:       #154A72;
  --navy-deep:  #0E3350;
  --navy-mid:   #4A82B0;
  --tan:        #C8853C;
  --tan-deep:   #A2672A;
  --rust:       #9A3F36;
  --sand:       #F8F3EA;
  --sand-deep:  #F0E7D7;
  --panel:      #FFFFFF;
  --ink:        #1A2B35;
  --mute:       #5F7382;
  --line:       #E0D9CB;
  --listed:     #1E6E52;
  --elsewhere:  #2A6090;
  --missing:    #A2672A;

  --sans: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-synthesis-weight: none;
}

a { color: inherit; }

/* ---------- masthead ---------- */

.masthead { background: var(--navy); color: #fff; }

.masthead-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15.5px;
}

.brand-arch { width: 26px; height: 16px; color: var(--tan); flex: none; }

.masthead-link {
  font-size: 14.5px;
  font-weight: 600;
  color: #CBDDE9;
  text-decoration: none;
}

.masthead-link:hover { color: #fff; }

/* ---------- stage ---------- */

.stage {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  padding: 34px 22px 40px;
}

.stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -260px;
  width: 900px;
  height: 900px;
  margin-left: -450px;
  border-radius: 50%;
  border: 1px solid rgba(200,133,60,0.22);
  pointer-events: none;
}

.stage-inner {
  position: relative;
  max-width: 1020px;
  margin: 0 auto;
}

h1 {
  font-size: clamp(31px, 7.6vw, 46px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.028em;
  margin: 0 0 14px;
  max-width: 15ch;
  text-wrap: balance;
}

.stand {
  margin: 0;
  color: #C0D6E4;
  font-size: 17.5px;
  max-width: 44ch;
}

.pets {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 14px auto 16px;
}

/* ---------- console ---------- */

.console {
  position: relative;
  z-index: 1;
  background: var(--panel);
  color: var(--ink);
  border-radius: 7px;
  padding: 22px 20px 24px;
  box-shadow: 0 18px 40px rgba(6,32,50,0.32);
  border-top: 5px solid var(--tan);
}

.field-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 9px;
}

.entry {
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--navy);
}

#chip {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 6px 2px 10px;
  font-family: var(--mono);
  font-size: clamp(21px, 5.6vw, 28px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  outline: none;
}

#chip::placeholder { color: #C2CBD2; }

.entry:focus-within { border-bottom-color: var(--tan); }

.sweep {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42%;
  height: 2px;
  background: var(--tan);
  transform: translateX(-110%);
  opacity: 0;
}

.console.busy .sweep {
  opacity: 1;
  animation: sweep 1.05s cubic-bezier(.45,0,.55,1) infinite;
}

@keyframes sweep {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(355%); }
}

.help {
  margin: 11px 0 18px;
  font-size: 14.5px;
  color: var(--mute);
  max-width: 46ch;
}

.go {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--tan);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 16px 20px;
  cursor: pointer;
}

.go:hover { background: var(--tan-deep); }

.go[disabled] { opacity: 0.6; cursor: default; }

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

.assurance {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--mute);
}

.assurance li { position: relative; padding-left: 13px; }

.assurance li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tan);
}

/* ---------- result ---------- */

.result { outline: none; }

.result h2 {
  font-size: clamp(21px, 5vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.018em;
  margin: 0 0 10px;
  font-weight: 800;
}

.result p { margin: 0 0 14px; max-width: 46ch; }

.checked {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--mute);
  margin: 0 0 12px;
}

.verdict {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 13px;
}

.r-listed    .verdict { background: var(--listed); }
.r-elsewhere .verdict { background: var(--elsewhere); }
.r-missing   .verdict { background: var(--missing); }
.r-snag      .verdict { background: var(--mute); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 6px;
  padding: 15px 24px;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-main { background: var(--tan); color: #fff; }
.btn-main:hover { background: var(--tan-deep); }

.btn-quiet {
  background: transparent;
  color: var(--navy);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.btn-quiet:hover { box-shadow: inset 0 0 0 1.5px var(--navy-mid); }

.aside {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--mute);
  max-width: 46ch;
}

.again {
  background: none;
  border: 0;
  padding: 0;
  margin-top: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--mute);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.again:hover { color: var(--navy); }

.note {
  margin: 11px 0 0;
  font-size: 14.5px;
  color: var(--missing);
  font-weight: 600;
}

/* ---------- band ---------- */

.band {
  background: var(--sand-deep);
  padding: 62px 22px 44px;
}

.band-inner { max-width: 1020px; margin: 0 auto; }

.band h2 {
  font-size: clamp(23px, 5.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.022em;
  margin: 0 0 26px;
  max-width: 20ch;
}

.steps { display: grid; gap: 26px; }

.step svg { width: 46px; height: 46px; color: var(--rust); display: block; margin-bottom: 8px; }

.step h3 {
  font-size: 17.5px;
  font-weight: 700;
  margin: 0 0 5px;
  letter-spacing: -0.012em;
}

.step p { margin: 0; color: #46606E; font-size: 16px; max-width: 40ch; }

/* ---------- reading ---------- */

.reading { max-width: 1020px; margin: 0 auto; padding: 50px 22px 10px; }

.reading h2 {
  font-size: clamp(22px, 5.2vw, 28px);
  font-weight: 800;
  letter-spacing: -0.022em;
  margin: 44px 0 18px;
  max-width: 24ch;
}

.reading h2:first-child { margin-top: 0; }

.outcome {
  border-left: 4px solid var(--tan);
  padding: 2px 0 2px 16px;
  margin-bottom: 20px;
  max-width: 58ch;
}

.outcome h3 { font-size: 17.5px; font-weight: 700; margin: 0 0 4px; }

.outcome p { margin: 0; color: #46606E; }

details {
  border-bottom: 1px solid var(--line);
  max-width: 58ch;
}

details:first-of-type { border-top: 1px solid var(--line); }

summary {
  cursor: pointer;
  padding: 15px 0;
  font-weight: 600;
  font-size: 16.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  color: var(--tan);
  font-weight: 700;
  font-size: 21px;
  line-height: 1;
  flex: none;
}

details[open] summary::after { content: "\2013"; }

details p { margin: 0 0 16px; color: #46606E; }

/* ---------- footer ---------- */

footer { margin-top: 40px; border-top: 1px solid var(--line); background: var(--sand-deep); }

.footer-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 26px 22px 40px;
  font-size: 14px;
  color: var(--mute);
}

.foot-brand { margin: 0 0 6px; font-weight: 700; color: var(--navy); }
.foot-note { margin: 0 0 12px; max-width: 54ch; }
.foot-links { margin: 0; }
.foot-links a { margin-right: 16px; text-underline-offset: 3px; }

/* ---------- wider screens ---------- */

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .go { width: auto; min-width: 290px; }
}

@media (min-width: 980px) {
  .stage { padding: 62px 22px 72px; }

  .stage::before {
    top: -330px;
    width: 1100px;
    height: 1100px;
    margin-left: -550px;
  }

  .stage-inner {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 56px;
    align-items: start;
  }

  h1 { font-size: 50px; max-width: 16ch; }

  .pets { max-width: 500px; margin: 30px 0 0 -14px; }

  .console { margin-top: 4px; }
  .pets { margin-bottom: -40px; }
}

@media (prefers-reduced-motion: reduce) {
  .console.busy .sweep {
    animation: none;
    opacity: 1;
    transform: translateX(0);
    width: 100%;
  }
}
