@font-face {
  font-family: "SCHABO";
  src: url("../assets/fonts/SCHABO-Condensed.woff2") format("woff2"),
       url("../assets/fonts/SCHABO-Condensed.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #ffffff;
  --paper: #000000;
  --purple: #a96cf7;
  --muted-surface: #2b2b2e;
  --muted-ink: #7d7d84;
  /* Colour an incoming word flashes from before settling into --ink. */
  --accent-from: var(--purple);

  /* Design frame the mobile layout is derived from (Figma iPhone 17, 402x874). */
  --frame-w: 402;

  /* Pointer parallax offsets, driven from js/main.js. */
  --shift-x: 0px;
  --shift-y: 0px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "SCHABO", "Oswald", "Arial Narrow", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------------------------------------------------------------- stage */

.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(2.75svh, env(safe-area-inset-top)) 20px
           max(6.5svh, env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------- backdrop */

.backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.backdrop__ribbon,
.backdrop__mark {
  position: absolute;
  display: block;
  height: auto;
  transform-origin: 50% 50%;
  will-change: transform;
}

/* Geometry mirrors the Figma frame: centre point as a percentage of the
   stage, width as a percentage of stage width, then the layer rotation. */
.backdrop__ribbon {
  left: 56.3%;
  top: 71.06%;
  width: 202.5%;
  fill: var(--purple);
  transform: translate(calc(-50% + var(--shift-x) * 1.6), calc(-50% + var(--shift-y) * 1.6))
             rotate(-25.27deg);
}

/* The wordmark sits over the ribbon, tinting it where the two overlap. */
.backdrop__mark {
  z-index: 1;
  left: 50.01%;
  top: 62.12%;
  width: 111.8%;
  fill: var(--ink);
  opacity: 0.2;
  transform: translate(calc(-50% + var(--shift-x)), calc(-50% + var(--shift-y)))
             rotate(-30deg);
}

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

.masthead__link {
  display: block;
  color: var(--ink);
}

.masthead__logo {
  display: block;
  width: clamp(68px, calc(82 / var(--frame-w) * 100vw), 104px);
  height: auto;
  fill: currentColor;
}

/* ----------------------------------------------------------------- hero */

.hero {
  margin-top: 10.9svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* Same 328/402 text column the design uses, so the headline keeps its
     two-line break at every phone width. */
  max-width: min(calc(332 / var(--frame-w) * 100vw), 392px);
}

.hero__title {
  margin: 0;
  font-size: clamp(34px, calc(48 / var(--frame-w) * 100vw), 56px);
  line-height: 1.0;
  font-weight: 400;
}

.button {
  margin-top: 2.1svh;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--purple);
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(14px, calc(16 / var(--frame-w) * 100vw), 18px);
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 200ms ease, background-color 200ms ease;
}

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
  background: #b884ff;
  box-shadow: 0 10px 30px -8px rgb(169 108 247 / 0.7);
}

/* The community sign-up is not live yet — the call to action is shown as
   inert rather than hidden, so the layout still reads as designed. */
.button:disabled {
  background: var(--muted-surface);
  color: var(--muted-ink);
  cursor: not-allowed;
  box-shadow: none;
}

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

/* -------------------------------------------------------------- tagline */

.tagline {
  margin: auto 0 0;
  font-size: clamp(34px, calc(48 / var(--frame-w) * 100vw), 56px);
  line-height: 1.0;
  text-align: center;
  white-space: nowrap;
}

.swap {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  /* Sized in px by the script so the trailing words glide instead of jumping. */
  transition: width 550ms cubic-bezier(0.65, 0, 0.35, 1);
}

.swap__word {
  display: inline-block;
  white-space: pre;
}

/* Only the outgoing copy is taken out of flow, so the box keeps the
   incoming word's height while the two cross-fade. */
.swap__word--leaving {
  position: absolute;
  left: 0;
  top: 0;
}

.swap__letter {
  display: inline-block;
  will-change: transform, opacity;
}

/* -------------------------------------------------------------- desktop */

@media (min-width: 900px) {
  .stage {
    align-items: stretch;
    padding: clamp(28px, 3.2vw, 52px) clamp(36px, 5.5vw, 96px)
             clamp(28px, 3.2vw, 52px);
  }

  .masthead__logo { width: clamp(92px, 7vw, 128px); }

  .hero {
    margin-top: auto;
    margin-bottom: auto;
    align-items: flex-start;
    text-align: left;
    max-width: min(48%, 21ch);
  }

  .hero__title {
    font-size: clamp(52px, 5.4vw, 96px);
    line-height: 0.92;
    text-wrap: pretty;
  }

  .button {
    margin-top: clamp(20px, 2.4vw, 34px);
    padding: 12px 26px;
    border-radius: 10px;
    font-size: clamp(18px, 1.5vw, 26px);
  }

  .tagline {
    margin: 0;
    text-align: left;
    font-size: clamp(52px, 6vw, 108px);
  }

  .backdrop__ribbon {
    left: 82%;
    top: 62%;
    width: 128%;
    transform: translate(calc(-50% + var(--shift-x) * 1.6), calc(-50% + var(--shift-y) * 1.6))
               rotate(-22deg);
  }

  .backdrop__mark {
    left: 74%;
    top: 50%;
    width: 74%;
    transform: translate(calc(-50% + var(--shift-x)), calc(-50% + var(--shift-y)))
               rotate(-30deg);
  }
}

/* Very wide screens: keep the composition from drifting off the right edge. */
@media (min-width: 1600px) {
  .backdrop__ribbon { left: 76%; width: 108%; }
  .backdrop__mark { left: 70%; width: 62%; }
}

@media (prefers-reduced-motion: reduce) {
  .swap { transition: none; }
  .button { transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
