/* reRhopSi — Spatial Intelligence R5
   One screen. The orrery (WebGL) is the centrepiece; all type is DOM.
   Self-hosted fonts, no network, no telemetry. */

@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300; font-display: block; src: url("assets/fonts/cormorant-garamond-latin-300-normal.woff2?v=719eedba4e") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 300; font-display: block; src: url("assets/fonts/cormorant-garamond-latin-300-italic.woff2?v=1b2b00c0d7") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400; font-display: block; src: url("assets/fonts/cormorant-garamond-latin-400-normal.woff2?v=a9ff7df676") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400; font-display: block; src: url("assets/fonts/cormorant-garamond-latin-400-italic.woff2?v=effe3ef07d") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: block; src: url("assets/fonts/instrument-sans-latin-400-normal.woff2?v=5e25932996") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: block; src: url("assets/fonts/instrument-sans-latin-500-normal.woff2?v=28e3d2510b") format("woff2"); }

:root {
  color-scheme: dark;
  --void: #06050a;
  --chamber: #140a10;
  --crimson: #c8102e;
  --crimson-light: #ff3b5c;
  --ember: #ff8d9d;
  --bone: #f3ece6;
  --bone-dim: #b9a8ae;
  --muted: #a89aa1;  /* ≥ 4.5:1 on the darkest rendered background (measured) */
  --display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --ease-out: cubic-bezier(.2, .7, .1, 1);
  --copy-pad: clamp(28px, 5.6vw, 96px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--void); }
body {
  min-width: 320px;
  height: 100svh;
  overflow: hidden;
  background: var(--void);
  color: var(--bone);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1.5px solid var(--ember); outline-offset: 6px; border-radius: 2px; }

/* ---------- atmosphere ---------- */
.atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 58% 56% at 66% 44%, rgba(132, 10, 34, .30), transparent 72%),
    radial-gradient(ellipse 44% 40% at 18% 96%, rgba(58, 12, 30, .40), transparent 72%),
    radial-gradient(ellipse 70% 60% at 50% 50%, var(--chamber), var(--void) 90%);
}
.atmosphere::before {
  content: ""; position: absolute; inset: 0; opacity: .085; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .8 0 0 0 0 .85 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.atmosphere::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
}

/* ---------- masthead ---------- */
.masthead {
  position: absolute; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(22px, 3.2vh, 40px) var(--copy-pad);
}
.masthead__brand img {
  height: clamp(22px, 2.15vw, 30px); width: auto;
  filter: drop-shadow(0 2px 14px rgba(200, 16, 46, .28));
}

/* ---------- layout ---------- */
.page {
  position: relative; z-index: 5;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 60%);
  align-items: stretch;
}
.copy {
  align-self: center;
  padding: 10vh var(--copy-pad) 16vh var(--copy-pad);
  min-width: 0;
}
.headline {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(60px, 7.1vw, 124px);
  line-height: .9;
  letter-spacing: -.012em;
  color: var(--bone);
}
.headline__line {
  display: block;
  opacity: 0; transform: translateY(22px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
}
.headline__line--em {
  font-style: italic;
  font-weight: 300;
  padding-left: .06em;
  color: var(--bone);
  transition-delay: .14s;
}
.statement {
  margin: clamp(22px, 3vh, 34px) 0 0 .08em;
  max-width: 28ch;
  font-size: clamp(15px, 1.12vw, 18px);
  line-height: 1.5;
  letter-spacing: .012em;
  color: var(--bone-dim);
  opacity: 0; transform: translateY(14px);
  transition: opacity 1.2s var(--ease-out) .42s, transform 1.2s var(--ease-out) .42s;
}
.is-ready .headline__line, .is-ready .statement { opacity: 1; transform: none; }

/* ---------- stage ---------- */
.stage {
  position: relative; min-width: 0; height: 100%;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.stage.is-dragging { cursor: grabbing; }
.stage__canvas { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; pointer-events: none; }

.stations { position: absolute; inset: 0; pointer-events: none; }
.station {
  position: absolute; left: 0; top: 0;
  pointer-events: auto;
  padding: 10px 14px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 13px;
  line-height: 1;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--bone);
  white-space: nowrap;
  transform-origin: 50% 0;
  will-change: transform, opacity;
  transition: font-size .6s var(--ease-out), letter-spacing .6s var(--ease-out), color .6s var(--ease-out);
}
.station__word { display: block; }
.station.is-active {
  font-size: clamp(30px, 2.9vw, 46px);
  letter-spacing: -.004em;
  text-transform: none;
  color: var(--bone);
  text-shadow: 0 0 28px rgba(255, 59, 92, .22);
}
.station:hover:not(.is-active) { color: var(--ember); }
.station:focus-visible { outline-offset: 2px; }

.caption {
  position: absolute; left: 0; right: 0; top: 78%; margin: 0;
  padding: 0 24px;
  text-align: center;
  font-size: clamp(13px, .95vw, 15px);
  letter-spacing: .03em;
  color: var(--muted);
  pointer-events: none;
}
.caption__text {
  display: inline-block;
  opacity: 1; transform: none;
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
}
.caption__text.is-changing { opacity: 0; transform: translateY(6px); }

/* ---------- hint & veil ---------- */
.hint {
  position: fixed; z-index: 20; right: var(--copy-pad); bottom: clamp(20px, 3.2vh, 36px); margin: 0;
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--bone-dim);
  opacity: 0; transition: opacity 1s var(--ease-out) 1.6s;
  pointer-events: none;
}
.is-ready .hint { opacity: 1; }
.is-ready .hint.is-done { opacity: 0; transition-delay: 0s; transition-duration: .6s; }

