/*
 * Glintkeep waitlist page.
 *
 * Palette copied once from the platform repo (MASpaeth/glintkeep,
 * packages/ui/src/tokens.css and brand/README.md). Brand rule: gold appears
 * in exactly two places: the glint inside the logo (in the SVG) and the thin
 * left edge of the keep (the Ask panel). Never for text, buttons or other UI
 * chrome; a test enforces this.
 */
:root {
  color-scheme: dark;

  --gk-ink: #121418;
  --gk-surface: #1a1d22;
  --gk-raised: #23272e;
  --gk-border: #2a2e35;
  --gk-border-strong: #3a3f48;
  --gk-outline: #6f7682;
  --gk-text: #ecedef;
  --gk-muted: #a3a9b2;
  --gk-paper: #f6f6f3;
  --gk-negative: #f47c7c;
  --gk-glint: #b07d12;

  --color-primary-hover: #ffffff;
  --color-primary-active: #e3e3de;
  --color-outline-hover: #8a919c;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-base: 200ms;
  --duration-slow: 320ms;

  /* One spacing scale for every vertical rhythm on the page. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* One gap between the home page's sections: from the end of one section's
     content to the next section's divider (a hairline, or the keep's
     battlement), then --section-inner from the divider to its content. */
  --section-gap: var(--space-6);
  --section-inner: var(--space-5);

  /* One container for every section: same edges everywhere. */
  --gutter: var(--space-4);
  --measure: 72rem;
  --header-h: 5.25rem;
  --font-small: 0.875rem;
  --font-xsmall: 0.8125rem;

  /* Pillars and keep: how far each piece rises as it appears. */
  --rise: 1.5rem;
  --keep-rise: 4rem;
  --wall-h: 17px; /* the keep's battlement line (see app.js drawWall) */
}

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

html {
  background: var(--gk-ink);
  color: var(--gk-text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, var(--gk-surface) 0%, transparent 70%),
    var(--gk-ink);
  overflow-wrap: break-word;
}

h1,
h2,
p,
ul,
figure {
  margin: 0;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--gk-text);
  text-decoration: underline;
  text-decoration-color: var(--gk-outline);
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--duration-base) var(--ease-out);
}

a:hover {
  text-decoration-color: currentColor;
}

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

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

[hidden] {
  display: none !important;
}

/* ---- header ------------------------------------------------------------ */

.site-header {
  /* Clear space around the lockup: >= 2 merlons (~21% of the mark height). */
  height: var(--header-h);
  padding-top: var(--space-6);
}

.lockup {
  display: block;
  height: 2.25rem; /* wordmark ~27px tall: above the 24px minimum */
  width: auto;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: var(--space-3) var(--space-5);
  font: inherit;
  font-weight: 650;
  color: var(--gk-ink);
  text-decoration: none;
  background: var(--gk-paper);
  border: 1px solid transparent; /* visible in forced-colors mode */
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--duration-base) var(--ease-out);
}

.button:hover {
  background: var(--color-primary-hover);
}

.button:active {
  background: var(--color-primary-active);
}

.button[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.8;
}

/* ---- landing (header + hero) ------------------------------------------- */

.hero {
  display: flex;
  flex-direction: column;
}

/* Decorative: the next section is just below, and it is out of the tab
   order. Shown from 1024px (see there). */
.scroll-cue {
  display: none;
}

/* Phones: tighter around the teaser (1.5rem above it and, via .story, below
   its caption), so Collect still starts on the first 375×812 screen; 640px
   and up restore the roomier rhythm. */
.hero-grid {
  display: grid;
  gap: var(--space-5);
  padding-block: var(--space-5) 0;
}

.kicker {
  margin-bottom: var(--space-4);
  color: var(--gk-muted);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.375rem, 1.6rem + 3.6vw, 4rem);
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.subline {
  margin-top: var(--space-5);
  max-width: 34ch;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  color: var(--gk-muted);
  text-wrap: balance;
}

.hero-cta {
  margin-top: var(--space-6);
}

/* A minimal dark browser frame around the teaser: the full capture at every
   width, scaled to the column, its bottom fading into the page over interface
   only. --teaser-fade-start is read by the e2e test that keeps the fade clear
   of the art crop and its credit. Phones also show the caption. */
.teaser-figure {
  margin: 0;
}

