/* ============================================================
   OBREPO.COM — LENS Corpus
   Design Language: Weight, antiquity, breath, no noise
   ============================================================ */

:root {
  --black: #0a0a0a;
  --white: #f5f2ec;
  --amber: #c8922a;
  --amber-dim: #8a6420;
  --grey-light: #c8c4bc;
  --grey-mid: #9a9488;
  --grey-dark: #3a3830;
  --font-serif: 'EB Garamond', 'Garamond', 'Georgia', serif;
  --font-display: 'UnifrakturMaguntia', 'MedievalSharp', serif;
  --transition: 0.4s ease;
  --max-width: 780px;
  --max-width-prose: 660px;
  --max-width-wide: 1100px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
  background: var(--black);
  color: var(--white);
}

body {
  font-family: var(--font-serif);
  line-height: 1.75;
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

h1 { font-size: 2.4rem; color: var(--white); }
h2 { font-size: 1.7rem; color: var(--white); margin-bottom: 1.2rem; }
h3 { font-size: 1.2rem; color: var(--amber); margin-bottom: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
h4 { font-size: 1rem; color: var(--grey-mid); }

p { margin-bottom: 1.4rem; color: var(--white); }
p:last-child { margin-bottom: 0; }

em { font-style: italic; color: var(--grey-light); }
strong { font-weight: 600; color: var(--white); }

a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}
a:hover { border-bottom-color: var(--amber); }

blockquote {
  border-left: 2px solid var(--amber);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  color: var(--grey-light);
  font-style: italic;
  font-size: 1.1rem;
}

hr {
  border: none;
  border-top: 1px solid var(--grey-dark);
  margin: 3rem auto;
  width: 60%;
}

/* ---- Layout ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.container-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
}

.section-tight {
  padding: 3rem 0;
}

/* ---- Navigation ---- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,10,10,0.97);
  border-bottom: 1px solid var(--grey-dark);
  transition: background var(--transition);
}

.nav-mark {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
  letter-spacing: 0.05em;
  text-decoration: none;
  border-bottom: none;
}
.nav-mark:hover { color: var(--amber); border-bottom: none; }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-mid);
  border-bottom: none;
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--amber); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--white);
  margin: 5px 0;
  transition: var(--transition);
}

/* ---- Entry / Threshold Page ---- */
.threshold {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}

/* LENS concept background — fades in behind threshold content */
.lens-bg {
  position: fixed;
  inset: 0;
  background-image: url('../assets/images/lens_concept.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  /* Flash to full opacity, then dim to resting state */
  animation: lensReveal 4s ease 0.3s forwards;
  -webkit-animation: lensReveal 4s ease 0.3s forwards;
}
@keyframes lensReveal {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0.22; }
}
@-webkit-keyframes lensReveal {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0.22; }
}

/* Wrapper: fade-in then oscillate — pure CSS, works on all browsers including iOS Safari */
.threshold-ambigram-wrap {
  width: min(480px, 90vw);
  margin-bottom: 3rem;
  display: block;
  transform-origin: center center;
  -webkit-transform-origin: center center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  pointer-events: none;
  /* Fade in, then a single quick 1s spin, then idle */
  animation:
    fadeIn 2s ease forwards,
    ambigramOscillate 1s ease-in-out 2.5s 1 forwards;
  -webkit-animation:
    fadeIn 2s ease forwards,
    ambigramOscillate 1s ease-in-out 2.5s 1 forwards;
  animation-fill-mode: forwards;
  -webkit-animation-fill-mode: forwards;
}

/* Image: starts black (no filter), inverts to white as background dims */
.threshold-ambigram {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.92;
  animation: ambigramInvert 4s ease 0.3s forwards;
  -webkit-animation: ambigramInvert 4s ease 0.3s forwards;
}
@keyframes ambigramInvert {
  0%   { filter: invert(0); }
  20%  { filter: invert(0); }
  100% { filter: invert(1); }
}
@-webkit-keyframes ambigramInvert {
  0%   { -webkit-filter: invert(0); }
  20%  { -webkit-filter: invert(0); }
  100% { -webkit-filter: invert(1); }
}

.threshold-word {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: var(--grey-mid);
  letter-spacing: 0.3em;
  text-transform: lowercase;
  margin-bottom: 1rem;
  animation: fadeIn 3s ease forwards;
}

.threshold-definition {
  font-size: 0.9rem;
  color: var(--grey-mid);
  letter-spacing: 0.06em;
  font-style: italic;
  max-width: 420px;
  margin-bottom: 2.5rem;
  animation: fadeIn 4s ease forwards;
}

