/* Power Cut Money Back: "Lights Back On" design (concept 2, chosen 16 Sep 2026).
   Tokens and components baked from design/concepts/direction-2-lights-back-on.html. */

:root {
  color-scheme: light;
  --bulb: #FFC23D;
  --bulb-deep: #E3A012;
  --bulb-pale: #FFF5DA;
  --night: #1B1745;
  --night-deep: #120F33;
  --night-raise: #262058;
  --dusk: #2D2770;
  --dusk-lift: #4C4598;
  --blue: #5B8CFF;
  --blue-ink: #3A5FD0;
  --blue-soft: #AFC5FF;
  --bg: #FFFFFF;
  --surface: #F4F3FB;
  --card: #FFFFFF;
  --card-hover: #FCFBFF;
  --input-bg: #FFFFFF;
  --note-bg: #EEF2FF;
  --footer-alt: #EDEBF7;
  --line: #DCD8EE;
  --ring: #6D67A0;
  --text: #1A1838;
  --muted: #5E5B7A;
  --on-night: #F3F0FF;
  --on-night-muted: #BEB8E2;
  --warm-white: #FFF3D6;
  --caution: #B3261E;
  --caution-soft: #FDECEA;
  --glow: 255 194 61;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 1.25rem;
  --col: 40rem;
  --bx: calc(100% - 2.6rem);
  --by: 4.4rem;
}

@property --r {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font: 400 1.0625rem/1.55 var(--body);
  color: var(--text);
  background: var(--bg);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

/* The ground fills whatever is left, so a short page never ends in a blank band. */
.page-ground {
  flex: 1;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--blue-ink);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 0.5rem;
}

[tabindex="-1"]:focus {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

p {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: inherit;
}

.col {
  width: min(100% - 2 * var(--gutter), var(--col));
  margin-inline: auto;
}

/* The sky: header, hero, progress */

.sky {
  position: relative;
  color: var(--on-night);
  padding-bottom: 4.75rem;
  border-radius: 0 0 58% 42% / 0 0 2.75rem 2rem;
  background: radial-gradient(130% 80% at 75% 0%, #231D5A 0%, var(--night) 48%, var(--night-deep) 100%);
}

.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--bx) var(--by), rgb(var(--glow) / 0.6) 0, rgb(var(--glow) / 0.26) 2.6rem, rgb(var(--glow) / 0.09) 9rem, transparent 19rem),
    radial-gradient(60% 40% at 30% 42%, rgb(var(--glow) / 0.07), transparent 70%);
}

body[data-stage="question"] .sky {
  --by: 4.1rem;
  padding-bottom: 5.25rem;
  background: linear-gradient(180deg, var(--night) 0%, var(--dusk) 55%, var(--dusk-lift) 100%);
}

body[data-stage="question"] .sky::before {
  background: radial-gradient(circle at var(--bx) var(--by), rgb(var(--glow) / 0.5) 0, rgb(var(--glow) / 0.2) 2.4rem, rgb(var(--glow) / 0.06) 8rem, transparent 15rem);
}

body[data-stage="result"] .sky {
  --by: 6.6rem;
  color: var(--text);
  background: transparent;
  padding-bottom: 0;
  border-radius: 0;
}

/* On the result the header is a small mark, not a banner. */
body[data-stage="result"] .site-header {
  min-height: 0;
  padding-block: 0.625rem 0.25rem;
}

body[data-stage="result"] .sky::before {
  content: none;
}

.site-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.625rem;
  min-height: 3.75rem;
  padding-block: 0.75rem;
  padding-right: 3.5rem;
}

