/* RAT landing — the gallery wall.
   One white field, one small mark placed off centre, the reactive atoms, and
   the copy one swipe away. No header, no footer. /thesis and /privacy keep
   style.css; nothing here touches them. */

:root {
  /* Safari-tab overscan. 0 everywhere except an iPhone Safari tab, where the
     ios-tab class below raises them (see CLAUDE.md). */
  --top: 0px;
  --bottom: 0px;

  --ground: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: rgba(10, 10, 10, 0.48);
  --rule: rgba(10, 10, 10, 0.14);
  --signal: #b00000; /* form errors only */

  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --body: clamp(22px, 0.9rem + 1.9vw, 40px);
  --label: clamp(11px, 0.62rem + 0.12vw, 12px);
  --edge: clamp(21px, 5vw, 89px);

  /* Where the controls sit; the copy fades out before it reaches them. */
  --chrome: calc(var(--top) + max(21px, env(safe-area-inset-top)));
}

/* ─── STAGE ──────────────────────────────────────────────────────────── */

html { background: var(--ground); color: var(--ink); }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font: 400 var(--body) / 1.2 var(--sans);
  letter-spacing: -0.018em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
::selection { background: var(--ink); color: var(--ground); }

/* The only fixed layer. No background of its own: the white comes from html. */
.stage { position: fixed; inset: 0; overflow: hidden; }

/* iPhone Safari tab: the stage becomes in-flow content taller than the
   screen and the document rests scrolled down by --top, so Safari shows the
   field behind its bars instead of flat bands. */
html.ios-tab { --top: 120px; --bottom: 136px; height: auto; overflow: hidden scroll; scrollbar-width: none; }
html.ios-tab::-webkit-scrollbar { display: none; }
html.ios-tab body { height: auto; overflow: visible; }
html.ios-tab .stage { position: relative; inset: auto; height: calc(100lvh + var(--top) + var(--bottom)); }

.field { position: absolute; inset: 0; transition: opacity 0.9s var(--ease); }
.field canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.is-reading .field { opacity: 0.1; }

/* ─── PANES ──────────────────────────────────────────────────────────── */

.pane {
  position: absolute;
  inset: 0;
  transition: transform 0.8s var(--ease), opacity 0.8s var(--ease);
}
.pane-field { touch-action: none; }
/* Direction comes from the gesture: home.js sets --px/--py on each pane to
   -1, 0 or 1, so the copy arrives travelling the way the finger moved. */
.pane-text { transform: translate(calc(var(--px, 1) * 100%), calc(var(--py, 0) * 100%)); pointer-events: none; }

.is-reading .pane-field { transform: translate(calc(var(--px, -1) * 21%), calc(var(--py, 0) * 21%)); opacity: 0; pointer-events: none; }
.is-reading .pane-text { transform: none; pointer-events: auto; }

/* The box a visitor can always see: starts at --top, one small viewport tall. */
.frame { position: absolute; left: 0; right: 0; top: var(--top); height: 100svh; }

/* Off centre on the Fibonacci scale: 8 left, 13 down. */
.mark {
  position: absolute;
  left: calc(50% - 8vmin);
  top: calc(50% + 13vmin);
  width: clamp(55px, 12vmin, 89px);
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: opacity 0.22s var(--ease);
}
.mark img { display: block; width: 100%; height: auto; }
.mark:hover { opacity: 0.55; }
.mark:focus-visible { outline: 1px solid var(--ink); outline-offset: 13px; }

/* ─── LABELS ─────────────────────────────────────────────────────────── */

.label,
.controls a,
.controls button {
  font: 400 var(--label) / 1.3 var(--mono);
  letter-spacing: 0.22em;
  text-transform: lowercase;
}
a { color: inherit; }
button { color: inherit; }