.threshold-problem {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--white);
  max-width: 440px;
  line-height: 1.8;
  margin-bottom: 3rem;
  opacity: 0.85;
  animation: fadeIn 4.5s ease forwards;
}

.threshold-enter {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  padding: 0.8rem 2.4rem;
  transition: all var(--transition);
  animation: fadeIn 5s ease forwards;
  cursor: pointer;
  background: none;
  font-family: var(--font-serif);
}
.threshold-enter:hover {
  background: var(--amber);
  color: var(--black);
  border-color: var(--amber);
}

/* ---- Track Navigation ---- */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5px;
  background: var(--grey-dark);
  border: 1px solid var(--grey-dark);
  margin: 4rem 0;
}

.track-card {
  background: var(--black);
  padding: 2.5rem 2rem;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  display: block;
  border-bottom: none;
}
.track-card:hover { background: #111; border-bottom: none; }
.track-card:hover .track-title { color: var(--amber); }

.track-number {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--grey-dark);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.track-title {
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: 0.6rem;
  transition: color var(--transition);
}

.track-description {
  font-size: 0.85rem;
  color: var(--grey-mid);
  line-height: 1.6;
  margin-bottom: 0;
}

.track-symbol {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.2rem;
  border-radius: 4px;
  overflow: hidden;
  opacity: 0.75;
  transition: opacity var(--transition);
}
.track-symbol img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.track-card:hover .track-symbol { opacity: 1; }

/* ---- Track Sticky Symbol ---- */
/* Full-screen flash → contracts to sticky watermark */
/* Uses fixed scale(6) — reliable on all browsers including Safari/WebKit */
@keyframes symbolReveal {
  0% {
    transform: translate(-50vw, -50vh)
               translate(110px, calc(110px + 5rem))
               scale(6);
    opacity: 0.95;
    filter: grayscale(0%);
    border-radius: 0;
  }
  55% {
    opacity: 0.95;
    filter: grayscale(0%);
  }
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.14;
    filter: grayscale(30%);
    border-radius: 8px;
  }
}
@-webkit-keyframes symbolReveal {
  0% {
    -webkit-transform: translate(-50vw, -50vh)
               translate(110px, calc(110px + 5rem))
               scale(6);
    opacity: 0.95;
    -webkit-filter: grayscale(0%);
    border-radius: 0;
  }
  55% {
    opacity: 0.95;
    -webkit-filter: grayscale(0%);
  }
  100% {
    -webkit-transform: translate(0, 0) scale(1);
    opacity: 0.14;
    -webkit-filter: grayscale(30%);
    border-radius: 8px;
  }
}

.track-symbol-sticky {
  position: fixed;
  bottom: 5rem;
  right: -1rem;
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 299;
  border-radius: 8px;
  overflow: hidden;
  animation: symbolReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  -webkit-animation: symbolReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.track-symbol-sticky img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 768px) {
  .track-symbol-sticky {
    width: 160px;
    height: 160px;
    bottom: 4.5rem;
    right: -0.5rem;
  }
  @-webkit-keyframes symbolReveal {
    0% {
      -webkit-transform: translate(-50vw, -50vh)
                 translate(80px, calc(80px + 4.5rem))
                 scale(5);
      opacity: 0.95;
      -webkit-filter: grayscale(0%);
      border-radius: 0;
    }
    55% { opacity: 0.95; -webkit-filter: grayscale(0%); }
    100% {
      -webkit-transform: translate(0, 0) scale(1);
      opacity: 0.12;
      -webkit-filter: grayscale(30%);
      border-radius: 8px;
    }
  }
  @keyframes symbolReveal {
    0% {
      transform: translate(-50vw, -50vh)
                 translate(80px, calc(80px + 4.5rem))
                 scale(5);
      opacity: 0.95;
      filter: grayscale(0%);
      border-radius: 0;
    }
    55% { opacity: 0.95; filter: grayscale(0%); }
    100% {
      transform: translate(0, 0) scale(1);
      opacity: 0.12;
      filter: grayscale(30%);
      border-radius: 8px;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .track-symbol-sticky {
    animation: none;
    -webkit-animation: none;
    opacity: 0.14;
    filter: grayscale(30%);
    border-radius: 8px;
  }
}

/* ---- Content Pages ---- */
.content-header {
  padding: 8rem 0 1.5rem;
  border-bottom: 1px solid var(--grey-dark);
  margin-bottom: 2rem;
}

.content-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
  display: block;
}

.content-body {
  padding: 0 0 6rem;
  max-width: var(--max-width-prose);
  margin-left: auto;
  margin-right: auto;
}

.content-body p {
  font-size: 1.05rem;
  line-height: 1.75;
}

/* ---- Depth Layers ---- */
.depth-layer {
  margin-top: 5rem;
  padding-top: 5rem;
  border-top: 1px solid var(--grey-dark);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.depth-layer.revealed {
  opacity: 1;
  transform: translateY(0);
}
/* Breathing room above section headings inside depth layers */
.depth-layer h3 {
  margin-top: 3rem;
}
.depth-layer > h3:first-child,
.depth-layer > *:first-child > h3:first-child {
  margin-top: 0;
}

.depth-reveal-btn {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey-mid);
  border: 1px solid var(--grey-dark);
  padding: 0.6rem 1.8rem;
  cursor: pointer;
  background: none;
  font-family: var(--font-serif);
  transition: all var(--transition);
  margin-top: 2rem;
}
.depth-reveal-btn:hover { color: var(--amber); border-color: var(--amber-dim); }

/* ---- Companion ---- */
.companion-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 0 6rem;
}

