/* Cadmium product page (Views/Home/Cadmium.cshtml). Cadmium wears its own brand: a
   warm charcoal ground, like a primed dark canvas, and the three cadmium pigments on
   it: yellow, orange and red. The name is painted in them, stroke by stroke. Builds on
   qx.css for reveals; motion in cadmium.js. Prefix: cd-. */

.cd {
  --cd-0: #0d0b0a;
  --cd-1: #141110;
  --cd-2: #1e1a18;
  --cd-3: #2b2522;
  --cd-text: #f3ede6;
  --cd-text-2: #b5a99f;
  --cd-text-3: #8d8279;
  --cd-line: rgba(255, 240, 225, 0.08);
  --cd-line-2: rgba(255, 240, 225, 0.17);
  /* The pigments. Red is for paint and large shapes only: on this ground it is too
     dark for small text (4:1), so small text and marks use --cd-accent (10:1). */
  --cd-yellow: #ffd92e;
  --cd-orange: #ff7a1c;
  --cd-red: #e3202c;
  --cd-accent: #ffb22a;
  --cd-paint: linear-gradient(100deg, var(--cd-yellow), #ffa51f 36%, var(--cd-orange) 60%, var(--cd-red));
  --cd-err: #ff8f86;
  --cd-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --cd-ease: cubic-bezier(0.16, 1, 0.3, 1);

  background:
    radial-gradient(70rem 40rem at 50% -10%, rgba(255, 122, 28, 0.08), transparent 70%),
    var(--cd-1);
  color: var(--cd-text);
}

body:has(.cd) {
  background: #141110;
}

.cd-sprite {
  display: none;
}

.cd-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cd-wrap {
  width: min(1240px, 100% - 2 * var(--qx-gutter));
  margin-inline: auto;
}

.cd-ic {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Type ---------- */

.cd-kicker {
  margin: 0 0 1.1rem;
  font-family: var(--cd-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cd-accent);
}

.cd-h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4.6vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.cd-sub {
  max-width: 58ch;
  margin: 1.25rem 0 0;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--cd-text-2);
}

.cd-sub a {
  color: var(--cd-text);
  text-decoration-line: underline;
  text-decoration-color: rgba(255, 122, 28, 0.5);
  text-underline-offset: 0.2em;
}

.cd-head {
  max-width: 50rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.cd-sec {
  padding-block: clamp(5rem, 12vh, 8rem);
  border-top: 1px solid var(--cd-line);
}

/* ---------- Buttons ---------- */

.cd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.1rem;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.4s ease, transform 0.4s var(--cd-ease);
}

.cd-btn--paint {
  background: linear-gradient(100deg, var(--cd-yellow), #ff9a1f 55%, #ff6a1b);
  color: #1c0d03;
  box-shadow: 0 0 0 rgba(255, 122, 28, 0);
}

.cd-btn--paint:hover {
  box-shadow: 0 8px 34px rgba(255, 122, 28, 0.45);
  transform: translateY(-2px);
}

.cd-btn--ghost {
  border-color: var(--cd-line-2);
  color: var(--cd-text);
}

.cd-btn--ghost:hover {
  border-color: rgba(255, 240, 225, 0.4);
  background: rgba(255, 240, 225, 0.06);
}

.cd-btn:focus-visible,
.cd a:focus-visible {
  outline: 2px solid var(--cd-yellow);
  outline-offset: 3px;
}

.cd-btn:disabled {
  cursor: progress;
  opacity: 0.7;
}

/* ---------- Hero: the name paints itself ---------- */

.cd-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: calc(100svh - 4rem);
  padding-block: clamp(3rem, 8vh, 5rem);
  overflow: hidden;
  text-align: center;
}

/* the weave of the canvas, fading out toward the edges */
.cd-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 240, 225, 0.028) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 240, 225, 0.028) 0 1px, transparent 1px 4px);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 15%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 45%, #000 15%, transparent 75%);
}

/* Three soft fields of pigment behind the name. They move a little against the
   pointer (--mx/--my) and sink as the page scrolls (--s); cadmium.js sets all three. */
.cd-fields {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  transform: translate(calc(var(--mx, 0) * -18px), calc(var(--my, 0) * -10px + var(--s, 0) * 70px));
  transition: transform 0.9s var(--cd-ease);
}

.cd-fields span {
  position: absolute;
  border-radius: 50%;
  animation: cd-drift 24s ease-in-out infinite alternate;
}

