/* EdgeCheck home page. Its own stylesheet: the app's styles.css is not loaded here.
   Color carries meaning, as in the app: green = target, red = stop, grey = luck.
   One display face (Inter Display, see fonts/OFL.txt) for headings; the device's own font for the rest. */

@font-face {
  font-family: "Inter Display";
  src: url("/assets/fonts/InterDisplay-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #edf0f2;
  --surface: #ffffff;
  --well: #f5f7f8;
  --ink: #17202a;
  --muted: #5a6672;
  --luck-ink: #6a7682;
  --line: #d3d9df;
  --hair: rgba(23, 32, 42, 0.09);
  --target: #0b7a64;
  --target-zone: rgba(11, 122, 100, 0.13);
  --stop: #bf3a2b;
  --stop-zone: rgba(191, 58, 43, 0.12);
  --luck: #8794a1;
  --focus: #2f55d4;
  --on-ink: #ffffff;
  --lift: 0 1px 2px rgba(23, 32, 42, 0.06), 0 6px 16px -10px rgba(23, 32, 42, 0.25);
  --float: 0 2px 6px rgba(23, 32, 42, 0.05), 0 32px 64px -32px rgba(23, 32, 42, 0.4);

  --display: "Inter Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11171d;
    --surface: #1a222b;
    --well: #151c23;
    --ink: #e6ebef;
    --muted: #a3afba;
    --luck-ink: #8d9aa7;
    --line: #2c3742;
    --hair: rgba(230, 235, 239, 0.08);
    --target: #3bc2a0;
    --target-zone: rgba(59, 194, 160, 0.16);
    --stop: #ff7b69;
    --stop-zone: rgba(255, 123, 105, 0.15);
    --luck: #75828f;
    --focus: #8fa8ff;
    --on-ink: #11171d;
    --lift: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 18px -10px rgba(0, 0, 0, 0.6);
    --float: 0 2px 6px rgba(0, 0, 0, 0.3), 0 32px 64px -28px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #11171d;
  --surface: #1a222b;
  --well: #151c23;
  --ink: #e6ebef;
  --muted: #a3afba;
  --luck-ink: #8d9aa7;
  --line: #2c3742;
  --hair: rgba(230, 235, 239, 0.08);
  --target: #3bc2a0;
  --target-zone: rgba(59, 194, 160, 0.16);
  --stop: #ff7b69;
  --stop-zone: rgba(255, 123, 105, 0.15);
  --luck: #75828f;
  --focus: #8fa8ff;
  --on-ink: #11171d;
  --lift: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 18px -10px rgba(0, 0, 0, 0.6);
  --float: 0 2px 6px rgba(0, 0, 0, 0.3), 0 32px 64px -28px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

/* Until the page's text is in the chosen language (see i18n.js). */
html.i18n-wait body {
  visibility: hidden;
}

/* Author display rules must never undo the hidden attribute. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 500;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 1.3rem + 5.6vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.042em;
}

h2 {
  font-size: clamp(2rem, 1.25rem + 3.1vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

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

.h-line {
  display: block;
}

/* The second line of a heading is in the grey that means luck in the app. */
.h-luck {
  color: var(--luck-ink);
}

.num {
  font-variant-numeric: tabular-nums;
}

.pos {
  color: var(--target);
}

.neg {
  color: var(--stop);
}

.center {
  text-align: center;
  margin-inline: auto;
}

.lead {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  color: var(--muted);
  max-width: 36em;
}

.note {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* What only a computer can use (the desktop app) is left out on phones and tablets; theme.js marks them. */
.phone .desktop-only {
  display: none !important;
}

:root:not(.phone) .phone-only {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- buttons ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 40px;
  padding: 0 1.05rem;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 500 0.9375rem/1 var(--text);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--lift);
  cursor: pointer;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background-color 0.2s;
}

.pill:hover {
  transform: translateY(-1px);
}

.pill:active {
  transform: scale(0.97);
}

.pill-ink {
  background: var(--ink);
  color: var(--on-ink);
  border-color: transparent;
}

.pill-lg {
  min-height: 50px;
  padding: 0 1.5rem;
  font-size: 1rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* ---------- top bar: brand, menu, start ---------- */

.nav {
  position: fixed;
  z-index: 40;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: var(--gutter);
  right: max(20px, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

/* On a phone the menu takes the room between the logo and the start button, whatever the language. */
@media (max-width: 759px) {
  .nav {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}

.nav > * {
  pointer-events: auto;
}

.nav-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font: 500 1.0625rem/1 var(--display);
  letter-spacing: -0.02em;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--hair);
  box-shadow: var(--lift);
}

.mark svg {
  width: 22px;
  height: 22px;
}

.nav-name {
  display: none;
}

.nav-mid {
  display: flex;
  justify-content: center;
  min-width: 0;
  container-type: inline-size;
}

.nav-menu {
  min-height: 42px;
  padding-inline: 0.95rem 1.1rem;
}

/* With too little room, the menu button is just its icon; the word stays for screen readers. */
@container (max-width: 112px) {
  .nav-menu {
    width: 42px;
    padding: 0;
  }

  .nav-menu-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.nav-menu svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* Open, the two bars cross into a close mark. */
.nav-menu path {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s var(--ease);
}

.nav-menu[aria-expanded="true"] .bar-1 {
  transform: translateY(3px) rotate(45deg);
}

.nav-menu[aria-expanded="true"] .bar-2 {
  transform: translateY(-3px) rotate(-45deg);
}

.menu {
  position: fixed;
  top: calc(max(12px, env(safe-area-inset-top, 0px)) + 54px);
  left: 50%;
  width: min(260px, calc(100vw - 40px));
  translate: -50% 0;
  display: grid;
  padding: 6px;
  border: 1px solid var(--hair);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--float);
  animation: menu-in 0.22s var(--ease);
  transform-origin: 50% 0;
}

.menu a {
  padding: 11px 14px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 0.9375rem;
}

.menu a:hover {
  background: var(--well);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
}

.nav-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.nav-end .pill {
  min-height: 42px;
}

.nav-signin {
  display: none;
  font-size: 0.9375rem;
  text-decoration: none;
}

.nav-signin:hover {
  text-decoration: underline;
}

@media (min-width: 760px) {
  .nav-name,
  .nav-signin {
    display: inline;
  }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 108px 0 72px;
}

.ribbon {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.6s ease;
  pointer-events: none;
}

.ribbon.on {
  opacity: 1;
}

.hero-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1.35rem;
  text-align: center;
  opacity: calc(1 - var(--k, 0) * 0.9);
  transform: translateY(calc(var(--k, 0) * -56px));
  will-change: opacity, transform;
}

.badge {
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
  box-shadow: var(--lift);
}

.hero h1 {
  max-width: 12em;
}

.hero-lead {
  max-width: 33em;
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
}

.hero .cta {
  margin-top: 0.4rem;
}

.hero-note {
  color: var(--muted);
  font-size: 0.8125rem;
}

/* The page opens with one sequence: each line sharpens into place, in order. */
@keyframes sharpen {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

:root:not(.i18n-wait) .hero-inner > :not(h1),
:root:not(.i18n-wait) .hero h1 .h-line {
  animation: sharpen 0.95s var(--ease) both;
  animation-delay: calc(var(--d, 0) * 110ms + 120ms);
}

/* ---------- the story: lock, close, verdict, played by scrolling ---------- */

.story {
  position: relative;
  padding: clamp(4rem, 3rem + 5vw, 7rem) 0;
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "head"
    "device"
    "steps";
  gap: 1.5rem;
  align-items: center;
}

.story-head {
  grid-area: head;
  font-size: clamp(1.6rem, 1.1rem + 2.4vw, 3.25rem);
}

.story-steps {
  grid-area: steps;
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-step {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  transition:
    opacity 0.45s var(--ease),
    transform 0.45s var(--ease);
}

.step-n {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition:
    background-color 0.3s,
    color 0.3s;
}

.story-step h3 {
  margin-top: 0.12rem;
}

.story-step p {
  margin-top: 0.3rem;
  color: var(--muted);
  max-width: 30em;
}

.story-step.is-on .step-n {
  background: var(--ink);
  color: var(--on-ink);
}

.device-stage {
  grid-area: device;
  display: grid;
  place-items: center;
}

@media (min-width: 900px) {
  .story-grid {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    grid-template-areas:
      "head device"
      "steps device";
    grid-template-rows: auto 1fr;
    column-gap: clamp(2.5rem, 5vw, 5rem);
    row-gap: 2.5rem;
  }

  .story-head {
    align-self: end;
  }

  .story-steps {
    align-self: start;
    gap: 1.6rem;
  }
}

/* With scripts, the section is tall and its content stays pinned while the scroll plays the story. */
.story.live {
  height: 340vh;
  padding: 0;
}

.story.live .story-pin {
  position: sticky;
  top: 0;
  display: grid;
  align-items: center;
  height: 100vh;
  height: 100svh;
  padding: 76px 0 18px;
}

.story.live .story-step:not(.is-on) {
  opacity: 0.38;
}

@media (max-width: 899px) {
  .story.live .story-grid {
    gap: 0.9rem;
  }

  /* On a phone the three steps share one place; the current one shows. */
  .story.live .story-steps {
    grid-template-areas: "step";
  }

  .story.live .story-step {
    grid-area: step;
  }

  .story.live .story-step:not(.is-on) {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* A short phone screen keeps the step titles and lets the descriptions go. */
@media (max-width: 899px) and (max-height: 690px) {
  .story.live .story-step p {
    display: none;
  }
}

/* The app, drawn small. Sizes are in em, so the whole thing scales with its font size. */
.device {
  position: relative;
  width: min(100%, 30em);
  font-size: clamp(10px, 3.3vw, 15.5px);
  font-size: clamp(10px, min(3.3vw, 1.85svh), 15.5px);
  line-height: 1.4;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 1.6em;
  box-shadow: var(--float);
  overflow: hidden;
  transform-origin: 50% 100%;
}

@media (min-width: 900px) {
  .device {
    font-size: clamp(12px, 1.9svh, 16px);
  }
}

.story.live .device {
  opacity: calc(0.2 + var(--rise, 1) * 0.8);
  transform: translateY(calc((1 - var(--rise, 1)) * 18%)) scale(calc(0.88 + var(--rise, 1) * 0.12));
}

.dv-top {
  display: flex;
  align-items: center;
  gap: 1.3em;
  padding: 0.85em 1.3em;
  border-bottom: 1px solid var(--hair);
}

.dv-mark {
  width: 1.4em;
  height: 1.4em;
}

.dv-tab {
  padding: 0.2em 0;
  color: var(--muted);
  font-size: 0.92em;
}

.dv-tab.is-on {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ink);
}

.dv-body {
  position: relative;
  display: grid;
  gap: 1em;
  padding: 1.15em 1.3em 1.3em;
}

.dv-title {
  font: 500 1.3em/1.2 var(--display);
  letter-spacing: -0.02em;
}

.dv-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75em 0.6em;
  margin-top: 0.85em;
}

.dv-field {
  grid-column: span 2;
  min-width: 0;
}

.dv-field.dv-wide {
  grid-column: span 3;
}

.dv-label {
  display: block;
  margin-bottom: 0.3em;
  color: var(--muted);
  font-size: 0.8em;
}

.dv-input,
.dv-seg {
  position: relative;
  display: flex;
  align-items: center;
  height: 2.55em;
  border: 1px solid var(--line);
  border-radius: 0.65em;
  background: var(--well);
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    color 0.3s;
}

.dv-input {
  gap: 0.3em;
  padding: 0 0.7em;
  font-size: 0.95em;
  white-space: nowrap;
  overflow: hidden;
}

.dv-val {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
}

.dv-input.typing {
  border-color: var(--focus);
  box-shadow: 0 0 0 0.2em color-mix(in srgb, var(--focus) 20%, transparent);
}

.dv-input.typing .dv-val::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -0.18em;
  background: var(--ink);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.dv-lock {
  flex: none;
  width: 0.9em;
  height: 0.9em;
  margin-left: auto;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
  transition: opacity 0.3s;
}

.dv-seg {
  padding: 0.2em;
  gap: 0.2em;
}

.dv-opt {
  flex: 1;
  display: grid;
  place-items: center;
  height: 100%;
  border-radius: 0.5em;
  color: var(--muted);
  font-size: 0.9em;
  transition:
    background-color 0.25s,
    color 0.25s;
}

.dv-long {
  background: var(--ink);
  color: var(--on-ink);
}

.dv-calc {
  margin-top: 0.75em;
  color: var(--muted);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease);
}

.dv-actions {
  display: grid;
  margin-top: 0.85em;
}

.dv-btn,
.dv-stamp {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 2.75em;
  border-radius: 999px;
  font-size: 0.95em;
  font-weight: 600;
  transition:
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.dv-btn {
  background: var(--ink);
  color: var(--on-ink);
  opacity: 0;
  transform: scale(0.96);
}

.dv-stamp {
  border: 1px solid color-mix(in srgb, var(--target) 40%, transparent);
  background: var(--target-zone);
  color: var(--target);
  font-variant-numeric: tabular-nums;
}

.dv-stamp svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.dv-chart {
  position: relative;
  transition:
    opacity 0.45s var(--ease),
    transform 0.45s var(--ease);
}

.dv-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.dv-chart .z-target {
  fill: var(--target-zone);
}

.dv-chart .z-stop {
  fill: var(--stop-zone);
}

.dv-chart line {
  stroke-width: 1.5;
}

.dv-chart .l-target {
  stroke: var(--target);
}

.dv-chart .l-stop {
  stroke: var(--stop);
}

.dv-chart .l-entry {
  stroke: var(--ink);
  stroke-dasharray: 5 4;
}

.dv-chart text {
  font: 600 10px var(--text);
}

.dv-chart .t-target {
  fill: var(--target);
}

.dv-chart .t-stop {
  fill: var(--stop);
}

.dv-chart .t-entry {
  fill: var(--muted);
}

.dv-chart .price {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.dv-hit {
  fill: var(--target);
  stroke: var(--surface);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  transition:
    opacity 0.3s,
    transform 0.4s var(--ease);
}

.dv-result {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin-top: 0.6em;
  color: var(--target);
  font-size: 0.85em;
  font-weight: 600;
  transform-origin: 0 50%;
  transition:
    opacity 0.3s,
    transform 0.4s var(--ease);
}

.dv-form {
  transition: opacity 0.5s var(--ease);
}

.dv-chip {
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: var(--target);
  color: var(--on-ink);
  font-variant-numeric: tabular-nums;
}

.dv-verdict {
  position: absolute;
  left: 0.9em;
  right: 0.9em;
  bottom: 0.9em;
  display: grid;
  gap: 0.35em;
  padding: 1.1em 1.2em 1em;
  border: 1px solid var(--hair);
  border-radius: 1.1em;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--float);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
}

.dv-kicker {
  color: var(--muted);
  font-size: 0.8em;
}

.dv-v-title {
  font: 500 1.45em/1.15 var(--display);
  letter-spacing: -0.025em;
}

.dv-v-line {
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.4;
}

.dv-bars {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45em 0.7em;
  align-items: center;
  margin-top: 0.45em;
  font-size: 0.82em;
}

.dv-bar {
  height: 0.6em;
  border-radius: 999px;
  background: var(--well);
  overflow: hidden;
}

.dv-bar i {
  display: block;
  height: 100%;
  width: calc(var(--w) * 100%);
  border-radius: inherit;
  transition: width 0.9s var(--ease) 0.15s;
}

.dv-bar .you {
  background: var(--target);
}

.dv-bar .luck {
  background: var(--luck);
}

.dv-bar-n {
  text-align: right;
  font-weight: 600;
}

.dv-note {
  margin-top: 0.25em;
  color: var(--muted);
  font-size: 0.72em;
}

/* Without scripts, or with reduced motion, the story is one still picture with the verdict below. */
.story:not(.live) .dv-verdict {
  position: static;
}

/* With scripts, each part waits for its moment in the story. */
.story.live .dv-input:not(.filled):not(.typing) .dv-lock,
.story.live:not(.s-locked) .dv-lock {
  opacity: 0;
}

.story.live:not(.s-long) .dv-long {
  background: transparent;
  color: var(--muted);
}

.story.live:not(.s-calc) .dv-calc {
  opacity: 0;
  transform: translateY(0.3em);
}

.story.live:not(.s-locked) .dv-btn {
  opacity: 1;
  transform: none;
}

.story.live.s-press:not(.s-locked) .dv-btn {
  transform: scale(0.94);
}

.story.live:not(.s-locked) .dv-stamp {
  opacity: 0;
  transform: scale(0.94);
}

.story.live.s-locked .dv-input {
  color: var(--muted);
}

/* The chart, with its target and stop zones, appears as soon as the levels are in. */
.story.live:not(.s-calc) .dv-chart {
  opacity: 0;
  transform: translateY(0.8em);
}

/* The verdict lays over the screen; what is under it steps back. */
.story.live.s-verdict .dv-form,
.story.live.s-verdict .dv-chart {
  opacity: 0.28;
}

.story.live:not(.s-hit) .dv-hit,
.story.live:not(.s-hit) .dv-result {
  opacity: 0;
  transform: scale(0.6);
}

.story.live:not(.s-verdict) .dv-verdict {
  opacity: 0;
  transform: translateY(1.4em) scale(0.97);
}

.story.live:not(.s-verdict) .dv-bar i {
  width: 0;
}

/* ---------- sections ---------- */

.section {
  padding: clamp(4.5rem, 3.5rem + 5vw, 8.5rem) 0;
}

/* Headings sharpen into place once, when they come into view. */
.motion .reveal:not(.in) {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(8px);
}

.motion .reveal {
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease),
    filter 0.9s var(--ease);
}

/* Questions a P&L can't answer */
.qa {
  margin-top: clamp(2.2rem, 1.5rem + 3vw, 4rem);
}

.qa-row {
  display: grid;
  gap: 0.5rem 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.qa-row:last-child {
  border-bottom: 1px solid var(--line);
}

.qa dt {
  font: 500 clamp(1.3rem, 1.05rem + 1vw, 1.9rem) / 1.15 var(--display);
  letter-spacing: -0.025em;
}

.qa dd {
  color: var(--muted);
  max-width: 32em;
}

@media (min-width: 860px) {
  .qa-row {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: baseline;
    padding: 2rem 0;
  }
}

/* Random entries: the position box */
.random-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.random-text {
  display: grid;
  gap: 1.4rem;
}

@media (min-width: 900px) {
  .random-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    gap: clamp(3rem, 6vw, 6rem);
  }
}

.position {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--hair);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--float);
}

.position svg {
  display: block;
  width: 100%;
  height: auto;
}

.position .zone-label {
  font: 600 13px var(--text);
}

.position .axis-label {
  font: 500 12px var(--text);
  fill: var(--muted);
}

.readout {
  font: 500 clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem) / 1.25 var(--display);
  letter-spacing: -0.02em;
}

.readout .num {
  color: var(--target);
}

.control {
  display: grid;
  gap: 6px;
}

.control label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

input[type="range"] {
  width: 100%;
  min-height: 32px;
  margin: 0;
  accent-color: var(--ink);
}

.dots {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 5px;
}

.dots span {
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--stop) 35%, transparent);
  border-radius: 4px;
  background: var(--stop-zone);
  transition:
    background-color 0.25s,
    border-color 0.25s;
  transition-delay: calc(var(--i, 0) * 12ms);
}