.companion-messages {
  min-height: 300px;
  max-height: 520px;
  overflow-y: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--grey-dark);
  border-bottom: 1px solid var(--grey-dark);
  margin-bottom: 1.5rem;
  scroll-behavior: smooth;
}

.message {
  margin-bottom: 1.8rem;
  animation: fadeIn 0.4s ease;
}

.message-role {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 0.4rem;
}

.message-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--white);
}

.message.assistant .message-content {
  color: var(--grey-light);
}

.companion-input-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.companion-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--grey-dark);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1rem;
  padding: 0.6rem 0;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: border-color var(--transition);
}
.companion-input:focus { border-bottom-color: var(--amber); }
.companion-input::placeholder { color: var(--grey-dark); }

.companion-send {
  background: none;
  border: 1px solid var(--grey-dark);
  color: var(--grey-mid);
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.companion-send:hover { color: var(--amber); border-color: var(--amber-dim); }
.companion-send:disabled { opacity: 0.4; cursor: default; }

.companion-thinking {
  font-size: 0.8rem;
  color: var(--grey-mid);
  font-style: italic;
  padding: 0.5rem 0;
  display: none;
}

/* ---- Living Margin ---- */
.margin-container {
  background: #0f0f0f;
  border: 1px solid var(--grey-dark);
  padding: 2rem;
  margin-top: 4rem;
}

.margin-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 1rem;
  display: block;
}

.margin-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--grey-dark);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  padding: 0.5rem 0;
  outline: none;
  resize: none;
  min-height: 80px;
  transition: border-color var(--transition);
}
.margin-input:focus { border-bottom-color: var(--amber); }
.margin-input::placeholder { color: var(--grey-dark); font-style: italic; }

.margin-save {
  background: none;
  border: none;
  color: var(--grey-mid);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.6rem 0;
  font-family: var(--font-serif);
  transition: color var(--transition);
  margin-top: 0.8rem;
}
.margin-save:hover { color: var(--amber); }

.margin-entries {
  margin-top: 1.5rem;
  border-top: 1px solid var(--grey-dark);
  padding-top: 1.5rem;
}

.margin-entry {
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid #1a1a1a;
}

.margin-entry-date {
  font-size: 0.65rem;
  color: var(--grey-dark);
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}

.margin-entry-text {
  font-size: 0.9rem;
  color: var(--grey-mid);
  line-height: 1.7;
}

/* ---- Skill Files ---- */
.skill-file-block {
  background: #0d0d0d;
  border: 1px solid var(--grey-dark);
  padding: 2rem;
  margin-bottom: 2rem;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--grey-light);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey-mid);
  border: 1px solid var(--grey-dark);
  padding: 0.4rem 1rem;
  cursor: pointer;
  background: none;
  font-family: var(--font-serif);
  transition: all var(--transition);
  margin-bottom: 1rem;
}
.copy-btn:hover { color: var(--amber); border-color: var(--amber-dim); }
.copy-btn.copied { color: var(--amber); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--grey-dark);
  padding: 3rem 0;
  text-align: center;
}

.footer-mark {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--grey-dark);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 1rem;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--grey-dark);
  letter-spacing: 0.08em;
  font-style: italic;
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Ambigram oscillation — pure CSS, compositor-level, works through filter stacking contexts */
@keyframes ambigramOscillate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}
@-webkit-keyframes ambigramOscillate {
  0%   { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(180deg); }
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

/* ---- Responsive ---- */

/* Hamburger nav: activate on all phones (up to 768px covers all iPhones in portrait) */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    left: 0; right: 0;
    background: rgba(10,10,10,0.98);
    padding: 2rem;
    border-bottom: 1px solid var(--grey-dark);
    gap: 1.5rem;
    z-index: 500;
  }
  .nav-links.open a {
    color: var(--amber);
    font-size: 1.1rem;
    padding: 0.75rem 0;
  }
  .nav-toggle { display: block; }
}

