/* Proyecto Sonra — experiencia clandestina
   Si leés esto: /prisma/interno.txt */

:root {
  --bg: #e7efec;
  --fg: #102e29;
  --muted: #4b6a64;
  --accent: #0f6e63;
  --alert: #d61f1f;
  --halo: #f0d27a;
  --void: #050806;
  --paper: #f7fbf9;
  --line: rgba(16, 46, 41, 0.16);
  --hud-h: 0px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --serif: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --mx: 50vw;
  --my: 40vh;
  --halo-r: 42vmin;
  --void-a: 0;
  --night: 0;
  --scan-a: 0.04;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  cursor: none;
}
body:not(.is-touch),
body:not(.is-touch) * {
  cursor: none !important;
}

body.is-touch,
body.is-touch * {
  cursor: auto;
}

body.era-clean {
  --bg: #e7efec;
  --fg: #102e29;
  --muted: #4b6a64;
  --accent: #0f6e63;
  --line: rgba(16, 46, 41, 0.16);
  --halo-r: 70vmin;
  --scan-a: 0.03;
}

body.era-origin {
  --bg: #e7efec;
  --fg: #102e29;
  --muted: #3f5c57;
  --accent: #0b5c54;
  --line: rgba(16, 46, 41, 0.18);
  --halo-r: 34vmin;
  --scan-a: 0.03;
}

body.era-shadow,
body.era-after {
  --bg: #050806;
  --fg: #e8d9a8;
  --muted: #8a7a52;
  --accent: #e4c56a;
  --line: rgba(228, 197, 106, 0.14);
  --halo-r: 28vmin;
  --scan-a: 0.12;
}

body.era-after {
  --fg: #cfe3ea;
  --accent: #8ec8d8;
  --halo: #b7e0ea;
  --muted: #6d8b96;
}

body,
body.era-clean,
body.era-origin,
body.era-shadow,
body.era-after {
  transition: color 2.4s ease;
  background: color-mix(in srgb, #e7efec calc((1 - var(--night)) * 100%), #050806 calc(var(--night) * 100%));
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.kicker {
  margin: 0 0 0.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.mono { font-family: var(--mono); }

.alert-blink { animation: blink 1.1s steps(2, start) infinite; color: var(--alert); }

@keyframes blink {
  50% { opacity: 0.15; }
}

/* Overlays */
#halo-canvas,
#halo-fg,
#night-tide,
#void-mask,
.scanlines,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#night-tide {
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(2, 4, 3, calc(var(--night) * 0.98)) 0%,
    rgba(5, 8, 6, calc(var(--night) * 0.94)) calc(var(--night) * 52%),
    rgba(5, 8, 6, calc(var(--night) * 0.55)) calc(var(--night) * 74%),
    rgba(5, 8, 6, calc(var(--night) * 0.18)) calc(var(--night) * 90%),
    transparent calc(var(--night) * 100% + 14%)
  );
}
#void-mask {
  z-index: 1;
  background: radial-gradient(
    circle var(--halo-r) at var(--mx) var(--my),
    rgba(255, 236, 180, calc(var(--night) * 0.1)) 0%,
    transparent 34%,
    rgba(5, 8, 6, calc(var(--night) * 0.28)) 62%,
    rgba(5, 8, 6, calc(var(--night) * 0.55)) 100%
  );
}
#halo-canvas {
  z-index: 2;
}
#halo-fg {
  z-index: 5;
}
.scanlines {
  z-index: 2;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, var(--scan-a)) 0 1px,
    transparent 1px 4px
  );
  mix-blend-mode: multiply;
  opacity: calc(0.2 + var(--night) * 0.4);
}
.grain {
  z-index: 2;
  opacity: calc(0.03 + var(--night) * 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
#cursor-ring {
  position: fixed;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  transform: translate(-50%, -50%);
  background: rgba(240, 210, 122, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.7),
    0 0 16px rgba(240, 210, 122, 0.85),
    0 0 42px rgba(240, 210, 122, 0.4);
}
#cursor-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px #fff;
}
body.is-touch #cursor-ring { display: none; }

