@font-face {
  font-family: "Manrope";
  src: url("./assets/fonts/Manrope-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: block;
}

:root {
  /* Makereason tokens. Dark, monochrome, one red moment (the record circle). */
  --bg: #010102;
  --surface: #121214;
  --border: #26262a;
  --text: #f7f8f8;
  --text-muted: #8b8b93;
  --text-faint: #5c5c64;
  --brand: #ff3b30;        /* record circle, Undo, nothing else */
  --focus: #8a94f3;

  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-display: 32px; --leading-display: 38px;   /* weight 700 */
  --text-title: 20px;   --leading-title: 26px;     /* weight 600 */
  --text-body: 17px;    --leading-body: 24px;      /* weight 400, thought cards */
  --text-small: 15px;   --leading-small: 20px;     /* weight 400 */
  --text-caption: 13px; --leading-caption: 16px;   /* weight 500, muted */

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 8px; --radius-md: 12px; --radius-full: 999px;

  color-scheme: dark;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); }

.portrait-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  text-align: center;
}

/* Logo at the top, words at the bottom, the bust fills everything between and behind. */
.portrait-screen { justify-content: space-between; }
.logo { position: relative; z-index: 2; display: block; width: auto; height: 26px; }
.portrait-copy { position: relative; z-index: 2; }
body { overflow-x: clip; }

/* The bust is the page: as tall as the screen, a little wider than a phone.
   The fade top and bottom lets the logo and the words sit on it. */
.portrait {
  position: fixed;
  left: 50%;
  top: calc(50% + 5svh);
  z-index: 0;
  width: min(max(100vw, 60svh), 100svh);
  aspect-ratio: 1;
  margin: 0;
  transform: translate(-50%, -50%);
  -webkit-mask-image: linear-gradient(transparent 2%, #000 14%, #000 55%, transparent 84%);
  mask-image: linear-gradient(transparent 2%, #000 14%, #000 55%, transparent 84%);
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.portrait[data-dragging] { cursor: grabbing; }
.portrait:focus-visible { outline: 2px solid var(--focus); outline-offset: -16px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.portrait-canvas,
.portrait-still {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.portrait-still {
  position: absolute;
  inset: 0;
}

.portrait-canvas { opacity: 0; }
.portrait-canvas[data-state="ready"] { opacity: 1; }
.portrait-canvas[data-state="ready"] + .portrait-still { display: none; }

.portrait-copy {
  container-type: inline-size;
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 640px;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 8.7vw, 36px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.subheading {
  margin: 0 auto;
  max-width: 39ch;
  color: #b9bac3;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

::selection { background: #5e6ad2; color: #f7f8f8; }

@media (max-width: 639px) {
  h1 {
    white-space: nowrap;
    text-wrap: nowrap;
    /* This exact Manrope heading measures 10.10449em, including letter spacing. */
    font-size: calc((100vw - max(20px, env(safe-area-inset-left)) - max(20px, env(safe-area-inset-right)) - 2px) / 10.105);
  }
  @supports (font-size: 1cqi) {
    h1 { font-size: calc((100cqi - 2px) / 10.105); }
  }
}

@media (min-width: 640px) {
  .portrait-screen { gap: 32px; padding: 32px; }
  .portrait-copy { gap: 20px; }
  .logo { height: 30px; }
  h1 { font-size: 48px; }
  .subheading { max-width: 60ch; font-size: 18px; }
}

@media (max-height: 650px) {
  .portrait-screen { gap: 20px; padding-block: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-bottom)); }
  .portrait-copy { gap: 14px; }
}


/* Raw, not polished: film grain. Overlay keeps the black black and roughens only the letters. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E");
  animation: grain 0.7s steps(2) infinite;
}
@keyframes grain { 50% { transform: translate(-2%, 1.5%); } 100% { transform: translate(1.5%, -1%); } }

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