.controls {
  position: absolute;
  z-index: 3;
  top: var(--chrome);
  left: max(var(--edge), env(safe-area-inset-left));
  right: max(var(--edge), env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
/* play top left, thesis top right; only the words take touches. */
.controls > * { pointer-events: auto; touch-action: none; }
/* Tracking leaves a trailing gap after the last letter; pull it back so the
   word ends on the margin. Padding grows the tap target past the 11px type. */
.controls a,
.controls button {
  margin: -13px -0.22em -13px -8px;
  padding: 13px 8px;
  border: 0;
  background: none;
  text-decoration: none;
  cursor: pointer;
}
.controls a:hover,
.controls button:hover { text-decoration: underline; text-underline-offset: 4px; }
/* play sits on the left margin, so it needs no tracking pull-back. */
.controls a { margin-right: -8px; }

/* ─── COPY ───────────────────────────────────────────────────────────── */

.scroller {
  position: absolute;
  inset: 0;
  overflow: hidden auto;
  overscroll-behavior: none;
  touch-action: pan-y;
  scrollbar-width: none;
  outline: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--chrome) + 34px), #000 calc(var(--chrome) + 89px));
          mask-image: linear-gradient(to bottom, transparent calc(var(--chrome) + 34px), #000 calc(var(--chrome) + 89px));
}
.scroller::-webkit-scrollbar { display: none; }

.copy {
  box-sizing: content-box;
  max-width: 21em;
  padding: calc(var(--chrome) + 89px) max(var(--edge), env(safe-area-inset-right)) calc(var(--bottom) + 144px) max(var(--edge), env(safe-area-inset-left));
}
.copy p,
.copy h1,
.copy h2,
.copy ul,
.copy ol { margin: 0; padding: 0; font-weight: 400; }
.copy p + p { margin-top: 0.6em; }

.copy .label { display: block; color: var(--ink-soft); margin-bottom: 21px; }
.copy section { margin-top: 2.6em; scroll-margin-top: calc(var(--chrome) + 89px); }
.copy .lede { margin-top: 0; }

/* 01–05 row */
.index { display: flex; flex-wrap: wrap; gap: 13px 34px; margin-top: 1.6em; }
.index a { text-decoration: none; color: var(--ink); }
.index a span { color: var(--ink-soft); margin-right: 0.6em; }
.index a:hover { text-decoration: underline; text-underline-offset: 4px; }

.steps { list-style: none; }
.steps li { margin-top: 1.1em; }
.steps .label,
.precise .label,
.register .label { margin-bottom: 8px; }
.precise { margin-top: 1.6em; }

.register { list-style: none; margin-top: 1.1em; }
.register li { padding: 13px 0 21px; border-top: 1px solid var(--rule); }
.register li:last-child { border-bottom: 1px solid var(--rule); }

.links { display: flex; flex-wrap: wrap; gap: 13px 34px; margin-top: 1.6em; }
.links a { color: var(--ink); text-decoration: none; }
.links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.contract {
  display: block;
  margin-top: 1.6em;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.contract .label { margin-bottom: 8px; }
.contract-val { font: 400 var(--label) / 1.5 var(--mono); letter-spacing: 0.04em; word-break: break-all; color: var(--ink); }
.contract:hover .contract-val { opacity: 0.55; }

.issuer { margin-top: 3.4em; }

/* ─── DESK FORM ──────────────────────────────────────────────────────── */

.desk-form { display: grid; gap: 34px; margin-top: 1.6em; }
.desk-form .label { margin-bottom: 0; }
.desk-form input,
.desk-form textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 0;
  font: 400 var(--body) / 1.2 var(--sans);
  letter-spacing: -0.018em;
  text-transform: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  outline: none;
  resize: none;
  transition: border-color 0.22s var(--ease);
}
.desk-form input:focus,
.desk-form textarea:focus { border-bottom-color: var(--ink); }
.desk-form ::placeholder { color: rgba(10, 10, 10, 0.26); }
.desk-form .input-error { border-bottom-color: var(--signal); }
.desk-form button {
  justify-self: start;
  margin: 0 0 0 -8px;
  padding: 13px 8px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.desk-form button:hover { text-decoration: underline; text-underline-offset: 4px; }
.desk-form button:disabled { color: var(--ink-soft); cursor: default; text-decoration: none; }
.form-status { color: var(--ink); }
.form-status.error { color: var(--signal); }

@media (prefers-reduced-motion: reduce) {
  .pane, .field { transition: none; }
}