@media (max-width: 680px) {
  html { font-size: 17px; }
  h1 { font-size: 1.8rem; }
  .tracks-grid { grid-template-columns: 1fr; }
  .companion-input-row { flex-direction: column; }
  .companion-send { width: 100%; text-align: center; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--grey-dark); }
::-webkit-scrollbar-thumb:hover { background: var(--grey-mid); }

/* ---- Selection ---- */
::selection { background: var(--amber); color: var(--black); }

/* ---- Chat / Companion Interface ---- */
.chat-container {
  max-width: 700px;
  margin: 0 auto;
}

.chat-messages {
  min-height: 320px;
  max-height: 560px;
  overflow-y: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--grey-dark);
  border-bottom: 1px solid var(--grey-dark);
  margin-bottom: 1.5rem;
  scroll-behavior: smooth;
}

.chat-message {
  margin-bottom: 2rem;
  animation: fadeIn 0.4s ease;
}

.chat-message.user {
  text-align: right;
}

.chat-bubble {
  display: inline-block;
  max-width: 82%;
  text-align: left;
}

.chat-message.user .chat-bubble p {
  color: var(--amber);
  font-size: 0.95rem;
  line-height: 1.7;
}

.chat-message.assistant .chat-bubble p {
  color: var(--grey-light);
  font-size: 0.95rem;
  line-height: 1.8;
}

.chat-message.thinking .chat-bubble {
  padding: 0.4rem 0;
}

.thinking-dots span {
  display: inline-block;
  animation: thinkPulse 1.4s infinite;
  color: var(--grey-mid);
  font-size: 1.4rem;
  line-height: 1;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkPulse {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}

.chat-input-area {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  border-top: 1px solid var(--grey-dark);
  padding-top: 1.2rem;
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--grey-dark);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1rem;
  padding: 0.5rem 0;
  outline: none;
  resize: none;
  min-height: 44px;
  transition: border-color var(--transition);
  line-height: 1.6;
}
.chat-input:focus { border-bottom-color: var(--amber); }
.chat-input::placeholder { color: var(--grey-dark); font-style: italic; }

.chat-send {
  background: none;
  border: 1px solid var(--grey-dark);
  color: var(--grey-mid);
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.chat-send:hover { color: var(--amber); border-color: var(--amber-dim); }
.chat-send:disabled { opacity: 0.4; cursor: default; }

.chat-note {
  font-size: 0.7rem;
  color: var(--grey-dark);
  font-style: italic;
  text-align: center;
  margin-top: 1.5rem;
  line-height: 1.6;
}

/* ---- Skill File Blocks ---- */
.skill-file-header {
  margin-bottom: 1rem;
}

.skill-file-header h3 {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--amber);
  text-transform: none;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.skill-file-header p {
  font-size: 0.82rem;
  color: var(--grey-mid);
  margin-bottom: 0.8rem;
}

.skill-file-content {
  background: #080808;
  border: 1px solid #1a1a1a;
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--grey-light);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 0.5rem;
}

/* ============================================================
   DYNAMIC AESTHETIC — A+B+C SYSTEM
   Track Chromatic Identity + Depth-Responsive Warming +
   Particle Field support
   ============================================================ */

/* Dynamic background CSS custom properties — set by JavaScript */
:root {
  --bg-h: 0;
  --bg-s: 0%;
  --bg-l: 4%;
  --bg-glow-opacity: 0;
  --depth-progress: 0;
}

/* Override body background to use dynamic HSL */
body {
  background: hsl(var(--bg-h), var(--bg-s), var(--bg-l));
  transition: background 2s ease;
}

/* Radial center bloom — the "glow" that emerges with depth */
body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    hsla(var(--bg-h), 50%, 60%, var(--bg-glow-opacity)) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  transition: opacity 2s ease;
}

/* Ensure content sits above the particle canvas and glow */
.threshold,
.content-header,
.content-body,
.companion-container,
.chat-container,
.container,
.container-wide,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ---- Luminous text treatment ---- */
/* Applied to key phrases; revealed via JS when depth layer opens */
.luminous {
  text-shadow: 0 0 18px hsla(var(--bg-h), 60%, 80%, 0.45),
               0 0 40px hsla(var(--bg-h), 50%, 70%, 0.18);
  transition: text-shadow 1.5s ease;
}

