/*
 * The holding page's whole stylesheet. A separate file rather than an inline <style>
 * block so the CSP in deploy/Caddyfile can keep `style-src` free of 'unsafe-inline' --
 * the same conclusion web-platform/ui/shell.css reached after being inline.
 */

:root {
  /*
   * COPIED from web-platform/ui/public/ds/tokens/colors.css (and --grid-cell from
   * tokens/spacing.css), not imported, and the copy is the point: this host must not
   * depend on the app host being up or on a 170 KB vendored bundle. Only the handful of
   * values this page uses, verified against that file value for value.
   *
   * Light theme only. The vendored tokens carry a `.theme-dark` block; nothing here
   * toggles it, exactly as in the SPA.
   */
  --paper: #f7f7f3;
  --card: #ffffff;
  --ink: #15181b;
  --ink-2: #3c4247;
  --ink-3: #6b7278;
  --line-2: #dcded7;
  --lime: #c7ff38;
  --lime-ink: #4e7000;
  --lime-wash: rgba(199, 255, 56, 0.3);
  --text-on-accent: #16210a;
  --line-grid: rgba(21, 24, 27, 0.055);
  --grid-cell: 32px;

  /* Lime as an outline on paper -- the app's own focus colour, never `outline: none`. */
  --focus-ring: var(--lime-ink);

  /*
   * Full fallback stacks, so the page is CORRECT with no network: the Google Fonts
   * stylesheet is the only cross-origin dependency here and it is allowed to fail.
   */
  --font-sans: "Barlow", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-condensed: "Barlow Condensed", "Barlow", "Arial Narrow", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

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

html {
  /* Belongs on the root so a form control's own colour scheme matches the page. */
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  /*
   * The design system's coordinate motif, at its own --grid-cell of 32px on both axes.
   * A pair of repeating-linear-gradients rather than an image, so there is no second
   * request and nothing for the CSP's img-src to allow.
   */
  background-image:
    repeating-linear-gradient(
      to right,
      var(--line-grid) 0 1px,
      transparent 1px var(--grid-cell)
    ),
    repeating-linear-gradient(
      to bottom,
      var(--line-grid) 0 1px,
      transparent 1px var(--grid-cell)
    );
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  /* 1rem floor, growing with the viewport; the heading below carries its own clamp. */
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/*
 * ONE centred column, capped so the measure stays readable on a wide monitor, with the
 * text left-aligned inside it. `min-height: 100vh` plus the auto middle row is what keeps
 * the footer at the bottom of a short page without a fixed position.
 */
.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(2rem, 6vh, 4.5rem);
  min-height: 100vh;
  /* The horizontal padding is what stops anything touching the edge at 360px. */
  padding: clamp(1.75rem, 5vw, 4rem) clamp(1.25rem, 5vw, 3rem);
  max-width: 52rem;
  margin: 0 auto;
}

main {
  align-self: center;
}

.wordmark {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  /* Lowercase in the mark itself, so this only prevents a stylesheet elsewhere changing it. */
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}

h1 {
  margin: 0 0 1.25rem;
  font-weight: 600;
  /* Fluid, so the two sentences stay on a sensible number of lines from 360px to 1440px. */
  font-size: clamp(2.125rem, 1.4rem + 3.4vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  /* Prevents the second sentence orphaning a single word on a narrow viewport. */
  text-wrap: balance;
}

.lede {
  margin: 0 0 1rem;
  max-width: 38rem;
  color: var(--ink-2);
  font-size: 1.125em;
}

.lede-last {
  margin-bottom: 2rem;
  color: var(--ink);
}

form {
  display: flex;
  /* Wraps to two rows below ~26rem rather than overflowing; see the 360px check. */
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0 0 0.75rem;
  max-width: 32rem;
}

input[type="email"] {
  /* `flex: 1 1 12rem` -- grow, shrink, and never demand more than 12rem before wrapping. */
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color 120ms ease;
}

input[type="email"]::placeholder {
  color: var(--ink-3);
}

input[type="email"]:hover {
  border-color: var(--ink-3);
}

button {
  flex: 0 0 auto;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--lime);
  color: var(--text-on-accent);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 120ms ease;
}

button:hover:not(:disabled) {
  filter: brightness(0.95);
}

button:disabled {
  cursor: progress;
  /* Still legible: this state carries the "Sending…" label and must stay readable. */
  opacity: 0.75;
}

/*
 * :focus-visible with a real offset ring, NEVER `outline: none`. Applied to the wrapper
 * selector list rather than per element so a future control cannot miss it.
 */
input[type="email"]:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.fineprint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-3);
}

.fineprint a {
  color: var(--ink-2);
}

/*
 * The single status region for BOTH error branches. `min-height: 0` when empty rather
 * than a reserved band: an always-present gap reads as a rendering bug on first paint.
 */
.status {
  margin: 0.875rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--lime-ink);
}

.status:empty {
  display: none;
}

/*
 * The success state: the signup rendered in the product's own fact shape, so the page
 * demonstrates the thing it is advertising.
 */
.fact-card {
  max-width: 32rem;
  padding: 1.25rem 1.375rem;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--card);
}

.fact-card dl {
  display: grid;
  gap: 0.625rem;
  margin: 0 0 1rem;
}

/*
 * A two-column row that COLLAPSES to one at narrow widths: the label column is a fixed
 * 7.5rem, which at 360px would leave the value nothing to sit in.
 */
.fact-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
}

.fact-card dt {
  font-family: var(--font-condensed);
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
}

.fact-card dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--ink);
  /* Long values wrap rather than widening the card past the viewport. */
  overflow-wrap: anywhere;
}

.fact-confirmed {
  display: inline-block;
  margin: 0;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--lime-wash);
  color: var(--lime-ink);
  font-family: var(--font-condensed);
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

footer {
  align-self: end;
}

/*
 * The label is real and reachable by a screen reader; only its pixels are gone. `clip`
 * plus a 1px box rather than `display: none`, which would remove it from the
 * accessibility tree along with the input's name.
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 26rem) {
  .fact-row {
    grid-template-columns: 1fr;
  }
}

/*
 * Every transition on this page is decorative, so honouring the preference costs nothing.
 * `!important` because these override rules declared above with equal specificity.
 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