.cd-fields span:nth-child(1) {
  left: -14%;
  top: -4%;
  width: min(54rem, 62vw);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(255, 217, 46, 0.2), rgba(255, 217, 46, 0.06) 55%, transparent);
}

.cd-fields span:nth-child(2) {
  left: 24%;
  bottom: -42%;
  width: min(62rem, 76vw);
  aspect-ratio: 1.25;
  background: radial-gradient(closest-side, rgba(255, 122, 28, 0.24), rgba(255, 122, 28, 0.07) 55%, transparent);
  animation-duration: 31s;
  animation-direction: alternate-reverse;
}

.cd-fields span:nth-child(3) {
  right: -16%;
  top: -12%;
  width: min(56rem, 64vw);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(227, 32, 44, 0.3), rgba(227, 32, 44, 0.08) 55%, transparent);
  animation-duration: 27s;
}

@keyframes cd-drift {
  from { transform: translate(-2.5rem, 1rem) scale(1); }
  to { transform: translate(2.5rem, -1.5rem) scale(1.08); }
}

.cd-hero-center {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
}

.cd-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 0 clamp(2rem, 5vh, 3.25rem);
  font-family: var(--cd-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cd-text-3);
  opacity: 0;
  animation: qx-fade 0.8s ease 0.1s forwards;
}

.cd-crumb a {
  color: var(--cd-text-2);
  text-decoration: none;
  transition: color 0.2s ease;
}

.cd-crumb a:hover {
  color: var(--cd-text);
}

/* Cadmium's cell in the periodic table: 48, Cd. */
.cd-tile {
  display: grid;
  justify-items: start;
  width: 2.5rem;
  height: 2.7rem;
  margin-right: 0.5rem;
  padding: 0.25rem 0.32rem;
  border: 1px solid rgba(255, 178, 42, 0.55);
  border-radius: 0.3rem;
  background: rgba(255, 122, 28, 0.08);
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cd-accent);
}

.cd-tile b {
  font-size: 0.56rem;
  font-weight: 500;
}

.cd-tile i {
  align-self: end;
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 1.12rem;
  font-style: normal;
  font-weight: 700;
}

.cd-status {
  margin-left: 0.4rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(255, 178, 42, 0.45);
  border-radius: 999px;
  color: var(--cd-accent);
  letter-spacing: 0.1em;
}

/* The painted wordmark (Views/Shared/_CadmiumWordmark.cshtml): nine brush strokes of
   thick, wet paint. In the hero each stroke is painted in turn, in the order a hand
   would write the word. Its colours and lighting are set on the SVG itself, so the mark
   also looks right on pages that do not load this file. */
.cd-title {
  width: min(100%, 62rem);
  margin: 0;
}