.teaser {
  --teaser-fade-start: 65%;
  -webkit-mask-image: linear-gradient(to bottom, #000 var(--teaser-fade-start), transparent);
  mask-image: linear-gradient(to bottom, #000 var(--teaser-fade-start), transparent);
  overflow: hidden;
  background: var(--gk-surface);
  border: 1px solid var(--gk-border-strong);
  border-radius: var(--radius-lg);
}

.teaser-caption {
  margin-top: var(--space-2);
  font-size: var(--font-small);
  color: var(--gk-muted);
}

.teaser-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--gk-border);
}

.teaser-dots {
  display: flex;
  gap: 0.375rem;
}

.teaser-dots span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--gk-border-strong);
}

.teaser-tag {
  margin-left: auto;
  padding: 0.125rem var(--space-2);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--gk-muted);
  white-space: nowrap;
  border: 1px solid var(--gk-border-strong);
  border-radius: 999px;
}

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

/* ---- story: pillars, then the keep -------------------------------------- */

.story {
  padding-top: var(--section-gap);
  scroll-margin-top: 0;
}

/* The battlement rises above the keep's top edge: the gap ends at its merlons. */
.story-stage {
  display: grid;
  gap: calc(var(--section-gap) + var(--wall-h));
}

.pillar-list {
  display: grid;
  gap: var(--space-6);
  padding: 0;
  list-style: none;
}

.pillar {
  padding-top: var(--section-inner);
  border-top: 1px solid var(--gk-border-strong);
}

.pillar h2,
.keep h2 {
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.pillar p,
.keep p {
  margin-top: var(--space-3);
  color: var(--gk-muted);
}

/* The collection-first proof: the one sentence in Collect and Build set in the
   brighter text color (DESIGN.md, The Muted Body Rule). */
.pillar .proof {
  color: var(--gk-text);
}

/* The keep: the Ask panel the pillars stand on. Its top edge is the
   battlement line (inline SVG, drawn by app.js to fit the width); the left
   edge is the one gold line on the page besides the logo glint. */
.keep {
  position: relative;
  background: var(--gk-surface);
  border: 1px solid var(--gk-border-strong);
  border-top: 0;
  border-left: 2px solid var(--gk-glint);
  border-radius: 0 0 var(--radius-lg) 0;
}

.keep-wall {
  position: absolute;
  bottom: 100%;
  left: -2px; /* span the border box: under the gold edge ... */
  right: -1px; /* ... to the right border */
  display: block;
  width: calc(100% + 3px);
  height: var(--wall-h);
  overflow: visible;
}

.keep-wall-line {
  fill: var(--gk-surface); /* the open path's fill closes along its base: just the merlons */
  stroke: var(--gk-outline);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
}

.keep-body {
  max-width: 42rem;
  padding: var(--space-5);
}

.keep em {
  color: var(--gk-text);
}

/* Footnote markers (* and †): links down to the fine print in the footer;
   each footnote links back. */
.mark {
  position: relative;
  padding-inline: 0.0625em;
  color: var(--gk-text);
  text-underline-offset: 0.32em; /* below the dagger's stem, not through it */
  text-decoration-skip-ink: none;
  scroll-margin-block: 40vh;
}

/* A ~44px tap target around each marker and back-link; the glyph keeps its size. */
.mark::after,
.fn-back::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.75rem;
  height: 2.75rem;
  transform: translate(-50%, -50%);
}

/* ---- questions (FAQ) --------------------------------------------------- */

/* Under the same hairline as the signup. One column on phones, two from 640px. */
.faq {
  padding-block: var(--section-gap);
}

.faq-inner {
  padding-top: var(--section-inner);
  border-top: 1px solid var(--gk-border-strong);
}

