/* ==========================================================================
   Lingoram — waitlist landing page
   Visual language mirrors the app's "Studio" skin: ink + paper with an
   electric lime signal colour (tokens copied from components/studio/studio.css).
   Mobile-first, logical properties only (RTL-safe), light + dark via
   prefers-color-scheme.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ds-font: Inter, "Inter var", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Noto Sans", "Noto Sans Arabic", "Noto Sans Hebrew", "Helvetica Neue", Arial, sans-serif;

  --ds-page: #f4f4f6;
  --ds-surface: #ffffff;
  --ds-surface-2: #f1f1f4;
  --ds-text: #0e0f13;
  --ds-muted: #5b5f6d;
  --ds-line: #e2e2e8;
  --ds-line-strong: #c9cad3;
  --ds-accent: #0e0f13;
  --ds-on-accent: #ffffff;
  --ds-accent-soft: #f1fadc;
  --ds-accent-ink: #2e4600;
  --ds-gold: #e09a00;
  --ds-focus: #6a5cff;
  --ds-danger: #c4271c;
  --ds-danger-soft: #fdeceb;
  --ds-success: #2e6b00;
  --ds-success-soft: #eaf7d2;

  --ds-radius: 20px;
  --ds-radius-sm: 12px;
  --ds-shadow: 0 30px 70px -30px rgba(14, 15, 19, .45);
  --ds-shadow-sm: 0 1px 2px rgba(14, 15, 19, .06), 0 8px 24px -12px rgba(14, 15, 19, .18);

  /* Ink stage (the app's sidebar palette — dark in both themes) */
  --lime: #c6f24e;
  --lime-ink: #0e0f13;
  --stage-bg: #0e1014;
  --stage-surface: #171a21;
  --stage-text: #eceef2;
  --stage-muted: #a8aebb;
  --stage-line: #252932;
  --stage-focus: #a79dff;

  --container: 1180px;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ds-page: #0b0c0f;
    --ds-surface: #14161b;
    --ds-surface-2: #1d2027;
    --ds-text: #eceef2;
    --ds-muted: #a3a8b6;
    --ds-line: #2a2e37;
    --ds-line-strong: #3a3f4b;
    --ds-accent: #c6f24e;
    --ds-on-accent: #0e0f13;
    --ds-accent-soft: #232b10;
    --ds-accent-ink: #d8fb80;
    --ds-focus: #a79dff;
    --ds-danger: #ff8a80;
    --ds-danger-soft: #3a1714;
    --ds-success: #d8fb80;
    --ds-success-soft: #232b10;
    --ds-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8);
    --ds-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);

    --stage-bg: #08090b;
    --stage-surface: #121419;

    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ds-page);
  color: var(--ds-text);
  font-family: var(--ds-font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { padding: 0; border: 0; min-inline-size: 0; }
legend { padding: 0; }
img, svg { display: block; max-inline-size: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

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

::selection { background: var(--lime); color: var(--lime-ink); }

.container {
  inline-size: 100%;
  max-inline-size: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }

.skip-link {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Header ---------- */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-block-size: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-block-size: 44px;
}
.brand__mark { inline-size: 36px; block-size: 36px; border-radius: 10px; }
.brand__mark--sm { inline-size: 28px; block-size: 28px; border-radius: 8px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.brand__sub { font-size: .72rem; font-weight: 600; color: var(--ds-muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge--soon {
  background: var(--ds-text);
  color: var(--ds-surface);
}
.badge--soon::before {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: var(--lime);
}
@media (prefers-color-scheme: dark) {
  .badge--soon { background: var(--ds-surface-2); color: var(--ds-text); border: 1px solid var(--ds-line); }
}

/* ---------- Hero / stage ---------- */
.hero { padding-block: 4px 40px; }

.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 28px;
  background: var(--stage-bg);
  color: var(--stage-text);
  padding: 28px 16px 16px;
  border: 1px solid var(--stage-line);
}
.stage :focus-visible { outline-color: var(--stage-focus); }
.stage .card :focus-visible { outline-color: var(--ds-focus); }

.stage__glow {
  position: absolute;
  z-index: -1;
  inset-block-start: -30%;
  inset-inline-end: -25%;
  inline-size: 90%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(198, 242, 78, .22), rgba(198, 242, 78, 0) 70%);
  pointer-events: none;
}
.stage::after {
  /* faint dot grid, like graph paper */
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: radial-gradient(rgba(236, 238, 242, .07) 1px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  pointer-events: none;
}

@media (min-width: 640px) {
  .stage { padding: 40px 32px 32px; border-radius: 32px; }
}
@media (min-width: 1024px) {
  .hero { padding-block: 8px 72px; }
  .stage { padding: 64px 56px; }
}

.hero__grid {
  display: grid;
  gap: 28px;
  align-items: start;
}
@media (min-width: 1024px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
    gap: 56px;
    align-items: start;
  }
  .hero__copy { padding-block-start: 28px; }
}

.hero__copy { padding-inline: 4px; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stage-line);
  background: var(--stage-surface);
  font-size: .8rem;
  font-weight: 700;
  color: var(--stage-text);
}
.kicker__dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(198, 242, 78, .18);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(198, 242, 78, .25); }
  50% { box-shadow: 0 0 0 7px rgba(198, 242, 78, 0); }
}