.dots span.hit {
  border-color: var(--target);
  background: var(--target);
}

.dots-caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* The prop exam, played many times */
.prop .lead {
  margin-top: 1.4rem;
}

.exam {
  display: grid;
  gap: 1.5rem 2.5rem;
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--hair);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--float);
}

.exam-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.exam-rules li {
  padding: 0.38rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.exam-rules .money {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.exam-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Lines keep their width in screen pixels however small the chart is drawn. */
.exam-chart line,
#exam-paths path {
  vector-effect: non-scaling-stroke;
}

.exam-chart line {
  stroke-width: 1.5;
}

.exam-target {
  stroke: var(--target);
  stroke-dasharray: 6 5;
}

.exam-start {
  stroke: var(--line);
}

.exam-floor {
  stroke: var(--stop);
  stroke-dasharray: 6 5;
}

/* A halo of the card's colour keeps the labels readable where lines cross them. */
.exam-label {
  font: 600 13px var(--text);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 0.35em;
  stroke-linejoin: round;
}

.exam-label.t-target {
  fill: var(--target);
}

.exam-label.t-floor {
  fill: var(--stop);
}

#exam-paths path {
  fill: none;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.5;
}

#exam-paths path.pass {
  stroke: var(--target);
}

#exam-paths path.fail {
  stroke: var(--stop);
}

