/* ---------------------------------------------------------------------------
   A sealed document.

   The page's job is to withhold, so the design is built around that: a redacted
   sentence sets the tone, and the one thing you can fill in — the email field —
   is drawn as its inverse. Bars hide, lines invite.

   Zero JavaScript by design; every motion here is CSS.
   --------------------------------------------------------------------------- */

:root {
  --paper: #dbdee6;
  --paper-sunk: #ccd0dc;
  --ink: #191a2e;
  --ink-soft: #4b4e68;
  --stamp: #3d2bae;
  --flag: #8e1f2f;

  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;

  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15161e;
    --paper-sunk: #1e202b;
    --ink: #dcdee8;
    --ink-soft: #8f93a9;
    --stamp: #9c8cff;
    --flag: #e8798a;
  }
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.75rem, 5vw, 4rem);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--stamp);
  color: var(--paper);
}

.sheet {
  width: min(100%, var(--measure));
}

/* --- masthead ------------------------------------------------------------ */

.masthead {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  animation: settle 500ms ease-out both;
}

.masthead__rule {
  flex: 1;
  height: 0;
  border-bottom: 1px dotted currentColor;
  transform: translateY(-0.25em);
  opacity: 0.65;
}

/* --- statement ----------------------------------------------------------- */

.statement {
  margin: clamp(2.25rem, 7vh, 3.75rem) 0 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1.85rem, 6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
  animation: settle 620ms 90ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.statement--small {
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
}

/* --- the redacted sentence: the signature -------------------------------- */

.redaction {
  max-width: 38rem;
  margin: 1.6rem 0 0;
  font-size: clamp(1rem, 2.4vw, 1.1rem);
  line-height: 1.95;
  color: var(--ink-soft);
  animation: settle 620ms 200ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.bar {
  display: inline-block;
  height: 0.74em;
  vertical-align: -0.03em;
  border-radius: 1.5px;
  background: var(--ink);
  opacity: 0.9;
  transform-origin: left center;
  animation: strike 380ms cubic-bezier(0.16, 0.84, 0.3, 1) both;
}

.w4 { width: 4ch; }
.w6 { width: 6ch; }
.w7 { width: 7ch; }
.w10 { width: 10ch; }

.bar:nth-of-type(1) { animation-delay: 420ms; }
.bar:nth-of-type(2) { animation-delay: 560ms; }
.bar:nth-of-type(3) { animation-delay: 700ms; }
.bar:nth-of-type(4) { animation-delay: 840ms; }

:where(a, button, input):focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 4px;
}

/* --- colophon ------------------------------------------------------------ */

/* Closes the sheet where the form used to. The hairline answers the dotted
   rule in the masthead, so the page still reads as bookended rather than
   simply running out. */
.colophon {
  margin-top: clamp(2.75rem, 9vh, 4.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink-soft) 70%, transparent);
  animation: settle 700ms 520ms ease-out both;
}

.colophon p {
  margin: 0;
}

.backlink {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--stamp);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

/* --- utilities ----------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes strike {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

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