body.is-dark {
  --fg: #f4f1ea;
  --muted: #c8b889;
  --accent: #e4c56a;
  --line: rgba(228, 197, 106, 0.16);
}

body.is-dark.era-after {
  --fg: #e8f2f5;
  --muted: #9bb8c2;
  --accent: #8ec8d8;
  --line: rgba(142, 200, 216, 0.16);
}

/* En la oscuridad el texto es blanco sólido: si el relleno es transparente, las partículas se leen encima de las letras */
body.is-dark .experience,
body.is-dark .hud {
  color: #f4f1ea;
}
body.is-dark :is(
  .era-title,
  .era-body,
  .era-note,
  .kicker,
  .synopsis blockquote,
  .scroll-hint,
  .archive-all a,
  .tx-footnote,
  .tx-status,
  .tx-social a,
  .hud-name,
  .hud-status,
  .hud-nav a,
  .hud-console-toggle,
  .dossier h3,
  .dossier p,
  .map-section .era-body,
  .cine-title,
  .cine-body,
  .cine-kicker,
  .cine-note
) {
  -webkit-text-fill-color: currentColor;
  color: #f4f1ea;
  background-image: none;
  text-shadow:
    0 1px 0 rgba(5, 8, 6, 0.92),
    0 0 16px rgba(5, 8, 6, 0.55);
}
body.is-dark :is(.kicker, a, .hud-nav a, .archive-all a, .tx-social a, .hud-console-toggle, .cine-kicker) {
  color: #fff;
  -webkit-text-fill-color: #fff;
}
body.is-dark .glitch::before {
  -webkit-text-fill-color: #ff3b3b;
  color: #ff3b3b;
}
body.is-dark .glitch::after {
  -webkit-text-fill-color: #7dffc3;
  color: #7dffc3;
}

/* Boot */
.boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #030504;
  color: #7dffc3;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.boot.is-done { display: none; }
.boot-terminal {
  width: min(720px, calc(100% - 2rem));
  font-size: 0.92rem;
}
.boot-id { opacity: 0.5; letter-spacing: 0.12em; }
.boot-line {
  margin: 0.15rem 0;
  opacity: 0;
  transform: translateY(4px);
}
.boot-line.is-on { opacity: 1; transform: none; }
.boot-skip {
  margin-top: 1.5rem;
  background: none;
  border: 1px solid rgba(125, 255, 195, 0.35);
  color: #7dffc3;
  font: inherit;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s;
}
.boot-skip.is-on { opacity: 1; }

