:root {
  --field-accent: #c07c61;
  --field-accent-soft: rgba(192, 124, 97, .18);
  --field-aurora: rgba(118, 171, 144, .18);
  --field-ink: #06110f;
}

body[data-palette="indigo"] {
  --field-accent: #a48bd4;
  --field-accent-soft: rgba(164, 139, 212, .18);
  --field-aurora: rgba(83, 118, 170, .2);
}

body[data-palette="ember"] {
  --field-accent: #de946f;
  --field-accent-soft: rgba(222, 148, 111, .2);
  --field-aurora: rgba(151, 87, 61, .2);
}

body[data-palette="dawn"] {
  --field-accent: #d8bd82;
  --field-accent-soft: rgba(216, 189, 130, .17);
  --field-aurora: rgba(118, 155, 144, .2);
}

body[data-phase="1"] { --field-accent: #c07c61; --field-accent-soft: rgba(192, 124, 97, .18); }
body[data-phase="2"] { --field-accent: #c9a96e; --field-accent-soft: rgba(201, 169, 110, .18); }
body[data-phase="3"] { --field-accent: #7fa9ae; --field-accent-soft: rgba(127, 169, 174, .18); }
body[data-phase="4"] { --field-accent: #a48bd4; --field-accent-soft: rgba(164, 139, 212, .18); }
body[data-phase="5"] { --field-accent: #73b8a0; --field-accent-soft: rgba(115, 184, 160, .18); }
body[data-phase="6"] { --field-accent: #d5c38a; --field-accent-soft: rgba(213, 195, 138, .18); }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--field-x, 75%) var(--field-y, 18%), var(--field-aurora), transparent 30rem),
    linear-gradient(180deg, transparent 55%, rgba(4, 13, 11, .52));
  transition: background 1.2s ease;
}

.sensory-dock {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(232, 229, 214, .15);
  border-radius: 999px;
  background: rgba(5, 18, 15, .8);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .32);
  backdrop-filter: blur(18px);
}

.sensory-dock button {
  min-width: 42px;
  height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: rgba(238, 230, 216, .72);
  background: transparent;
  font: 700 10px/1 var(--sans, sans-serif);
  letter-spacing: .15em;
  text-transform: uppercase;
}

.sensory-dock button:hover,
.sensory-dock button[aria-pressed="true"] {
  color: #fff6e8;
  background: var(--field-accent-soft);
}

.sensory-volume { display: flex; align-items: center; width: 72px; padding: 0 4px; }
.sensory-volume input { width: 100%; height: 2px; accent-color: var(--field-accent); cursor: pointer; }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--field-accent);
  box-shadow: 0 0 0 0 var(--field-accent-soft);
  animation: fieldPulse 2.8s ease-out infinite;
}

.living-field {
  position: relative;
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto 120px;
  padding: clamp(28px, 5vw, 68px);
  overflow: hidden;
  border: 1px solid rgba(221, 226, 210, .12);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(134, 176, 151, .08), transparent 54%),
    rgba(7, 23, 19, .66);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 42px 100px rgba(0, 0, 0, .18);
}

.living-field::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  top: -210px;
  border: 1px solid rgba(211, 220, 203, .11);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(211, 220, 203, .025), 0 0 0 120px rgba(211, 220, 203, .018);
}

.living-field__head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 50px;
  align-items: end;
  margin-bottom: 38px;
}

.living-field h2 {
  max-width: 720px;
  margin: 12px 0 0;
  color: #eee6d8;
  font: 400 clamp(2.25rem, 4.6vw, 5rem)/.98 var(--serif, Georgia, serif);
  letter-spacing: -.045em;
}

.living-field__head > p:last-child {
  margin: 0;
  color: rgba(238, 230, 216, .62);
  font-size: .98rem;
  line-height: 1.75;
}

.route-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.route-card {
  position: relative;
  min-height: 220px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(231, 228, 210, .12);
  border-radius: 22px;
  color: #eee6d8;
  text-align: left;
  background: rgba(4, 15, 13, .48);
  transition: transform .45s ease, border-color .45s ease, background .45s ease;
}

.route-card:hover {
  transform: translateY(-7px);
  border-color: color-mix(in srgb, var(--field-accent) 60%, transparent);
  background: rgba(12, 31, 26, .76);
}

.route-card small {
  display: block;
  color: var(--field-accent);
  font: 700 .65rem/1 var(--sans, sans-serif);
  letter-spacing: .2em;
  text-transform: uppercase;
}

.route-card strong {
  display: block;
  margin: 40px 0 12px;
  font: 400 1.65rem/1.05 var(--serif, Georgia, serif);
}