.cd-wm {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.cd-hero .cd-wm {
  filter: drop-shadow(0 18px 38px rgba(227, 60, 20, 0.28));
}

@media (prefers-reduced-motion: no-preference) {
  /* pathLength is 1 on every stroke: one dash as long as the stroke, pulled into view.
     The gap is a little longer than the stroke so no cap shows before it starts. */
  .cd-hero .cd-wm path {
    stroke-dasharray: 1 1.1;
    stroke-dashoffset: 1.03;
    animation: cd-stroke 0.66s cubic-bezier(0.55, 0.06, 0.2, 1) forwards;
    animation-delay: calc(0.3s + var(--i, 0) * 0.17s);
  }
}

.cd-wm g > path:nth-child(2) { --i: 1; }
.cd-wm g > path:nth-child(3) { --i: 2; }
.cd-wm g > path:nth-child(4) { --i: 3; }
.cd-wm g > path:nth-child(5) { --i: 4; }
.cd-wm g > path:nth-child(6) { --i: 5; }
.cd-wm g > path:nth-child(7) { --i: 6; }
.cd-wm g > path:nth-child(8) { --i: 7; }
.cd-wm g > path:nth-child(9) { --i: 8; }

@keyframes cd-stroke {
  to { stroke-dashoffset: 0; }
}

.cd-tagline {
  margin: clamp(1.5rem, 4vh, 2.5rem) 0 0;
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  color: var(--cd-text-2);
  opacity: 0;
  animation: qx-fade-up 0.9s var(--cd-ease) 1.7s forwards;
}

.cd-actions--center {
  justify-content: center;
  opacity: 0;
  animation: qx-fade-up 0.9s var(--cd-ease) 1.9s forwards;
}

/* ---------- Intro: the headline that used to open the page ---------- */

.cd-h1 {
  margin: 0;
  font-size: clamp(3rem, 8.4vw, 7.75rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

/* only the lines move: the heading itself skips qx's fade-up */
.qx-js .qx .cd-h1[data-reveal] {
  opacity: 1;
  transform: none;
}

.cd-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.cd-line > span {
  display: inline-block;
}

.qx-js .cd-line > span {
  transform: translateY(110%);
  transition: transform 1.1s var(--cd-ease);
}

.qx-js .cd-line:nth-child(2) > span {
  transition-delay: 0.12s;
}

.qx-js .cd-h1.is-in .cd-line > span {
  transform: none;
}

.cd-h1 em {
  font-style: normal;
  color: var(--cd-orange);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .cd-h1 em {
    background: var(--cd-paint);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.cd-lead {
  max-width: 54ch;
  margin: 1.75rem 0 0;
  font-size: clamp(1.08rem, 1.35vw, 1.25rem);
  line-height: 1.6;
  color: var(--cd-text-2);
}

/* The app screenshot: tilted back at first, flattening as it scrolls up
   (cadmium.js sets --t from 1 to 0). Not on the page at the moment: the old
   screenshot was removed when the editor's interface changed, and these styles
   wait for its replacement (docs/cadmium-images.md). */
.cd-app {
  --t: 1;
  position: relative;
  margin: clamp(2.5rem, 6vh, 4rem) 0 0;
  border: 1px solid var(--cd-line-2);
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--cd-0);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.6),
    0 0 90px rgba(255, 122, 28, calc(0.06 + (1 - var(--t)) * 0.08));
  transform: perspective(1600px) rotateX(calc(var(--t) * 14deg)) scale(calc(1 - var(--t) * 0.06));
  transform-origin: 50% 0%;
}

.cd-app img {
  display: block;
  width: 100%;
  height: auto;
}

.cd-app-caption {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--cd-text-3);
}

/* ---------- Features ---------- */

.cd-feats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cd-line);
  border-radius: 1.25rem;
  background: var(--cd-line);
  list-style: none;
}

.cd-feat {
  position: relative;
  padding: clamp(1.5rem, 2.5vw, 2rem);
  background: var(--cd-1);
  transition: background-color 0.4s ease;
}

.cd-feat:hover {
  background: #1a1614;
}

/* the icons take the three pigments in turn (the red one lightened to read as a mark) */
.cd-feat .cd-ic {
  color: var(--cd-yellow);
  filter: drop-shadow(0 0 8px rgba(255, 122, 28, 0.35));
}

.cd-feat:nth-child(3n + 2) .cd-ic { color: var(--cd-orange); }
.cd-feat:nth-child(3n) .cd-ic { color: #ff5340; }

.cd-feat h3 {
  margin: 1.1rem 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.cd-feat p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--cd-text-2);
}

/* ---------- Pipeline: a light travels along the steps ---------- */

.cd-steps {
  --p: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 2.25rem 0 0;
  list-style: none;
}

.cd-steps::before,
.cd-steps::after {
  content: '';
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  right: 0;
  height: 2px;
  border-radius: 2px;
}

.cd-steps::before {
  background: var(--cd-line-2);
}

.cd-steps::after {
  background: linear-gradient(90deg, var(--cd-yellow), var(--cd-orange) 60%, var(--cd-red));
  box-shadow: 0 0 14px rgba(255, 122, 28, 0.5);
  transform: scaleX(var(--p));
  transform-origin: left;
}

.cd-step {
  position: relative;
  display: grid;
  gap: 0.45rem;
}