.wordmark {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-weight: 650;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: inherit;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.test-tag {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.375rem 0.625rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  color: #E9E5FF;
}

body[data-stage="result"] .test-tag {
  background: var(--surface);
  color: var(--muted);
}

.pendant {
  position: absolute;
  top: 0;
  left: var(--bx);
  width: 2.5rem;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}

.pendant .cord {
  width: 2px;
  margin: 0 auto;
  height: calc(var(--by) - 2.4rem);
  background: linear-gradient(#3A3474, #5B549A);
}

body[data-stage="result"] .pendant .cord {
  background: linear-gradient(#D6D2EA, #9E98C4);
}

.pendant svg {
  display: block;
  width: 2.5rem;
  height: 3.5rem;
  overflow: visible;
}

.pendant .halo {
  position: absolute;
  left: 50%;
  top: calc(var(--by) - 0.1rem);
  width: 14rem;
  height: 14rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgb(var(--glow) / 0.7) 0, rgb(var(--glow) / 0.28) 22%, rgb(var(--glow) / 0.08) 45%, transparent 70%);
}

body[data-stage="result"] .pendant .halo {
  opacity: 0.5;
}

.hero {
  padding-top: 0.75rem;
}

.hero h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
}

.hero .h-ask {
  display: block;
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: clamp(1.5rem, 6.6vw, 2.25rem);
  line-height: 1.15;
  color: var(--on-night-muted);
}

.hero .h-answer {
  display: block;
  margin-top: 0.25rem;
  font-weight: 800;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: clamp(2.75rem, 12.6vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.022em;
  color: var(--warm-white);
  text-wrap: balance;
}

.lede {
  margin-top: 1rem;
  max-width: 32ch;
  color: var(--on-night);
}

.facts {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.facts li {
  display: flex;
  gap: 0.625rem;
  align-items: baseline;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--on-night-muted);
}

.facts strong {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--warm-white);
  white-space: nowrap;
}

.trust {
  margin-top: 1rem;
  max-width: 40ch;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--on-night-muted);
}

.facts li::before,
.fact::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  transform: translateY(-0.1rem);
  background: var(--bulb);
  box-shadow: 0 0 10px 3px rgb(var(--glow) / 0.55);
}

/* Progress: a string of festoon lights */

.progress {
  margin-top: 1.25rem;
}

body[data-stage="question"] .progress {
  margin-top: 1rem;
}

.progress-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #E6E2FF;
  font-variant-numeric: tabular-nums;
}

.festoon {
  position: relative;
  height: 2.75rem;
  margin-top: 0.375rem;
}

.festoon .cord-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 20px;
  overflow: visible;
}

.festoon .cord-line path {
  fill: none;
  stroke: #6A63A6;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.fb {
  position: absolute;
  top: calc(var(--sag) * 1px);
  left: calc((var(--k) - 0.5) / 6 * 100%);
  width: 1rem;
  transform: translateX(-50%);
}

.fb::before {
  content: "";
  display: block;
  width: 0.45rem;
  height: 0.35rem;
  margin: 0 auto;
  border-radius: 2px 2px 0 0;
  background: #77709F;
}

.fb::after {
  content: "";
  display: block;
  width: 1rem;
  height: 1.15rem;
  border-radius: 48% 48% 50% 50% / 38% 38% 62% 62%;
  background: rgb(255 255 255 / 0.08);
  border: 1.5px solid rgb(255 255 255 / 0.3);
  transition: box-shadow 0.4s, background 0.4s;
}