#exam-paths circle.pass {
  fill: var(--target);
}

#exam-paths circle.fail {
  fill: var(--stop);
}

.exam-side {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.exam-big {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2em 0.45em;
  font: 500 1.25rem/1.1 var(--display);
  letter-spacing: -0.02em;
}

.exam-big .num {
  font-size: clamp(3.4rem, 2.6rem + 3vw, 4.8rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.exam-sub {
  color: var(--muted);
  font-size: 0.9375rem;
}

.sizes {
  display: grid;
  gap: 10px;
  margin: 0.4rem 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.sizes li {
  display: grid;
  grid-template-columns: minmax(7.5em, auto) minmax(0, 1fr) 3em;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.sizes li.is-you {
  color: var(--ink);
  font-weight: 600;
}

.sizes-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--well);
  overflow: hidden;
}

.sizes-bar i {
  display: block;
  height: 100%;
  width: calc(var(--w) * 100%);
  border-radius: inherit;
  background: var(--luck);
  transition: width 1.1s var(--ease);
}

.sizes li.is-you .sizes-bar i {
  background: var(--ink);
}

.sizes .num {
  text-align: right;
}

.motion .exam:not(.played) .sizes-bar i {
  width: 0;
}

@media (min-width: 900px) {
  .exam {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-areas:
      "rules rules"
      "chart side";
    align-items: start;
  }

  .exam-rules {
    grid-area: rules;
  }

  .exam-chart {
    grid-area: chart;
  }

  .exam-side {
    grid-area: side;
  }
}

/* Tools: each one shows a small piece of the real screen */
.tool-grid {
  display: grid;
  gap: 14px;
  margin-top: clamp(2.2rem, 1.5rem + 3vw, 3.5rem);
}

@media (min-width: 720px) {
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1020px) {
  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-wide {
    grid-column: span 2;
  }
}

.tool {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.5rem;
  padding: 10px 10px 22px;
  border: 1px solid var(--hair);
  border-radius: 24px;
  background: var(--surface);
}

.tool h3,
.tool > p {
  padding-inline: 12px;
}

.tool h3 {
  margin-top: 0.6rem;
}

.tool > p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.tool-visual {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 150px;
  padding: 18px;
  border-radius: 16px;
  background: var(--well);
  font-size: 0.875rem;
}

.sn {
  width: 100%;
  border-collapse: collapse;
}

.sn td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}

.sn tr:last-child td {
  border-bottom: 0;
}

.sn td:first-child {
  white-space: normal;
}

.sn td:last-child {
  text-align: right;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--luck) 20%, transparent);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-signal {
  background: var(--ink);
  color: var(--on-ink);
}

.file {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.file-icon {
  width: 16px;
  height: 20px;
  border: 1.5px solid var(--muted);
  border-radius: 3px;
}

.mini-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
}

.rule {
  font-weight: 600;
}

.candles {
  width: 100%;
  max-width: 220px;
  height: auto;
}

.candles line {
  stroke-width: 1.5;
}

.c-up line,
.c-up rect {
  stroke: var(--target);
  fill: var(--target);
}

.c-down line,
.c-down rect {
  stroke: var(--stop);
  fill: var(--stop);
}

.candles .c-target {
  stroke: var(--target);
  stroke-dasharray: 3 3;
  fill: none;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.check-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--target);
  color: var(--on-ink);
  font-size: 0.75rem;
}