.hero__title {
  margin-block-start: 18px;
  font-size: clamp(2.1rem, 1.3rem + 4.2vw, 4rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 800;
  text-wrap: balance;
}
.hero__title::after {
  /* lime underline flourish */
  content: "";
  display: block;
  inline-size: 72px;
  block-size: 6px;
  margin-block-start: 18px;
  border-radius: 999px;
  background: var(--lime);
}

.hero__subtitle {
  margin-block-start: 18px;
  max-inline-size: 36rem;
  font-size: clamp(1rem, .95rem + .3vw, 1.125rem);
  color: var(--stage-muted);
  text-wrap: pretty;
}

.hero__points {
  display: none; /* mobile: keep the form near the fold */
  gap: 10px;
  margin-block-start: 22px;
}
@media (min-width: 640px) { .hero__points { display: grid; } }
.hero__points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .95rem;
  font-weight: 600;
}
.tick {
  flex: none;
  inline-size: 22px;
  block-size: 22px;
  padding: 3px;
  border-radius: 7px;
  background: var(--lime);
  color: var(--lime-ink);
}

/* Decorative greetings */
.greetings { display: none; }
@media (min-width: 1024px) {
  .greetings {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
  }
}
.greeting {
  position: absolute;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--stage-line);
  background: rgba(23, 26, 33, .7);
  color: var(--stage-muted);
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
  animation: float 9s ease-in-out infinite;
}
.greeting--1 { inset-block-start: 22px;  inset-inline-start: 46%; }
.greeting--2 { inset-block-start: 18px;  inset-inline-end: 9%; animation-delay: -2s; }
.greeting--3 { inset-block-end: 22px;    inset-inline-start: 40%; animation-delay: -4s; color: var(--lime); border-color: rgba(198, 242, 78, .35); }
.greeting--4 { inset-block-end: 20px;    inset-inline-start: 56px; animation-delay: -6s; }
.greeting--5 { inset-block-end: 22px;    inset-inline-end: 9%; animation-delay: -1s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- Card ---------- */
.card {
  position: relative;
  background: var(--ds-surface);
  color: var(--ds-text);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow);
}
.signup { padding: 20px 16px; scroll-margin-block-start: 16px; }
.signup:focus { outline: none; }
@media (min-width: 400px) { .signup { padding: 24px 20px; } }
@media (min-width: 640px) { .signup { padding: 28px; } }

.signup__title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.signup__lead {
  margin-block-start: 4px;
  font-size: .9rem;
  color: var(--ds-muted);
}

/* ---------- Form ---------- */
.form {
  display: grid;
  gap: 20px;
  margin-block-start: 20px;
}

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