.fb.is-done::after,
.fb.is-current::after {
  border-color: #FFD877;
  background: radial-gradient(circle at 45% 38%, #FFF7DD 0 20%, var(--bulb) 60%, #EFA20F 100%);
  box-shadow: 0 0 calc(4px + var(--k) * 3px) calc(var(--k) * 1px) rgb(var(--glow) / calc(0.25 + var(--k) * 0.07));
}

.fb.is-current::after {
  box-shadow: 0 0 0 4px rgb(var(--glow) / 0.22), 0 0 calc(12px + var(--k) * 5px) calc(3px + var(--k) * 1.5px) rgb(var(--glow) / 0.62);
}

/* The question card */

.page-ground {
  background: linear-gradient(180deg, var(--surface) 0, var(--bg) 38rem);
}

body[data-stage="result"] .page-ground {
  background: var(--bg);
}

.card {
  position: relative;
  margin-top: -3.5rem;
  width: min(100% - 1.5rem, var(--col));
  margin-inline: auto;
  background: var(--card);
  border-radius: 1.75rem;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 0 0 1px rgb(27 23 69 / 0.05), 0 -22px 44px -26px rgb(var(--glow) / 0.75);
}

.card-foot {
  height: 3rem;
}

.q {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 60, "WONK" 0;
  font-weight: 600;
  font-size: clamp(1.5rem, 6.4vw, 2rem);
  line-height: 1.14;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.hint {
  margin-top: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 44ch;
}

.text-input {
  display: block;
  width: 100%;
  margin-top: 1.125rem;
  height: 3.75rem;
  padding: 0 1.125rem;
  font: 600 1.375rem/1 var(--body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--input-bg);
  border: 2px solid var(--ring);
  border-radius: 1rem;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.text-input.input-sm {
  margin-top: 0;
  height: 3.25rem;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.text-input::placeholder {
  color: #6D67A0;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.text-input:hover {
  border-color: #6D67A0;
}

.text-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgb(91 140 255 / 0.3);
}

.text-input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.text-input[aria-invalid="true"] {
  border-color: var(--caution);
}

.text-input:disabled {
  background: var(--surface);
  color: var(--muted);
  cursor: not-allowed;
}

.time-pair {
  margin-top: 1.25rem;
}

.pair-label {
  font-weight: 650;
  margin-bottom: 0.5rem;
}

.date-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.small-field span {
  display: block;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.is-disabled span {
  color: var(--muted);
}

.is-disabled .pair-label,
.is-disabled .small-field span {
  color: var(--ring);
}

/* Options */

.options {
  display: grid;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 4rem;
  padding: 0.875rem 1.125rem;
  border: 2px solid var(--line);
  border-radius: 1.25rem;
  background: var(--card);
  cursor: pointer;
  line-height: 1.35;
  transition: border-color 0.2s, background-color 0.25s, transform 0.12s;
}

.option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.option .dot {
  position: relative;
  flex: none;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  border: 2px solid var(--ring);
  background: var(--card);
  transition: background 0.3s, box-shadow 0.35s, border-color 0.2s;
}

.option .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--text);
  transform: scale(0);
  transition: transform 0.2s;
}

.option .box {
  position: relative;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.45rem;
  border: 2px solid var(--ring);
  background: var(--card);
  transition: background 0.25s, border-color 0.2s, box-shadow 0.3s;
}

.option .box::after {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 0.16rem;
  width: 0.35rem;
  height: 0.7rem;
  border: solid var(--text);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s;
}

.option:hover {
  border-color: var(--ring);
  background: var(--card-hover);
}

.option:active {
  transform: scale(0.99);
}

.option input:checked + .dot {
  border-color: var(--bulb-deep);
  background: radial-gradient(circle at 42% 36%, #FFF8E0 0 18%, var(--bulb) 58%, #F0A712 100%);
  box-shadow: 0 0 0 5px rgb(var(--glow) / 0.22), 0 0 22px 7px rgb(var(--glow) / 0.5);
}

.option input:checked + .dot::after {
  transform: scale(1);
}

.option input:checked + .box {
  border-color: var(--bulb-deep);
  background: var(--bulb);
  box-shadow: 0 0 0 4px rgb(var(--glow) / 0.22);
}

.option input:checked + .box::after {
  transform: rotate(45deg) scale(1);
}

.option:has(input:checked) {
  border-color: var(--bulb-deep);
  background: var(--bulb-pale);
}

.option:has(input:checked) .opt-text {
  font-weight: 600;
}

/* The inputs are transparent, so the option itself carries the focus ring.
   focus-within also covers browsers without :has() and programmatic focus after an error. */
.option:focus-within,
.option:has(input:focus-visible) {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.option input[aria-invalid="true"] ~ .dot {
  border-color: var(--caution);
}

.options-row {
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 0.5rem;
}

.options-row .option {
  min-height: 3.25rem;
  padding: 0.625rem 0.75rem;
  gap: 0.5rem;
  border-radius: 999px;
}

.options-row .option .dot,
.options-pair .option .dot {
  width: 1.25rem;
  height: 1.25rem;
}

.options-row .option input:checked + .dot,
.options-pair .option input:checked + .dot {
  box-shadow: 0 0 0 4px rgb(var(--glow) / 0.22), 0 0 14px 4px rgb(var(--glow) / 0.5);
}

.options-pair {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.options-pair .option {
  min-height: 3.25rem;
  padding: 0.625rem 0.875rem;
  gap: 0.625rem;
  border-radius: 1rem;
}

.option-check {
  margin-top: 1.25rem;
}

.sub-question + .sub-question {
  margin-top: 1.75rem;
}

.sub-question > legend {
  font-weight: 650;
  line-height: 1.35;
  max-width: 44ch;
}

.sub-question > .hint {
  margin-top: 0.375rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.5rem;
  padding: 0 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 700 1.0625rem/1.2 var(--body);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.3s, transform 0.12s, background-color 0.2s, border-color 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  cursor: progress;
  opacity: 0.75;
}

.btn-primary {
  background: var(--bulb);
}

.btn-primary:hover {
  box-shadow: 0 0 0 6px rgb(var(--glow) / 0.22), 0 0 30px 6px rgb(var(--glow) / 0.45);
}

.btn-quiet {
  background: transparent;
  border-color: var(--ring);
}

.btn-quiet:hover {
  border-color: var(--text);
  background: var(--surface);
}

.btn-block {
  width: 100%;
  margin-top: 1.25rem;
}

.step-nav {
  display: flex;
  gap: 0.625rem;
  margin-top: 1.5rem;
}

.step-nav .btn-primary {
  flex: 1;
}

.step-error {
  margin-top: 1rem;
  color: var(--caution);
  font-weight: 600;
}

.step-error:empty {
  display: none;
}

/* Result */

.result {
  padding-top: 0;
}

.lit-panel {
  position: relative;
  padding-top: 0.75rem;
  padding-bottom: 1.75rem;
}

.lit-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  left: -4rem;
  right: -4rem;
  top: 1.5rem;
  height: 15rem;
  background: radial-gradient(48% 52% at 36% 58%, rgb(var(--glow) / 0.62) 0, rgb(var(--glow) / 0.3) 42%, rgb(var(--glow) / 0.1) 70%, transparent 100%);
  filter: blur(2px);
}

[data-kind="none"] .lit-panel::before,
[data-kind="unsupported"] .lit-panel::before {
  background: radial-gradient(48% 52% at 36% 58%, rgb(126 120 168 / 0.22) 0, rgb(126 120 168 / 0.1) 55%, transparent 100%);
}

.lit-panel > * {
  position: relative;
}

.result-kicker {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--muted);
}

.result-amount {
  margin-top: 0.25rem;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 850;
  font-size: clamp(3.25rem, 16vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

[data-kind="unsupported"] .result-amount {
  font-size: clamp(2rem, 9vw, 3.5rem);
  letter-spacing: -0.02em;
}

.result-lead {
  margin-top: 0.625rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 80, "WONK" 0;
  font-weight: 650;
  font-size: clamp(1.25rem, 5.4vw, 1.625rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 24ch;
}

.result-lead:empty {
  display: none;
}

.result-condition {
  margin-top: 0.75rem;
  max-width: 36ch;
  line-height: 1.5;
  color: var(--muted);
}

.alert {
  margin-top: 1.5rem;
  background: var(--caution-soft);
  border: 1.5px solid var(--caution);
  border-radius: 1.25rem;
  padding: 1.125rem 1.25rem;
}

.alert h2 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 70;
  font-weight: 650;
  font-size: 1.25rem;
  line-height: 1.2;
  margin-bottom: 0.375rem;
}

.alert a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-weight: 700;
}

.receipt {
  margin: 1.5rem 0 0;
  background: var(--surface);
  border-radius: 1.5rem;
  padding: 0.375rem 1.25rem;
}

.receipt > div {
  padding: 1rem 0;
  border-top: 1.5px dashed var(--line);
}

.receipt > div:first-child {
  border-top: 0;
}

.receipt dt {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.receipt dd {
  margin: 0.25rem 0 0;
  line-height: 1.5;
}

.receipt .date {
  display: block;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-weight: 700;
  font-size: clamp(1.875rem, 8.4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.receipt .date-note {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  line-height: 1.45;
}

.receipt .is-caution .date {
  color: var(--caution);
  font-size: 1.375rem;
}

.receipt .is-duration .date {
  font-size: 1.375rem;
  font-weight: 600;
}

.receipt .is-caution dd {
  color: var(--caution);
  font-weight: 600;
}

.section-title {
  margin-top: 3rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 70, "WONK" 0;
  font-weight: 650;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.steps {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  counter-reset: step;
}

.steps > li {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  padding-bottom: 1.5rem;
  counter-increment: step;
}

.steps > li:last-child {
  padding-bottom: 0;
}

.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.25rem - 1px);
  top: 2.75rem;
  bottom: 0.25rem;
  border-left: 2px dotted #C9C4E2;
}

.steps > li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.125rem;
  line-height: 1;
}

.steps > li > * {
  grid-column: 2;
  padding-top: 0.45rem;
}

.steps a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* What to say to the operator, set as spoken lines */
.asks {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.375rem;
}

.asks li {
  font-family: var(--display);
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.1875rem;
  line-height: 1.3;
  padding: 0.625rem 0.875rem;
  background: var(--surface);
  border-radius: 1rem 1rem 1rem 0.25rem;
}

.claim-link {
  margin-top: 0.875rem;
}

.notes {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.notes p {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 1rem 1.125rem;
  border-radius: 1.25rem;
  background: var(--note-bg);
  line-height: 1.5;
}

.notes p::before {
  content: "i";
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.05rem;
  border-radius: 50%;
  background: var(--blue-ink);
  color: #fff;
  font: italic 700 0.875rem/1 var(--display);
}

.notes p.is-caution {
  background: var(--caution-soft);
}

.notes p.is-caution::before {
  content: "!";
  background: var(--caution);
  font-style: normal;
}

.notes:empty {
  display: none;
}

.working {
  margin-top: 2rem;
  border-top: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
}

.working summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.5rem 0;
  cursor: pointer;
  font-family: var(--display);
  font-variation-settings: "SOFT" 70;
  font-weight: 600;
  font-size: 1.25rem;
}

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

.working summary .plus {
  position: relative;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--surface);
  transition: background 0.2s;
}

.working summary .plus::before,
.working summary .plus::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.875rem;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

.working summary .plus::after {
  transform: rotate(90deg);
  transition: transform 0.3s;
}

.working[open] summary .plus::after {
  transform: rotate(0deg);
}

.working summary:hover .plus {
  background: var(--card-hover);
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

thead th {
  text-align: left;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--muted);
  padding: 0 0.75rem 0.5rem 0;
}

tbody th,
tbody td {
  text-align: left;
  vertical-align: top;
  padding: 1rem 0.75rem 1rem 0;
  border-top: 1.5px dashed var(--line);
  line-height: 1.45;
}

tbody th {
  font-weight: 600;
}

tbody td:nth-child(2) {
  font-size: 0.9375rem;
  color: var(--muted);
}

tbody td:last-child {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100;
  font-weight: 750;
  font-size: 1.625rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.explain {
  padding: 0.25rem 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted);
}

.restart {
  margin-top: 2rem;
}

/* Feedback */

.feedback {
  margin-top: 3.5rem;
  background: var(--surface);
  border-radius: 2rem 2rem 2rem 0.75rem;
  padding: 1.75rem 1.25rem 1.5rem;
}

.feedback h2 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 70;
  font-weight: 650;
  font-size: 1.625rem;
  line-height: 1.15;
}

.feedback > p {
  margin-top: 0.375rem;
  color: var(--muted);
}

.feedback form {
  margin-top: 1.5rem;
}

.feedback .option {
  background: var(--card);
}

.feedback .option:has(input:checked) {
  background: var(--bulb-pale);
}

.field-label {
  display: block;
  margin-top: 1.5rem;
  font-weight: 650;
}

textarea {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  min-height: 6.5rem;
  padding: 0.875rem 1rem;
  resize: vertical;
  font: 400 1rem/1.5 var(--body);
  color: var(--text);
  background: var(--input-bg);
  border: 2px solid var(--ring);
  border-radius: 1rem;
}

textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgb(91 140 255 / 0.3);
}

.feedback .hint {
  margin-top: 0.5rem;
}

.thanks {
  margin-top: 1rem;
  font-weight: 650;
}

/* The one inverted section: the next night */

.prepare {
  margin-top: 4rem;
  color: var(--on-night);
  background: radial-gradient(90% 60% at 85% 0%, #2A2463 0, var(--night) 55%, var(--night-deep) 100%);
  border-radius: 3rem 3rem 0 0 / 2.25rem 2.25rem 0 0;
  padding-block: 2.75rem 3rem;
}

.prepare h2 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 700;
  font-size: clamp(2rem, 8.6vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--warm-white);
}

.prepare .intro-line {
  margin-top: 0.5rem;
  color: var(--on-night-muted);
}

.prepare .btn-quiet {
  margin-top: 1.25rem;
  color: var(--on-night);
  border-color: #7C75B8;
}

.prepare .btn-quiet:hover {
  background: var(--night-raise);
  border-color: var(--on-night);
}

.prepare h3 {
  margin-top: 2.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100;
  font-weight: 600;
  font-size: 1.375rem;
  color: var(--warm-white);
}

.prepare h3::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--bulb);
  box-shadow: 0 0 12px 3px rgb(var(--glow) / 0.5);
}