.route-card span {
  color: rgba(238, 230, 216, .55);
  font-size: .78rem;
  line-height: 1.55;
}

.route-card i {
  position: absolute;
  right: 20px;
  bottom: 16px;
  color: rgba(238, 230, 216, .28);
  font: normal 1.25rem/1 var(--serif, serif);
}

.field-view {
  width: min(1180px, calc(100% - 64px));
  min-height: 70vh;
  margin: 0 auto;
  padding: 95px 0 80px;
}

.field-view__head {
  display: grid;
  grid-template-columns: 1fr minmax(260px, .55fr);
  gap: 60px;
  align-items: end;
  margin-bottom: 48px;
}

.field-view__head h2 {
  margin: 10px 0 0;
  color: #eee6d8;
  font: 400 clamp(3rem, 6vw, 6.8rem)/.88 var(--serif, Georgia, serif);
  letter-spacing: -.055em;
}

.field-view__head > p:last-child {
  color: rgba(238, 230, 216, .58);
  line-height: 1.7;
}

.observatory-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.field-panel {
  grid-column: span 4;
  min-height: 210px;
  padding: 26px;
  border: 1px solid rgba(238, 230, 216, .11);
  border-radius: 24px;
  background: rgba(7, 22, 18, .58);
}

.field-panel--wide { grid-column: span 8; }
.field-panel--full { grid-column: 1 / -1; }
.field-panel__label { color: rgba(238, 230, 216, .76); font: 700 .68rem/1.25 var(--sans, sans-serif); letter-spacing: .18em; text-transform: uppercase; }
.field-panel h2 { margin: 20px 0 8px; color: #eee6d8; font: 400 2rem/1.05 var(--serif, Georgia, serif); }
.field-panel p { color: rgba(238, 230, 216, .56); line-height: 1.65; }

.metric-value {
  display: block;
  margin-top: 30px;
  color: var(--field-accent);
  font: 400 clamp(3.5rem, 8vw, 7rem)/.8 var(--serif, Georgia, serif);
  letter-spacing: -.06em;
}

.constellation-stage {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(238, 230, 216, .12);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 50%, var(--field-aurora), transparent 45%),
    rgba(3, 13, 11, .76);
}

.constellation-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.constellation-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; padding: 30px; text-align: center; color: rgba(238, 230, 216, .55); }
.constellation-empty strong { color: #eee6d8; font: 400 2rem/1 var(--serif, Georgia, serif); }

.journey-echo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 15px 18px;
  border: 1px solid rgba(238, 230, 216, .1);
  border-radius: 16px;
  color: rgba(238, 230, 216, .5);
  background: rgba(7, 20, 17, .46);
}

.journey-echo button { color: var(--field-accent); font: 700 .65rem/1 var(--sans, sans-serif); letter-spacing: .14em; text-transform: uppercase; }
.journey-echo__wave { display: flex; align-items: center; gap: 3px; height: 24px; }
.journey-echo__wave i { width: 2px; height: 25%; border-radius: 99px; background: rgba(238, 230, 216, .3); animation: wave 1.4s ease-in-out infinite; }
.journey-echo__wave i:nth-child(2n) { animation-delay: -.4s; }
.journey-echo__wave i:nth-child(3n) { animation-delay: -.8s; }

.is-presence .site-header,
.is-presence .site-footer,
.is-presence .journey__rail,
.is-presence .ambient-field__grain {
  opacity: .16;
  transition: opacity .7s ease;
}

body[data-route="blind"] .journey__rail ol,
body[data-route="blind"] .journey__heading .eyebrow,
body[data-route="blind"] .word-choice > p {
  opacity: 0;
  pointer-events: none;
}

body[data-route="blind"] .journey__heading h2 {
  filter: blur(11px);
  opacity: .38;
  transition: filter .8s ease, opacity .8s ease;
}

body[data-route="blind"].blind-revealed .journey__heading h2 {
  filter: none;
  opacity: 1;
}

.voice-room,
.threshold-event,
.daily-room {
  margin-top: 18px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid color-mix(in srgb, var(--field-accent) 45%, transparent);
  border-radius: 22px;
  color: #eee6d8;
  background:
    radial-gradient(circle at 92% 12%, var(--field-accent-soft), transparent 17rem),
    rgba(4, 15, 13, .92);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .25);
}

