/* ===== Fonts ===== */

@font-face {
  font-family: "Bodoni Moda";
  src: url("fonts/bodoni-moda-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ===== Tokens ===== */

:root {
  --encre: #0A0C0E;
  --os: #E8E2D2;
  --glacier: #7C9CB3;

  --serif: "Bodoni Moda", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --container: 620px;
  --gutter: clamp(20px, 6vw, 40px);
}

/* ===== Reset ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--encre);
  color: var(--os);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transform: translateZ(0);
}

h1, h2, p, ul {
  margin: 0;
}

a {
  color: var(--os);
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

input {
  font: inherit;
  color: inherit;
}

/* ===== Paper grain overlay =====
   Fixed, pointer-events:none pseudo-layer only, never on a scrolling
   container, so it costs nothing on repaint. */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch' result='t'/%3E%3CfeColorMatrix in='t' type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ===== Focus ===== */

a:focus,
button:focus,
input:focus {
  outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--glacier);
  outline-offset: 3px;
}

/* ===== Layout shell ===== */

.masthead,
.hero,
.articles,
.isolated-line,
.colophon {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  width: 100%;
}

/* ===== First screen (photographed) ===== */

.screen1 {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background-image:
    linear-gradient(180deg, rgba(10, 12, 14, 0.32) 0%, rgba(10, 12, 14, 0.58) 40%, rgba(10, 12, 14, 1) 100%),
    url("assets/hero-bg.webp");
  background-size: cover;
  background-position: center;
  background-color: var(--encre);
}

/* ===== Masthead ===== */

.masthead {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: clamp(16px, 4vh, 28px);
  padding-bottom: clamp(10px, 3vh, 20px);
}

.masthead__crown {
  width: 34px;
  height: 21px;
}

.masthead__word {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.32em;
}

/* ===== Hero ===== */

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: clamp(4px, 1.6vh, 12px);
  padding-bottom: clamp(20px, 5vh, 32px);
}

.hero__dense {
  display: flex;
  flex-direction: column;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(44px, 12vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

.hero__spacer {
  flex: none;
  height: clamp(24px, 6vh, 64px);
}

.hero__quiet {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3.4vh, 24px);
}

/* ===== Countdown ===== */

.countdown {
  display: flex;
  align-items: baseline;
  gap: clamp(20px, 5vw, 32px);
  margin-top: clamp(16px, 3vh, 24px);
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.countdown__value {
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: clamp(32px, 8.5vw, 44px);
  line-height: 1;
  color: var(--os);
}

.countdown__label {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--os);
  opacity: 0.72;
}

.countdown__caption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--os);
  opacity: 0.7;
  margin-top: 6px;
}

/* ===== Subtitle ===== */

.hero__subtitle {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.01em;
}

/* ===== Enrollment (steps) ===== */

.step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step[hidden] {
  display: none;
}

.field-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--os);
  opacity: 0.58;
}

.field-input {
  appearance: none;
  width: 100%;
  min-height: 48px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(232, 226, 210, 0.35);
  border-radius: 0;
  padding: 12px 2px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--os);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.field-input::placeholder {
  color: var(--os);
  opacity: 0.58;
}

.field-input:focus {
  border-bottom-color: var(--glacier);
  border-bottom-width: 2px;
  padding-bottom: 11px;
  background: rgba(124, 156, 179, 0.06);
}

.field-input[aria-invalid="true"] {
  border-bottom-color: var(--os);
  border-bottom-width: 2px;
  padding-bottom: 11px;
}

.field-error {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--os);
}

/* ===== Buttons =====
   No fill, ever: a text label sitting on a rule. The rule reacts on
   hover/active (simple state change, not an animation). */

.btn {
  position: relative;
  align-self: flex-start;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  padding: 0 6px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--os);
}

.btn--primary {
  text-transform: uppercase;
}

.btn::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 11px;
  height: 4px;
  background: var(--glacier);
  transition: height 0.15s ease, background-color 0.15s ease;
}

.btn:hover::after {
  height: 7px;
}

.btn:active::after {
  background: #6D8CA0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:disabled::after {
  height: 3px;
}

.btn--ghost::after {
  background: rgba(232, 226, 210, 0.4);
  height: 1px;
}

.btn--ghost:hover::after {
  background: var(--os);
  height: 2px;
}

/* ===== Step 2 ===== */

.step2__question {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
}

/* ===== Step 3 ===== */

.step--3 {
  align-items: flex-start;
  gap: 14px;
}

.step3__label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--os);
  opacity: 0.5;
}

.step3__number {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(60px, 18vw, 88px);
  line-height: 1;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(124, 156, 179, 0.45);
  width: 100%;
}

.step3__confirm {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
}

.step3__note {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--os);
  opacity: 0.72;
}

/* ===== Articles ===== */

.articles {
  padding-top: clamp(28px, 6vh, 44px);
  padding-bottom: clamp(24px, 6vh, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vh, 28px);
}

.rule {
  border: none;
  border-top: 1px solid var(--glacier);
  opacity: 0.4;
  margin: 0;
}

.article {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article__num {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--os);
  opacity: 1;
}

.article__text {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;
}

/* ===== Isolated line ===== */

.isolated-line {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(19px, 5vw, 24px);
  letter-spacing: 0.015em;
  padding-block: clamp(32px, 7vh, 48px);
  text-wrap: balance;
}

/* ===== Footer ===== */

.colophon {
  padding-top: clamp(24px, 5vh, 32px);
  padding-bottom: clamp(28px, 6vh, 40px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(124, 156, 179, 0.3);
}

.colophon__data,
.colophon__links {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--os);
  opacity: 0.72;
}

.colophon__links a {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== Reduced motion ===== */

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.001ms !important;
  }
}

/* ===== Legal page ===== */

.legal {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.legal__title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(22px, 6vw, 30px);
  letter-spacing: 0.04em;
  padding-top: clamp(24px, 6vh, 40px);
  padding-bottom: clamp(24px, 6vh, 40px);
}

.legal .articles {
  padding-inline: 0;
  padding-top: 0;
}

.legal__back {
  padding-block: clamp(28px, 6vh, 44px);
}

.legal__back a {
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== Wide viewports ===== */

@media (min-width: 700px) {
  :root {
    --container: 640px;
  }

  .hero {
    gap: clamp(22px, 3.4vh, 32px);
  }

  .step--1 {
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
  }

  .step--1 .field-label {
    display: none;
  }

  .step--1 .field-input {
    flex: 1;
  }

  .field-error {
    order: 3;
  }
}

@media (min-width: 900px) {
  :root {
    --container: 760px;
    --gutter: 48px;
  }

  .masthead {
    padding-top: 44px;
    padding-bottom: 8px;
  }

  .masthead__crown {
    width: 40px;
    height: 25px;
  }

  .masthead__word {
    font-size: 14px;
  }

  .hero {
    justify-content: center;
    padding-top: 8px;
    padding-bottom: 32px;
  }

  .hero__title {
    font-size: clamp(64px, 6.4vw, 112px);
    line-height: 0.92;
  }

  .countdown {
    margin-top: 36px;
    gap: 28px;
  }

  .countdown__value {
    font-size: clamp(48px, 4.6vw, 76px);
  }

  .countdown__label {
    font-size: 12px;
    letter-spacing: 0.16em;
  }

  .hero__spacer {
    flex: none;
    min-height: 0;
    height: clamp(40px, 6vh, 96px);
  }

  .hero__quiet {
    gap: 28px;
  }

  .hero__subtitle {
    font-size: 18px;
    max-width: 56ch;
  }

  .articles {
    padding-top: 36px;
  }
}