.faq-title {
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.faq-list {
  display: grid;
  gap: var(--space-5) var(--space-6);
  margin-top: var(--space-5);
}

.faq-item h3 {
  font-size: 1.0625rem;
  font-weight: 650;
}

.faq-item p {
  max-width: 60ch;
  margin-top: var(--space-2);
  color: var(--gk-muted);
}

/* ---- signup ------------------------------------------------------------ */

/* The giveaway hero's left column (under the card on phones). On wider
   screens the email field and the button share one row. */
.signup {
  grid-area: signup;
  max-width: 36rem;
  scroll-margin-top: var(--space-5);
}

.signup-title {
  max-width: 40ch;
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.signup-badge {
  margin-top: var(--space-3);
  color: var(--gk-muted);
  text-wrap: balance;
}


/* Once joined, the success message stands where the heading was: the raised
   tone, a title-sized first line. */
.signup .success {
  margin-top: 0;
  padding: var(--space-5);
  font-size: 1rem;
  font-weight: 400;
}

.success-title {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.success-next {
  margin-top: var(--space-3);
  color: var(--gk-muted);
}

.success-share a {
  overflow-wrap: anywhere;
}

/* "Copy" beside the share link: a quiet outline button, 32px tall. */
.copy-share {
  min-height: 2rem;
  margin-left: var(--space-2);
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--gk-text);
  background: transparent;
  border: 1px solid var(--gk-outline);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.copy-share:hover {
  border-color: var(--color-outline-hover);
}

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

.signup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "label"
    "email"
    "email-error"
    "consent"
    "news"
    "note"
    "submit"
    "turnstile"
    "form-error"
    "terms"
    "giveaway"
    "privacy";
  row-gap: var(--space-3);
  margin-top: var(--space-4);
}

.email-label {
  grid-area: label;
}

.signup-form input[type="email"],
.remove-form input[type="email"] {
  grid-area: email;
}

.email-error {
  grid-area: email-error;
}

.signup-submit,
.remove-submit {
  grid-area: submit;
  white-space: nowrap;
}

.signup-form .check {
  grid-area: consent;
  margin-top: var(--space-2);
}

.signup-form .news-check {
  grid-area: news;
}

.signup-note {
  grid-area: note;
}

.signup-form .turnstile,
.remove-form .turnstile {
  grid-area: turnstile;
}

.signup-form .form-error,
.remove-form .form-error {
  grid-area: form-error;
}

/* "Joining enters you in the giveaway (Official Rules)…" under the form. */
.form-giveaway {
  grid-area: giveaway;
  font-size: 0.9375rem;
  color: var(--gk-muted);
}

.form-privacy {
  grid-area: privacy;
  font-size: 0.9375rem;
  color: var(--gk-muted);
}

/* Standalone links ("Privacy notice", "Back to glintkeep.com"): padded toward a
   44px tap target without moving their text. */
.form-privacy a,
.back-home a {
  display: inline-block;
  padding-block: 0.6875rem;
  margin-block: -0.6875rem;
}

/* "Free to start." under each "Join the waitlist" button. */
.cta-note {
  font-size: var(--font-small);
  color: var(--gk-muted);
}

.hero-cta + .cta-note {
  margin-top: var(--space-2);
}

label {
  font-weight: 600;
}

input[type="email"] {
  width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  font: inherit;
  font-size: 1rem; /* no iOS zoom on focus */
  color: var(--gk-text);
  background: var(--gk-ink);
  border: 1px solid var(--gk-outline);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-base) var(--ease-out);
}

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

input[aria-invalid="true"] {
  border-color: var(--gk-negative);
}

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-3);
  align-items: start;
}

.check label {
  font-weight: 400;
  cursor: pointer;
}

.check .field-error {
  grid-column: 1 / -1;
}

.check .field-error:not(:empty) {
  margin-top: var(--space-2);
}

input[type="checkbox"] {
  width: 1.375rem;
  height: 1.375rem;
  margin: 0.0625rem 0 0;
  accent-color: var(--gk-paper);
  cursor: pointer;
}

/* The same ring as every other control, not the browser's own. */
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--gk-paper);
  outline-offset: 3px;
  border-radius: 2px;
}

.field-error,
.form-error {
  color: var(--gk-negative);
  font-size: 0.9375rem;
}

.turnstile:empty {
  display: none;
}

.success {
  margin-top: var(--space-6);
  padding: var(--space-4);
  font-size: 1.125rem;
  font-weight: 600;
  background: var(--gk-raised);
  border: 1px solid var(--gk-border-strong);
  border-radius: var(--radius-md);
}

/* "Changed your mind? Remove your email" under the signup success message. */
.success-remove {
  margin-top: var(--space-3);
  font-size: var(--font-small);
  font-weight: 400;
}

.success-remove a {
  text-decoration-skip-ink: none;
}

