/* Flying Money microsite. Ink, aged paper, one seal red. */

:root {
  --ink: #0C0B09;
  --coal: #171512;
  --paper: #E6D9BE;
  --paper-dim: #B9AB8E;
  --brass: #8F7E5E;
  --line: #3B3529;
  --seal: #B8281F;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* The whole scroll. Six beats. Change this and the beats scale with it. */
  --track: 600vh;
}

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

html { color-scheme: dark; background: var(--ink); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: clamp(15px, 0.4vw + 13px, 18px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--brass); text-underline-offset: 0.2em; }
a:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }

/* 1. The scroll track. */
.spacer { height: var(--track); width: 1px; pointer-events: none; }

/* 2. The stage. */
.stage {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--coal);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(6, 1fr);
  padding: clamp(20px, 4vw, 56px);
  gap: 0 clamp(8px, 1.2vw, 20px);
}

.film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* A little tooth over the image so the crossfades never look like a slideshow. */
.grain {
  position: absolute;
  inset: -50%;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.85  0 0 0 0 0.75  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: soft-light;
}

/* 3. Beats. */
.beat {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(6, 1fr);
  padding: clamp(20px, 4vw, 56px);
  gap: 0 clamp(8px, 1.2vw, 20px);
  opacity: 0;
  pointer-events: none;
}
.beat.is-live { pointer-events: auto; }

.block {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(8px, 1vw, 16px);
  min-width: 0;
}
.block p { margin: 0; max-width: 46ch; color: var(--paper-dim); }
/* Legibility over busy frames. */
.block p, .block h2, .title, .logline, .tags span { text-shadow: 0 1px 14px rgba(12, 11, 9, 0.85), 0 0 2px rgba(12, 11, 9, 0.6); }
.block h2 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "wght" 560;
  font-size: clamp(var(--h2-min, 30px), 4.6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
  color: var(--paper);
}
.block h2.name { font-size: clamp(var(--name-min, 40px), 7vw, 104px); }

.block-centre  { grid-column: 2 / 12; grid-row: 2 / 6; justify-content: center; align-items: center; text-align: center; }
.block-centre p { max-width: 52ch; }
.block-left    { grid-column: 2 / 7;  grid-row: 3 / 7; }
.block-right   { grid-column: 7 / 12; grid-row: 2 / 7; }
.block-split-l { grid-column: 2 / 7;  grid-row: 4 / 7; }
.block-split-r { grid-column: 7 / 12; grid-row: 4 / 7; }
.block-foot    { grid-column: 2 / 8;  grid-row: 6 / 7; }
.block-contact { grid-column: 8 / 12; grid-row: 4 / 7; }

.eyebrow, .meta, .mono, .serial, .cue, .tags span, .spec dt {
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(10px, 0.75vw, 13px);
  color: var(--brass);
}
.eyebrow { margin: 0 0 4px; }
.meta { list-style: none; margin: 0; padding: 0; display: flex; gap: 2em; flex-wrap: wrap; }
.mono { text-transform: none; letter-spacing: 0.04em; color: var(--paper); font-size: clamp(12px, 0.95vw, 15px); margin-top: 12px; max-width: 60ch; }
.block-turn h2 { max-width: 18ch; }

/* Title beat. */
.title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "wght" 640;
  font-size: clamp(56px, 10.5vw, 168px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--paper);
}
.logline { font-size: clamp(16px, 1.3vw, 22px); max-width: 32ch; }
.ghost {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 36vw;
  line-height: 1;
  color: rgba(230, 217, 190, 0.05);
  user-select: none;
  pointer-events: none;
}
.cue {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 4vw, 56px);
  transform: translateX(-50%);
  letter-spacing: 0.24em;
}
.cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 28px;
  margin: 10px auto 0;
  background: linear-gradient(var(--brass), transparent);
}

/* Map tags on beat S1. */
.tags { position: absolute; inset: 0; pointer-events: none; }
.tags span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  padding-left: 14px;
  letter-spacing: 0.2em;
}
.tags span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  background: var(--seal);
}

/* The ask. */
.spec {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 22px;
  margin: 0;
  max-width: 44ch;
}
.spec dt { padding-top: 0.3em; }
.spec dd { margin: 0; color: var(--paper); }
.serial {
  color: var(--seal);
  letter-spacing: 0.24em;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 6px;
}
.block-contact p { color: var(--paper); }

/* Progress hairline along the bottom. The one moving element that is not the image. */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(230, 217, 190, 0.08);
}
.progress i { display: block; height: 100%; width: 0; background: var(--brass); }

/* Phones: stack the split beat, loosen the grids. */
@media (max-width: 720px) {
  .stage, .beat { padding: 20px; }
  .block-left, .block-right, .block-centre { grid-column: 1 / 13; }
  .block-split-l { grid-column: 1 / 13; grid-row: 2 / 4; }
  .block-split-r { grid-column: 1 / 13; grid-row: 4 / 7; }
  .block-ask { grid-column: 1 / 13; grid-row: 1 / 5; }
  .block-contact { grid-column: 1 / 13; grid-row: 5 / 7; }
  .block-foot { grid-column: 1 / 13; }
  .ghost { font-size: 60vw; }
  /* Keep all five pins on phones, re-placed above the text block. */
  .tags .t-sg { --x: 64% !important; --y: 50% !important; }
  .tags .t-cm { --x: 40% !important; --y: 42% !important; }
  .tags .t-co { --x: 6% !important; --y: 36% !important; }
}

/* Short viewports (landscape phones, small laptops with browser chrome): tighten the scale. */
@media (max-height: 560px) {
  :root { --h2-min: 20px; --name-min: 26px; }
  body { font-size: 14px; }
  .title { font-size: clamp(40px, 9vw, 120px); }
  .logline { font-size: 15px; }
  .block { gap: 6px; }
  .block p { max-width: 40ch; }
  .stage, .beat { padding: 16px 24px; }
}

/* Reduced motion: beats still fade, the image cuts instead of drifting. app.js reads the same query. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
