@font-face {
  font-family: "Barlow SC";
  src: url("/fonts/barlow-sc-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Barlow SC";
  src: url("/fonts/barlow-sc-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Sampled from the render's paper so the page matches it before the image lands. */
  --paper: #d8481c;
  --paper-deep: #b8330f;
  --paper-lit: #ff8a4c;
  --ink: #120a06;
  --ink-soft: #2e150a;
  --cream: #fff3ea;

  --gutter: clamp(16px, 3.2vw, 48px);
  --font: "Barlow SC", "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: linear-gradient(180deg, var(--paper-deep) 0%, var(--paper) 55%, #dc541d 100%);
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
  display: grid;
  /* bar / empty space over the render / text block / footer */
  grid-template-rows: auto 1fr auto auto;
  overflow-x: clip;
}

/* The studio photograph: fixed, full-bleed, anchored to its top so the
   wordmark never crops; the paper below absorbs any extra height. */
.hero {
  position: fixed;
  inset: 0;
  z-index: 0;
  /* A drag that starts on the image must orbit the camera, not drag the file. */
  pointer-events: none;
}
.hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
}

.live {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease-out;
}
.live.is-live { opacity: 1; }

/* Once the live view has compiled, the whole page is a drag surface. */
.can-orbit body { cursor: grab; user-select: none; -webkit-user-select: none; }
.can-orbit { touch-action: pan-y; }
.is-dragging body { cursor: grabbing; }
.notify { cursor: auto; user-select: text; -webkit-user-select: text; }

.bar, .stage, .foot { position: relative; z-index: 1; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Top slate ---- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: calc(var(--gutter) * 0.75) var(--gutter) 0;
  /* The top of the render is the dark end of the sky gradient: cream reads there, ink doesn't. */
  color: var(--cream);
  font-weight: 700;
  font-size: clamp(0.95rem, 0.8rem + 0.4vw, 1.2rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bar__status {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.bar__status::before {
  content: "";
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: currentColor;
  animation: tally 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes tally {
  0%, 55% { opacity: 1; }
  70%, 85% { opacity: 0.25; }
  100% { opacity: 1; }
}

/* ---- Stage: taglines + signup, sitting on the paper below the spheres ---- */
.stage { grid-row: 3; }
.foot { grid-row: 4; }
/* The footer continues the same glow, so the pool runs to the bottom edge. */
.foot-wrap { grid-row: 4; background: rgba(255, 150, 92, 0.55); position: relative; z-index: 1; }
/* Light pooling on the paper under the text: keeps ink at >= 4.5:1 on the
   render's darkest floor pixels (measured on both framings), and still reads
   when the live camera swings round to the dimmer side. */
.stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -4rem 0 0;
  background: linear-gradient(to top,
    rgba(255, 150, 92, 0.55) 0%,
    rgba(255, 150, 92, 0.55) 72%,
    rgba(255, 150, 92, 0) 100%);
  pointer-events: none;
}
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 25rem);
  align-items: end;
  align-content: end;
  gap: clamp(1.5rem, 3vw, 5rem);
  padding: 0 var(--gutter) clamp(1rem, 2.4vw, 2rem);
}

/* "This is V2 of your V1." then one paragraph of "X, not Y." pairs:
   the V2 word bold in ink, the V1 word regular in ink-soft. */
.vs { min-width: 0; }
.vs p { margin: 0; }
.vs__lead {
  font-weight: 700;
  font-size: clamp(1.6rem, 1rem + 2vw, 3rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem !important;
}
.vs__body {
  max-width: 40em;
  font-size: clamp(1.05rem, 0.75rem + 0.7vw, 1.45rem);
  line-height: 1.3;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.vs__body b { font-weight: 700; color: var(--ink); }
/* Each "X, not Y." stays on one line. */
.vs__pair { white-space: nowrap; }

/* ---- Signup ---- */
.notify {
  display: grid;
  gap: 0.5rem;
}
.notify__label {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.notify__field {
  display: flex;
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px;
  box-shadow: 0 18px 40px -18px rgba(18, 10, 6, 0.55);
  transition: box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.notify__field:focus-within {
  box-shadow: 0 0 0 3px var(--cream), 0 18px 40px -18px rgba(18, 10, 6, 0.55);
}
.notify input[type="email"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1.1rem;
  color: var(--cream);
  background: transparent;
  border: 0;
  padding: 0.7rem 0.9rem 0.7rem 1.1rem;
  outline: none;
}
.notify input[type="email"]::placeholder { color: #c9a996; opacity: 1; }
.notify button {
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper-lit);
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  transition: background-color 200ms ease-out, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.notify button:hover { background: var(--cream); }
.notify button:active { transform: scale(0.97); }
.notify button:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }
.notify button[disabled] { opacity: 0.6; cursor: progress; }

.notify__msg {
  margin: 0;
  min-height: 1.3em;
  font-size: 1rem;
  font-weight: 700;
}
.notify[data-state="error"] .notify__field { box-shadow: 0 0 0 3px var(--cream); }
.notify[data-state="done"] .notify__field { display: none; }
.notify[data-state="done"] .notify__msg { font-size: clamp(1.2rem, 1rem + 0.6vw, 1.6rem); }

.notify__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Footer rule ---- */
.foot {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin: 0 var(--gutter);
  padding: 0.8rem 0 calc(var(--gutter) * 0.6);
  border-top: 2px solid var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
}

.foot__hint { display: none; margin-right: auto; }
.can-orbit .foot__hint { display: inline; }

/* ---- Portrait: the tall render is width-scaled and top-anchored, so the
   spheres end at ~69vw (0.294 x 2.333vw); 76vw leaves a gap. Keep the text below them; a short phone scrolls. */
@media (orientation: portrait) {
  body { grid-template-rows: auto minmax(calc(76vw - 3.5rem), 1fr) auto auto; }
}

/* ---- Narrow / portrait ---- */
@media (max-width: 960px), (orientation: portrait) {
  .stage {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .notify { max-width: 30rem; }
}
@media (max-width: 640px) {
  .foot { font-size: 0.8rem; }
  .foot__reset { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bar__status::before { animation: none; }
}

/* ---- 404 ---- */
.lost .stage { grid-template-columns: 1fr; }
.lost .lost__code {
  margin: 0;
  font-weight: 700;
  font-size: clamp(6rem, 22vw, 16rem);
  line-height: 0.8;
  letter-spacing: -0.03em;
}
.lost .lost__text { margin: 0; font-size: clamp(1.25rem, 1rem + 1vw, 2rem); font-weight: 700; }
.lost a { color: var(--ink); text-underline-offset: 0.2em; }
.lost a:hover { text-decoration-thickness: 3px; }