.field__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  font-weight: 800;
  color: var(--ds-text);
}
.field__step {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 22px;
  block-size: 22px;
  border-radius: 7px;
  background: var(--ds-text);
  color: var(--lime);
  font-size: .72rem;
  font-weight: 900;
}
@media (prefers-color-scheme: dark) {
  .field__step { background: var(--lime); color: var(--lime-ink); }
}

/* legend inside grid fieldset: give it the same gap as other children */
.field--langs > legend { margin-block-end: 10px; }

.field__hint {
  font-size: .8rem;
  color: var(--ds-muted);
  line-height: 1.4;
}
/* Empty-state hint is only shown while the chip list is empty.
   (Requires the <ul> to have no whitespace children; JS can also toggle [hidden].) */
.chips:not(:empty) + .field__hint { display: none; }

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ds-danger);
}
.field__error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 16px;
  block-size: 16px;
  margin-block-start: 1px;
  border-radius: 50%;
  background: var(--ds-danger);
  color: var(--ds-surface);
  font-size: .68rem;
  font-weight: 900;
}

/* Invalid state: JS sets aria-invalid="true" on the email input, and
   either aria-invalid="true" or .is-invalid on a language fieldset. */
.field.is-invalid .picker__toggle,
.field[aria-invalid="true"] .picker__toggle {
  border-color: var(--ds-danger);
  color: var(--ds-danger);
}

/* ---------- Chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips:empty { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-block-size: 36px;
  padding-inline: 14px 4px;
  border-radius: 999px;
  border: 1px solid var(--ds-text);
  background: var(--ds-accent-soft);
  color: var(--ds-text);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.2;
  animation: chip-in .22s var(--ease);
}
/* "learn" chips use the inverse ink look so the two lists are distinguishable */
.chips--learn .chip {
  background: var(--ds-text);
  color: var(--ds-surface);
}
.chips--learn .chip .chip__remove { color: var(--lime); }
.chips--learn .chip .chip__remove:hover { background: rgba(198, 242, 78, .18); }
@media (prefers-color-scheme: dark) {
  .chip { border-color: rgba(198, 242, 78, .45); }
  .chips--learn .chip { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
  .chips--learn .chip .chip__remove { color: var(--lime-ink); }
  .chips--learn .chip .chip__remove:hover { background: rgba(14, 15, 19, .12); }
}

.chip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-inline-size: 18ch;
}

.chip__remove {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 36px;
  block-size: 36px;
  margin-block: -4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ds-muted);
  transition: background-color .15s, color .15s;
}
.chip__remove::before,
.chip__remove::after {
  content: "";
  position: absolute;
  inline-size: 12px;
  block-size: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}
.chip__remove::after { transform: rotate(-45deg); }
.chip__remove:hover { background: rgba(14, 15, 19, .08); color: var(--ds-text); }
.chip__remove:focus-visible { outline-offset: 0; border-radius: 50%; }
@media (prefers-color-scheme: dark) {
  .chip__remove:hover { background: rgba(255, 255, 255, .1); }
}

@keyframes chip-in {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: none; }
}

/* ---------- Picker (combobox) ---------- */
.picker { position: relative; display: grid; gap: 8px; }

.picker__toggle {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-block-size: 44px;
  padding-inline: 14px 18px;
  border-radius: 999px;
  border: 1.5px dashed var(--ds-line-strong);
  background: transparent;
  color: var(--ds-text);
  font-size: .875rem;
  font-weight: 700;
  transition: border-color .15s, background-color .15s;
}
.picker__toggle:hover { border-color: var(--ds-text); background: var(--ds-surface-2); }
.picker__toggle[aria-expanded="true"] {
  border-style: solid;
  border-color: var(--ds-text);
  background: var(--ds-surface-2);
}
.picker__toggle-icon {
  inline-size: 18px;
  block-size: 18px;
  transition: transform .2s var(--ease);
}
.picker__toggle[aria-expanded="true"] .picker__toggle-icon { transform: rotate(45deg); }
.picker__toggle:disabled { opacity: .5; cursor: not-allowed; }

