/* Fallbacks for Syne, scaled to the same width and baseline so the wordmark
   keeps its footprint while the web font loads. Arial Black (macOS, Windows),
   Arial Bold (iOS), Roboto Bold (Android). */
@font-face {
  font-family: "Syne Fallback";
  src: local("Arial Black"), local("Arial-Black");
  font-weight: 800;
  size-adjust: 152.49%;
  ascent-override: 60.99%;
  descent-override: 17.71%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Syne Fallback Bold";
  src: local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 800;
  size-adjust: 167.59%;
  ascent-override: 55.49%;
  descent-override: 16.11%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Syne Fallback Android";
  src: local("Roboto Bold"), local("Roboto-Bold");
  font-weight: 800;
  size-adjust: 186.75%;
  ascent-override: 49.80%;
  descent-override: 14.46%;
  line-gap-override: 0%;
}

:root {
  --bone: #F2EDE6;
  --void: #0A0A0A;
  --rust: #C4451A;
  --rust-hover: #A83917;
  --smoke: #6B6B6B;

  --pad: clamp(1.25rem, 4vw, 3rem);
  --pad-y: clamp(1.25rem, min(4vw, 4vh), 3rem);
  --max: 80rem;
  --gap-s: clamp(1.25rem, 2.5vw, 2rem);
  --gap-m: clamp(2.25rem, min(5vw, 5.5vh), 4rem);
  --gap-l: clamp(3rem, min(8vw, 7vh), 6rem);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--bone);
  color: var(--void);
  font-family: "Space Mono", monospace;
  font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Grain: greyscale noise, soft-light so the average tone of Bone is unchanged. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='3' intercept='-1'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.5;
}

.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  row-gap: var(--gap-l);
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad-y) var(--pad);
  text-align: center;
}

/* Wordmark: one colour, sized to fill the width of its container. */
.masthead {
  width: 100%;
  max-width: var(--max);
  container-type: inline-size;
}

.wordmark {
  margin: 0;
  font-family: "Syne", "Syne Fallback", "Syne Fallback Bold", "Syne Fallback Android", sans-serif;
  font-weight: 800;
  font-size: clamp(1.75rem, 8vw, 7rem);
  font-size: calc(100cqi / 11.3);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

main {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: var(--max);
}

h1 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-weight: 900;
  font-size: clamp(3.5rem, min(15vw, 19vh), 10rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
}

/* Loading bar: a faint Void track; the Rust fill runs in from the left and out to the right. */
.loader {
  position: relative;
  overflow: hidden;
  width: min(100%, 18rem);
  height: 3px;
  margin-top: var(--gap-s);
  background: rgb(10 10 10 / 0.12);
}

.loader::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--rust);
  transform: scaleX(0);
  animation: load 2.8s cubic-bezier(0.65, 0, 0.35, 1) 0.6s infinite;
}

@keyframes load {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  50.01% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

.story {
  max-width: 60ch;
  margin: var(--gap-m) 0 0;
  text-wrap: pretty;
}

.signup {
  width: 100%;
  max-width: 60ch;
  margin-top: var(--gap-m);
}

.hook {
  margin: 0 0 1rem;
  font-weight: 700;
  text-wrap: balance;
}

.form {
  max-width: 400px;
  min-height: 43px;
  margin: 0 auto;
}

.small-print,
.footer {
  margin: 0;
  color: var(--smoke);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.small-print {
  margin-top: 0.875rem;
}

/* 404 link. Bold at 19px or more, so Bone on Rust meets AA as large text. */
.button {
  display: inline-block;
  margin-top: var(--gap-m);
  padding: 0.75rem 1.5rem;
  background: var(--rust);
  color: var(--bone);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}

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

a:focus-visible {
  outline: 3px solid var(--void);
  outline-offset: 3px;
}

/* Entrance: each block rises in, staggered by --d. */
.reveal {
  animation: rise 0.9s var(--ease) both;
  animation-delay: var(--d, 0s);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
  }

  .loader::after {
    animation: none;
    transform: none;
  }
}