/* At depth 0, no glow — JS controls opacity reveal */
.depth-layer:not(.revealed) .luminous {
  text-shadow: none;
}

/* ---- Ambigram oscillation ---- */
/* Pure CSS animation handles rotation; see @keyframes ambigramOscillate above */
@media (prefers-reduced-motion: reduce) {
  .threshold-ambigram-wrap {
    animation: fadeIn 2s ease forwards;
    -webkit-animation: fadeIn 2s ease forwards;
  }
}

/* ---- Particle canvas ---- */
#obrepo-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 2.5s ease;
}

/* ---- Track color accent overrides ---- */
/* Each track page body carries a data-track attribute set by PHP */
body[data-track="word"] { --track-accent: hsl(255, 50%, 65%); }
body[data-track="mirror"] { --track-accent: hsl(210, 35%, 70%); }
body[data-track="pattern"] { --track-accent: hsl(165, 45%, 60%); }
body[data-track="map"] { --track-accent: hsl(38, 55%, 60%); }
body[data-track="practice"] { --track-accent: hsl(22, 40%, 65%); }
body[data-track="companion"] { --track-accent: hsl(45, 35%, 70%); }

/* Depth reveal button takes on track accent at depth > 0 */
body[data-track] .depth-reveal-btn:hover {
  color: var(--track-accent, var(--amber));
  border-color: var(--track-accent, var(--amber-dim));
}

/* Active nav link uses track accent when on a track page */
body[data-track] .nav-links a.active {
  color: var(--track-accent, var(--amber));
}

/* Content label uses track accent */
body[data-track] .content-label {
  color: var(--track-accent, var(--amber));
}

/* ---- Depth progress indicator (subtle) ---- */
/* A thin line at the top of the viewport that fills with depth */
body[data-track]::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: calc(var(--depth-progress, 0) * 100%);
  background: var(--track-accent, var(--amber));
  opacity: 0.5;
  z-index: 200;
  transition: width 1.5s ease;
  pointer-events: none;
}

/* ---- Reduced motion overrides ---- */
@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
  body::before { display: none; }
  #obrepo-particles { display: none; }
  .threshold-ambigram { transition: none; animation: none; }
  .depth-layer { transition: opacity 0.2s ease; }
  .luminous { transition: none; }
}

/* ============================================================
   JOURNEY CODE PANEL
   Fixed to the bottom of the viewport. Unobtrusive by default —
   only the thin bar is visible. Expands upward on toggle.
   ============================================================ */

.journey-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--grey-mid);
  background: hsla(0, 0%, 5%, 0.88);
  border-top: 1px solid hsla(0, 0%, 100%, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.journey-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  min-height: 2.4rem;
}

.journey-toggle {
  background: none;
  border: none;
  color: var(--grey-mid);
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}
.journey-toggle:hover,
.journey-toggle:focus-visible {
  opacity: 1;
  color: var(--grey-light);
  outline: none;
}
.journey-toggle-label {
  text-transform: uppercase;
  font-size: 0.65rem;
}
.journey-toggle-icon {
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.3s ease;
  display: inline-block;
}
.journey-toggle[aria-expanded="true"] .journey-toggle-icon {
  transform: rotate(180deg);
}

.journey-code-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
}

.journey-code-display {
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--grey-light);
  user-select: all;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18rem;
}