.url {
  justify-self: start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
}

.url-name {
  color: var(--ink);
}

.mini-verdict {
  font: 500 1.35rem/1.15 var(--display);
  letter-spacing: -0.02em;
}

.mini-sub {
  color: var(--muted);
}

.phone {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.phone-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--lift);
}

.phone-icon svg {
  width: 36px;
  height: 36px;
}

.phone-name {
  font-size: 0.8125rem;
}

.ai {
  display: grid;
  gap: 10px;
}

.ai p {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
}

.ai-h {
  font-weight: 600;
}

.ai-t {
  color: var(--muted);
}

.tools-note {
  margin-top: 14px;
}

.tool .tool-link a {
  color: var(--ink);
  font-weight: 600;
}

/* Honest by design, and the price */
.honest {
  display: grid;
  gap: 2rem;
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid var(--hair);
  border-radius: 32px;
  background: var(--surface);
}

.honest-text {
  display: grid;
  gap: 1.3rem;
  align-content: start;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.875rem;
}

.plan {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: clamp(20px, 3vw, 32px);
  border-radius: 22px;
  background: var(--well);
}

.plan-name {
  color: var(--muted);
  font-size: 0.9375rem;
}

.plan-price {
  font: 500 clamp(3rem, 2.4rem + 2.4vw, 4.2rem) / 1 var(--display);
  letter-spacing: -0.045em;
}