.prepare-panel > h3:first-child {
  margin-top: 1.75rem;
}

.prep-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}

.prep-list li {
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.06);
  line-height: 1.5;
  color: var(--on-night-muted);
}

.prep-list strong {
  color: var(--on-night);
  font-weight: 600;
}

.prepare p {
  line-height: 1.55;
}

#backup-power > p {
  margin-top: 0.75rem;
  color: var(--on-night-muted);
}

.prepare .safety {
  margin-top: 1rem;
  padding: 1rem 1.125rem;
  border-radius: 1rem;
  background: var(--night-raise);
  border: 1.5px solid #4D4690;
  color: var(--on-night);
}

.brand-links {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.brand-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue-soft);
  font-size: 0.9375rem;
}

.prepare .disclosure {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--on-night-muted);
}

/* Footer */

.site-footer {
  background: var(--surface);
  padding-block: 2.25rem 2.5rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

body[data-stage="result"] .site-footer {
  background: var(--footer-alt);
}

.foot-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.foot-mark span {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100;
  font-weight: 650;
  font-size: 1rem;
}

.switch {
  width: 1.75rem;
  height: 2.5rem;
  flex: none;
}

.switch .plate {
  fill: var(--card);
  stroke: var(--line);
  stroke-width: 1.5;
}

.switch .rocker {
  fill: var(--surface);
  transition: transform 0.35s;
  transform-origin: 14px 20px;
}

.switch .led {
  fill: #C9C4E2;
  transition: fill 0.3s, filter 0.3s;
}

body[data-stage="result"] .switch .rocker {
  transform: scaleY(-1);
}

body[data-stage="result"] .switch .led {
  fill: var(--bulb);
  filter: drop-shadow(0 0 4px rgb(var(--glow) / 0.9));
}

.site-footer p + p {
  margin-top: 0.75rem;
}

/* Dark: the lights are off. Follows the device unless the switch says otherwise. */

body[data-theme="dark"] {
  --bg: #120F33;
  --surface: #221D4E;
  --card: #1E1949;
  --card-hover: #262056;
  --input-bg: #171240;
  --note-bg: #232B5C;
  --footer-alt: #0E0C29;
  --line: #3A3474;
  --ring: #9992CE;
  --text: #F3F0FF;
  --muted: #BEB8E2;
  --blue-ink: #AFC5FF;
  --caution: #FF9A8F;
  --caution-soft: #3B1F2C;
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) {
    --bg: #120F33;
    --surface: #221D4E;
    --card: #1E1949;
    --card-hover: #262056;
    --input-bg: #171240;
    --note-bg: #232B5C;
    --footer-alt: #0E0C29;
    --line: #3A3474;
    --ring: #9992CE;
    --text: #F3F0FF;
    --muted: #BEB8E2;
    --blue-ink: #AFC5FF;
    --caution: #FF9A8F;
    --caution-soft: #3B1F2C;
  }
}