.cd-step-dot {
  position: absolute;
  top: -2.25rem;
  left: 0;
  z-index: 1;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid var(--cd-line-2);
  border-radius: 50%;
  background: var(--cd-1);
  transition: border-color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

/* each step lights in the colour the line has reached there */
.cd-step.is-lit .cd-step-dot {
  border-color: var(--dot, var(--cd-accent));
  background: var(--dot, var(--cd-accent));
  box-shadow: 0 0 16px rgba(255, 122, 28, 0.7);
}

.cd-step:nth-child(1) { --dot: var(--cd-yellow); }
.cd-step:nth-child(2) { --dot: #ffa51f; }
.cd-step:nth-child(3) { --dot: var(--cd-orange); }
.cd-step:nth-child(4) { --dot: #f0402a; }

.cd-step b {
  font-size: 1.35rem;
  font-weight: 650;
}

.cd-step span:last-child {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--cd-text-2);
}

.cd-note {
  margin: 2.5rem 0 0;
  font-family: var(--cd-mono);
  font-size: 0.8rem;
  color: var(--cd-text-3);
}

/* ---------- Scripting ---------- */

.cd-script-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.cd-code {
  overflow: hidden;
  border: 1px solid var(--cd-line-2);
  border-radius: 0.9rem;
  background: var(--cd-0);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.cd-code-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--cd-line);
  background: var(--cd-2);
}

.cd-code-bar i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--cd-3);
}

.cd-code-bar span {
  margin-left: 0.5rem;
  font-family: var(--cd-mono);
  font-size: 0.75rem;
  color: var(--cd-text-3);
}

.cd-code pre {
  margin: 0;
  padding: 1.25rem 1.4rem 1.4rem;
  overflow-x: auto;
  font-family: var(--cd-mono);
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--cd-text);
}

.cd-code pre:focus-visible {
  outline: 2px solid var(--cd-yellow);
  outline-offset: -2px;
}

.cd-code .k { color: #ff9a4a; }
.cd-code .s { color: #ffdc8a; }
.cd-code .n { color: #ff8f86; }

/* ---------- Magnesium plugins ----------
   On Cadmium's own ground. Magnesium appears as its wordmark. */

.cd-mg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(5rem, 12vh, 8rem);
  border-top: 1px solid var(--cd-line);
  color: var(--cd-text);
}

.cd-mg-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(46rem 22rem at 15% 0%, rgba(255, 122, 28, 0.06), transparent 70%);
}

.cd-mg-head {
  max-width: 56rem;
}

.cd-mg-kicker,
.cd-mg-h3 {
  margin: 0 0 1.25rem;
  font-family: var(--cd-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cd-accent);
}

.cd-mg-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em 0.5em;
  margin: 0;
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
}

.cd-mg-wm {
  width: auto;
  height: 0.92em;
}

.cd-mg-lede {
  max-width: 58ch;
  margin: 1.5rem 0 0;
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--cd-text-2);
}

/* outside (Python) and inside (Magnesium) */
.cd-mg-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.cd-mg-side {
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--cd-line);
  border-radius: 1rem;
  background: var(--cd-2);
}

.cd-mg-side--in {
  border-color: rgba(255, 122, 28, 0.3);
  background: linear-gradient(135deg, rgba(255, 122, 28, 0.07), rgba(255, 122, 28, 0.02)), var(--cd-2);
}

.cd-mg-side-label {
  margin: 0 0 0.75rem;
  font-family: var(--cd-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cd-text-3);
}

.cd-mg-side-label span {
  color: var(--cd-text);
}

.cd-mg-side-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--cd-text-2);
}

.cd-mg-h3 {
  margin-top: clamp(3.5rem, 7vw, 5rem);
}

.cd-mg-caps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cd-line);
  border-radius: 1.25rem;
  background: var(--cd-line);
  list-style: none;
}

.cd-mg-cap {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 1.5rem 1.6rem;
  background: var(--cd-1);
  transition: background-color 0.4s ease;
}

.cd-mg-cap:hover {
  background: #1a1614;
}

.cd-mg-cap b {
  font-size: 1.12rem;
  font-weight: 650;
}

.cd-mg-cap > span {
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--cd-text-2);
}

.cd-mg code {
  font-family: var(--cd-mono);
  font-size: 0.85em;
  color: var(--cd-accent);
}

.cd-mg-events {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cd-mg-events code {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--cd-line-2);
  border-radius: 999px;
  background: var(--cd-2);
  font-size: 0.78rem;
}

.cd-mg-why {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cd-mg-why li {
  display: grid;
  gap: 0.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--cd-line-2);
}

.cd-mg-why b {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cd-text);
}

.cd-mg-why span {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--cd-text-2);
}

.cd-mg-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--cd-line);
}

.cd-mg-foot p {
  max-width: 62ch;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--cd-text-3);
}

.cd-mg-link {
  display: inline-flex;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--cd-accent);
  text-decoration: none;
}

.cd-mg-link span {
  transition: transform 0.4s var(--cd-ease);
}