.plan-sub {
  color: var(--muted);
}

.plan-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.9rem 0 1.3rem;
  padding: 0;
  list-style: none;
}

.plan-list li {
  display: flex;
  gap: 0.6rem;
}

.plan-list li::before {
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.3em;
  margin-top: 0.5em;
  border-left: 2px solid var(--target);
  border-bottom: 2px solid var(--target);
  transform: rotate(-45deg);
}

.plan-cta {
  justify-self: start;
}

@media (min-width: 900px) {
  .honest {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: center;
  }
}

/* Common questions */
.faq-grid {
  display: grid;
  gap: 2rem;
}

.faq-head {
  display: grid;
  gap: 1.2rem;
  align-content: start;
  justify-items: start;
}

@media (min-width: 900px) {
  .faq-grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 5rem;
  }

  .faq-head {
    position: sticky;
    top: 110px;
  }
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list details:first-child {
  border-top: 1px solid var(--line);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0.2rem;
  cursor: pointer;
  list-style: none;
  font-size: 1.0625rem;
  font-weight: 500;
}

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

.faq-list summary::after {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  color: var(--muted);
  transition: transform 0.3s var(--ease);
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list details p {
  max-width: 38em;
  padding: 0 0.2rem 1.3rem;
  color: var(--muted);
}

.faq-list details[open] p {
  animation: answer-in 0.35s var(--ease);
}

@keyframes answer-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* The end: a hand of locked trades */
.final {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(5rem, 4rem + 5vw, 9rem) 0 clamp(5rem, 4rem + 4vw, 8rem);
}

.final-inner {
  display: grid;
  justify-items: center;
  gap: 1.3rem;
  text-align: center;
}

.final-inner .cta {
  margin-top: 0.4rem;
}

.fan {
  position: relative;
  width: min(100%, 640px);
  height: 176px;
  margin-bottom: 1rem;
}

.fan-card {
  --spread: 124px;
  position: absolute;
  left: 50%;
  top: 14px;
  width: 128px;
  margin-left: -64px;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--float);
  text-align: left;
  font-size: 0.75rem;
  transform: translateX(calc(var(--i) * var(--spread))) translateY(calc(var(--i) * var(--i) * 6px))
    rotate(calc(var(--i) * 6deg));
  transition: transform 0.9s var(--ease);
  transition-delay: calc((2 - var(--i)) * 40ms);
}