/* With the lights off, the bulb is dark too. */
body[data-theme="dark"] .glass-lit,
body[data-theme="dark"] .halo {
  opacity: 0.12;
}

body[data-theme="dark"][data-stage="result"] .pendant .halo {
  opacity: 0.12;
}

body[data-theme="dark"] .fb.is-done::after,
body[data-theme="dark"] .fb.is-current::after {
  filter: saturate(0.7) brightness(0.85);
}

body[data-theme="dark"] .lit-panel::before {
  opacity: 0.45;
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) .glass-lit,
  body:not([data-theme="light"]) .halo {
    opacity: 0.12;
  }

  body:not([data-theme="light"]) .lit-panel::before {
    opacity: 0.45;
  }
}

/* The bulb and the footer plate are both the light switch. */
.light-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.25rem;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: inherit;
}

/* The bulb keeps its exact place on the cord; the tap area is laid over it. */
.bulb-switch {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  pointer-events: auto;
}

.bulb-switch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
}

.pendant {
  pointer-events: none;
}

body[data-theme="dark"] .switch .rocker,
body[data-theme="dark"][data-stage="result"] .switch .rocker {
  transform: none;
}

body[data-theme="dark"][data-stage="result"] .switch .led {
  fill: var(--line);
  filter: none;
}