.prisma-facade {
  position: absolute;
  inset: 0;
  background: #eef4f1;
  color: #12332e;
  display: none;
  flex-direction: column;
  font-family: var(--display);
}
.prisma-facade.is-on { display: flex; }
.prisma-facade.is-glitch {
  animation: facade-glitch 0.8s steps(2, end) infinite;
  filter: contrast(1.4) saturate(0.2);
}
.prisma-topbar {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid rgba(18, 51, 46, 0.12);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.prisma-mark {
  width: 18px;
  height: 18px;
  background: #0f6e63;
  clip-path: polygon(50% 0, 100% 78%, 50% 100%, 0 78%);
}
.prisma-nav { opacity: 0.45; }
.prisma-access {
  margin-left: auto;
  border: 1px solid #0f6e63;
  padding: 0.35rem 0.7rem;
}
.prisma-hero {
  flex: 1;
  display: grid;
  align-content: center;
  padding: 6vh 8vw;
  max-width: 1100px;
}
.prisma-eyebrow {
  font-family: var(--mono);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #0f6e63;
}
.prisma-title {
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.9;
  margin: 0.2rem 0 1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.prisma-lead {
  max-width: 38rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: #345a54;
}
.prisma-cta span {
  display: inline-block;
  margin-top: 1.5rem;
  background: #0f6e63;
  color: #eef4f1;
  padding: 0.85rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.prisma-alert {
  display: none;
  position: absolute;
  inset: auto 0 0 0;
  background: #d61f1f;
  color: #fff;
  padding: 0.8rem 1.2rem;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: none;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.prisma-alert.is-on { display: flex; }

@keyframes facade-glitch {
  0% { transform: none; }
  20% { transform: translate(-6px, 2px) skewX(-2deg); }
  40% { transform: translate(7px, -3px); }
  60% { transform: translate(-3px, 0) skewX(3deg); }
  100% { transform: none; }
}

/* HUD */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--hud-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.1rem;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}
body.is-live .hud { opacity: 1; pointer-events: auto; }
.admin-bar .hud { top: 32px; }
.hud-left, .hud-right, .hud-nav { display: flex; align-items: center; gap: 1rem; }
.hud-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  letter-spacing: 0.22em;
}
.hud-prism {
  width: 12px;
  height: 12px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 78%, 50% 100%, 0 78%);
}
.hud-status { color: var(--muted); display: none; }
.hud-nav a { color: inherit; opacity: 0.55; text-decoration: none; }
.hud-nav a:hover { opacity: 1; }
.hud-console-toggle {
  background: none;
  border: 1px solid var(--line);
  color: inherit;
  font: inherit;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  letter-spacing: 0.14em;
}
.hud-console-toggle .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.35rem;
  background: var(--alert);
  border-radius: 50%;
  animation: blink 1.4s steps(2, start) infinite;
}

@media (min-width: 860px) {
  .hud-status { display: inline; }
}

/* Experience */
.experience {
  position: relative;
  z-index: 4;
  isolation: isolate;
  opacity: 0;
}
body.is-live .experience { opacity: 1; }
.hud { display: none; }

.synopsis,
.era,
.map-section,
.archive-section,
.tx-section {
  min-height: 100svh;
  padding: 10vh 6vw 12vh;
  display: grid;
  align-content: center;
}
.synopsis {
  position: relative;
}
.scroll-down {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  z-index: 5;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  color: var(--fg);
  text-decoration: none;
  opacity: 0.8;
}
.scroll-down:hover,
.scroll-down:focus {
  opacity: 1;
}
.scroll-down span {
  width: 16px;
  height: 16px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: scroll-down-bounce 1.6s ease-in-out infinite;
}
@keyframes scroll-down-bounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.35; }
  50% { transform: rotate(45deg) translate(5px, 5px); opacity: 1; }
}