.motion .fan:not(.in) .fan-card {
  transform: translateY(26px) rotate(calc(var(--i) * 1.5deg));
}

.fan-card:nth-child(3) {
  z-index: 2;
}

.fan-card:nth-child(2),
.fan-card:nth-child(4) {
  z-index: 1;
}

.fan-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
}

.fan-top .symbol {
  color: var(--ink);
  font-weight: 700;
}

.fan-card svg {
  width: 100%;
  height: auto;
}

.fan-card path {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.fan-card .up {
  stroke: var(--target);
}

.fan-card .down {
  stroke: var(--stop);
}

.fan-card .flat {
  stroke: var(--luck);
}

.fan-r {
  font: 500 1.15rem/1 var(--display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.fan-when {
  color: var(--muted);
  font-size: 0.6875rem;
}

/* A phone holds three of the five cards. */
@media (max-width: 600px) {
  .fan {
    height: 158px;
  }

  .fan-card {
    --spread: 104px;
    width: 110px;
    margin-left: -55px;
  }

  .fan-card:first-child,
  .fan-card:last-child {
    display: none;
  }
}

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

.foot {
  position: relative;
  overflow: hidden;
  padding-top: clamp(3rem, 2.5rem + 2vw, 4.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.foot-grid {
  display: grid;
  gap: 2.5rem;
}

.foot-brand {
  display: grid;
  gap: 1rem;
  justify-items: start;
  align-content: start;
}

.foot-brand .nav-brand {
  color: var(--ink);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 2rem;
}

.foot-h {
  margin-bottom: 0.7rem;
  color: var(--ink);
  font-weight: 600;
}

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

.foot ul a {
  text-decoration: none;
}

.foot ul a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (min-width: 860px) {
  .foot-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  }
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.6rem;
  margin-top: 3rem;
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
  border-top: 1px solid var(--hair);
  font-size: 0.8125rem;
}

.lang-pick select {
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
}

.wordmark {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.5rem;
  color: var(--ink);
  font: 500 190px var(--display);
  letter-spacing: -0.04em;
}

/* ---------- the download page ---------- */

.dl-page {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
}

.dl-ribbon {
  z-index: -1;
}

.dl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: max(18px, env(safe-area-inset-top, 0px));
}

.theme-pick {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--lift);
}

.theme-pick button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-pick button[aria-pressed="true"] {
  background: var(--well);
  color: var(--ink);
}

.theme-pick svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dl {
  display: grid;
  gap: 2rem;
  align-content: center;
  padding-block: clamp(1.5rem, 6vh, 5rem);
}

@media (min-width: 900px) {
  .dl {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(3rem, 8vw, 8rem);
  }

  .dl-art {
    order: 2;
  }
}

.dl-main {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 32rem;
}

.dl-main h1 {
  font-size: clamp(2rem, 1.45rem + 1.7vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.dl-sub {
  color: var(--muted);
}

.dl-wait {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
}

.dl-wait a {
  color: var(--ink);
  font-weight: 600;
}

/* On a phone: no download, the way to the web app, and the link to send to a computer */
.dl-phone {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.dl-phone p:first-child {
  color: var(--muted);
}

.dl-phone .pill {
  width: 100%;
}

.os-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 0.6rem;
  padding: 4px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--well);
}

.os-pick button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 0.9375rem/1 var(--text);
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

.os-pick button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--lift);
}

.dl-panel {
  display: grid;
  gap: 0.9rem;
}

.dl-get {
  display: grid;
  gap: 0.6rem;
}

.dl-button {
  width: 100%;
  min-height: 52px;
}

.dl-button[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
  box-shadow: none;
}

.dl-meta {
  color: var(--muted);
  font-size: 0.8125rem;
}

.dl-block {
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.dl-h {
  margin-bottom: 0.55rem;
  font: 600 0.875rem/1.3 var(--text);
  letter-spacing: 0;
}

.req div {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.28rem 0;
  font-size: 0.875rem;
}

.req dt {
  flex: none;
  color: var(--muted);
}

.req dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
}

.first {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* The command sits on its own line, whole, and scrolls sideways in its box on a small screen. */
.first code {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.35rem;
  padding: 4px 8px;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--well);
  color: var(--ink);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.dl-note {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.dl-help {
  color: var(--muted);
  font-size: 0.875rem;
}

.dl-help a {
  color: var(--ink);
  font-weight: 600;
}

.dl-art {
  display: grid;
  place-items: center;
}

/* The app's icon as an object: a light tile, lit from above, in both themes. */
.app-tile {
  display: grid;
  place-items: center;
  width: clamp(112px, 26vw, 236px);
  aspect-ratio: 1;
  border: 1px solid rgba(23, 32, 42, 0.08);
  border-radius: 22.5%;
  background: linear-gradient(180deg, #ffffff, #e3e8ec);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 6px rgba(23, 32, 42, 0.06),
    0 2px 6px rgba(23, 32, 42, 0.08),
    0 44px 80px -34px rgba(23, 32, 42, 0.55);
}

.app-tile svg {
  width: 56%;
  height: auto;
}

:root:not(.i18n-wait) .app-tile {
  animation: sharpen 1.1s var(--ease) 0.15s both;
}

.dl-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.6rem;
  padding-top: 1.2rem;
  padding-bottom: max(1.4rem, env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 0.8125rem;
}

.dl-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin-left: auto;
}

.dl-links a {
  text-decoration: none;
}

.dl-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------- the win rate calculator (/win-rate-calculator) ---------- */

.calc {
  display: grid;
  gap: 2rem;
  align-content: center;
  padding-block: clamp(1.5rem, 6vh, 4.5rem);
}

@media (min-width: 900px) {
  .calc {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-areas:
      "intro card"
      "cta card";
    grid-template-rows: auto 1fr;
    column-gap: clamp(3rem, 7vw, 7rem);
    row-gap: 2.4rem;
    align-items: start;
  }

  .calc-intro {
    grid-area: intro;
    align-self: end;
  }

  .calc-card {
    grid-area: card;
  }

  .calc-cta {
    grid-area: cta;
  }
}

.calc-intro {
  display: grid;
  gap: 1rem;
  max-width: 32rem;
}

.calc-intro h1 {
  font-size: clamp(2.2rem, 1.5rem + 2.4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.calc-card {
  gap: 22px;
}

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

@media (max-width: 560px) {
  /* Target distance on its own row; trades and wins side by side, their boxes level even when a label wraps. */
  .calc-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
  }

  .calc-field:first-child {
    grid-column: 1 / -1;
  }
}

.calc-field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.calc-field label {
  color: var(--muted);
  font-size: 0.8125rem;
}

.calc-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--well);
  color: var(--ink);
  font: 500 1.35rem var(--display);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.calc-field input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.calc-hint {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.calc-chance {
  display: grid;
  gap: 6px;
}

.calc-even {
  color: var(--muted);
  font-size: 0.875rem;
}

.calc-bars {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  font-size: 0.875rem;
}

.calc-track {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--well);
  overflow: hidden;
}

.calc-track span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--target);
  transition: width 0.3s var(--ease);
}

.calc-track #c-luck-bar {
  background: var(--luck);
}

