/* Sora and Inter, self-hosted from @fontsource (SIL OFL 1.1). Copied into /fonts by build.mjs. */
@font-face { font-family: "Sora"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/sora-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/sora-latin-600-normal.woff2") format("woff2"); }
/* Layout: one fixed cinematic stage (video plate + three.js layer + type), driven by a tall scroll track.
   Scenes: A opening → move 1 (through the door) → B hall of windows → move 2 → C contact.
   Colours are @massepoint/look's dark tokens. Single dark look by design. */
:root {
  --background: 0 0% 4%;
  --foreground: 30 20% 96%;
  --muted-foreground: 30 8% 66%;
  --primary: 18 100% 50%;
  --primary-soft: 22 100% 58%;
  --hairline: 30 12% 100% / 0.12;
  --font-display: Sora, "Segoe UI", system-ui, sans-serif;
  --font-body: Inter, "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(20px, 4.4vw, 72px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { background: hsl(var(--background)); }
body {
  margin: 0;
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 3px; border-radius: 4px; }

/* ---------- Stage ---------- */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: hsl(var(--background));
  z-index: 0;
}
.world {
  position: absolute;
  inset: -3%;
  will-change: transform;
}
.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--fx, 70%) 50%;
  opacity: 0;
  pointer-events: none;
}
.layer.on { opacity: 1; }
.fade { transition: opacity 260ms ease; }
#gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.grade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, hsl(0 0% 0% / 0.55) 100%),
    linear-gradient(180deg, hsl(0 0% 0% / 0.35) 0%, transparent 18%, transparent 78%, hsl(0 0% 0% / 0.45) 100%);
}
::selection { background: hsl(var(--primary) / 0.85); color: #fff; }
html { scrollbar-width: thin; scrollbar-color: hsl(var(--primary) / 0.55) hsl(var(--background)); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: hsl(var(--background)); }
::-webkit-scrollbar-thumb { background: hsl(var(--primary) / 0.5); border-radius: 8px; }

.ico {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Chrome ---------- */

.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: calc(env(safe-area-inset-top, 0px) + clamp(18px, 3.4vh, 34px));
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.top a { pointer-events: auto; text-decoration: none; }
.brand { font: 600 clamp(15px, 1.2vw, 19px)/1 var(--font-display); letter-spacing: -0.02em; }
.brand img { display: block; width: auto; height: clamp(30px, 2.5vw, 42px); }
.out { font: 500 clamp(13px, 0.95vw, 15px)/1 var(--font-body); display: inline-flex; gap: 8px; align-items: center; }
.out:hover, .brand:hover { color: hsl(var(--primary-soft)); }

/* ---------- Type overlays ---------- */

.overlay { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.copy {
  position: absolute;
  left: max(var(--gutter), env(safe-area-inset-left, 0px));
  right: max(var(--gutter), env(safe-area-inset-right, 0px));
  opacity: 0;
  will-change: opacity, transform;
}
.copy.live { pointer-events: auto; }
/* The opening reads before any script runs (crawlers, no-JS); the script takes over from there. */
#copyA, #footA { opacity: 1; }
.display {
  margin: 0;
  font: 400 clamp(40px, 5vw, 84px)/1.04 var(--font-display);
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.lede {
  margin: clamp(18px, 2.6vh, 28px) 0 0;
  max-width: 44ch;
  font: 400 clamp(16px, 1.25vw, 20px)/1.55 var(--font-body);
  letter-spacing: 0.005em;
  color: hsl(var(--muted-foreground));
  text-wrap: pretty;
}

#copyA { top: 30vh; max-width: 62rem; }
#copyB { bottom: calc(env(safe-area-inset-bottom, 0px) + 8vh); text-align: center; }
#copyB p {
  margin: 0;
  font: 400 clamp(16px, 1.3vw, 22px)/1.2 var(--font-display);
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
  text-shadow: 0 2px 22px hsl(0 0% 0% / 0.85);
}
#copyC { top: 31vh; left: max(calc(var(--gutter) + 7.6vw), env(safe-area-inset-left, 0px)); max-width: 34rem; }
#copyC .display { font-size: clamp(40px, 4.6vw, 78px); }

.cta {
  margin-top: clamp(22px, 3.2vh, 36px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  border: 1.5px solid hsl(var(--primary));
  border-radius: 999px;
  color: hsl(var(--primary-soft));
  font: 500 16px/1 var(--font-body);
  text-decoration: none;
  background: hsl(0 0% 0% / 0.28);
  transition: background 200ms cubic-bezier(0.22, 1, 0.36, 1), color 200ms ease, box-shadow 200ms ease;
}
.cta:hover { background: hsl(var(--primary)); color: #fff; box-shadow: 0 10px 40px -10px hsl(var(--primary) / 0.8); }
.cta:active { transform: scale(0.98); }
.again {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 18px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: hsl(var(--muted-foreground));
  font: 500 13px/1 var(--font-body);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.again:hover { color: hsl(var(--foreground)); }

/* A link laid over a hall window: the whole window is clickable, a tag on its corner, the name under it. */
.tile {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.tile.live { visibility: visible; pointer-events: auto; cursor: pointer; }
.tile-tag {
  position: absolute;
  left: 18px;
  top: 0;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: #fff;
  font: 600 12px/1 var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 8px 30px -8px hsl(var(--primary) / 0.95);
}
.tile-tag i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: tally 1.6s ease-in-out infinite; }
@keyframes tally { 50% { opacity: 0.25; } }
.tile-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 18px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  white-space: nowrap;
  border: 1.5px solid hsl(var(--primary));
  border-radius: 999px;
  background: hsl(0 0% 4% / 0.55);
  color: hsl(var(--primary-soft));
  font: 500 clamp(14px, 1.05vw, 16px)/1 var(--font-body);
  transition: background 200ms cubic-bezier(0.22, 1, 0.36, 1), color 200ms ease, box-shadow 200ms ease;
}
.tile:hover .tile-name, .tile:focus-visible .tile-name { background: hsl(var(--primary)); color: #fff; box-shadow: 0 10px 40px -10px hsl(var(--primary) / 0.8); }
.tile:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 6px; }
@media (prefers-reduced-motion: reduce) { .tile-tag i { animation: none; } }

.foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: clamp(16px, 2.6vh, 26px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(18px, 3.2vh, 34px));
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  font: 400 clamp(12px, 0.9vw, 14px)/1.4 var(--font-body);
  color: hsl(var(--foreground) / 0.72);
  opacity: 0;
}
.foot p { margin: 0; }
.foot a { color: hsl(var(--foreground) / 0.9); text-underline-offset: 3px; }
#footA { border-top: 1px solid hsl(var(--hairline)); }
#footA .sign { letter-spacing: 0; }
.foot.live { pointer-events: auto; }

/* Scroll prompt: a label over a thin track with a pulse running down it. Fades once scrolling starts. */
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(88px, 12vh, 128px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font: 500 12px/1 var(--font-body);
  letter-spacing: 0.06em;
  color: hsl(var(--foreground) / 0.72);
  opacity: 0;
}
.hint i {
  position: relative;
  width: 1px;
  height: 40px;
  overflow: hidden;
  background: hsl(var(--foreground) / 0.18);
}
.hint i::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 14px;
  background: hsl(var(--primary-soft));
  animation: hint 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes hint { from { transform: translateY(-14px); } to { transform: translateY(40px); } }

.track { position: relative; z-index: 1; height: 760vh; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Phone ---------- */

@media (max-width: 720px) {
  #copyA { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 19vh); }
  #copyC { top: auto; left: max(var(--gutter), env(safe-area-inset-left, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 14vh); }
  .display, #copyC .display { font-size: clamp(36px, 10.4vw, 52px); }
  .lede { font-size: 16px; }
  .grade {
    background:
      linear-gradient(180deg, hsl(0 0% 0% / 0.45) 0%, transparent 20%, transparent 40%, hsl(0 0% 0% / 0.78) 82%, hsl(0 0% 0% / 0.9) 100%);
  }
  #footA .sign { display: none; }
  .hint { bottom: calc(env(safe-area-inset-bottom, 0px) + 74px); }
}

@media (prefers-reduced-motion: reduce) {
  .hint i::after { animation: none; top: 13px; }
}