.voice-room[hidden], .threshold-event[hidden], .daily-room[hidden] { display: none; }
.voice-room__head, .threshold-event__head, .daily-room__head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.voice-room h3, .threshold-event h3, .daily-room h3 { margin: 8px 0 0; font: 400 clamp(1.8rem, 3.4vw, 3rem)/1 var(--serif, Georgia, serif); }
.voice-room p, .threshold-event p, .daily-room p { color: rgba(238, 230, 216, .58); line-height: 1.65; }
.room-close { min-width: 44px; min-height: 44px; color: rgba(238, 230, 216, .76); font-size: 1.3rem; }

.voice-controls,
.threshold-event__actions,
.daily-room__actions,
.deep-controls,
.observatory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
}

.micro-button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid rgba(238, 230, 216, .14);
  border-radius: 999px;
  color: #eee6d8;
  background: rgba(238, 230, 216, .04);
  font: 700 .66rem/1 var(--sans, sans-serif);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.micro-button:hover, .micro-button--active { border-color: var(--field-accent); background: var(--field-accent-soft); }
.micro-button--danger { color: #df9c87; }
.voice-time { min-width: 55px; color: var(--field-accent); font: 500 1rem/1 var(--mono, monospace); }
.voice-room audio { width: 100%; margin-top: 20px; opacity: .82; }

.threshold-event {
  position: relative;
  overflow: hidden;
  animation: eventArrives .9s cubic-bezier(.2, .8, .2, 1) both;
}
.threshold-event::before {
  content: "";
  position: absolute;
  inset: -60% -30%;
  pointer-events: none;
  background: conic-gradient(from 90deg, transparent, var(--field-accent-soft), transparent 40%);
  animation: slowTurn 18s linear infinite;
}
.threshold-event > * { position: relative; z-index: 1; }
.threshold-event textarea, .daily-room textarea, .deep-chamber textarea, .capsule-form textarea {
  width: 100%;
  min-height: 100px;
  margin-top: 18px;
  padding: 16px 0;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid rgba(238, 230, 216, .18);
  color: #eee6d8;
  background: transparent;
  font: 400 1.2rem/1.55 var(--serif, Georgia, serif);
}

.daily-room {
  width: min(760px, calc(100% - 32px));
  margin: 24px auto 70px;
}

.deep-chamber {
  margin-top: 48px;
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid rgba(238, 230, 216, .12);
  border-radius: 30px;
  text-align: left;
  background: linear-gradient(135deg, rgba(130, 160, 144, .1), transparent 60%);
}
.deep-chamber[hidden] { display: none; }
.deep-chamber__number { color: var(--field-accent); font: 700 .7rem/1 var(--sans, sans-serif); letter-spacing: .2em; }
.deep-chamber h3 { margin: 18px 0 10px; font: 400 clamp(2rem, 4vw, 4rem)/.98 var(--serif, Georgia, serif); }
.deep-chamber > p { color: rgba(238, 230, 216, .58); line-height: 1.65; }
.deep-chamber__dots { display: flex; gap: 7px; margin-top: 26px; }
.deep-chamber__dots i { width: 23px; height: 2px; background: rgba(238, 230, 216, .16); }
.deep-chamber__dots i.is-active { background: var(--field-accent); }

.observatory-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.observatory-tool {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(238, 230, 216, .11);
  border-radius: 26px;
  background: rgba(7, 22, 18, .58);
}
.observatory-tool--wide { grid-column: 1 / -1; }
.observatory-tool h2 { margin: 15px 0 10px; color: #eee6d8; font: 400 2.25rem/1 var(--serif, Georgia, serif); }
.observatory-tool > p { color: rgba(238, 230, 216, .56); line-height: 1.65; }

.compare-controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 24px 0; }
.compare-controls select,
.capsule-form input,
.atlas-filter input {
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(238, 230, 216, .13);
  border-radius: 12px;
  color: #eee6d8;
  background: rgba(3, 13, 11, .65);
}
.compare-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.compare-result div { min-height: 110px; padding: 16px; border-radius: 16px; background: rgba(238, 230, 216, .035); }
.compare-result b { display: block; margin-bottom: 12px; color: var(--field-accent); font: 700 .62rem/1 var(--sans, sans-serif); letter-spacing: .14em; text-transform: uppercase; }
.compare-result span { color: rgba(238, 230, 216, .72); font: 400 1rem/1.5 var(--serif, Georgia, serif); }

.lexicon-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.lexicon-cloud span { padding: 9px 13px; border: 1px solid rgba(238, 230, 216, .1); border-radius: 999px; color: rgba(238, 230, 216, .64); font-size: calc(.72rem + var(--weight, 0) * .08rem); background: rgba(238, 230, 216, .025); }
.lexicon-cloud span.is-strong { color: #eee6d8; border-color: color-mix(in srgb, var(--field-accent) 45%, transparent); }

.capsule-form { display: grid; grid-template-columns: 1fr 160px; gap: 10px; margin-top: 20px; }
.capsule-form textarea { grid-column: 1 / -1; margin-top: 0; }
.capsule-list { display: grid; gap: 10px; margin-top: 22px; }
.capsule-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: start; padding: 16px; border-radius: 15px; background: rgba(238, 230, 216, .035); }
.capsule-item time { color: var(--field-accent); font: 700 .64rem/1.4 var(--sans, sans-serif); letter-spacing: .1em; text-transform: uppercase; }
.capsule-item p { margin: 0; color: rgba(238, 230, 216, .7); }

.atlas-lens {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 22px 0 12px;
  padding: 14px;
  border: 1px solid rgba(238, 230, 216, .1);
  border-radius: 16px;
  background: rgba(7, 22, 18, .5);
}
.atlas-filter input { width: 100%; }
.atlas-lens__actions { display: flex; gap: 8px; }

.phenomenon-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--field-accent);
  background: var(--field-accent-soft);
  font: 700 .58rem/1 var(--sans, sans-serif);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.constellation-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.constellation-legend { position: absolute; left: 24px; bottom: 20px; z-index: 2; display: flex; gap: 18px; color: rgba(238, 230, 216, .78); font-size: .72rem; }