/* "Build it with us." under the signup success message, past a hairline. */
.build {
  max-width: 36rem;
  margin: var(--space-6) auto 0;
  padding-top: var(--space-6);
  border-top: 1px solid var(--gk-border);
}

.build-title {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.build-text {
  margin-top: var(--space-2);
  color: var(--gk-muted);
}

.build-cta {
  margin-top: var(--space-5);
}

.build-follow {
  margin-top: var(--space-4);
  font-size: var(--font-small);
  color: var(--gk-muted);
}

/* Padded toward a 44px tap target without moving the line's text. */
.build-follow a {
  display: inline-block;
  padding-block: 0.6875rem;
  margin-block: -0.6875rem;
}

.build-follow span {
  color: var(--gk-outline);
}

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

/* Two tiers: one row of tagline, links and icons, a hairline, then the fine
   print ending with the ©. No logo here: the header lockup is the page's only
   logo (Brand & Logo: never two lockups in one view). */
.site-footer {
  padding-block: var(--section-inner) var(--space-6);
  border-top: 1px solid var(--gk-border);
  font-size: var(--font-small);
  color: var(--gk-muted);
}

/* Phones: tagline, text links, icons, stacked and left-aligned. From 640px one
   row: the tagline left, then the links, a thin divider and the icons on the
   right, all centred on one line (the links and icons drop under the tagline
   only if the row is too narrow for both). */
.footer-top {
  display: grid;
  padding-bottom: var(--section-inner);
  border-bottom: 1px solid var(--gk-border);
}

.footer-nav {
  display: grid;
  justify-items: start;
}

/* The column gap is 0.5rem (was 0.75rem) so that the row with "Privacy Policy"
   and "Terms of Service" still fits beside the tagline at the full measure in
   most fonts (not in the widest, such as DejaVu Sans: there it drops under it). */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}

.footer-links a {
  padding-block: 0.75rem;
}

/* The current page: weight 600, no underline. */
.footer-links a[aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
}

.footer-links span {
  color: var(--gk-outline);
}

/* Phones: the links wrap with a gap, without the dots. */
@media (max-width: 39.99rem) {
  .footer-links span {
    display: none;
  }

  .footer-links {
    column-gap: var(--space-4);
  }
}

/* Monochrome ~20px icons in 44px tap targets. The negative inline margins put
   the first and last glyph on the text links' edges. */
.footer-social {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc((1.25rem - 2.75rem) / 2);
  padding: 0;
  list-style: none;
}

/* The divider between the links and the icons: a glyph-high hairline, the same
   space (0.75rem) from the last link and from the first glyph. */
.footer-social::before {
  content: none;
  align-self: center;
  width: 1px;
  height: 1.25rem;
  margin-inline: calc(var(--space-3) + (2.75rem - 1.25rem) / 2) 0;
  background: var(--gk-border-strong);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--gk-muted);
  transition: color var(--duration-base) var(--ease-out);
}

.footer-social a:hover,
.footer-social a:focus-visible {
  color: var(--gk-text);
}

.footer-social a:focus-visible {
  outline-offset: -2px;
}

.footer-social svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.fine-print {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--section-inner);
  font-size: var(--font-xsmall);
}

.fine-print > * {
  max-width: 80ch;
}

.footnotes {
  display: grid;
  gap: var(--space-3); /* keeps the back-links' tap targets apart */
  padding: 0;
  list-style: none;
}

.footnotes li {
  scroll-margin-block: 40vh;
}

.footnotes li:target {
  color: var(--gk-text);
}

.fn-back {
  position: relative;
  padding-inline: 0.0625em;
  text-underline-offset: 0.32em;
  text-decoration-skip-ink: none;
}


/* ---- /privacy and /remove ---------------------------------------------- */

.home-link {
  display: inline-block;
}

.doc {
  padding-block: var(--space-8) var(--space-9);
}

.doc h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem);
}

.doc > p,
.doc section p {
  max-width: 68ch;
  margin-top: var(--space-5);
  font-size: 1.0625rem;
  color: var(--gk-muted);
}

