@font-face {
  font-family: "Pain Display";
  src: local("Arial Narrow"), local("Helvetica Neue Condensed");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #050507;
  --ink-soft: #0b0b0f;
  --paper: #ece9e5;
  --muted: #99969f;
  --quiet: #625f68;
  --red: #a5102d;
  --red-bright: #d22845;
  --violet: #aa9bc5;
  --line: rgba(236, 233, 229, 0.18);
  --line-strong: rgba(236, 233, 229, 0.44);
  --ease: cubic-bezier(0.2, 0.76, 0.24, 1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  background: var(--ink);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--ink);
}

body {
  min-height: 100svh;
  overflow: hidden;
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 1rem;
  left: 1rem;
  transform: translateY(-180%);
  padding: 0.7rem 1rem;
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 35%, rgba(101, 88, 130, 0.11), transparent 28%),
    linear-gradient(110deg, #050507 0 38%, #09090d 68%, #030305 100%);
}

.site-shell::before {
  content: "";
  position: absolute;
  z-index: -3;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 7, 0.98) 0%, rgba(5, 5, 7, 0.84) 46%, rgba(5, 5, 7, 0.16) 100%),
    url("assets/pain-visual.jpg") center 22% / cover no-repeat;
  filter: grayscale(0.5) contrast(1.15) brightness(0.48);
  transform: scale(1.025);
  transition: opacity 1.2s var(--ease), filter 1.2s var(--ease), transform 8s var(--ease);
}

.is-entered .site-shell::before {
  opacity: 0;
  transform: scale(1.08);
}

.site-shell::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 25;
  inset: 0;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.rain {
  pointer-events: none;
  position: absolute;
  z-index: 18;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  mix-blend-mode: screen;
  transition: opacity 500ms ease;
}

.masthead {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  padding: 0 3.5vw;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--paper);
  text-decoration: none;
  min-height: 44px;
}

.wordmark__glyph {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(170, 155, 197, 0.85);
  border-radius: 50%;
}

.wordmark__glyph::before,
.wordmark__glyph::after,
.wordmark__glyph i {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(170, 155, 197, 0.72);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.wordmark__glyph::before {
  width: 18px;
  height: 18px;
}

.wordmark__glyph::after {
  width: 8px;
  height: 8px;
  background: rgba(165, 16, 45, 0.72);
}

.wordmark__glyph i {
  width: 2px;
  height: 2px;
  background: var(--paper);
}

.wordmark__text {
  font-family: "Pain Display", "Arial Narrow", sans-serif;
  font-stretch: condensed;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.34em;
}

.masthead__meta {
  display: flex;
  gap: 2.4rem;
  color: rgba(236, 233, 229, 0.65);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.system-state {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
}

.system-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}

.system-state b {
  font-weight: 600;
}

.gate {
  position: absolute;
  z-index: 10;
  inset: 88px 0 46px;
  display: grid;
  grid-template-columns: minmax(20px, 0.7fr) minmax(440px, 1fr) minmax(420px, 1.05fr);
  align-items: center;
  padding: 4vh 6vw 3vh;
  transition: opacity 680ms var(--ease), transform 900ms var(--ease), visibility 900ms;
}

.is-entered .gate {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-2.5vh) scale(1.015);
  pointer-events: none;
}

.gate__content {
  grid-column: 2;
  width: min(100%, 710px);
}

.kicker,
.gate__index {
  margin: 0;
  color: rgba(236, 233, 229, 0.48);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.kicker::before {
  content: "";
  display: inline-block;
  width: 34px;
  height: 1px;
  margin: 0 12px 3px 0;
  background: var(--red-bright);
}

.gate h1 {
  margin: 1.6rem 0 1rem;
  max-width: 8ch;
  font-family: "Pain Display", "Arial Narrow", sans-serif;
  font-size: clamp(4.1rem, 7.1vw, 9rem);
  font-weight: 800;
  font-stretch: condensed;
  line-height: 0.83;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  text-wrap: balance;
}

.gate__instruction {
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.25vw, 1.28rem);
  font-style: italic;
}

.gate-form {
  width: min(100%, 480px);
  margin-top: clamp(2.2rem, 6vh, 4.8rem);
}

.gate-form > label {
  display: block;
  margin-bottom: 0.75rem;
  color: rgba(236, 233, 229, 0.54);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.gate-form__line {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 240ms ease;
}

.gate-form__line:focus-within {
  border-color: var(--paper);
}

.gate-form input {
  min-width: 0;
  flex: 1;
  height: 56px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font-family: "Pain Display", "Arial Narrow", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.gate-form button {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.gate-form button svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  transition: transform 220ms ease;
}

.gate-form button:hover svg {
  transform: translateX(5px);
}

.gate-form__error {
  min-height: 1.4em;
  margin: 0.8rem 0 0;
  color: #e65066;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.gate__sigil {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 11vw;
  width: min(29vw, 470px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  opacity: 0.28;
  background: radial-gradient(circle, #08070d 0 7%, #8e80ad 8%, #615579 62%, #201b30 72%);
  box-shadow: 0 0 65px rgba(151, 127, 197, 0.14), inset 0 0 35px rgba(0, 0, 0, 0.75);
  animation: sigilBreath 8s ease-in-out infinite;
}

.gate__sigil,
.gate__sigil span {
  border: 1px solid rgba(20, 15, 31, 0.88);
  border-radius: 50%;
}

.gate__sigil::before,
.gate__sigil::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(20, 15, 31, 0.88);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.gate__sigil::before {
  width: 87%;
  height: 87%;
}

.gate__sigil::after {
  width: 61%;
  height: 61%;
}

.gate__sigil span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.gate__sigil span:nth-child(1) {
  width: 74%;
  height: 74%;
}

.gate__sigil span:nth-child(2) {
  width: 47%;
  height: 47%;
}

.gate__sigil span:nth-child(3) {
  width: 14%;
  height: 14%;
  background: #050409;
  box-shadow: 0 0 12px rgba(8, 5, 14, 0.7);
}

.gate__index {
  position: absolute;
  right: 3.5vw;
  bottom: 2vh;
  writing-mode: vertical-rl;
}

.experience {
  position: absolute;
  z-index: 9;
  inset: 88px 0 46px;
  visibility: hidden;
  opacity: 0;
  transform: scale(1.035);
  pointer-events: none;
  transition: opacity 1.05s 420ms var(--ease), transform 1.6s 260ms var(--ease), visibility 0s 420ms;
}

.is-entered .experience {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #06070a;
}

.portrait-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #090b10;
  perspective: 1200px;
}

.pain-canvas,
.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pain-canvas {
  z-index: 0;
  display: block;
  opacity: 0;
  background: #07090d;
  transform: scale(1.015);
  transition: opacity 900ms var(--ease);
}

.portrait-wrap.webgl-ready .pain-canvas {
  opacity: 1;
}

.portrait-wrap.webgl-ready .portrait {
  opacity: 0;
  animation: none;
}

.portrait-wrap.webgl-ready .portrait__pulse {
  opacity: 0;
  animation: none;
}

.portrait {
  z-index: 0;
  object-fit: cover;
  object-position: 62% 12%;
  opacity: 1;
  filter: saturate(0.76) contrast(1.12) brightness(0.82);
  transform: scale(1.015);
  animation: breathe 12s var(--ease) infinite alternate;
  transition: opacity 600ms ease, filter 700ms ease, transform 1.2s var(--ease);
}

.portrait__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 4, 7, 0.96) 0%, rgba(3, 4, 7, 0.84) 25%, rgba(3, 4, 7, 0.17) 60%, rgba(3, 4, 7, 0.3) 100%),
    linear-gradient(0deg, rgba(3, 4, 7, 0.97) 0%, rgba(3, 4, 7, 0.46) 29%, transparent 57%);
}