.cd-mg-link:hover span {
  transform: translateX(4px);
}

/* ---------- Waitlist ---------- */

.cd-close {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
}

.cd-close::before {
  content: '';
  position: absolute;
  inset: auto 0 -30%;
  z-index: -1;
  height: 90%;
  background: radial-gradient(45% 55% at 50% 100%, rgba(255, 122, 28, 0.12), transparent 70%);
  pointer-events: none;
}

.cd-wl {
  display: grid;
  justify-items: center;
}

/* a drop of wet paint */
.cd-drop {
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 30%),
    linear-gradient(140deg, var(--cd-yellow), var(--cd-orange) 55%, var(--cd-red));
  box-shadow: 0 0 22px 6px rgba(255, 122, 28, 0.45), 0 0 70px 24px rgba(227, 32, 44, 0.18);
  animation: cd-pulse 3.2s ease-in-out infinite;
}

@keyframes cd-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.82); }
}

.cd-h2--wl {
  max-width: 16ch;
}

.cd-sub--wl {
  max-width: 56ch;
}

.cd-form {
  display: grid;
  gap: 0.85rem;
  width: min(100%, 30rem);
  margin-top: 2.25rem;
  text-align: left;
}

.cd-input {
  width: 100%;
  height: 3.25rem;
  padding: 0 1.1rem;
  border: 1px solid var(--cd-line-2);
  border-radius: 0.8rem;
  background: var(--cd-2);
  font: inherit;
  font-size: 1rem;
  color: var(--cd-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cd-input::placeholder {
  color: var(--cd-text-3);
}

.cd-input:focus {
  outline: none;
  border-color: rgba(255, 122, 28, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 122, 28, 0.15);
}

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

.cd-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--cd-text-2);
  cursor: pointer;
}

.cd-consent a {
  color: var(--cd-text);
  text-decoration-line: underline;
  text-underline-offset: 0.18em;
}

.cd-check {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--cd-accent);
}

.cd-field-error {
  font-size: 0.85rem;
  color: var(--cd-err);
}

.cd-field-error:empty {
  display: none;
}

.cd-form .cf-turnstile {
  min-height: 65px;
}

.cd-btn--submit {
  width: 100%;
  margin-top: 0.25rem;
}

.cd-done {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  margin-top: 2.25rem;
  padding: 1.75rem 2rem;
  border: 1px solid rgba(255, 122, 28, 0.35);
  border-radius: 1rem;
  background: rgba(255, 122, 28, 0.05);
}

.cd-done:focus {
  outline: none;
}

.cd-done-ic {
  width: 30px;
  height: 30px;
  color: var(--cd-accent);
}

.cd-done-title {
  margin: 0.25rem 0 0;
  font-size: 1.2rem;
  font-weight: 650;
}

.cd-done-body {
  margin: 0;
  color: var(--cd-text-2);
}

.cd-privacy {
  margin: 1.5rem 0 0;
  font-size: 0.85rem;
  color: var(--cd-text-3);
}

/* ---------- Small screens ---------- */

@media (max-width: 1023px) {
  .cd-mg-why {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .cd-script-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 639px) {
  .cd-hero {
    min-height: 0;
    padding-block: 5rem 4rem;
  }

  .cd-mg-split,
  .cd-mg-caps,
  .cd-mg-why {
    grid-template-columns: minmax(0, 1fr);
  }

  .cd-feats {
    grid-template-columns: minmax(0, 1fr);
  }

  .cd-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    padding: 0 0 0 2.25rem;
  }

  .cd-steps::before,
  .cd-steps::after {
    top: 0.45rem;
    bottom: 0;
    left: 0.45rem;
    right: auto;
    width: 2px;
    height: auto;
  }

  .cd-steps::after {
    transform: scaleY(var(--p));
    transform-origin: top;
  }

  .cd-step-dot {
    top: 0.2rem;
    left: -2.25rem;
  }

  .cd-actions .cd-btn {
    flex: 1 1 auto;
  }
}

/* ---------- Reduced motion ---------- */

/* The name is simply there (its paint-on only exists under no-preference, above), the
   pigment fields and the drop hold still, and the screenshot lies flat. */
@media (prefers-reduced-motion: reduce) {
  .cd-fields,
  .cd-fields span {
    animation: none;
    transform: none;
    transition: none;
  }

  .cd-drop {
    animation: none;
  }

  .cd-app {
    transform: none;
  }
}