.era-frame {
  width: 100%;
  max-width: 92rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem 5vw;
}
.era-title {
  font-family: var(--display);
  font-size: clamp(2.6rem, 6.8vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin: 0;
  font-weight: 800;
  max-width: 13ch;
  font-variation-settings: "opsz" 80, "wdth" 82;
}
.era-body {
  font-family: var(--display);
  font-size: clamp(1.18rem, 1.85vw, 1.55rem);
  line-height: 1.38;
  max-width: 36rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 40, "wdth" 84;
  color: color-mix(in srgb, var(--fg) 88%, var(--muted));
}
.era-note {
  opacity: 0.55;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.synopsis blockquote {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.85rem, 4.2vw, 3.4rem);
  line-height: 1.02;
  font-style: normal;
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: min(18ch, 78vw);
  font-variation-settings: "opsz" 80, "wdth" 82;
}
.scroll-hint {
  margin-top: 2.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 960px) {
  .era-frame {
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
    grid-template-areas:
      "kicker kicker"
      "title body"
      "note body";
    align-items: end;
  }
  .era-frame .kicker,
  .era-frame .cine-kicker { grid-area: kicker; }
  .era-frame .era-title,
  .era-frame .cine-title { grid-area: title; }
  .era-frame .era-body,
  .era-frame .cine-body {
    grid-area: body;
    max-width: 34rem;
    padding-bottom: 0.2em;
  }
  .era-frame .era-note,
  .era-frame .cine-note { grid-area: note; }
  .map-section .era-frame,
  .archive-section .era-frame,
  .tx-section .era-frame {
    grid-template-areas:
      "kicker kicker"
      "title body"
      "note note";
  }
}

/* Capas vivas: el JS de parallax mueve opacity/transform */
.cine-kicker,
.cine-title,
.cine-body,
.cine-note,
.cine-layer {
  opacity: 0;
  will-change: transform, opacity;
}
.no-js .cine-kicker,
.no-js .cine-title,
.no-js .cine-body,
.no-js .cine-note,
.no-js .cine-layer {
  opacity: 1;
  transform: none;
}
.caret {
  display: inline-block;
  width: 0.6ch;
  height: 1em;
  margin-left: 0.3rem;
  background: var(--accent);
  animation: blink 1s steps(2, start) infinite;
  vertical-align: text-bottom;
}

.era-clean {
  background:
    linear-gradient(180deg, rgba(255,255,255, calc(0.55 * (1 - var(--night)))), transparent 40%),
    radial-gradient(1200px 500px at 80% 10%, rgba(15, 110, 99, calc(0.12 * (1 - var(--night)))), transparent 60%);
}
.era-origin {
  background: repeating-linear-gradient(
    -12deg,
    transparent 0 18px,
    rgba(125, 255, 195, 0.03) 18px 19px
  );
}
.era-shadow {
  background:
    radial-gradient(800px 400px at 20% 80%, rgba(228, 197, 106, 0.06), transparent 55%);
}
.era-after {
  background:
    linear-gradient(180deg, transparent, rgba(142, 200, 216, 0.04));
}

.glitch { position: relative; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  animation: glitch-shift 0.9s infinite;
}
.glitch::before {
  color: #ff3b3b;
  clip-path: inset(0 0 52% 0);
}
.glitch::after {
  color: #7dffc3;
  clip-path: inset(48% 0 0 0);
  animation-delay: 0.14s;
}
@keyframes glitch-shift {
  0%, 18%, 42%, 64%, 100% { transform: none; opacity: 0; }
  4% { transform: translate(-6px, 1px); opacity: 0.8; }
  7% { transform: translate(7px, -2px); opacity: 0.55; }
  10% { transform: translate(-3px, 0); opacity: 0; }
  24% { transform: translate(5px, 2px); opacity: 0.7; }
  27% { transform: translate(-8px, -1px); opacity: 0.45; }
  30% { transform: none; opacity: 0; }
  48% { transform: translate(8px, 0); opacity: 0.75; }
  51% { transform: translate(-4px, 2px); opacity: 0.4; }
  54% { transform: none; opacity: 0; }
}

/* Map */
.map-wrap {
  position: relative;
  margin-top: 1rem;
  border: 1px solid var(--line);
  background: rgba(5, 8, 6, 0.45);
  min-height: 88vh;
}
.map-bldg {
  fill: rgba(125, 255, 195, 0.07);
  stroke: rgba(228, 197, 106, 0.38);
  stroke-width: 0.28;
}
.map-bldg.is-surface {
  fill: rgba(125, 255, 195, 0.11);
  stroke: rgba(228, 197, 106, 0.48);
}
.map-bldg.is-park {
  fill: rgba(8, 12, 10, 0.55);
  stroke: rgba(228, 197, 106, 0.28);
  stroke-dasharray: 0.8 0.5;
}
.map-bldg.is-hab {
  fill: rgba(125, 255, 195, 0.09);
}
.map-bldg.is-lost {
  fill: rgba(4, 6, 5, 0.55);
  stroke: rgba(228, 197, 106, 0.42);
  stroke-dasharray: 0.7 0.55;
}
.map-bldg.is-deep {
  fill: rgba(4, 6, 5, 0.78);
  stroke: rgba(228, 197, 106, 0.62);
}
.map-glass {
  fill: rgba(142, 200, 216, 0.08);
  stroke: rgba(142, 200, 216, 0.42);
  stroke-width: 0.28;
}
.map-origin-zone {
  fill: rgba(12, 8, 4, 0.55);
  stroke: rgba(228, 197, 106, 0.55);
  stroke-width: 0.32;
  stroke-dasharray: 0.9 0.5;
}
.map-dome {
  fill: none;
  stroke: rgba(142, 200, 216, 0.45);
  stroke-width: 0.35;
}
.map-shaft {
  fill: rgba(5, 8, 6, 0.7);
  stroke: rgba(228, 197, 106, 0.32);
  stroke-width: 0.22;
}
.map-shaft-tick {
  stroke: rgba(228, 197, 106, 0.28);
  stroke-width: 0.22;
}
.map-svg { width: 100%; height: 88vh; display: block; }
.map-road {
  fill: none;
  stroke: rgba(228, 197, 106, 0.35);
  stroke-width: 0.35;
  stroke-dasharray: 1.2 0.8;
}
.map-water {
  fill: none;
  stroke: rgba(142, 200, 216, 0.45);
  stroke-width: 0.5;
}
.map-label-ghost {
  fill: rgba(228, 197, 106, 0.28);
  font-size: 2.15px;
  font-family: var(--mono);
  letter-spacing: 0.3px;
}
.map-floor-tag {
  fill: rgba(228, 197, 106, 0.38);
  font-size: 2.05px;
  font-family: var(--mono);
  letter-spacing: 0.22px;
}
.map-node { cursor: pointer; }
.map-hit {
  fill: transparent;
  pointer-events: all;
}
.map-dot { fill: var(--halo, #e4c56a); }
.map-pulse {
  fill: none;
  stroke: var(--halo, #e4c56a);
  stroke-width: 0.18;
  opacity: 0.5;
  animation: pulse 2.6s ease-out infinite;
}
.map-label {
  fill: #f0e2b2;
  font-size: 2.15px;
  font-family: var(--mono);
  text-anchor: middle;
}
.map-node:focus { outline: none; }
.map-node:hover .map-dot,
.map-node:focus .map-dot { fill: #fff; }
.map-node.is-lost .map-dot { fill: #d7b36a; }
.map-node.is-lost .map-pulse {
  stroke: #d7b36a;
  animation-duration: 1.35s;
}
.map-node.is-origin .map-dot { fill: #f0e2b2; }
.map-node.is-origin .map-pulse {
  stroke: #f0e2b2;
  animation-duration: 0.9s;
}

@keyframes pulse {
  from { r: 1.4; opacity: 0.55; }
  to { r: 4.4; opacity: 0; }
}

.dossier {
  position: fixed;
  z-index: 75;
  top: 18vh;
  right: 4vw;
  left: auto;
  bottom: auto;
  width: min(360px, calc(100vw - 2rem));
  padding: 0;
  background: rgba(8, 10, 8, 0.94);
  border: 1px solid rgba(228, 197, 106, 0.3);
  color: #f0e2b2;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
}
.dossier[hidden] { display: none !important; }
.dossier-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid rgba(228, 197, 106, 0.22);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.dossier-bar .kicker { margin: 0; }
.dossier-body { padding: 0.95rem 1.1rem 1.15rem; }
.dossier-body h3 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 1.25rem;
}
.dossier-close {
  position: static;
  background: none;
  border: 0;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.25rem;
}
.win-bar { cursor: grab; user-select: none; touch-action: none; }
.win.is-dragging { user-select: none; }
.win.is-dragging .win-bar { cursor: grabbing; }
.console.is-floated {
  width: min(640px, calc(100vw - 1.5rem));
  max-width: 640px;
}

/* Files */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.file-card {
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem 1.3rem;
  background: #eef3f1;
  color: var(--fg);
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.file-card h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.2;
  margin: 0.3rem 0 0.7rem;
  color: inherit;
}
.file-code, .file-src, .file-lock {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.file-excerpt {
  flex: 1;
  font-size: 0.88rem;
  color: color-mix(in srgb, var(--fg) 78%, var(--muted));
}
.file-card-full { display: none; }
.file-link {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.file-card.is-sealed .file-excerpt {
  filter: blur(2.5px);
  user-select: none;
  opacity: 0.55;
}
.file-card.is-unsealed .file-excerpt { filter: none; opacity: 1; }
.file-card.is-unsealed .file-lock { display: none; }
.file-card.is-unsealed .file-link { display: inline; }
.file-card.is-pending { opacity: 0.72; }

body.is-dark .file-card {
  background: #121410;
  border-color: rgba(228, 197, 106, 0.32);
  color: #e8d9a8;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}
body.is-dark .file-card h3 {
  color: #f4f1ea;
  -webkit-text-fill-color: #f4f1ea;
  text-shadow: none;
}
body.is-dark .file-code,
body.is-dark .file-src,
body.is-dark .file-lock {
  color: #c8b889;
  -webkit-text-fill-color: #c8b889;
  text-shadow: none;
}
body.is-dark .file-excerpt {
  color: rgba(232, 217, 168, 0.78);
  -webkit-text-fill-color: rgba(232, 217, 168, 0.78);
  text-shadow: none;
}
body.is-dark .file-link {
  color: #e4c56a;
  -webkit-text-fill-color: #e4c56a;
  text-shadow: none;
}
body.is-dark .file-card.is-sealed .file-excerpt {
  color: rgba(232, 217, 168, 0.4);
  -webkit-text-fill-color: rgba(232, 217, 168, 0.4);
}
.archive-all { margin-top: 1.5rem; }

/* Transmission */
.tx-form {
  display: grid;
  gap: 0.7rem;
  max-width: 420px;
  margin-top: 1rem;
}
.tx-form input,
.tx-form button {
  font: inherit;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--fg);
}
.tx-form button {
  background: var(--accent);
  color: #08110e;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  font-size: 0.78rem;
}
.tx-status { min-height: 1.4em; font-size: 0.8rem; }
.tx-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.tx-form { position: relative; }
.tx-ok[hidden] { display: none !important; }
.tx-ok {
  display: block;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, #050806 84%);
  padding: 1.15rem 1.2rem 1.25rem;
  color: var(--fg);
}
.tx-ok-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.tx-ok-title {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.tx-ok-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.92;
}
.tx-form.is-sent input,
.tx-form.is-sent button[type="submit"],
.tx-form.is-sent .tx-status {
  display: none;
}
.tx-form.is-fail .tx-status {
  color: #ffb4b4;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
body.is-dark .tx-ok {
  background: rgba(228, 197, 106, 0.12);
  border-color: #e4c56a;
  color: #f4f1ea;
  box-shadow: 0 0 0 1px rgba(228, 197, 106, 0.2), 0 12px 40px rgba(0, 0, 0, 0.35);
}
body.is-dark .tx-ok-kicker,
body.is-dark .tx-ok-title {
  color: #e4c56a;
  -webkit-text-fill-color: #e4c56a;
  text-shadow: none;
}
.tx-footnote { margin-top: 3rem; opacity: 0.55; max-width: 36rem; font-size: 0.78rem; }
.tx-social { display: flex; gap: 1rem; }

/* Explorer */
.console {
  position: fixed;
  z-index: 70;
  left: 1rem;
  bottom: 1rem;
  width: min(520px, calc(100vw - 2rem));
  height: min(62vh, 520px);
  max-width: 640px;
  background: rgba(4, 8, 6, 0.96);
  border: 1px solid rgba(125, 255, 195, 0.28);
  color: #9fffd8;
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  box-shadow: 0 20px 80px rgba(0,0,0,0.45);
}
.console[hidden] { display: none; }
.console-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid rgba(125, 255, 195, 0.18);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
  opacity: 0.7;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.console-min {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
}
.explorer-path {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid rgba(125, 255, 195, 0.12);
  min-height: 2.1rem;
}
.explorer-back {
  background: none;
  border: 1px solid rgba(125, 255, 195, 0.25);
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0.1rem 0.4rem;
}
.explorer-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  opacity: 0.85;
}
.explorer-crumbs button {
  background: none;
  border: 0;
  color: #e4c56a;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.explorer-crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  opacity: 0.45;
  color: inherit;
}
.explorer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.explorer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}
.explorer-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(125, 255, 195, 0.08);
  color: inherit;
  font: inherit;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}
.explorer-row:hover,
.explorer-row:focus {
  background: rgba(125, 255, 195, 0.08);
  outline: none;
}
.explorer-ico { opacity: 0.7; }
.explorer-name { letter-spacing: 0.02em; }
.explorer-meta {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
}
.explorer-row.is-bad { color: #e4c56a; }
.explorer-row.is-deny { color: #d61f1f; opacity: 0.85; }
.explorer-row.is-open { background: rgba(228, 197, 106, 0.1); }
.file-win {
  position: fixed;
  z-index: 76;
  top: 12vh;
  left: 28vw;
  width: min(440px, calc(100vw - 1.5rem));
  height: min(48vh, 420px);
  display: flex;
  flex-direction: column;
  background: rgba(8, 10, 8, 0.96);
  border: 1px solid rgba(228, 197, 106, 0.38);
  color: #e8d9a8;
  font-family: var(--mono);
  font-size: 0.8rem;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
}
.file-win.is-bad { border-color: rgba(228, 197, 106, 0.55); }
.file-win.is-deny { border-color: rgba(214, 31, 31, 0.55); color: #f0c2c2; }
.file-win-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid rgba(228, 197, 106, 0.22);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #e4c56a;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.file-win-body {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 0.85rem 0.9rem 1.1rem;
  white-space: pre-wrap;
  font: inherit;
  color: inherit;
}
.file-win.is-exp {
  width: min(540px, calc(100vw - 1.5rem));
  height: min(64vh, 580px);
}
.file-win-body.is-html {
  white-space: normal;
  font-family: var(--display);
  font-size: 0.95rem;
  line-height: 1.45;
}
.file-win-body.is-html p,
.file-win-body.is-html ul {
  margin: 0 0 0.85em;
}
.file-win-body.is-html ul {
  padding-left: 1.15em;
}
.file-win-body.is-html .doc-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
  margin-bottom: 1rem;
}
.console-fab {
  position: fixed;
  z-index: 60;
  right: 1rem;
  bottom: 1rem;
  width: 48px;
  height: 48px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, #000);
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}
body.is-live .console-fab { opacity: 1; pointer-events: auto; }
body.console-open .console-fab { display: none; }

/* Documents */
.doc-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  padding: calc(var(--hud-h) + 3rem) 6vw 20vh;
}
.doc-paper {
  max-width: 42rem;
  background: color-mix(in srgb, var(--bg) 80%, #000 20%);
  border: 1px solid var(--line);
  padding: 2rem 1.5rem 2.5rem;
}
body:not(.is-experience) {
  --bg: #0b100e;
  --fg: #d7ece4;
  --accent: #7dffc3;
  --void-a: 0.55;
  cursor: auto;
}
.doc-body { font-family: var(--serif); font-size: 1.2rem; }
.doc-body .redacted { font-family: var(--mono); font-size: 0.92rem; }
.doc-body .bar,
.bar {
  background: #111;
  color: #111;
  padding: 0 0.2em;
  user-select: none;
}
.doc-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.doc-index-head { max-width: 42rem; margin-bottom: 2rem; }
.file-grid.is-page { position: relative; z-index: 2; }

.btn-ghost {
  display: inline-block;
  margin-top: 1rem;
  border: 1px solid var(--line);
  padding: 0.6rem 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

@media (max-width: 800px) {
  body { cursor: auto; font-size: 14px; }
  .hud-nav { display: none; }
  .synopsis blockquote { max-width: none; }
  .map-svg { height: 78vh; }
  .map-wrap { min-height: 78vh; }
  .console { left: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: min(70vh, 520px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
  .cine-kicker,
  .cine-title,
  .cine-body,
  .cine-note,
  .cine-layer {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