/* The lights-on reveal: the one orchestrated moment.
   It spreads from the top corner where the bulb hangs. */

.lights-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  display: none;
  --cx: 100%;
  --cy: 0%;
}

.lights-overlay.run {
  display: block;
  background: radial-gradient(circle at var(--cx) var(--cy), rgb(18 15 51 / 0) var(--r), rgb(18 15 51 / 0.97) calc(var(--r) + 13rem));
  animation: spread 1.2s cubic-bezier(0.6, 0, 0.2, 1) both, overlayfade 1.2s linear both;
}

.lights-overlay.run::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--night-deep);
  animation: flicker 1.2s linear both;
}

@keyframes spread {
  0%, 28% { --r: 0px; }
  100% { --r: 160vmax; }
}

@keyframes overlayfade {
  0%, 78% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes flicker {
  0%, 9% { opacity: 1; }
  12% { opacity: 0.35; }
  15% { opacity: 1; }
  20% { opacity: 0.2; }
  24% { opacity: 0.8; }
  28%, 100% { opacity: 0; }
}

body.powering .pendant {
  z-index: 41;
}

body.powering .pendant .glass-lit {
  animation: bulbflick 1.2s linear both;
}

body.powering .pendant .halo {
  animation: haloflick 1.2s linear both;
}

@keyframes bulbflick {
  0%, 9% { opacity: 0.1; }
  12% { opacity: 1; }
  15% { opacity: 0.15; }
  20% { opacity: 1; }
  24% { opacity: 0.4; }
  28%, 100% { opacity: 1; }
}

@keyframes haloflick {
  0%, 9% { opacity: 0; }
  12% { opacity: 0.8; }
  15% { opacity: 0.05; }
  20% { opacity: 1; }
  24% { opacity: 0.3; }
  28% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* Larger screens */

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
  }

  .card {
    padding: 2.25rem 2.25rem 2rem;
    width: min(100% - 3rem, var(--col));
  }

  .receipt {
    padding: 0.5rem 1.75rem;
  }

  .receipt > div {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 1.5rem;
    align-items: baseline;
  }

  .receipt dd {
    margin: 0;
  }

  .feedback {
    padding: 2.25rem 2.25rem 2rem;
  }

  .options-pair {
    grid-template-columns: repeat(4, auto);
    justify-content: start;
  }

  .step-nav .btn-primary {
    flex: 0 1 14rem;
    margin-left: auto;
  }

  .btn-block {
    width: auto;
    min-width: 14rem;
  }
}

