/*
 * activeaicoach.com — one stylesheet for every page.
 *
 * WHY THIS EXISTS. The site had three looks: a dark slate landing page with a
 * sky-blue accent, two creator pages in the app's olive-lime, and five pages
 * with no accent at all. Nothing shared a font, a radius or a spacing step, so
 * every new page invented its own and the drift was one-way. This is the one
 * place a colour or a size is decided.
 *
 * THE LOOK is from the creators-page redesign canvas: dark bands top and
 * bottom, light cards between them, borders instead of shadows, Space Grotesk
 * over Inter. Its emerald was not the brand, so the accent here is the app's
 * own electric lime (`#c8ff47`) with the darker `#425c00` carrying text on
 * light ground — the same pair as frontend/lib/palettes.ts, so the site and
 * the app agree at the moment someone taps through from one to the other.
 *
 * DELIBERATELY SINGLE-THEME. `color-scheme: light` and every colour stated
 * outright. A marketing site that follows the OS into dark mode has to design
 * two of everything, and the dark bands already carry the contrast this needs.
 *
 * NO SHADOWS ANYWHERE. Separation is a 1px border. Adding a shadow to one card
 * is what starts the next round of drift.
 */

:root {
  color-scheme: light;

  /* Ground and surfaces */
  --ground: #f6f7f9;
  --surface: #ffffff;
  --line: #e3e6eb;
  --line-strong: #d4d8df;

  /* Ink, on light */
  --ink: #10131a;
  --ink-soft: #4b5563;
  --ink-faint: #6b7280;

  /* The dark bands */
  --dark: #090c11;
  --dark-raised: #141a22;
  --dark-line: #1f2630;
  --dark-line-soft: #2a3442;
  --on-dark: #b7c0cc;
  --on-dark-faint: #8b96a5;

  /* The brand. `--lime` is a fill with dark text on it; `--accent` is text. */
  --lime: #c8ff47;
  --lime-bright: #d6ff78;
  --on-lime: #10131a;
  --accent: #425c00;
  --accent-deep: #334700;
  --accent-tint: #f3fbdd;
  --accent-tint-line: #dbefae;
  --accent-on-dark: #c8ff47;
  --accent-tint-dark: #17210a;
  --accent-tint-dark-line: #2f4213;

  /* Semantic, separate from the accent */
  --bad: #9f1239;
  --bad-tint: #fff1f3;
  --bad-line: #fbcfd8;

  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-pill: 999px;
  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 14px;
  --r-btn: 12px;
  --r-xs: 10px;
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-soft);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----------------------------------------------------------------- layout */

/*
 * One gutter rule for the whole site. `padding-block` rather than a `padding`
 * shorthand, so a section that sets its own vertical rhythm cannot zero the
 * sides and push text against the screen edge on a phone.
 */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.wrap-narrow {
  max-width: 760px;
}

.band-dark {
  background: var(--dark);
  color: var(--on-dark);
}

.band-surface {
  background: var(--surface);
}

.section {
  padding-block: 72px;
}

/* ------------------------------------------------------------------- type */

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.375rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
}

.band-dark h1,
.band-dark h2,
.band-dark h3,
.band-dark h4 {
  color: #ffffff;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-deep);
}

.band-dark a:not(.btn) {
  color: var(--accent-on-dark);
}

strong {
  color: var(--ink);
  font-weight: 600;
}

.band-dark strong {
  color: #ffffff;
}

.eyebrow {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

.band-dark .eyebrow {
  color: var(--accent-on-dark);
}

/* The hero's pill-shaped label, which the plain eyebrow is not. */
.tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  border: 1px solid var(--accent-tint-dark-line);
  background: var(--accent-tint-dark);
  padding: 0.45rem 0.8rem;
  border-radius: var(--r-pill);
  margin: 0 0 1.25rem;
}

.lede {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 34rem;
}

.band-dark .lede {
  color: var(--on-dark);
}

.hint {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.fineprint {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  background: var(--dark);
  border-bottom: 1px solid var(--dark-line);
}

.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: #ffffff;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand:hover {
  color: #ffffff;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--r-xs);
  background: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.875rem;
}

.topnav a:not(.btn) {
  color: var(--on-dark);
  text-decoration: none;
}

.topnav a:not(.btn):hover {
  color: #ffffff;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-family: var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/*
 * The label on a lime fill is ALWAYS the near-black ink, on every background
 * the button sits on. It shipped once as lime-on-lime, because `.band-dark a`
 * and `.topnav a` are specificity 0-1-1 against this rule's 0-1-0 and quietly
 * won: a bright block with an invisible label. Those context rules now carry
 * `:not(.btn)`, and site-css.test.ts fails if one loses it.
 */
.btn-primary {
  background: var(--lime);
  color: var(--on-lime);
}

.btn-primary:hover {
  background: var(--lime-bright);
  color: var(--on-lime);
}

.btn-dark {
  background: var(--dark);
  color: #ffffff;
}

.btn-dark:hover {
  background: var(--dark-raised);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  color: #ffffff;
  border-color: var(--dark-line-soft);
}

.btn-ghost:hover {
  background: var(--dark-raised);
  color: #ffffff;
}

.btn-sm {
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* A state, not a button: something that is not clickable yet. */
.btn-pending {
  background: var(--dark-raised);
  color: var(--on-dark);
  border-color: var(--dark-line-soft);
  cursor: default;
}

.btn-pending:hover {
  background: var(--dark-raised);
  color: var(--on-dark);
}

.btnrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  align-items: center;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.band-dark a:focus-visible,
.band-dark button:focus-visible {
  outline-color: var(--lime);
}

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

.hero .wrap {
  padding-block: 72px 80px;
}

.hero-split {
  display: flex;
  flex-wrap: wrap;
  gap: 3.5rem;
  align-items: center;
}

.hero-split > .hero-copy {
  flex: 1 1 440px;
  min-width: 0;
}

.hero-split > .panel {
  flex: 1 1 360px;
  min-width: 0;
}

.hero-center {
  text-align: center;
}

.hero-center .lede {
  margin-inline: auto;
}

.hero-center .btnrow {
  justify-content: center;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 1.25rem;
}

/* ------------------------------------------------------- cards and panels */

.panel {
  background: var(--dark-raised);
  border: 1px solid var(--dark-line);
  border-radius: var(--r-lg);
  padding: 2rem;
}

.panel .eyebrow {
  color: var(--on-dark-faint);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.tile {
  background: var(--dark);
  border: 1px solid var(--dark-line);
  border-radius: var(--r-sm);
  padding: 1.25rem;
}

.tile-figure {
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-on-dark);
  font-variant-numeric: tabular-nums;
}

.tile-figure-sm {
  font-size: 1.375rem;
  font-weight: 600;
  color: #ffffff;
}

.tile-label {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--on-dark);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.75rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: var(--r-xs);
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-line);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  margin-bottom: 1rem;
}