.doc h2 {
  margin-top: var(--space-7);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.doc section p {
  margin-top: var(--space-2);
}

.doc > .doc-updated {
  font-size: var(--font-small);
}

.doc > .back-home {
  margin-top: var(--space-7);
}

.remove .back-home {
  margin-top: var(--space-5);
}

/* /giveaway: the Official Rules, word for word, in the /privacy frame. */
.rules > p,
.rules section p {
  max-width: 68ch;
  margin-top: var(--space-4);
  font-size: 1.0625rem;
  color: var(--gk-muted);
}

.rules > p.rules-notice {
  margin-top: var(--space-5);
  color: var(--gk-text);
}

.rules > .doc-updated {
  font-size: var(--font-small);
}

.rules strong {
  color: var(--gk-text);
  font-weight: 650;
}

/* The prize table: a real table that fits a 390px phone without widening
   the page; long cells wrap instead of scrolling. */
.rules-table {
  max-width: 68ch;
  margin-top: var(--space-4);
}

.rules-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  color: var(--gk-muted);
}

.rules-table th,
.rules-table td {
  padding: var(--space-2) var(--space-3) var(--space-2) 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--gk-border);
  overflow-wrap: break-word;
}

.rules-table th {
  color: var(--gk-text);
  font-weight: 600;
  border-bottom-color: var(--gk-border-strong);
}

.rules-table th:last-child,
.rules-table td:last-child {
  padding-right: 0;
}

/* Quantity: a narrow column. */
.rules-table th:nth-child(2),
.rules-table td:nth-child(2) {
  width: 5.5rem;
}

@media (max-width: 39.99rem) {
  .rules-table table {
    font-size: var(--font-small);
  }

  .rules-table th,
  .rules-table td {
    padding-right: var(--space-2);
  }

  .rules-table th:nth-child(2),
  .rules-table td:nth-child(2) {
    width: 4.25rem;
  }

  .rules-table th:nth-child(3),
  .rules-table td:nth-child(3) {
    width: 36%;
  }
}

/* ---- the giveaway bar (every public page, while entries are open) -------- */

/* Off until js/giveaway-bar-early.js adds the class, so no-JS visitors and
   dismissed bars never see it. In flow at the top of the simple pages; floating
   on the home page, whose top is the hero itself. */
.giveaway-bar {
  display: none;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  padding-inline: max(var(--gutter), calc((100% - var(--measure)) / 2 + var(--gutter)));
  background: var(--gk-surface);
  border-bottom: 1px solid var(--gk-border-strong);
  font-size: var(--font-small);
  color: var(--gk-muted);
}

.giveaway-bar-on .giveaway-bar {
  display: flex;
}

.giveaway-bar-text {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-4);
}

.giveaway-bar-text a {
  display: inline-block;
  padding-block: 0.25rem;
}

.giveaway-bar-link {
  font-weight: 600;
}

.giveaway-bar-dismiss {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: calc(var(--space-3) * -1);
  padding: 0;
  background: transparent;
  border: 1px solid transparent; /* visible in forced-colors mode */
  color: var(--gk-muted);
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out);
}

.giveaway-bar-dismiss:hover {
  color: var(--gk-text);
}

.giveaway-bar-floating {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  transition:
    opacity var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out),
    visibility var(--duration-base);
}

.giveaway-bar-floating.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Anchors and keyboard focus land clear of the floating bar. */
html:has(.giveaway-bar-floating.is-shown) {
  scroll-padding-top: 5rem;
}

/* /remove: one email field and the button, laid out like the signup row. */
.remove {
  max-width: 36rem;
  margin-top: var(--space-6);
}

.remove-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "label"
    "email"
    "email-error"
    "submit"
    "turnstile"
    "form-error";
  row-gap: var(--space-3);
}

.remove .success {
  margin-top: 0;
}

.remove-contact {
  margin-top: var(--space-6);
}

/* ---- wider screens ----------------------------------------------------- */