.daily-list { display: grid; gap: 10px; margin-top: 22px; }
.daily-item { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px 18px; align-items: start; padding: 18px; border: 1px solid rgba(238, 230, 216, .12); border-radius: 16px; background: rgba(238, 230, 216, .025); }
.daily-item time { color: var(--field-accent); font: 700 .68rem/1.4 var(--sans, sans-serif); letter-spacing: .08em; text-transform: uppercase; }
.daily-item b { color: #eee6d8; font: 400 1.05rem/1.4 var(--serif, Georgia, serif); }
.daily-item p { grid-column: 2; margin: 0; color: rgba(238, 230, 216, .78); line-height: 1.6; white-space: pre-wrap; }
.trace-answer--extended > div p { margin: 0 0 .55rem; white-space: pre-wrap; }
.trace-answer--extended > div p:first-child { color: rgba(238, 230, 216, .72); font-style: italic; }
.trace-resume { margin-top: 16px; }
.constellation-legend span { display: inline-flex; align-items: center; gap: 7px; }
.constellation-legend i { width: 6px; height: 6px; border-radius: 50%; background: rgba(226, 226, 209, .82); }
.constellation-legend span:first-child i { background: var(--field-accent); }

.field-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 100;
  max-width: min(520px, calc(100% - 32px));
  padding: 16px 20px;
  transform: translate(-50%, 20px);
  border: 1px solid rgba(238, 230, 216, .14);
  border-radius: 15px;
  color: #eee6d8;
  background: rgba(5, 18, 15, .94);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.field-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes fieldPulse { 60%, 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes wave { 50% { height: 100%; background: var(--field-accent); } }
@keyframes eventArrives { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes slowTurn { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .living-field__head, .field-view__head { grid-template-columns: 1fr; gap: 22px; }
  .route-grid { grid-template-columns: repeat(2, 1fr); }
  .field-panel, .field-panel--wide { grid-column: span 6; }
  .observatory-tools { grid-template-columns: 1fr; }
  .observatory-tool--wide { grid-column: auto; }
}

@media (max-width: 620px) {
  .living-field, .field-view { width: min(100% - 28px, 1180px); }
  .living-field { padding: 24px 16px; border-radius: 24px; }
  .route-grid { grid-template-columns: 1fr; }
  .route-card { min-height: 165px; }
  .route-card strong { margin-top: 26px; }
  .field-panel, .field-panel--wide { grid-column: 1 / -1; }
  .constellation-stage { min-height: 460px; }
  .sensory-dock { right: 12px; bottom: 12px; }
  .sensory-dock button { min-width: 38px; height: 38px; padding: 0 10px; }
  .sensory-volume { width: 44px; }
  .site-header nav { max-width: 62vw; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .compare-controls, .compare-result, .capsule-form { grid-template-columns: 1fr; }
  .capsule-form textarea { grid-column: auto; }
  .capsule-item { grid-template-columns: 1fr auto; }
  .capsule-item p { grid-column: 1 / -1; grid-row: 2; }
  .daily-item { grid-template-columns: 1fr auto; }
  .daily-item b, .daily-item p { grid-column: 1 / -1; }
  .atlas-lens { grid-template-columns: 1fr; }
  .atlas-lens__actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot, .journey-echo__wave i { animation: none !important; }
}