/* ---- Tooltip trigger (the "?" button) ---- */
.journey-tooltip-trigger {
  background: none;
  border: 1px solid hsla(0, 0%, 100%, 0.15);
  border-radius: 50%;
  color: var(--grey-mid);
  font-family: inherit;
  font-size: 0.62rem;
  line-height: 1;
  width: 1.15rem;
  height: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.journey-tooltip-trigger:hover,
.journey-tooltip-trigger:focus-visible {
  border-color: hsla(0, 0%, 100%, 0.4);
  color: var(--grey-light);
  outline: none;
}

/* ---- Tooltip bubble ---- */
.journey-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.6rem);
  left: 0;
  width: min(22rem, 90vw);
  background: hsla(0, 0%, 10%, 0.97);
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: 0.4rem;
  padding: 0.85rem 1rem;
  color: var(--grey-light);
  font-family: var(--font-serif);
  font-size: 0.78rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 32px hsla(0, 0%, 0%, 0.6);
  z-index: 400;
  pointer-events: none;
}
.journey-tooltip::after {
  content: "";
  position: absolute;
  bottom: -0.45rem;
  left: 1.2rem;
  width: 0.8rem;
  height: 0.8rem;
  background: hsla(0, 0%, 10%, 0.97);
  border-right: 1px solid hsla(0, 0%, 100%, 0.1);
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.1);
  transform: rotate(45deg);
}
.journey-tooltip em {
  font-style: normal;
  color: #fff;
  font-weight: 500;
}
.journey-tooltip strong {
  display: block;
  color: #fff;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Show tooltip on hover/focus of trigger */
.journey-tooltip-trigger:hover + .journey-tooltip,
.journey-tooltip-trigger:focus + .journey-tooltip,
.journey-tooltip-trigger:focus-visible + .journey-tooltip {
  display: block;
}

/* ---- Copy button ---- */
.journey-copy {
  background: none;
  border: 1px solid hsla(0, 0%, 100%, 0.12);
  border-radius: 0.25rem;
  color: var(--grey-mid);
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.journey-copy:hover,
.journey-copy:focus-visible {
  border-color: hsla(0, 0%, 100%, 0.35);
  color: var(--grey-light);
  outline: none;
}

/* ---- Expandable return section ---- */
.journey-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1rem;
}
.journey-content.open {
  max-height: 8rem;
  padding: 0.6rem 1rem 0.8rem;
}

.journey-return-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey-mid);
  margin-bottom: 0.4rem;
}

.journey-return-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.journey-resume-input {
  flex: 1;
  background: hsla(0, 0%, 100%, 0.04);
  border: 1px solid hsla(0, 0%, 100%, 0.12);
  border-radius: 0.25rem;
  color: var(--grey-light);
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.journey-resume-input:focus {
  border-color: hsla(0, 0%, 100%, 0.3);
}
.journey-resume-input::placeholder {
  color: hsla(0, 0%, 100%, 0.2);
  font-size: 0.7rem;
}

.journey-resume-btn {
  background: none;
  border: 1px solid hsla(0, 0%, 100%, 0.18);
  border-radius: 0.25rem;
  color: var(--grey-mid);
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.journey-resume-btn:hover,
.journey-resume-btn:focus-visible {
  border-color: hsla(0, 0%, 100%, 0.4);
  color: var(--grey-light);
  outline: none;
}

/* ---- Status messages ---- */
.journey-msg {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  margin-top: 0.35rem;
  min-height: 1rem;
  transition: color 0.3s ease;
}
.journey-msg.success { color: hsla(165, 40%, 65%, 0.9); }
.journey-msg.error   { color: hsla(0, 40%, 65%, 0.9); }

/* ---- Track accent tinting on track pages ---- */
body[data-track] .journey-code-display {
  color: var(--track-accent-dim, var(--grey-light));
}
body[data-track] .journey-toggle:hover,
body[data-track] .journey-copy:hover,
body[data-track] .journey-resume-btn:hover {
  color: var(--track-accent, var(--amber));
  border-color: var(--track-accent-dim, var(--amber-dim));
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .journey-content { transition: none; }
  .journey-toggle-icon { transition: none; }
}

/* ---- Small screens ---- */
@media (max-width: 480px) {
  .journey-bar { padding: 0.4rem 0.75rem; gap: 0.45rem; }
  .journey-code-display { max-width: 10rem; font-size: 0.68rem; }
  .journey-tooltip { left: auto; right: 0; }
  .journey-tooltip::after { left: auto; right: 1.2rem; }
}

/* ============================================================
   BOTTOM-OF-TRACK NAVIGATION
   ============================================================ */

.track-nav {
  border-top: 1px solid var(--grey-dark);
  padding: 3rem 0 2rem;
  margin-top: 5rem;
}

.track-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

/* Prev / Next links */
.track-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none;
  border-bottom: none;
  transition: color var(--transition);
  color: var(--grey-mid);
}
.track-nav-link:hover {
  color: var(--grey-light);
  border-bottom: none;
}
.track-nav-prev { align-items: flex-start; text-align: left; }
.track-nav-next { align-items: flex-end;   text-align: right; }
.track-nav-empty { pointer-events: none; }

.track-nav-dir {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey-dark);
  transition: color var(--transition);
}
.track-nav-link:hover .track-nav-dir {
  color: var(--grey-mid);
}

.track-nav-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: inherit;
}

/* Centre wrapper — pipes + companion link inline */
.track-nav-centre {
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.track-nav-pipe {
  color: var(--grey-dark);
  user-select: none;
}

/* Companion link */
.track-nav-companion {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-mid);
  text-decoration: none;
  border-bottom: none;
  transition: color var(--transition);
}
.track-nav-companion:hover {
  color: var(--amber);
  border-bottom: none;
}