.foot { display: contents; }
.contact {
  position: fixed; z-index: 20; left: var(--copy-pad); bottom: clamp(20px, 3.2vh, 36px);
  font-size: 12.5px; letter-spacing: .05em; line-height: 1; color: var(--bone-dim);
  padding: 6px 0; border-bottom: 1px solid transparent;
  opacity: 0; transition: opacity 1s var(--ease-out) 1.4s, color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.is-ready .contact { opacity: 1; }
.contact:hover { color: var(--bone); border-bottom-color: rgba(255, 141, 157, .55); }

.veil {
  position: fixed; inset: 0; z-index: 50; background: var(--void);
  pointer-events: none; opacity: 1;
  transition: opacity 1.4s var(--ease-out);
}
.is-ready .veil { opacity: 0; }

/* ---------- fallback (no WebGL) ---------- */
.fallback { display: none; position: absolute; inset: 0; pointer-events: none; }
.fallback__symbol {
  position: absolute; left: 50%; top: 46%; width: min(52%, 420px); height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 20px 60px rgba(200, 16, 46, .35));
}
.fallback__ring {
  position: absolute; left: 50%; top: 52%; width: 82%; aspect-ratio: 2.4;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 59, 92, .45);
  box-shadow: 0 0 40px rgba(200, 16, 46, .18), inset 0 0 40px rgba(200, 16, 46, .08);
}
.no-webgl .stage__canvas { display: none; }
.no-webgl .fallback { display: block; }
.no-webgl .station { transition: transform .9s var(--ease-out), opacity .9s var(--ease-out), font-size .6s var(--ease-out), letter-spacing .6s var(--ease-out), color .6s var(--ease-out); }

/* ---------- tablet / mobile: deliberately stacked ---------- */
@media (max-width: 860px) {
  .masthead { justify-content: center; padding: clamp(18px, 3vh, 28px) 24px; }
  .masthead__brand img { height: 22px; }
  .page { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .copy { align-self: start; text-align: center; padding: calc(clamp(18px, 3vh, 28px) + 22px + clamp(26px, 5vh, 54px)) 24px 0; }
  .headline { font-size: clamp(44px, 12vw, 72px); line-height: .9; }
  .headline__line--em { padding-left: 0; }
  .statement { margin: 16px auto 0; font-size: 14px; max-width: 26ch; }
  .stage { min-height: 0; }
  .station { font-size: 11px; letter-spacing: .22em; padding: 8px 10px; }
  .station.is-active { font-size: clamp(26px, 8vw, 36px); }
  .caption { bottom: 6.5%; font-size: 12.5px; max-width: 86%; }
  .hint { right: 50%; transform: translateX(50%); bottom: 40px; font-size: 9.5px; }
  .contact { left: 50%; transform: translateX(-50%); bottom: 12px; font-size: 12px; }
  .fallback__symbol { width: 58%; }
}
@media (max-width: 380px) {
  .headline { font-size: clamp(40px, 11.4vw, 48px); }
  .statement { font-size: 13px; }
  .copy { padding-left: 20px; padding-right: 20px; }
}
/* short landscape phones and small laptops: force the split layout, shrink the type */
@media (max-height: 560px) and (min-width: 640px) and (orientation: landscape) {
  .masthead { justify-content: flex-start; padding: 14px var(--copy-pad); }
  .masthead__brand img { height: 18px; }
  .page { grid-template-columns: minmax(0, 42%) minmax(0, 58%); grid-template-rows: 1fr; }
  .copy { align-self: center; text-align: left; padding: 6vh var(--copy-pad) 8vh var(--copy-pad); }
  .headline { font-size: clamp(40px, 6.2vw, 64px); }
  .headline__line--em { padding-left: .06em; }
  .statement { margin: 14px 0 0 .08em; font-size: 13px; max-width: 26ch; }
  .station { font-size: 10px; letter-spacing: .22em; }
  .station.is-active { font-size: 21px; }
  .caption { font-size: 11.5px; }
  .hint { display: none; }
  .contact { bottom: 12px; font-size: 11px; }
}
/* portrait phones that are also short */
@media (max-width: 860px) and (max-height: 700px) and (orientation: portrait) {
  .headline { font-size: clamp(38px, 10vw, 52px); }
  .copy { padding-top: calc(18px + 22px + 18px); }
  .statement { margin-top: 10px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .headline__line, .statement, .veil, .hint, .contact, .caption__text, .station { transition: none !important; }
  .veil { display: none; }
}