@media (min-width: 40rem) {
  :root {
    --gutter: var(--space-6);
    --section-gap: var(--space-8);
  }

  /* The simple pages: one centred column, as wide as the home page's signup
     column, inside the same container. Padding, not a width, so everything in it
     shares the column's left edge. The Termly pages already fill the container. */
  .page-remove .doc,
  .page-giveaway .doc,
  .page-404 .doc {
    padding-inline: max(var(--gutter), calc((min(100%, var(--measure)) - 36rem) / 2));
  }

  .hero-grid {
    gap: var(--space-7);
    padding-block: var(--space-6);
  }

  .teaser-caption {
    display: none;
  }

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

  .signup-form {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label label"
      "email submit"
      "email-error email-error"
      "consent consent"
      "news news"
      "note note"
      "turnstile turnstile"
      "form-error form-error"
      "terms terms"
      "giveaway giveaway"
      "privacy privacy";
    column-gap: var(--space-3);
  }

  .remove-form {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label label"
      "email submit"
      "email-error email-error"
      "turnstile turnstile"
      "form-error form-error";
    column-gap: var(--space-3);
  }

  .footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: var(--space-6);
  }

  .footer-nav {
    display: flex;
    align-items: center;
  }

  .footer-social {
    flex-wrap: nowrap;
  }

  .footer-social::before {
    content: "";
  }

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

  .keep-body {
    padding: var(--space-5) var(--space-6);
  }
}