.calc-bars .num {
  min-width: 2.5ch;
  font-weight: 600;
  text-align: right;
}

@media (max-width: 560px) {
  /* Labels wrap instead of squeezing the bars. */
  .calc-bars {
    grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) auto;
  }
}

.calc-verdict {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--well);
}

.calc-verdict-title {
  font: 500 clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem) / 1.15 var(--display);
  letter-spacing: -0.025em;
}

.calc-verdict-line {
  color: var(--muted);
}

.calc-verdict[data-verdict="unlikely"] {
  border-color: color-mix(in srgb, var(--target) 45%, transparent);
  background: var(--target-zone);
}

.calc-verdict[data-verdict="unlikely"] .calc-verdict-title {
  color: var(--target);
}

.calc-verdict[data-verdict="invalid"] .calc-verdict-title {
  color: var(--stop);
}

.calc-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.calc-share:not(:has(button:not([hidden]))) {
  display: none;
}

.calc-note {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.calc-cta {
  display: grid;
  gap: 0.8rem;
  max-width: 32rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.calc-cta h2 {
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.calc-cta p {
  color: var(--muted);
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* The link from the home page's chance box to the calculator. */
.calc-link {
  margin-top: 10px;
  font-size: 0.875rem;
}

.calc-link a {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- less motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