.card-dark {
  background: var(--dark);
  color: var(--on-dark);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.card-dark strong {
  display: block;
  color: #ffffff;
  margin-bottom: 0.3rem;
}

.card-dark a:not(.btn) {
  color: var(--accent-on-dark);
}

/* A feature run: an eyebrow, a heading and a paragraph, repeated. */
.feature {
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
}

.feature:first-of-type {
  border-top: 0;
}

.feature h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

/* --------------------------------------------------------------- the form */

.form-card,
.aside-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 2rem;
}

.apply-split {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

/*
 * The main column holds three cards and shows one at a time — the form, the
 * agreement, then the code. They are siblings because the page's script
 * toggles `hidden` between them, so the column is a flex container rather
 * than the card itself.
 */
.apply-split > .apply-main {
  flex: 999 1 540px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.apply-split > .form-card {
  flex: 999 1 540px;
  min-width: 0;
}

/* An attestation that closes a form, set apart from the fields above it. */
.adult-row,
.agree-row {
  margin-top: 1.5rem;
}

.apply-split > .aside {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fieldgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 0 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  font-family: var(--text);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
}

input[type="text"],
input[type="email"],
input[type="number"],
select {
  height: 48px;
}

textarea {
  min-height: 96px;
  padding: 0.75rem 0.875rem;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

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

legend {
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.625rem;
}

/* Multi-select options that read as one row of choices. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
}

/* An attestation: the box and the sentence it commits you to. */
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}

.check input[type="checkbox"] {
  margin: 0.2rem 0 0;
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--accent);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ------------------------------------------------------- results and code */

.code-display {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 7vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--ink);
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-line);
  border-radius: var(--r-md);
  padding: 1.25rem 1rem;
  word-break: break-all;
}

.msg {
  border-radius: var(--r-xs);
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.msg-bad {
  color: var(--bad);
  background: var(--bad-tint);
  border-color: var(--bad-line);
}

/* A numbered list of what happens next, not a decorative sequence. */
.next {
  margin: 0;
  padding-left: 1.25rem;
}

.next li {
  margin-bottom: 0.5rem;
}

.rulelist {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.rulelist strong {
  display: block;
  margin-bottom: 0.25rem;
}

.readfull {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------- long prose */

/*
 * The legal pages and the FAQ. Rules between sections rather than cards,
 * because a privacy policy is one document and boxing each clause would make
 * it look like a set of options.
 */
.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.prose h2 {
  font-size: 1.15rem;
  line-height: 1.35;
  margin: 2rem 0 0.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.prose h2:first-of-type {
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  font-size: 0.975rem;
  margin: 1.1rem 0 0.4rem;
}

.prose ul,
.prose ol {
  margin: 0 0 0.75rem;
  padding-left: 1.3rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose dl {
  margin: 0;
}

.prose dt {
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.875rem;
}

.prose dd {
  margin: 0.2rem 0 0;
}

.meta {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.version {
  font-family: var(--mono);
}

/* A plain-English summary beside the clause it summarises. */
.plain {
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-line);
  border-radius: var(--r-xs);
  padding: 0.875rem 1rem;
  margin: 0.875rem 0 1.125rem;
  font-size: 0.9375rem;
}

.plain strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* A run of question-and-answer pairs, ruled apart rather than boxed. */
.qa {
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.qa:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.qa h2 {
  font-size: 1.0625rem;
  line-height: 1.35;
  margin-bottom: 0.4rem;
  padding-top: 0;
  border-top: 0;
}

/* One sentence that must not be skimmed past. */
.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-tint);
  padding: 0.875rem 1rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}

.accent {
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------------------------------------- comparison */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--ground);
  white-space: nowrap;
}

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

td:first-child {
  font-weight: 500;
  color: var(--ink);
}

/* ------------------------------------------------------------- link grid */

.linkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.linkcard {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.875rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

.linkcard:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

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

.sitefoot {
  background: var(--dark);
  color: var(--on-dark-faint);
  font-size: 0.8125rem;
}

.sitefoot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 28px;
}

.sitefoot a:not(.btn) {
  color: var(--on-dark);
  text-decoration: none;
}

.sitefoot a:not(.btn):hover {
  color: #ffffff;
}

.footnav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* ------------------------------------------------------------ small print */

@media (max-width: 560px) {
  .tiles {
    grid-template-columns: 1fr;
  }

  .section {
    padding-block: 48px;
  }

  .hero .wrap {
    padding-block: 48px 56px;
  }

  .panel,
  .form-card,
  .aside-card {
    padding: 1.375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