.picker__panel {
  display: grid;
  gap: 0;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-sm);
  overflow: hidden;
  animation: panel-in .18s var(--ease);
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.picker__search-wrap {
  position: relative;
  border-block-end: 1px solid var(--ds-line);
}
.picker__search-icon {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 14px;
  inline-size: 18px;
  block-size: 18px;
  color: var(--ds-muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.picker__search {
  inline-size: 100%;
  min-block-size: 48px;
  padding-inline: 42px 14px;
  border: 0;
  background: transparent;
  font-size: 1rem; /* >=16px avoids iOS zoom */
  color: var(--ds-text);
  -webkit-appearance: none;
  appearance: none;
}
.picker__search::placeholder { color: var(--ds-muted); opacity: 1; }
.picker__search:focus-visible { outline: none; }
.picker__search-wrap:focus-within { box-shadow: inset 0 -2px 0 var(--ds-focus); }
.picker__search::-webkit-search-cancel-button { cursor: pointer; }

.picker__list {
  max-block-size: min(264px, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  scrollbar-width: thin;
}
.picker__list:empty { display: none; }

.picker__group {
  padding: 10px 10px 4px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ds-muted);
}

.picker__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 44px;
  padding-block: 8px;
  padding-inline: 12px 40px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.picker__option-name {
  font-weight: 700;
  font-size: .925rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker__option-meta {
  margin-inline-start: auto;
  font-size: .8rem;
  color: var(--ds-muted);
  white-space: nowrap;
}

.picker__option:hover,
.picker__option.is-active {
  background: var(--ds-surface-2);
}
.picker__option.is-active {
  box-shadow: inset 0 0 0 2px var(--ds-focus);
}

/* selected: lime-tinted with a check mark at the inline end */
.picker__option[aria-selected="true"] {
  background: var(--ds-accent-soft);
}
.picker__option[aria-selected="true"] .picker__option-meta { color: var(--ds-accent-ink); }
.picker__option[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline-end: 14px;
  inset-block-start: 50%;
  inline-size: 12px;
  block-size: 7px;
  margin-block-start: -5px;
  border-inline-start: 2.5px solid currentColor;
  border-block-end: 2.5px solid currentColor;
  transform: rotate(-45deg);
  color: var(--ds-text);
}
.picker__option[aria-selected="true"].is-active { background: var(--ds-accent-soft); }

.picker__option[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .45;
}
.picker__option[aria-disabled="true"]:hover { background: transparent; }

.picker__empty {
  padding: 18px 16px;
  text-align: center;
  font-size: .875rem;
  color: var(--ds-muted);
}

/* ---------- Email input ---------- */
.input {
  inline-size: 100%;
  min-block-size: 50px;
  padding-inline: 16px;
  border-radius: var(--ds-radius-sm);
  border: 1.5px solid var(--ds-line-strong);
  background: var(--ds-surface);
  color: var(--ds-text);
  font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
/* keep the LTR email readable but aligned with the page direction */
.input[dir="ltr"]:placeholder-shown { text-align: start; }
:root[dir="rtl"] .input[dir="ltr"] { text-align: end; }
.input::placeholder { color: var(--ds-muted); opacity: .8; }
.input:hover { border-color: var(--ds-muted); }
.input:focus-visible {
  outline: none;
  border-color: var(--ds-focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ds-focus) 22%, transparent);
  border-radius: var(--ds-radius-sm);
}
.input[aria-invalid="true"] {
  border-color: var(--ds-danger);
  background: var(--ds-danger-soft);
}
.input[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ds-danger) 22%, transparent);
}

/* ---------- Honeypot ---------- */
.hp {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Turnstile ---------- */
.turnstile:empty { display: none; }
.turnstile {
  display: flex;
  justify-content: center;
  min-block-size: 65px;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-block-size: 52px;
  padding-inline: 24px;
  border: 0;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.005em;
  text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background-color .15s;
}
.btn--block { inline-size: 100%; }

.btn--primary {
  background: var(--ds-accent);
  color: var(--ds-on-accent);
  box-shadow: 0 10px 24px -12px rgba(14, 15, 19, .55);
}
.btn--primary .btn__icon { color: var(--lime); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(14, 15, 19, .6); }
.btn--primary:active { transform: translateY(0); }
@media (prefers-color-scheme: dark) {
  .btn--primary { box-shadow: 0 10px 28px -12px rgba(198, 242, 78, .45); }
  .btn--primary .btn__icon { color: inherit; }
  .btn--primary:hover { box-shadow: 0 14px 32px -12px rgba(198, 242, 78, .55); }
}

.btn__icon {
  inline-size: 20px;
  block-size: 20px;
  flex: none;
  transition: transform .2s var(--ease);
}
.btn:hover .btn__icon:not(.icon-up) { transform: translateX(3px); }
:root[dir="rtl"] .icon-dir:not(.icon-up) { transform: scaleX(-1); }
:root[dir="rtl"] .btn:hover .icon-dir:not(.icon-up) { transform: scaleX(-1) translateX(3px); }

.btn__spinner {
  display: none;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-inline-end-color: transparent;
  animation: spin .7s linear infinite;
}

/* Loading: JS sets aria-busy="true" (and ideally disabled) on #submit */
.btn[aria-busy="true"] {
  cursor: progress;
  pointer-events: none;
  transform: none;
}
.btn[aria-busy="true"] .btn__icon { display: none; }
.btn[aria-busy="true"] .btn__spinner { display: inline-block; }
.btn[aria-busy="true"] .btn__label { opacity: .85; }
.btn:disabled:not([aria-busy="true"]) { opacity: .55; cursor: not-allowed; transform: none; }

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

/* ---------- Form status ---------- */
.form-status {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.45;
}
.form-status:empty { display: none; }
.form-status[data-state] {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--ds-radius-sm);
  border: 1px solid transparent;
}
.form-status[data-state]::before {
  content: "";
  flex: none;
  inline-size: 18px;
  block-size: 18px;
  margin-block-start: 1px;
  border-radius: 50%;
  background: currentColor;
  -webkit-mask: var(--status-icon) center / contain no-repeat;
  mask: var(--status-icon) center / contain no-repeat;
}
.form-status[data-state="error"] {
  background: var(--ds-danger-soft);
  border-color: color-mix(in srgb, var(--ds-danger) 35%, transparent);
  color: var(--ds-danger);
  --status-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1a9 9 0 1 0 0 18 9 9 0 0 0 0-18zm-1 4h2v6H9zm0 8h2v2H9z'/%3E%3C/svg%3E");
}
.form-status[data-state="success"] {
  background: var(--ds-success-soft);
  border-color: color-mix(in srgb, var(--ds-success) 35%, transparent);
  color: var(--ds-success);
  --status-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1a9 9 0 1 0 0 18 9 9 0 0 0 0-18zm-1.2 13L4.6 9.8l1.5-1.4 2.7 2.7 5.1-5.2 1.5 1.4z'/%3E%3C/svg%3E");
}
.form-status[data-state="loading"] {
  background: var(--ds-surface-2);
  color: var(--ds-muted);
}
.form-status[data-state="loading"]::before {
  background: none;
  -webkit-mask: none;
  mask: none;
  border: 2.5px solid currentColor;
  border-inline-end-color: transparent;
  animation: spin .7s linear infinite;
}

.form__consent {
  font-size: .76rem;
  line-height: 1.5;
  color: var(--ds-muted);
}
.form__consent a { font-weight: 700; text-underline-offset: 2px; }

/* ---------- Success panel ---------- */
.success {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-block: 28px 12px;
  text-align: center;
  animation: success-in .4s var(--ease);
}
.success:focus { outline: none; }
.success__icon {
  inline-size: 72px;
  block-size: 72px;
  margin-block-end: 6px;
  color: var(--ds-success);
}
@media (prefers-color-scheme: light) {
  .success__icon { color: #4f7a00; }
}
.success__icon svg { inline-size: 100%; block-size: 100%; }
.success__title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.success__body { max-inline-size: 30ch; color: var(--ds-text); }
.success__note { font-size: .875rem; color: var(--ds-muted); }
@keyframes success-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
/* When JS hides the form, the header copy can be hidden too by adding .is-done to .signup */
.signup.is-done .signup__head { display: none; }

/* ---------- Sections ---------- */
.section { padding-block: 32px 56px; }
@media (min-width: 1024px) { .section { padding-block: 32px 96px; } }

.section__head { max-inline-size: 40rem; margin-block-end: 28px; }
.eyebrow {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ds-muted);
}
.section__title {
  margin-block-start: 8px;
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  font-weight: 800;
  text-wrap: balance;
}

/* Steps */
.steps {
  display: grid;
  gap: 12px;
  counter-reset: step;
}
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 16px; } }