/* Track accent tinting */
body[data-track] .track-nav-link:hover {
  color: var(--track-accent, var(--grey-light));
}
body[data-track] .track-nav-companion:hover {
  color: var(--track-accent, var(--amber));
}

/* Small screens */
@media (max-width: 540px) {
  .track-nav-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    text-align: center;
    gap: 1.2rem;
  }
  .track-nav-prev,
  .track-nav-next {
    align-items: center;
  }
  .track-nav-centre {
    justify-self: center;
  }
}


/* ============================================================
   GALLERY PAGE
   ============================================================ */

.gallery-main {
  min-height: 100vh;
  padding-bottom: 6rem;
}

.gallery-header {
  padding: 6rem 0 3rem;
  border-bottom: 1px solid var(--grey-dark);
}

.gallery-intro {
  color: var(--grey-mid);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-top: 1rem;
  max-width: 480px;
}

.gallery-filter-bar {
  border-bottom: 1px solid var(--grey-dark);
  padding: 1.2rem 0;
  position: sticky;
  top: 56px;
  z-index: 50;
  background: rgba(10,10,10,0.96);
  backdrop-filter: blur(8px);
}

.gallery-filter-bar .container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gallery-filter-btn {
  background: none;
  border: 1px solid var(--grey-dark);
  color: var(--grey-mid);
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 2px;
}
.gallery-filter-btn:hover {
  color: var(--amber);
  border-color: var(--amber-dim);
}
.gallery-filter-btn.active {
  color: var(--amber);
  border-color: var(--amber);
  background: rgba(200,146,42,0.08);
}

.gallery-body {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
}

.gallery-section {
  margin-top: 5rem;
}

.gallery-section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--grey-dark);
}

.gallery-track-symbol {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  opacity: 0.75;
  border: 1px solid var(--grey-dark);
}

.gallery-track-symbol img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: invert(1);
}

.gallery-track-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--grey-light);
  text-transform: uppercase;
  font-weight: 500;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid var(--grey-dark);
  background: #111;
  aspect-ratio: 3 / 4;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover {
  border-color: var(--amber-dim);
  transform: translateY(-3px);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease, transform 0.4s ease;
  opacity: 0.88;
}

.gallery-item:hover img {
  opacity: 1;
  transform: scale(1.03);
}

.gallery-item-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1rem 0.9rem;
  background: linear-gradient(to top, rgba(10,10,10,0.92) 0%, transparent 100%);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--grey-light);
  letter-spacing: 0.03em;
  transform: translateY(4px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover .gallery-item-title,
.gallery-item:focus .gallery-item-title {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.96);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.gallery-lightbox.active {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: 680px;
  width: 100%;
  text-align: center;
}

.lightbox-inner img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border: 1px solid var(--grey-dark);
  display: block;
  margin: 0 auto;
}

.lightbox-caption {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--grey-mid);
  font-size: 0.9rem;
  margin-top: 1rem;
  letter-spacing: 0.04em;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--grey-dark);
  color: var(--grey-light);
  font-size: 1.4rem;
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  z-index: 1001;
}

.lightbox-close:hover { border-color: var(--amber-dim); color: var(--white); }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid var(--grey-dark);
  color: var(--grey-light);
  font-size: 1.2rem;
  width: 2.8rem;
  height: 2.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  z-index: 1001;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
.lightbox-prev:hover,
.lightbox-next:hover { border-color: var(--amber-dim); color: var(--white); }

/* Gallery responsive */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .gallery-body { padding: 0 1rem; }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
  .gallery-item-title { opacity: 1; transform: translateY(0); font-size: 0.75rem; }
}

/* ============================================================
   CLICKABLE SYMBOL STICKY + COMPANION MAGE STICKY
   ============================================================ */

/* Track symbol becomes interactive — visual cue */
.track-symbol-sticky.clickable {
  pointer-events: auto;
  cursor: pointer;
}
.track-symbol-sticky.clickable::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: 0 0 0 0 rgba(200, 146, 42, 0);
  animation: symbolPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes symbolPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 146, 42, 0); }
  50%       { box-shadow: 0 0 14px 3px rgba(200, 146, 42, 0.22); }
}