@media (min-width: 64rem) {
  :root {
    --bx: calc(50% + 27rem);
    --by: 12rem;
  }

  body[data-stage="question"] .sky {
    --by: 7rem;
  }

  body[data-stage="result"] .sky {
    --by: 13rem;
  }

  .pendant {
    width: 3.5rem;
  }

  .pendant svg {
    width: 3.5rem;
    height: 4.9rem;
  }

  .pendant .cord {
    height: calc(var(--by) - 3.35rem);
  }

  .pendant .halo {
    width: 22rem;
    height: 22rem;
  }

  .site-header {
    min-height: 5rem;
    padding-right: 0;
  }

  .wordmark {
    font-size: 1.25rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .sky {
    padding-bottom: 6rem;
    border-radius: 0 0 58% 42% / 0 0 5rem 3.5rem;
  }

  .sky::before {
    background:
      radial-gradient(circle at var(--bx) var(--by), rgb(var(--glow) / 0.6) 0, rgb(var(--glow) / 0.26) 4rem, rgb(var(--glow) / 0.09) 16rem, transparent 34rem),
      radial-gradient(40% 40% at 40% 45%, rgb(var(--glow) / 0.06), transparent 70%);
  }

  .lede {
    font-size: 1.25rem;
  }

  .progress {
    margin-top: 3rem;
  }

  .card {
    margin-top: -4rem;
  }

  .lit-panel {
    padding-top: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation: none !important;
  }

  .lights-overlay {
    display: none !important;
  }
}