@media (min-width: 64rem) {
  /* The landing fills the first screen: header + hero = 100svh. */
  .hero {
    min-height: calc(100svh - var(--header-h));
  }

  .scroll-cue {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto var(--space-5);
    color: var(--gk-muted);
    transition:
      opacity var(--duration-slow) var(--ease-out),
      visibility var(--duration-slow);
  }

  .scroll-cue.is-hidden {
    opacity: 0;
    visibility: hidden;
  }

  /* A little tighter than from 640px, so the giveaway teaser strip and the
     scroll cue still fit the first screen at 1280×720. */
  .hero-grid {
    flex: 1;
    padding-block: var(--space-5);
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: var(--space-8);
  }

  .pillar-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(var(--rise));
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes keep-rise {
  from {
    opacity: 0;
    transform: translateY(var(--keep-rise));
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes nudge {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(0.25rem);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .scroll-cue svg {
    animation: nudge 2.4s var(--ease-out) infinite;
  }

  .success:not([hidden]),
  .build:not([hidden]) {
    animation: rise var(--duration-slow) var(--ease-out);
  }

  .js .keep-wall-line {
    stroke-dasharray: 1;
  }
}

/*
 * Story, pinned (html.pin-story: wide screens, motion allowed, and the stage
 * fits the viewport; early.js and app.js decide): the stage pins, centred in
 * the viewport, for --pin-len of scrolling, and scroll progress builds it:
 *   approach  Collect rises in as the stage arrives, once it is fully on screen,
 *             so it pins with Collect shown and never fades in half cut off
 *   0–60%     Track, Brew, Build rise in, one after another
 *   60–90%    the keep rises in beneath them; 66–90% its battlement draws
 * Scroll-driven animations ("sda") where supported; otherwise app.js sets
 * --t (0..1) per piece and --draw on the keep ("sda-fallback").
 * The sticky box is only as tall as the stage (app.js sets --stage-h) and an
 * empty ::after of --pin-len gives it room to stay, so the section is laid
 * out like any other: one --section-gap before the pillars, and the next
 * section one --section-gap after the keep once it releases. The ranges are
 * offsets on the section's cover range: --pin-start is where it pins (the
 * section's top at the viewport bottom is 0).
 */
/* Short laptop windows (1280×720, 1024×768): a compact landing, so the whole
   first screen, giveaway teaser strip and scroll cue included, fits with room
   to spare (fonts render taller on some systems). Copy unchanged. */
@media (min-width: 64rem) and (max-height: 50rem) {
  .hero-grid {
    padding-block: var(--space-3);
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--space-7);
  }

  .hero h1 {
    font-size: clamp(2.5rem, 1.5rem + 2.4vw, 3rem);
  }

  .kicker {
    margin-bottom: var(--space-3);
  }

  .subline {
    margin-top: var(--space-4);
    font-size: 1.125rem;
  }

  .hero-cta {
    margin-top: var(--space-5);
  }

  .teaser-figure {
    max-width: 34rem;
    justify-self: end;
    width: 100%;
  }

  .scroll-cue {
    margin-bottom: var(--space-3);
  }
}

@media (min-width: 64rem) and (prefers-reduced-motion: no-preference) {
  .pin-story .story {
    --pin-len: 50svh;
    --pin-start: calc(50svh + var(--stage-h, 0px) / 2 + var(--section-gap));
    view-timeline: --story block;
  }

  .pin-story .story::after {
    content: "";
    display: block;
    height: var(--pin-len);
  }

  .pin-story .story-pin {
    position: sticky;
    top: calc((100svh - var(--stage-h, 0px)) / 2);
  }

  .pin-story.sda .pillar,
  .pin-story.sda .keep,
  .pin-story.sda .keep-wall-line {
    animation-duration: auto;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: --story;
  }

  .pin-story.sda .pillar {
    animation-name: rise;
  }

  /* Collect on its own view timeline: from fully in view at the bottom to its
     pinned place (its top where the centred stage's top will be). */
  .pin-story.sda .pillar:nth-child(1) {
    animation-timeline: view();
    animation-range: entry 100% cover calc(50svh + var(--stage-h, 0px) / 2);
  }

  .pin-story.sda .pillar:nth-child(2) {
    animation-range: cover var(--pin-start) cover calc(var(--pin-start) + var(--pin-len) * 0.2);
  }

  .pin-story.sda .pillar:nth-child(3) {
    animation-range: cover calc(var(--pin-start) + var(--pin-len) * 0.2) cover calc(var(--pin-start) + var(--pin-len) * 0.4);
  }

  .pin-story.sda .pillar:nth-child(4) {
    animation-range: cover calc(var(--pin-start) + var(--pin-len) * 0.4) cover calc(var(--pin-start) + var(--pin-len) * 0.6);
  }

  .pin-story.sda .keep {
    animation-name: keep-rise;
    animation-range: cover calc(var(--pin-start) + var(--pin-len) * 0.6) cover calc(var(--pin-start) + var(--pin-len) * 0.9);
  }

  .pin-story.sda .keep-wall-line {
    animation-name: draw;
    animation-range: cover calc(var(--pin-start) + var(--pin-len) * 0.66) cover calc(var(--pin-start) + var(--pin-len) * 0.9);
  }

  .pin-story.sda-fallback .pillar {
    opacity: var(--t, 0);
    transform: translateY(calc((1 - var(--t, 0)) * var(--rise)));
  }

  .pin-story.sda-fallback .keep {
    opacity: var(--t, 0);
    transform: translateY(calc((1 - var(--t, 0)) * var(--keep-rise)));
  }

  .pin-story.sda-fallback .keep-wall-line {
    stroke-dashoffset: calc(1 - var(--draw, 0));
  }
}

/* Story, unpinned (phones, and wide screens whose stage doesn't fit the
   viewport): each pillar, then the keep, fades up as it scrolls into view. */
@media (prefers-reduced-motion: no-preference) {
  :root:not(.pin-story).sda .pillar,
  :root:not(.pin-story).sda .keep,
  :root:not(.pin-story).sda .keep-wall-line {
    animation-duration: auto;
    animation-timing-function: linear;
    animation-fill-mode: both;
  }

  :root:not(.pin-story).sda .pillar,
  :root:not(.pin-story).sda .keep {
    animation-name: rise;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }

  :root:not(.pin-story).sda .keep {
    view-timeline: --keep block;
  }

  :root:not(.pin-story).sda .keep-wall-line {
    animation-name: draw;
    animation-timeline: --keep;
    animation-range: entry 20% entry 100%;
  }

  :root:not(.pin-story).sda-fallback .pillar,
  :root:not(.pin-story).sda-fallback .keep {
    opacity: 0;
    transform: translateY(var(--rise));
    transition:
      opacity 600ms var(--ease-out),
      transform 600ms var(--ease-out);
  }

  :root:not(.pin-story).sda-fallback .keep-wall-line {
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 900ms var(--ease-out) 200ms;
  }

  :root:not(.pin-story).sda-fallback .pillar.is-in,
  :root:not(.pin-story).sda-fallback .keep.is-in {
    opacity: 1;
    transform: none;
  }

  :root:not(.pin-story).sda-fallback .keep.is-in .keep-wall-line {
    stroke-dashoffset: 0;
  }
}

/* A focused footnote marker must never sit in an invisible pillar or keep:
   whatever holds focus is shown fully, wherever the scroll is. */
.js .pillar:focus-within,
.js .keep:focus-within {
  opacity: 1;
  transform: none;
  animation: none;
}

.js .keep:focus-within .keep-wall-line {
  stroke-dashoffset: 0;
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