/* Companion page mage sticky symbol */
.companion-symbol-sticky {
  position: fixed;
  bottom: 5rem;
  right: -1rem;
  width: 220px;
  height: 330px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 299;
  border-radius: 8px;
  overflow: hidden;
  animation: symbolReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  -webkit-animation: symbolReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.companion-symbol-sticky img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.companion-symbol-sticky::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: 0 0 0 0 rgba(100, 180, 100, 0);
  animation: companionPulse 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes companionPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(100, 180, 100, 0); }
  50%       { box-shadow: 0 0 18px 4px rgba(100, 180, 100, 0.18); }
}
@media (max-width: 768px) {
  .companion-symbol-sticky {
    width: 160px;
    height: 240px;
    bottom: 4.5rem;
    right: -0.5rem;
  }
}
@media (min-width: 1200px) {
  .companion-symbol-sticky {
    opacity: 0.14;
    filter: grayscale(20%);
    animation: none;
    -webkit-animation: none;
  }
}

/* ============================================================
   SYMBOL CONTEXT MODAL
   Opens when the sticky symbol is tapped/clicked on track pages.
   ============================================================ */
.symbol-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 700;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}
.symbol-modal.active {
  display: flex;
}
.symbol-modal-inner {
  position: relative;
  max-width: 480px;
  width: 100%;
  background: rgba(18, 16, 14, 0.98);
  border: 1px solid var(--grey-dark);
  border-radius: 4px;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
}
.symbol-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--grey-mid);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  line-height: 1;
  transition: color 0.2s;
}
.symbol-modal-close:hover { color: var(--white); }
.symbol-modal-track {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 0.5rem;
}
.symbol-modal-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--white);
  margin-bottom: 0.4rem;
}
.symbol-modal-depth {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--grey-mid);
  margin-bottom: 1.8rem;
  font-style: italic;
}
.symbol-modal-prompt {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--grey-light);
  line-height: 1.7;
  margin-bottom: 2rem;
  font-style: italic;
}
.symbol-modal-btn {
  display: inline-block;
  background: none;
  border: 1px solid var(--grey-dark);
  color: var(--grey-mid);
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.75rem 2rem;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s, border-color 0.3s;
}
.symbol-modal-btn:hover {
  color: var(--amber);
  border-color: var(--amber-dim);
  text-decoration: none;
}
@media (max-width: 480px) {
  .symbol-modal-inner { padding: 2rem 1.4rem 1.6rem; }
  .symbol-modal-title { font-size: 1.3rem; }
}

/* ================================================================
   PRACTICE RE-ENTRY BAR
   Fixed bar below nav, shown on return visits to The Practice.
   ================================================================ */
#practice-reentry-bar {
  position: fixed;
  top: 52px; /* sits just below the site nav */
  left: 0;
  right: 0;
  z-index: 600;
  background: #0a0a0a; /* solid fallback for Safari */
  background: rgba(10, 10, 10, 0.95);
  border-bottom: 1px solid #8a6420;
  text-align: center;
  padding: 0.6rem 1rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#practice-reentry-bar a {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c8922a;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s ease;
}
#practice-reentry-bar a:hover { opacity: 0.7; }

/* ================================================================
   RECYCLE RETURN BANNER
   Injected at top of track pages when arriving via Practice recycle.
   ================================================================ */
#recycle-return-banner {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 600;
  background: #0a0a0a; /* solid fallback for Safari */
  background: rgba(10, 10, 10, 0.95);
  border-bottom: 1px solid #8a6420;
  text-align: center;
  padding: 0.6rem 1rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#recycle-return-banner a {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c8922a;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s ease;
}
#recycle-return-banner a:hover { opacity: 0.7; }

/* Amber pulse on track symbol when arriving via recycle */
.recycle-pulse {
  animation: recyclePulse 2.5s ease-in-out infinite;
}
@keyframes recyclePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180, 130, 60, 0); }
  50%       { box-shadow: 0 0 0 8px rgba(180, 130, 60, 0.25); }
}

/* ================================================================
   PRACTICE GRAPH — INLINE RECYCLE COMPANION REPLY
   ================================================================ */
.pg-recycle-companion {
  margin: 2rem 0 1.5rem;
  border-left: 2px solid #8a6420;
  padding-left: 1.2rem;
}
.pg-recycle-companion-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
}
.pg-recycle-companion-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c8922a;
  animation: pgDotPulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
.pg-recycle-companion-dot:nth-child(2) { animation-delay: 0.2s; }
.pg-recycle-companion-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pgDotPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40%           { opacity: 1;   transform: scale(1); }
}
.pg-recycle-companion-status {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #8a6420;
  font-style: italic;
}
.pg-recycle-companion-reply {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  line-height: 1.75;
  color: #c8c4bc;
}
.pg-recycle-companion-reply p {
  margin: 0 0 1rem;
}
.pg-recycle-companion-reply p:last-child {
  margin-bottom: 0;
}
.pg-recycle-companion-error {
  font-style: italic;
  color: #8a6420;
}