.step {
  padding: 20px;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-line);
  background: var(--ds-surface);
  transition: transform .2s var(--ease), border-color .2s;
}
.step:hover { transform: translateY(-2px); border-color: var(--ds-muted); }
.step__num {
  display: inline-grid;
  place-items: center;
  min-inline-size: 40px;
  block-size: 32px;
  padding-inline: 8px;
  border-radius: 10px;
  background: var(--ds-text);
  color: var(--lime);
  font-size: .8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  .step__num { background: var(--lime); color: var(--lime-ink); }
}
.step__title { margin-block-start: 14px; font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; }
.step__text { margin-block-start: 6px; font-size: .925rem; color: var(--ds-muted); }

/* Feature grid: preview + styles */
.feature-grid {
  display: grid;
  gap: 12px;
  margin-block-start: 12px;
}
@media (min-width: 900px) {
  .feature-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; margin-block-start: 16px; }
}

.preview {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 24px 16px 18px;
  border-radius: var(--ds-radius);
  background: var(--stage-bg);
  color: var(--stage-text);
  border: 1px solid var(--stage-line);
}
@media (min-width: 640px) { .preview { padding: 32px 28px 22px; } }

.preview__card {
  padding: 18px;
  border-radius: var(--ds-radius-sm);
  background: #ffffff;
  color: #0e0f13;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .6);
  transform: rotate(-1.2deg);
}
:root[dir="rtl"] .preview__card { transform: rotate(1.2deg); }
@media (prefers-color-scheme: dark) {
  .preview__card { background: #1d2027; color: #eceef2; border: 1px solid #2a2e37; }
}
.preview__bar { display: flex; align-items: center; gap: 12px; }
.preview__tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: #0e0f13;
  color: var(--lime);
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.preview__meter {
  flex: 1;
  block-size: 6px;
  border-radius: 999px;
  background: rgba(127, 130, 145, .25);
  overflow: hidden;
}
.preview__meter span {
  display: block;
  inline-size: 62%;
  block-size: 100%;
  border-radius: inherit;
  background: var(--lime);
}
.preview__sentence {
  margin-block: 18px 16px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 2;
  direction: ltr;
  text-align: left;
}
.preview__blank {
  display: inline-block;
  min-inline-size: 3.2em;
  padding-inline: 8px;
  border-radius: 8px;
  background: #f1fadc;
  color: #2e4600;
  text-align: center;
  line-height: 1.6;
}
.preview__blank--empty {
  background: transparent;
  box-shadow: inset 0 -2.5px 0 #c6f24e;
  border-radius: 0;
}
@media (prefers-color-scheme: dark) {
  .preview__blank { background: #232b10; color: #d8fb80; }
}
.preview__options { display: flex; flex-wrap: wrap; gap: 8px; direction: ltr; }
.preview__opt {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(127, 130, 145, .35);
  font-weight: 700;
  font-size: .9rem;
}
.preview__opt.is-picked { background: #0e0f13; color: var(--lime); border-color: #0e0f13; }
@media (prefers-color-scheme: dark) {
  .preview__opt.is-picked { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
}
.preview__caption {
  font-size: .85rem;
  color: var(--stage-muted);
  text-align: center;
}

.styles {
  padding: 22px 20px;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-line);
  background: var(--ds-surface);
}
@media (min-width: 640px) { .styles { padding: 28px; } }
.styles__title { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.styles__text { margin-block-start: 4px; font-size: .925rem; color: var(--ds-muted); }
.styles__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 18px;
}
.styles__list li {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-line);
  font-size: .85rem;
  font-weight: 700;
  transition: background-color .15s, border-color .15s;
}
.styles__list li:nth-child(3n + 1) { background: var(--ds-accent-soft); border-color: color-mix(in srgb, var(--ds-accent-ink) 22%, transparent); color: var(--ds-accent-ink); }

/* Perks */
.perks {
  display: grid;
  gap: 12px;
  margin-block-start: 12px;
}
@media (min-width: 600px) { .perks { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .perks { grid-template-columns: repeat(4, 1fr); gap: 16px; margin-block-start: 16px; } }

.perk {
  padding: 20px;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-line);
  background: var(--ds-surface);
}
.perk__icon {
  display: inline-grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border-radius: 12px;
  background: var(--ds-surface-2);
  color: var(--ds-text);
}
.perk__icon svg { inline-size: 22px; block-size: 22px; }
.perk:first-child .perk__icon { color: var(--ds-gold); }
.perk__title { margin-block-start: 12px; font-size: 1rem; font-weight: 800; }
.perk__text { margin-block-start: 4px; font-size: .875rem; color: var(--ds-muted); }

/* CTA band */
.cta-band {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-block-start: 28px;
  padding: 22px 20px;
  border-radius: var(--ds-radius);
  background: var(--lime);
  color: var(--lime-ink);
}
.cta-band__text { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.cta-band .btn--primary { background: #0e0f13; color: #ffffff; box-shadow: none; }
.cta-band .btn--primary .btn__icon { color: var(--lime); }
.cta-band :focus-visible { outline-color: #0e0f13; }
@media (min-width: 640px) {
  .cta-band { flex-direction: row; align-items: center; justify-content: space-between; padding: 24px 28px; }
  .cta-band__text { font-size: 1.35rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-block-start: 1px solid var(--ds-line);
  padding-block: 28px calc(28px + env(safe-area-inset-bottom));
}
.site-footer__inner {
  display: grid;
  gap: 12px;
}
.site-footer__brand { display: inline-flex; align-items: center; gap: 8px; }
.site-footer__privacy { max-inline-size: 60ch; font-size: .85rem; color: var(--ds-muted); }
.site-footer__copy { font-size: .8rem; color: var(--ds-muted); }
.site-footer a { text-underline-offset: 2px; }
@media (min-width: 900px) {
  .site-footer__inner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 32px;
  }
}

/* ---------- Motion & contrast preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  /* keep spinners meaningful but slow */
  .btn__spinner, .form-status[data-state="loading"]::before {
    animation-duration: 1.6s !important;
    animation-iteration-count: infinite !important;
  }
  .step:hover, .btn--primary:hover { transform: none; }
}

@media (forced-colors: active) {
  .chip, .picker__toggle, .picker__panel, .btn, .input, .step, .perk, .styles, .card { border: 1px solid CanvasText; }
  .chip__remove::before, .chip__remove::after { background: ButtonText; }
  .picker__option.is-active, .picker__option[aria-selected="true"] { outline: 2px solid Highlight; }
}

@media print {
  .greetings, .stage__glow, .stage::after, .cta-band { display: none; }
  .stage { background: none; color: inherit; border: 0; }
}

/* ---------- Static text pages (privacy.html, 404.html) ---------- */
.prose { max-inline-size: 46rem; padding-block: 24px 72px; }
.prose ul + p { margin-block-start: 12px; }
.prose h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-block-end: 8px; }
.prose h2 { font-size: 1.2rem; font-weight: 800; margin-block: 32px 8px; }
.prose p, .prose li { color: var(--ds-text); }
.prose p + p { margin-block-start: 12px; }
.prose ul { list-style: disc; padding-inline-start: 1.25rem; display: grid; gap: 6px; margin-block-start: 8px; }
.prose a { font-weight: 700; text-underline-offset: 2px; }
.prose .prose__meta { color: var(--ds-muted); font-size: .875rem; }
.prose .btn { margin-block-start: 24px; }