.portrait__pulse {
  position: absolute;
  top: 22%;
  left: 50.5%;
  width: 17vw;
  height: 17vw;
  min-width: 170px;
  min-height: 170px;
  border: 1px solid rgba(170, 155, 197, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 3vw rgba(170, 155, 197, 0.02),
    0 0 0 7vw rgba(170, 155, 197, 0.015);
  animation: eyePulse 5.5s ease-in-out infinite;
}

.scene-marker {
  position: absolute;
  z-index: 3;
  top: 6vh;
  left: 3.5vw;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(236, 233, 229, 0.44);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.scene-marker i {
  width: 42px;
  height: 1px;
  background: rgba(236, 233, 229, 0.25);
}

.standing {
  position: absolute;
  z-index: 3;
  top: 6vh;
  right: 3.5vw;
  width: min(22vw, 290px);
  text-align: right;
}

.standing__label {
  margin: 0 0 0.45rem;
  color: rgba(236, 233, 229, 0.4);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.standing__rank {
  margin: 0;
  font-family: "Pain Display", "Arial Narrow", sans-serif;
  font-size: clamp(1.55rem, 2.6vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.standing__trace {
  height: 1px;
  margin: 0.8rem 0 0.7rem;
  overflow: hidden;
  background: rgba(236, 233, 229, 0.18);
}

.standing__trace i {
  display: block;
  width: 6%;
  height: 100%;
  background: var(--red-bright);
  box-shadow: 0 0 12px var(--red);
  transition: width 900ms var(--ease);
}

.standing__note {
  margin: 0;
  color: rgba(236, 233, 229, 0.48);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.45;
}

.authority-nav {
  position: absolute;
  z-index: 8;
  top: 25%;
  left: 3.5vw;
  display: grid;
  width: min(17vw, 225px);
  border-top: 1px solid rgba(236, 233, 229, 0.18);
  transition: opacity 500ms ease, transform 700ms var(--ease), filter 450ms ease;
}

.authority-nav button {
  position: relative;
  display: grid;
  grid-template-columns: 2.1rem 1fr auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(236, 233, 229, 0.13);
  color: rgba(236, 233, 229, 0.55);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color 200ms ease, transform 260ms var(--ease), opacity 260ms ease;
}

.authority-nav button[hidden] {
  display: none;
}

.authority-nav button:hover {
  color: var(--paper);
}

.authority-nav button[aria-disabled="true"] {
  color: rgba(236, 233, 229, 0.28);
}

.authority-nav button.is-evading {
  transform: translate(var(--evade-x, 28px), var(--evade-y, 0));
}

.authority-nav span {
  color: var(--red-bright);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.authority-nav b {
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.authority-nav i {
  color: rgba(236, 233, 229, 0.3);
  font-size: 0.52rem;
  font-style: normal;
  letter-spacing: 0.12em;
}

.authority-nav.is-confiscated,
.authority-rewrite .authority-nav {
  opacity: 0;
  filter: blur(7px);
  transform: translateX(-44px);
  pointer-events: none;
}

.domain-panel {
  position: absolute;
  z-index: 14;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(48vw, 720px);
  padding: clamp(1.5rem, 4vw, 4rem);
  overflow: auto;
  border-left: 1px solid rgba(236, 233, 229, 0.19);
  color: var(--paper);
  background:
    linear-gradient(155deg, rgba(17, 18, 25, 0.985), rgba(4, 5, 8, 0.985)),
    var(--ink);
  box-shadow: -30px 0 100px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(22px);
  opacity: 0;
  transform: translateX(102%);
  pointer-events: none;
  transition: opacity 420ms ease, transform 700ms var(--ease);
}

.domain-panel.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.domain-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}

.domain-panel header p {
  margin: 0 0 0.6rem;
  color: var(--red-bright);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.domain-panel h2 {
  margin: 0;
  font-family: "Pain Display", "Arial Narrow", sans-serif;
  font-size: clamp(2.3rem, 5vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.domain-panel header button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(236, 233, 229, 0.22);
  border-radius: 50%;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

.domain-panel__content {
  display: grid;
  gap: 1rem;
  padding-top: 1.6rem;
}

.archive-entry,
.judgement-entry,
.secret-entry {
  padding: 1.15rem 0 1.25rem;
  border-bottom: 1px solid rgba(236, 233, 229, 0.12);
}

.archive-entry span,
.judgement-entry span,
.secret-entry span {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--violet);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.archive-entry p,
.judgement-entry p,
.secret-entry p {
  margin: 0;
  color: rgba(236, 233, 229, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.58;
  white-space: pre-line;
}

.judgement-entry strong {
  display: block;
  margin-bottom: 0.75rem;
  font-family: "Pain Display", "Arial Narrow", sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.domain-empty {
  margin: 3rem 0 0;
  color: rgba(236, 233, 229, 0.46);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  line-height: 1.6;
}

.path-presence {
  position: absolute;
  z-index: 12;
  top: 44%;
  right: 3.5vw;
  display: grid;
  justify-items: end;
  padding: 1rem 0 1rem 1.4rem;
  border-right: 2px solid var(--red);
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
  transition: opacity 450ms ease, transform 650ms var(--ease);
}

.path-presence.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.path-presence span,
.path-presence p {
  margin: 0;
  color: rgba(236, 233, 229, 0.42);
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.path-presence strong {
  margin: 0.45rem 0;
  font-family: "Pain Display", "Arial Narrow", sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.authority-curtain {
  position: absolute;
  z-index: 19;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.8rem;
  padding: 2rem;
  opacity: 0;
  background: rgba(2, 2, 4, 0.96);
  pointer-events: none;
  transition: opacity 480ms ease;
}

.authority-curtain.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.authority-curtain__eye {
  position: relative;
  width: min(36vw, 270px);
  aspect-ratio: 1;
  border: 2px solid #252032;
  border-radius: 50%;
  background: radial-gradient(circle, #b3a3d0 7%, #9584b7 40%, #5a4a78 75%, #241c34);
  box-shadow: 0 0 70px rgba(132, 102, 183, 0.18), inset 0 0 30px rgba(15, 8, 26, 0.45);
}

.authority-curtain.is-visible .authority-curtain__eye {
  animation: rinneganBreath 4.8s ease-in-out infinite;
}

.authority-curtain__eye::after,
.authority-curtain__eye i {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(25, 19, 37, 0.88);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.authority-curtain__eye::after {
  width: 7%;
  height: 7%;
  background: #08060e;
  box-shadow: 0 0 12px rgba(15, 8, 26, 0.7);
}

.authority-curtain__eye i:nth-child(1) { width: 74%; height: 74%; }
.authority-curtain__eye i:nth-child(2) { width: 48%; height: 48%; }
.authority-curtain__eye i:nth-child(3) { width: 24%; height: 24%; }

.authority-curtain p {
  max-width: 28ch;
  margin: 0;
  text-align: center;
  text-wrap: balance;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 2.7rem);
  line-height: 1.25;
}

.authority-glitch .stage {
  animation: authorityGlitch 720ms steps(2, end) both;
}

.authority-glitch .stage::after {
  content: "";
  position: absolute;
  z-index: 18;
  inset: 0;
  background:
    linear-gradient(transparent 0 46%, rgba(165, 16, 45, 0.22) 47% 48%, transparent 49%),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(170, 155, 197, 0.035) 9px 10px);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: glitchScan 720ms steps(4, end) both;
}

.environment-void .portrait__veil {
  background:
    radial-gradient(circle at 62% 26%, rgba(120, 88, 164, 0.03), rgba(1, 1, 3, 0.97) 54%),
    linear-gradient(0deg, rgba(1, 1, 3, 0.98), rgba(1, 1, 3, 0.28));
}

.feature-confiscated {
  opacity: 0 !important;
  transform: translateY(15px) !important;
  pointer-events: none !important;
}

.memory-fragment {
  position: absolute;
  z-index: 10;
  top: 33%;
  right: 4vw;
  width: min(280px, 24vw);
  padding: 1.1rem 1.15rem 1.15rem;
  border-left: 2px solid var(--violet);
  opacity: 0;
  background: rgba(6, 7, 10, 0.76);
  backdrop-filter: blur(15px);
  transform: translateX(18px);
  pointer-events: none;
  transition: opacity 450ms ease, transform 600ms var(--ease);
}

.memory-fragment.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.memory-fragment span {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--violet);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.memory-fragment p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.93rem;
  line-height: 1.5;
}

.dialogue {
  position: absolute;
  z-index: 5;
  left: 7vw;
  bottom: 17vh;
  width: min(48vw, 760px);
  min-height: 190px;
}

.dialogue__speaker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dialogue__speaker span {
  color: var(--red-bright);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.3em;
}

.dialogue__speaker i {
  padding-left: 1rem;
  border-left: 1px solid rgba(236, 233, 229, 0.25);
  color: rgba(236, 233, 229, 0.42);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0.18em;
}

.dialogue__body {
  display: flex;
  min-height: 3.2em;
  align-items: flex-start;
}

.dialogue__line {
  max-width: 27ch;
  margin: 0;
  text-wrap: balance;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.65vw, 3.2rem);
  line-height: 1.13;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.95);
}

.dialogue__line.is-changing {
  animation: lineIn 650ms var(--ease) both;
}

.dialogue__aside {
  margin: 0.9rem 0 0;
  color: rgba(236, 233, 229, 0.45);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.thinking {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 3rem;
}

.thinking[hidden] {
  display: none;
}

.thinking span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet);
  animation: thinking 1.25s ease-in-out infinite;
}

.thinking span:nth-child(2) {
  animation-delay: 150ms;
}

.thinking span:nth-child(3) {
  animation-delay: 300ms;
}

.composer {
  position: absolute;
  z-index: 7;
  left: 7vw;
  right: 7vw;
  bottom: 5.1vh;
  display: grid;
  grid-template-columns: auto minmax(0, 680px) auto 1fr;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 500ms ease, transform 650ms var(--ease);
}

.composer.is-ready {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.composer__mic,
.composer__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.composer__mic {
  gap: 0.7rem;
  height: 50px;
  padding: 0 0.4rem 0 0;
  color: rgba(236, 233, 229, 0.7);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.composer__mic svg,
.composer__send svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.composer__mic.is-listening {
  color: var(--red-bright);
}

.composer__mic.is-listening svg {
  filter: drop-shadow(0 0 8px rgba(210, 40, 69, 0.8));
  animation: micPulse 1.1s ease-in-out infinite;
}

.composer__field {
  position: relative;
  border-bottom: 1px solid rgba(236, 233, 229, 0.32);
}

.composer__field input {
  width: 100%;
  height: 52px;
  padding: 0 0.4rem;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font-size: 1rem;
}

.composer__field input::placeholder {
  color: rgba(236, 233, 229, 0.34);
}

.composer__sweep {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1px;
  background: var(--violet);
  transition: width 380ms var(--ease);
}

.composer__field:focus-within .composer__sweep {
  width: 100%;
}

.composer__send {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(236, 233, 229, 0.28);
  border-radius: 50%;
  transition: border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.composer__send:hover {
  border-color: rgba(236, 233, 229, 0.8);
  background: rgba(236, 233, 229, 0.08);
  transform: translateX(3px);
}

.composer.is-sealed {
  opacity: 0.34;
  pointer-events: none;
}

.controls {
  position: absolute;
  z-index: 12;
  right: 3.5vw;
  bottom: 4.4vh;
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.controls button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: rgba(236, 233, 229, 0.44);
  background: transparent;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  transition: color 180ms ease;
}

.controls button:hover {
  color: rgba(236, 233, 229, 0.9);
}

.pain-avatar-canvas { position:absolute; inset:0; width:100%; height:100%; opacity:0; pointer-events:none; z-index:2; }
.portrait-wrap.avatar-ready .pain-avatar-canvas { opacity:1; }
.portrait-wrap.avatar-ready .pain-canvas { visibility:hidden; }
.portrait-wrap.avatar-ready .portrait { opacity:.42; filter:blur(5px) saturate(.6); transform:scale(2.7); transform-origin:100% 0; object-position:100% 0; }
.portrait-wrap.avatar-ready::after { content:""; position:absolute; inset:0; background:radial-gradient(ellipse at 55% 30%,transparent,#09091255 65%); pointer-events:none; z-index:3; }
.dialogue__line { max-height:min(32vh,290px); overflow-y:auto; scrollbar-width:thin; scrollbar-color:#706079 transparent; }
.dialogue--long .dialogue__line { max-width:46ch; font-size:clamp(1.2rem,1.8vw,1.9rem); text-wrap:pretty; }
.settings-dialog { width:min(680px,calc(100vw - 28px)); max-height:86dvh; overflow:auto; }
.settings-dialog h2 { font-size:clamp(2rem,7vw,3rem); }
.settings-dialog .nature-dialog__close { position:sticky; top:0; right:auto; float:right; z-index:5; width:44px; height:44px; margin:-10px -5px 0 12px; background:#111016; }
.settings-section { padding:22px 0; border-bottom:1px solid #ffffff1a; }
.settings-section h3 { margin:0 0 12px; color:#d6cadf; font-size:1rem; letter-spacing:.02em; }
.settings-section p { margin:10px 0; font-size:.82rem; line-height:1.65; }
.settings-consent { display:flex; align-items:flex-start; gap:12px; font-size:.8rem; line-height:1.6; }
.settings-consent input { flex:0 0 auto; width:20px; height:20px; margin:3px 0; accent-color:#9e83b5; }
.settings-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.settings-actions button,.settings-import,.settings-dialog select { min-height:44px; padding:11px 14px; color:#ede8f0; background:#19171f; border:1px solid #ffffff30; border-radius:4px; font:inherit; font-size:.7rem; letter-spacing:.06em; cursor:pointer; }
.settings-actions button:hover,.settings-import:hover { border-color:#b4a0c4; }
.settings-actions button:disabled { opacity:.5; cursor:wait; }
.settings-dialog select { display:block; width:100%; margin-top:10px; font-size:.82rem; }
.settings-import { position:relative; display:inline-flex; align-items:center; overflow:hidden; }
.settings-import input { position:absolute; inset:0; width:100%; opacity:0; cursor:pointer; }
.settings-note { color:#b6aebf!important; font-size:.76rem!important; }
.settings-records { max-height:280px; overflow:auto; margin-top:16px; }
.settings-records article { padding:12px; margin-bottom:8px; background:#ffffff06; border-left:2px solid #8d759f; }
.settings-records small { color:#a594b0; }
.settings-records p { white-space:pre-wrap; overflow-wrap:anywhere; }
.conversation-status { position:absolute; z-index:35; bottom:125px; right:3.5vw; display:flex; gap:12px; align-items:center; max-width:min(500px,90vw); padding:10px 12px; border:1px solid #9e86af66; border-radius:5px; background:#100c18ee; color:#d8cee3; font-size:.72rem; }
.conversation-status[hidden] { display:none; }
.conversation-status span { flex:1; }
.conversation-status button { flex:0 0 auto; border:1px solid #c5aed966; min-height:44px; padding:8px; color:#e2d8ea; background:#292132; font-size:.62rem; cursor:pointer; }
.conversation-active .composer__mic { color:#bda1d4; }
@media(max-width:560px) {
  .settings-dialog { padding:25px 20px; }
  .settings-actions button,.settings-import { flex:1 1 auto; text-align:center; justify-content:center; }
  .disclaimer { gap:12px; }
  .conversation-status { left:1rem; right:1rem; bottom:118px; max-width:none; padding:6px 8px; font-size:.65rem; }
  .conversation-active .dialogue { bottom:max(25vh,190px); }
  .dialogue__line { max-height:28vh; }
  .dialogue--long .dialogue__line { font-size:clamp(1.15rem,5vw,1.7rem); }
}

.controls svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.controls button[aria-pressed="false"] .icon-sound path:last-child {
  opacity: 0;
}

.session-mark {
  position: absolute;
  z-index: 3;
  right: -0.2rem;
  top: 46%;
  margin: 0;
  color: rgba(236, 233, 229, 0.22);
  font-family: "Pain Display", "Arial Narrow", sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  writing-mode: vertical-rl;
}

.disclaimer {
  position: absolute;
  z-index: 30;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 1.3rem;
  height: 46px;
  padding: 0 3.5vw;
  border-top: 1px solid var(--line);
  color: rgba(236, 233, 229, 0.35);
  background: rgba(5, 5, 7, 0.72);
  backdrop-filter: blur(12px);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.disclaimer > * + *::before {
  content: "•";
  margin-right: 1.3rem;
  color: var(--red);
}

.disclaimer__button {
  padding: 0;
  border: 0;
  color: rgba(236, 233, 229, 0.5);
  background: transparent;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color 180ms ease;
}

.disclaimer__button:hover {
  color: var(--paper);
}

.nature-dialog {
  width: min(92vw, 680px);
  max-height: min(82svh, 760px);
  padding: clamp(1.7rem, 4vw, 3.2rem);
  overflow: auto;
  border: 1px solid rgba(236, 233, 229, 0.22);
  color: var(--paper);
  background:
    linear-gradient(145deg, rgba(18, 18, 24, 0.98), rgba(6, 6, 9, 0.98)),
    var(--ink);
  box-shadow: 0 24px 120px rgba(0, 0, 0, 0.75);
}

.nature-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(10px);
}

.nature-dialog__close {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(236, 233, 229, 0.2);
  border-radius: 50%;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 1.5rem;
  line-height: 1;
}

.nature-dialog h2 {
  margin: 1rem 0 1.4rem;
  font-family: "Pain Display", "Arial Narrow", sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.nature-dialog > p:not(.kicker) {
  color: rgba(236, 233, 229, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.62;
}

.nature-dialog__facts {
  margin: 1.6rem 0;
  border-top: 1px solid var(--line);
}

.nature-dialog__facts p {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) 2fr;
  gap: 1rem;
  margin: 0;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.5;
}

.nature-dialog__facts b {
  color: var(--violet);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nature-dialog__facts span {
  color: rgba(236, 233, 229, 0.63);
}

.nature-dialog__legal {
  margin-bottom: 0 !important;
  color: rgba(236, 233, 229, 0.42) !important;
  font-family: inherit !important;
  font-size: 0.74rem !important;
  letter-spacing: 0.04em;
}

.system-toast {
  position: absolute;
  z-index: 40;
  top: 104px;
  left: 50%;
  max-width: min(90vw, 460px);
  padding: 0.75rem 1rem;
  opacity: 0;
  color: rgba(236, 233, 229, 0.82);
  background: rgba(9, 9, 13, 0.82);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -8px);
  pointer-events: none;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  transition: opacity 280ms ease, transform 360ms var(--ease);
}

.system-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.impact-wave,
.lightning {
  position: absolute;
  z-index: 20;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.impact-wave {
  top: 50%;
  left: 62%;
  right: auto;
  bottom: auto;
  width: 160vmax;
  height: 160vmax;
  border: 1px solid rgba(236, 233, 229, 0.65);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.025);
}

.event-impact .impact-wave {
  animation: impactWave 1.25s var(--ease) both;
}

.event-impact .portrait {
  animation: imageImpact 700ms var(--ease) both;
}

.event-impact .pain-canvas {
  animation: canvasImpact 700ms var(--ease) both;
}

.lightning {
  background: rgba(183, 194, 224, 0.26);
}

.event-storm .lightning {
  animation: lightning 1.1s linear both;
}

.mood-hostile .portrait {
  filter: saturate(0.72) contrast(1.25) brightness(0.68) hue-rotate(-8deg);
}

.mood-hostile .pain-canvas {
  filter: none;
}

.mood-hostile .portrait__pulse {
  border-color: rgba(210, 40, 69, 0.52);
  box-shadow: 0 0 80px rgba(165, 16, 45, 0.28);
}

.mood-contemplative .portrait {
  filter: saturate(0.48) contrast(1.02) brightness(0.76) hue-rotate(12deg);
}

.mood-contemplative .pain-canvas {
  filter: none;
}

.mood-interested .portrait {
  filter: saturate(0.94) contrast(1.1) brightness(0.9);
}

.mood-interested .pain-canvas {
  filter: none;
}

.noscript {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  color: var(--paper);
  background: var(--ink);
  text-align: center;
}

@keyframes breathe {
  from { transform: scale(1.015); }
  to { transform: scale(1.045) translateY(-0.5%); }
}

@keyframes eyePulse {
  0%, 100% { opacity: 0.38; transform: translate(-50%, -50%) scale(0.96); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.03); }
}

@keyframes sigilBreath {
  0%, 100% { opacity: 0.23; }
  50% { opacity: 0.37; }
}

@keyframes rinneganBreath {
  0%, 100% { transform: scale(0.985); opacity: 0.86; }
  50% { transform: scale(1.015); opacity: 1; }
}

@keyframes lineIn {
  from { opacity: 0; transform: translateY(12px); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes thinking {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-5px); }
}

@keyframes micPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes impactWave {
  0% { opacity: 0.85; transform: translate(-50%, -50%) scale(0.025); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

@keyframes imageImpact {
  0% { transform: scale(1.03); }
  36% { transform: scale(1.085); filter: saturate(0.4) contrast(1.5) brightness(1.1); }
  100% { transform: scale(1.025); }
}

@keyframes canvasImpact {
  0% { transform: scale(1.015); }
  36% { transform: scale(1.045); }
  100% { transform: scale(1.015); }
}

@keyframes lightning {
  0%, 12%, 30%, 100% { opacity: 0; }
  5% { opacity: 1; }
  20% { opacity: 0.55; }
}

@keyframes authorityGlitch {
  0% { transform: translate(0); filter: none; }
  18% { transform: translate(-5px, 1px); filter: hue-rotate(8deg) contrast(1.25); }
  37% { transform: translate(6px, -1px); clip-path: inset(7% 0 35%); }
  55% { transform: translate(-2px, 0); clip-path: inset(44% 0 12%); }
  76% { transform: translate(3px, 1px); filter: hue-rotate(-12deg) contrast(1.16); }
  100% { transform: translate(0); filter: none; clip-path: inset(0); }
}

@keyframes glitchScan {
  0% { opacity: 0; transform: translateY(-2%); }
  20% { opacity: 0.8; transform: translateY(3%); }
  55% { opacity: 0.42; transform: translateY(-1%); }
  100% { opacity: 0; transform: translateY(0); }
}

@media (min-width: 961px) {
  .composer {
    bottom: calc(2.5vh + 60px);
  }

  .dialogue {
    bottom: calc(22vh + 10px);
  }

  .controls {
    bottom: 2.5vh;
  }
}

@media (max-width: 960px) {
  .masthead {
    height: 74px;
    padding: 0 1.25rem;
  }

  .masthead__meta > span:first-child {
    display: none;
  }

  .gate {
    inset: 74px 0 42px;
    grid-template-columns: 1fr;
    align-items: end;
    padding: 8vh 1.35rem 10vh;
  }

  .gate__content {
    grid-column: 1;
  }

  .gate h1 {
    font-size: clamp(2.7rem, 13.5vw, 6.6rem);
  }

  .gate__sigil {
    top: 26%;
    right: -15vw;
    width: 72vw;
  }

  .gate__index {
    display: none;
  }

  .experience {
    inset: 74px 0 42px;
  }

  .portrait {
    object-position: 58% 12%;
  }

  .portrait__pulse {
    top: 15%;
  }

  .portrait__veil {
    background:
      linear-gradient(90deg, rgba(3, 4, 7, 0.45), rgba(3, 4, 7, 0.08) 76%, rgba(3, 4, 7, 0.3)),
      linear-gradient(0deg, rgba(3, 4, 7, 0.98) 0%, rgba(3, 4, 7, 0.78) 42%, rgba(3, 4, 7, 0.08) 78%);
  }

  .scene-marker {
    top: 1.2rem;
    left: 1.2rem;
  }

  .scene-marker span:first-child,
  .scene-marker i {
    display: none;
  }

  .standing {
    top: 1.2rem;
    right: 1.2rem;
    width: 42vw;
  }

  .standing__note {
    display: none;
  }

  .memory-fragment {
    top: 23%;
    right: 1.2rem;
    width: min(78vw, 280px);
  }

  .authority-nav {
    top: 18%;
    left: 1.2rem;
    bottom: auto;
    width: min(44vw, 180px);
    grid-template-columns: 1fr;
  }

  .authority-nav button {
    grid-template-columns: 1.8rem 1fr;
    padding-right: 0.7rem;
  }

  .authority-nav i {
    display: none;
  }

  .domain-panel {
    width: 100%;
  }

  .path-presence {
    top: 29%;
    right: 1.2rem;
  }

  .dialogue {
    left: 1.35rem;
    right: 1.35rem;
    bottom: 15vh;
    width: auto;
    min-height: 150px;
  }

  .dialogue__line {
    max-width: 30ch;
    font-size: clamp(1.4rem, 5.8vw, 2.3rem);
  }

  .composer {
    left: 1.35rem;
    right: 1.35rem;
    bottom: 3.6vh;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
  }

  .controls {
    right: 1.1rem;
    bottom: auto;
    top: 4.5rem;
    gap: 1rem;
  }

  .controls #soundButton span {
    display: none;
  }

  .controls #resetButton {
    display: none;
  }

  .controls #exitButton span {
    display: inline;
  }

  .controls #exitButton::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 8px rgba(210, 40, 69, 0.7);
  }

  .session-mark {
    display: none;
  }

  .disclaimer {
    height: 44px;
    padding: 0 1.25rem;
    justify-content: center;
  }

  .disclaimer span {
    display: none;
  }

  .disclaimer > * + *::before {
    content: none;
  }

  .disclaimer__button {
    min-height: 44px;
    padding: 0 0.65rem;
  }

  .controls button {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .domain-panel,
  .disclaimer {
    backdrop-filter: none;
  }
}

@media (max-width: 560px) {
  .site-shell {
    min-height: 500px;
  }

  .wordmark__text {
    font-size: 0.96rem;
  }

  .masthead__meta {
    font-size: 0.58rem;
  }

  .gate {
    padding-bottom: 8vh;
  }

  .gate h1 {
    margin-top: 1.15rem;
    font-size: clamp(2.65rem, 13.5vw, 4.5rem);
  }

  .gate-form {
    margin-top: 2.4rem;
  }

  .gate-form button span {
    display: none;
  }

  .gate-form button {
    width: 48px;
    justify-content: center;
    flex-shrink: 0;
  }

  .portrait {
    object-position: 58% 0;
    transform-origin: 50% 0;
    transform: scale(1.22);
  }

  .portrait__pulse {
    top: 15%;
    left: 50.5%;
  }

  .standing__rank {
    font-size: 1.25rem;
  }

  .authority-nav {
    top: 24%;
    left: 1rem;
    width: min(43vw, 160px);
  }

  .authority-nav button {
    min-height: 44px;
  }

  .authority-nav b {
    font-size: 0.56rem;
    letter-spacing: 0.13em;
  }

  .domain-panel {
    padding: 1.35rem 1.2rem 3rem;
  }

  .domain-panel h2 {
    font-size: clamp(2.2rem, 13vw, 3.6rem);
  }

  .controls {
    left: 1rem;
    right: 1rem;
    top: auto;
    bottom: 0.25rem;
    justify-content: flex-end;
    gap: 0.85rem;
  }

  .controls button {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
  }

  .dialogue {
    bottom: max(19vh, 140px);
  }

  .dialogue__aside {
    max-width: 82%;
    font-size: 0.71rem;
  }

  .composer__mic {
    width: 44px;
    padding: 0;
  }

  .composer {
    bottom: 64px;
  }

  .composer__mic span {
    display: none;
  }

  .composer__send {
    width: 44px;
    height: 44px;
  }

  .composer__field input {
    height: 46px;
    font-size: 1rem;
  }

  .scene-marker {
    display: none;
  }
}

@media (max-height: 560px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .site-shell {
    height: 620px;
    min-height: 620px;
  }

  .gate {
    padding-top: 2rem;
    padding-bottom: 2rem;
    align-items: center;
  }

  .dialogue {
    bottom: 100px;
    min-height: 120px;
  }

  .composer {
    bottom: 24px;
  }
}

@media (max-height: 720px) and (min-width: 700px) {
  .gate h1 {
    font-size: clamp(3.7rem, 6.5vw, 6.5rem);
  }

  .gate-form {
    margin-top: 2rem;
  }

  .dialogue {
    bottom: 18vh;
    min-height: 140px;
  }

  .dialogue__line {
    font-size: clamp(1.25rem, 2.25vw, 2.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* Layout 2026-10-15: structural content uses flow; only scene effects and
   deliberate drawers/dialogs are overlays. Short screens scroll naturally. */
:root { --layout-gutter: clamp(16px, 3.5vw, 56px); --layout-gap: clamp(20px, 3vw, 44px); }
[hidden] { display: none !important; }
.experience__right .composer.composer--local { grid-template-columns: minmax(0, 1fr) 48px; }
body { overflow-x: hidden; overflow-y: auto; }
.rain { position: fixed; }
.site-shell { display: flex; flex-direction: column; height: auto; min-height: 100svh; overflow: clip; }
.masthead { position: relative; inset: auto; flex: 0 0 auto; height: auto; min-height: 76px; gap: 24px; padding: 14px var(--layout-gutter); }
.masthead__meta { flex-wrap: wrap; justify-content: flex-end; gap: 12px 24px; line-height: 1.5; text-align: right; }
.system-state { min-width: 0; }
.system-state b { overflow-wrap: anywhere; }
.gate { position: relative; inset: auto; flex: 1; min-height: calc(100svh - 146px); grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); padding: 64px var(--layout-gutter); overflow: hidden; }
.gate__content { position: relative; z-index: 2; grid-column: 1; width: 100%; max-width: 710px; min-width: 0; }
.gate h1 { max-width: 10ch; font-size: clamp(48px, 6.8vw, 104px); line-height: .92; }
.gate-form { width: 100%; max-width: 480px; }
.gate-form input { min-width: 0; }
.gate-form__error { height: auto; min-height: 24px; overflow-wrap: anywhere; }
.gate__sigil { z-index: 0; right: 4%; top: 50%; width: min(39vw, 560px); }
.gate__index { right: var(--layout-gutter); bottom: 32px; }
.is-entered .gate { display: none; }
.experience { display: none; position: relative; inset: auto; transform: none; }
.is-entered .experience { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: stretch; gap: 20px var(--layout-gap); width: calc(100% - 2 * var(--layout-gutter)); max-width: 1520px; margin: 28px auto; transform: none; }
.experience > * { min-width: 0; }
.stage { position: relative; inset: auto; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #090b11; }
.stage__meta { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 20px; padding: 20px; border-bottom: 1px solid var(--line); background: #0c0d13; }
.stage__meta .scene-marker { position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .56rem; line-height: 1.6; letter-spacing: .1em; }
.stage__meta .scene-marker i { width: 24px; }
.stage__meta .standing { position: static; width: auto; min-width: 0; text-align: right; }
.standing__rank { font-size: clamp(1.1rem, 1.8vw, 1.8rem); line-height: 1.1; overflow-wrap: anywhere; }
.standing__label { font-size: .56rem; letter-spacing: .13em; line-height: 1.5; }
.standing__trace { margin: 10px 0; }
.standing__note { font-size: .74rem; overflow-wrap: anywhere; }
.stage__visual { position: relative; height: clamp(340px, 52svh, 660px); flex: 1 0 auto; overflow: hidden; isolation: isolate; }
.stage__visual .portrait__veil { pointer-events: none; background: linear-gradient(0deg, #06070ad9, transparent 40%), linear-gradient(90deg, #05070b44, transparent 60%, #05070b33); }
.stage > .authority-nav { position: relative; inset: auto; display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; border-top: 1px solid var(--line); background: #0c0d13; }
.stage > .authority-nav button { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 7px; min-width: 0; min-height: 76px; padding: 14px 16px; border-bottom: 0; border-right: 1px solid var(--line); overflow-wrap: anywhere; }
.stage > .authority-nav button[hidden] { display: none; }
.stage > .authority-nav button:last-child { border-right: 0; }
.stage > .authority-nav b { font-size: .63rem; line-height: 1.4; letter-spacing: .08em; }
.stage > .authority-nav i { font-size: .5rem; letter-spacing: .06em; }
.stage > .authority-nav button.is-evading { transform: translateY(-4px); }
.stage__notices { display: grid; gap: 12px; }
.stage__notices > :not(.is-visible) { display: none; }
.stage__notices > .is-visible { position: relative; inset: auto; width: auto; min-width: 0; max-width: none; margin: 12px 16px; padding: 14px; text-align: left; justify-items: start; border-left: 2px solid var(--violet); border-right: 0; overflow-wrap: anywhere; }
.stage__notices .path-presence strong { line-height: 1.25; font-size: 1.1rem; }
.stage__notices .memory-fragment p { font-size: .9rem; }
.experience__right { display: flex; flex-direction: column; justify-content: center; gap: 28px; min-width: 0; padding: clamp(24px, 3.2vw, 52px); border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(145deg, #111016f5, #08090def); }
.experience__right .dialogue { position: relative; inset: auto; width: 100%; min-width: 0; min-height: 0; }
.dialogue__speaker { flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 24px; line-height: 1.6; }
.dialogue__speaker span { font-size: .74rem; letter-spacing: .22em; overflow-wrap: anywhere; }
.dialogue__speaker i { font-size: .6rem; padding-left: 12px; letter-spacing: .12em; }
.experience__right .dialogue__line { width: 100%; max-width: 28ch; max-height: min(46svh, 480px); padding-right: 6px; font-size: clamp(1.5rem, 2.45vw, 2.75rem); line-height: 1.22; letter-spacing: -.018em; overflow-wrap: anywhere; text-wrap: pretty; overscroll-behavior: contain; }
.experience__right .dialogue--long .dialogue__line { max-width: none; font-size: clamp(1.15rem, 1.7vw, 1.75rem); line-height: 1.45; }
.dialogue__aside { max-width: none; margin-top: 20px; font-size: .76rem; line-height: 1.65; overflow-wrap: anywhere; }
.experience__right .composer { position: relative; inset: auto; display: grid; grid-template-columns: 44px minmax(0, 1fr) 48px; width: 100%; gap: 12px; margin-top: 4px; padding-top: 24px; border-top: 1px solid var(--line); }
.composer__mic { width: 44px; min-height: 48px; height: 48px; padding: 0; }
.composer__mic span { display: none; }
.composer__field { min-width: 0; }
.composer__field input { min-width: 0; height: 48px; padding: 0 8px; font-size: 16px; }
.composer__send { width: 48px; height: 48px; }
.experience > .controls { position: relative; inset: auto; grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.experience > .controls button { display: inline-flex; justify-content: center; min-width: 44px; min-height: 44px; height: auto; padding: 12px 16px; gap: 8px; border: 1px solid var(--line); border-radius: 4px; font-size: .61rem; letter-spacing: .09em; line-height: 1.5; color: #c0b8c9; }
.experience > .controls #resetButton { display: inline-flex; }
.experience > .controls #soundButton span { display: inline; }
.experience > .controls #exitButton::before { content: none; }
.experience > .session-mark { position: static; grid-column: 1 / -1; display: block; margin: -8px 0 0; text-align: right; writing-mode: horizontal-tb; font-size: .56rem; line-height: 1.5; }
.experience > .conversation-status { position: relative; inset: auto; grid-column: 1 / -1; flex-wrap: wrap; width: 100%; max-width: none; gap: 12px; padding: 14px; }
.conversation-status span { min-width: min(100%, 200px); overflow-wrap: anywhere; line-height: 1.5; }
.disclaimer { position: relative; inset: auto; flex: 0 0 auto; flex-wrap: wrap; height: auto; min-height: 64px; gap: 8px 24px; margin-top: auto; padding: 10px var(--layout-gutter); line-height: 1.5; letter-spacing: .08em; }
.disclaimer > * + *::before { content: none; }
.disclaimer__button { min-height: 44px; padding: 8px 0; text-align: left; }
.disclaimer span { overflow-wrap: anywhere; }
.domain-panel { position: fixed; inset: 16px 16px 16px auto; z-index: 45; width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 6px; overscroll-behavior: contain; }
.domain-panel header { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; gap: 20px; padding-bottom: 20px; background: #0d0e14; }
.domain-panel h2 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.05; overflow-wrap: anywhere; }
.domain-panel header button { flex-shrink: 0; }
.domain-panel__content { min-width: 0; }
.domain-panel__content p, .domain-panel__content strong { overflow-wrap: anywhere; }
.nature-dialog, .settings-dialog { width: min(760px, calc(100% - 32px)); max-width: calc(100% - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; }
.dialog-heading { position: sticky; top: 0; z-index: 6; display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; gap: 20px; padding: 24px 28px; border-bottom: 1px solid var(--line); background: #121118; }
.dialog-heading > div { min-width: 0; }
.dialog-heading .kicker { font-size: .6rem; letter-spacing: .12em; line-height: 1.6; }
.dialog-heading .kicker::before { width: 24px; margin-right: 10px; }
.nature-dialog .dialog-heading h2 { margin: 12px 0 0; font-size: clamp(1.65rem, 4.5vw, 2.5rem); line-height: 1.05; overflow-wrap: anywhere; }
.dialog-heading .nature-dialog__close { position: static; float: none; margin: 0; width: 44px; height: 44px; background: #1c1922; }
.dialog-body { min-width: 0; padding: 4px 28px 28px; }
.dialog-body > p:not(.kicker) { color: #bfb9c7; font-family: Georgia, serif; font-size: .95rem; line-height: 1.7; overflow-wrap: anywhere; }
.settings-section { padding: 24px 0; }
.settings-section h3 { line-height: 1.4; }
.settings-section p { overflow-wrap: anywhere; }
.settings-consent { min-width: 0; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 12px; overflow-wrap: anywhere; }
.settings-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.settings-actions button, .settings-import { width: 100%; min-width: 0; min-height: 44px; padding: 12px; line-height: 1.5; letter-spacing: .04em; text-align: center; justify-content: center; overflow-wrap: anywhere; }
.settings-dialog select { min-width: 0; max-width: 100%; padding-right: 28px; }
.nature-dialog__facts p { grid-template-columns: minmax(0, .7fr) minmax(0, 2fr); }
.nature-dialog__facts span, .nature-dialog__facts b { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .is-entered .experience { grid-template-columns: minmax(0, 1fr); max-width: 700px; gap: 18px; margin: 20px auto; }
  .stage__visual { height: clamp(280px, 40svh, 440px); }
  .stage__meta { padding: 16px 20px; }
  .experience__right { padding: 28px; gap: 24px; }
  .experience__right .dialogue__line { max-width: none; max-height: min(42svh, 420px); font-size: clamp(1.4rem, 4.5vw, 2.15rem); }
  .experience__right .dialogue--long .dialogue__line { font-size: clamp(1.1rem, 3.5vw, 1.5rem); }
  .experience > .session-mark { display: none; }
  .experience > .controls { justify-content: stretch; }
  .experience > .controls button { flex: 1 1 auto; }
  .disclaimer { justify-content: space-between; }
}
@media (max-width: 560px) {
  .masthead { min-height: 64px; gap: 12px; }
  .wordmark { gap: 10px; }
  .wordmark__text { letter-spacing: .22em; }
  .masthead__meta { font-size: .56rem; letter-spacing: .08em; }
  .gate { grid-template-columns: minmax(0, 1fr); min-height: calc(100svh - 128px); padding: 48px 24px; align-items: center; }
  .gate h1 { font-size: clamp(40px, 12vw, 66px); line-height: .94; }
  .gate__sigil { right: -35%; top: 35%; width: 95vw; opacity: .35; }
  .gate-form { margin-top: 32px; }
  .stage__meta { padding: 16px; gap: 12px; }
  .stage__meta .scene-marker { font-size: .5rem; }
  .stage__visual { height: clamp(230px, 35svh, 340px); }
  .standing__rank { font-size: 1.15rem; }
  .stage > .authority-nav button { min-height: 68px; padding: 12px 10px; }
  .stage > .authority-nav b { font-size: .6rem; letter-spacing: .05em; }
  .experience__right { padding: 22px 18px; gap: 20px; }
  .dialogue__speaker { margin-bottom: 18px; }
  .dialogue__aside { font-size: .72rem; }
  .experience__right .composer { gap: 8px; grid-template-columns: 44px minmax(0, 1fr) 44px; padding-top: 20px; }
  .composer__send { width: 44px; height: 44px; }
  .experience > .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .experience > .controls button { min-width: 0; padding: 12px 8px; font-size: .58rem; }
  .disclaimer { gap: 8px 16px; font-size: .55rem; }
  .dialog-heading { gap: 12px; padding: 20px 18px; }
  .dialog-body { padding: 4px 18px 22px; }
  .dialog-heading .kicker { font-size: .53rem; letter-spacing: .08em; }
  .dialog-heading .kicker::before { width: 14px; margin-right: 7px; }
  .nature-dialog__facts p { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .domain-panel { padding: 20px 18px; }
}
