
@font-face {
  font-family: 'Redacted';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/Redacted/Redacted-Regular.woff2') format('woff2');
}

/**
 * Shared skeleton tokens for the landing page blocks.
 *
 * Every block concatenates this with its own `style.css` into
 * `makeElement({ style })` — via `./skeleton.ts`, which also prepends the
 * Redacted @font-face — so a block carries everything `[skeleton]` needs and
 * nothing has to be linked globally for the mode to work.
 *
 * The values are the wireframe's grey ramp expressed against `--text` /
 * `--background` rather than the flat hexes it was drawn with, so a skeleton
 * follows the site into dark mode instead of staying a light-mode artifact.
 */
:root {
  /* Redacted has no italic or bold cut — the fallback keeps metrics sane if the
     woff2 is missing, in which case a skeleton degrades to plain grey text. */
  --landing-skeleton-font: 'Redacted', var(--font-primary, sans-serif);

  --landing-skeleton-heading: color-mix(in srgb, var(--background), var(--text) 70%);
  --landing-skeleton-copy: color-mix(in srgb, var(--background), var(--text) 30%);
  --landing-skeleton-kicker: color-mix(in srgb, var(--background), var(--text) 24%);
  --landing-skeleton-media: color-mix(in srgb, var(--background), var(--text) 38%);
  --landing-skeleton-rule: color-mix(in srgb, var(--background), var(--text) 12%);
  --landing-skeleton-surface: color-mix(in srgb, var(--background), var(--text) 2%);
}

/**
 * The design's capture section: a section head, one field and one button on a
 * line, a mono note under it.
 *
 * The block still decides nothing about where the address goes — with `action`
 * it posts, without one it dispatches `landing:newsletter:submit` and the page
 * answers — so this is only the dressing.
 */
landing-newsletter {
  --newsletter-muted: color-mix(in srgb, var(--background), var(--text) 65%);
  --newsletter-wipe: 340ms cubic-bezier(0.45, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  width: 100%;
  padding: clamp(56px, 8vh, 104px) 28px 0;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  landing-newsletter {
    padding: 40px 20px 0;
  }
}

landing-newsletter [kicker] {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text2);
}

landing-newsletter [headline] {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(1.5rem, 3vw, 2.625rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.038em;
  text-wrap: balance;
  color: var(--text);
}

landing-newsletter [copy] {
  margin: 0;
  max-width: 58ch;
  font-size: 0.96875rem;
  line-height: 1.5;
  text-wrap: pretty;
  color: var(--newsletter-muted);
}

landing-newsletter [subscribe] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 560px;
  margin-top: clamp(16px, 2vh, 32px);
}

landing-newsletter [field] {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

/* The label is the field's name, not decoration — hidden visually because the
   placeholder carries it in this layout, but never removed, or the input is
   announced as "edit text, blank". */
landing-newsletter [field-label] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

landing-newsletter input {
  flex: 1 1 220px;
  min-width: 0;
  border: 1px solid var(--light);
  background: var(--light0);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

landing-newsletter input::placeholder {
  color: var(--text2);
}

landing-newsletter input:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: -1px;
  border-color: var(--text);
}

/* The hero's wipe — see the note in `HeroCentered/style.css`. */
landing-newsletter button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--text);
  background: var(--text);
  padding: 13px 23px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--background);
  cursor: pointer;
  transition: color 180ms linear;
}

landing-newsletter button::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--background);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--newsletter-wipe);
}

landing-newsletter button:hover::after {
  transform: scaleX(1);
  transform-origin: left center;
}

landing-newsletter button:hover {
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  landing-newsletter button::after {
    transition: none;
  }
}

landing-newsletter [fine-print] {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--text2);
}

/* Written into by the block on an optimistic submit, and by the page on a
   failure — see `LandingView/logic.ts`, which owns the error case. */
landing-newsletter [status] {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text);
}

landing-newsletter :is([kicker], [headline], [copy], [fine-print], [status]):empty {
  display: none;
}

/* ---------------- SKELETON ---------------- */

landing-newsletter[skeleton],
landing-newsletter[skeleton] * {
  font-family: var(--landing-skeleton-font);
  font-weight: 400;
  letter-spacing: normal;
}

landing-newsletter[skeleton] {
  background: var(--landing-skeleton-surface);
  pointer-events: none;
  user-select: none;
}

landing-newsletter[skeleton] :is([kicker], [headline], [copy], [fine-print]):empty {
  display: revert;
}

landing-newsletter[skeleton] [kicker] {
  color: var(--landing-skeleton-kicker);
}

landing-newsletter[skeleton] [kicker]:empty::before {
  content: 'Newsletter';
}

/* No hover in a still picture. */
landing-newsletter[skeleton] button::after {
  display: none;
}

/* An empty input already *is* the wireframe's shape, so the field needs no
   filler — only the browser's disabled tint taking off, which would otherwise
   read as a state rather than as a blank. */
landing-newsletter[skeleton] input {
  border-color: var(--landing-skeleton-rule);
  background: var(--background);
  opacity: 1;
}

landing-newsletter[skeleton] input::placeholder {
  color: transparent;
}

landing-newsletter[skeleton] button {
  background: var(--landing-skeleton-heading);
  color: var(--background);
  opacity: 1;
}

landing-newsletter[skeleton] [headline] {
  color: var(--landing-skeleton-heading);
}

landing-newsletter[skeleton] [headline]:empty::before {
  content: 'Sign up for the occasional letter';
}

landing-newsletter[skeleton] [copy] {
  color: var(--landing-skeleton-copy);
}

landing-newsletter[skeleton] [copy]:empty::before {
  content: 'One line explaining what lands in the inbox and how often.';
}

landing-newsletter[skeleton] [fine-print] {
  color: var(--landing-skeleton-kicker);
}

landing-newsletter[skeleton] [fine-print]:empty::before {
  content: 'Unsubscribe whenever you like.';
}
