/* The Current of Consciousness on tsr.wtf. Uses the site's tokens from global.css. */
.cur {
  --np: #e3a2d8;
  --np-2: #bfa5ff;
  --ph: #9cc4ff;
  --ph-2: #79e0c6;
  --seam: #ecd7a4;
  --stopc: #f0b38a;
  --panel: rgba(4, 14, 25, 0.72);
  --hair: rgba(236, 228, 210, 0.14);
  --w: min(1180px, 100% - 2 * var(--gutter, 24px));
  position: relative;
  z-index: 1;
  color: var(--text, #e6e0d4);
  font-family: var(--sans, 'Manrope', system-ui, sans-serif);
  overflow-x: clip;
}
body.cur-page { background: #030d17; }
body.cur-page main { position: relative; }
#mirror-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, #071a2c 0%, #030d17 70%);
}
.cur i { font-family: var(--serif, 'Cormorant Garamond', Georgia, serif); font-style: italic; font-size: 1.14em; line-height: 1; }
.cur a { color: inherit; }
.cur :focus-visible { outline: 2px solid var(--seam); outline-offset: 3px; border-radius: 4px; }

/* ---------- hero ---------- */
.cur-hero {
  min-height: calc(100svh - var(--header-h, 68px));
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(14px, 2.4vh, 26px);
  text-align: center;
  padding: clamp(28px, 6vh, 72px) var(--gutter, 24px) clamp(40px, 8vh, 90px);
}
.hero-book { margin: 0; color: var(--seam); font-size: 0.95rem; letter-spacing: 0.02em; }
.cur-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 5.2vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--ivory, #f2ede3);
  text-wrap: balance;
}
.hero-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(880px, 100%);
  margin: clamp(4px, 2vh, 20px) 0;
}
.hero-row span { display: grid; gap: 2px; }
.hero-row i { font-size: clamp(5rem, 13vw, 10.5rem); line-height: 0.8; font-weight: 500; }
.hero-row small { font-size: clamp(0.8rem, 1.4vw, 1rem); color: var(--mist, #a9b4b8); }
.hero-C { justify-items: end; text-align: right; padding-right: clamp(18px, 5vw, 64px); }
.hero-C i { color: var(--np); text-shadow: 0 0 60px rgba(227, 162, 216, 0.35); }
.hero-c { justify-items: start; text-align: left; padding-left: clamp(18px, 5vw, 64px); }
.hero-c i { color: var(--ph); text-shadow: 0 0 60px rgba(156, 196, 255, 0.35); }
.hero-seam {
  width: 2px;
  height: clamp(120px, 22vh, 220px);
  background: linear-gradient(transparent, var(--seam) 20%, #fff 50%, var(--seam) 80%, transparent);
  box-shadow: 0 0 24px 2px rgba(236, 215, 164, 0.55);
}
.hero-lede { margin: 0; max-width: 40rem; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--ivory); text-wrap: pretty; }
.legend { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin: 6px 0 0; padding: 0; font-size: 0.95rem; }
.legend li { display: inline-flex; align-items: center; gap: 10px; }
.legend .v-line { position: relative; display: inline-block; width: 54px; height: 2px; flex: none; }
.hero-rule { margin: 0; color: var(--mist); font-size: 0.98rem; max-width: 34rem; }
.hero-go {
  margin-top: 6px;
  display: inline-block;
  padding: 13px 26px;
  border: 1px solid var(--seam);
  border-radius: 999px;
  color: var(--seam);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.25s, color 0.25s;
}
.hero-go:hover { background: var(--seam); color: #051320; }

/* verdict lines (legend, stations, ledger) */
.v-line { background: linear-gradient(90deg, var(--np), var(--seam) 50%, var(--ph)); }
.v-inverse .v-line { background: linear-gradient(90deg, var(--np-2), var(--seam) 50%, var(--ph-2)); }
.v-inverse .v-line::after { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border: 2px solid var(--seam); border-radius: 50%; transform: translate(-50%, -50%); background: #051320; }
.v-stop .v-line, .v-stay .v-line { background: linear-gradient(90deg, transparent 50%, var(--ph) 50%); }
.v-stop .v-line::after, .v-stay .v-line::after { content: ''; position: absolute; left: 50%; top: 50%; width: 2px; height: 14px; transform: translate(-50%, -50%); background: var(--stopc); box-shadow: 0 0 10px var(--stopc); }

/* ---------- chapter rail ---------- */
.rail { position: fixed; right: max(10px, calc((100vw - 1320px) / 2)); top: 50%; transform: translateY(-50%); z-index: 5; opacity: 0; transition: opacity 0.4s; }
.cur.walking .rail { opacity: 1; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail a { display: grid; place-items: center; width: 30px; height: 26px; text-decoration: none; color: var(--mist); font-size: 0.72rem; font-variant-numeric: tabular-nums; border-radius: 6px; }
.rail a span { opacity: 0.55; transition: opacity 0.2s, transform 0.2s; }
.rail a:hover span, .rail a.on span { opacity: 1; color: var(--seam); transform: scale(1.25); }
@media (max-width: 1100px) { .rail { display: none; } }

/* ---------- parts ---------- */
.part { width: var(--w); margin: clamp(70px, 14vh, 150px) auto 0; text-align: center; }
.part p { margin: 0 0 6px; color: var(--seam); font-size: 0.95rem; }
.part h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 3rem); color: var(--ivory); }

/* ---------- stations ---------- */
.st { width: var(--w); margin: clamp(60px, 12vh, 130px) auto 0; scroll-margin-top: calc(var(--header-h, 68px) + 12px); }
.st-head { text-align: center; max-width: 46rem; margin: 0 auto clamp(22px, 4vh, 40px); }
.st-n { margin: 0 0 6px; color: var(--mist); font-size: 0.92rem; }
.st h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4.6vw, 3.5rem); line-height: 1.03; color: var(--ivory); text-wrap: balance; }
.st-q { margin: 12px auto 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 1.9vw, 1.45rem); line-height: 1.35; color: var(--seam); text-wrap: balance; }

.st-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(110px, 13vw, 170px) minmax(0, 1fr); align-items: start; }
.side { background: var(--panel); border: 1px solid var(--hair); border-radius: 18px; padding: clamp(18px, 2.4vw, 30px); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.side.np { border-color: rgba(227, 162, 216, 0.22); }
.side.ph { border-color: rgba(156, 196, 255, 0.22); }
.side-name { margin: 0 0 12px; font-size: 0.88rem; font-weight: 600; }
.np .side-name { color: var(--np); }
.ph .side-name { color: var(--ph); }
.say { margin: 0 0 14px; font-size: clamp(1rem, 1.25vw, 1.1rem); line-height: 1.6; max-width: 34rem; }
.np .say { font-family: var(--serif); font-size: clamp(1.22rem, 1.7vw, 1.48rem); line-height: 1.38; color: var(--ivory); }
.np .say i { font-size: 1em; }
.cur sup, .cur sub { font-family: var(--serif); font-size: 0.62em; line-height: 0; }
.ph .say i { font-size: 1.2em; }
.say.none { color: var(--mist); font-style: italic; }
.eq { margin: 0 0 16px; font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2.15rem); line-height: 1.25; color: var(--ph); overflow-wrap: anywhere; }
.eq i { font-size: 1em; }
.inst { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; margin-top: 6px; border-radius: 12px; background: rgba(3, 10, 18, 0.55); }
.read { margin: 10px 0 0; min-height: 2.9em; font-size: 0.95rem; line-height: 1.45; color: var(--ivory); font-variant-numeric: tabular-nums; }
.read b { color: var(--ph); font-weight: 600; }
.ctl { display: grid; gap: 8px; margin-top: 10px; }
.ctl-label { font-size: 0.9rem; color: var(--mist); }
.ctl input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
.ctl input[type='range']::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, rgba(156, 196, 255, 0.25), var(--ph)); }
.ctl input[type='range']::-moz-range-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, rgba(156, 196, 255, 0.25), var(--ph)); }
.ctl input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px; border-radius: 50%; background: #051320; border: 2px solid var(--ph); box-shadow: 0 0 14px rgba(156, 196, 255, 0.6); }
.ctl input[type='range']::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #051320; border: 2px solid var(--ph); box-shadow: 0 0 14px rgba(156, 196, 255, 0.6); }

/* the middle: what happens at the mirror */
.mid { display: grid; justify-items: center; padding-top: clamp(90px, 16vh, 150px); }
.verdict { display: grid; justify-items: center; gap: 12px; width: 100%; }
.verdict .v-line { position: relative; display: block; width: 100%; height: 2px; transform: scaleX(0); transform-origin: right center; transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s; }
.st.in .verdict .v-line { transform: scaleX(1); }
.v-text { margin: 0; display: grid; gap: 4px; text-align: center; padding: 8px 12px; border-radius: 12px; background: rgba(3, 13, 23, 0.82); opacity: 0; transform: translateY(6px); transition: opacity 0.6s 0.9s, transform 0.6s 0.9s; }
.st.in .v-text { opacity: 1; transform: none; }
.v-word { font-family: var(--serif); font-size: clamp(1.1rem, 1.5vw, 1.35rem); line-height: 1.1; color: var(--seam); }
.s-stop .v-word { color: var(--stopc); }
.v-note { font-size: 0.8rem; line-height: 1.35; color: var(--mist); max-width: 13em; }

/* what crosses arrives after the line does */
.st .side.np > * { opacity: 0; transform: translateX(14px); transition: opacity 0.8s 1s, transform 0.8s 1s; }
.st.in .side.np > * { opacity: 1; transform: none; }
.st .side.np.empty { border-style: dashed; }

.after { margin: clamp(22px, 4vh, 40px) auto 0; max-width: 44rem; text-align: center; font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.8rem); line-height: 1.36; color: var(--ivory); text-wrap: pretty; }
.after i { font-size: 1em; }
.after cite { display: block; margin-top: 8px; font-family: var(--sans); font-style: normal; font-size: 0.9rem; color: var(--mist); }

/* chapter 7: the pair that does cross */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) clamp(110px, 13vw, 170px) minmax(0, 1fr); align-items: center; margin-top: 18px; }
.pair > div { text-align: center; }
.pair-eq { margin: 0; font-family: var(--serif); font-size: clamp(1.3rem, 2.3vw, 1.9rem); line-height: 1.2; }
.pair-np .pair-eq { color: var(--np); }
.pair-ph .pair-eq { color: var(--ph); }
.pair-ph .pair-eq i { font-size: 1em; }
.pair-note { margin: 4px 0 0; font-size: 0.9rem; color: var(--mist); }
.pair-mid { border-top: 2px solid; border-image: linear-gradient(90deg, var(--np), var(--seam), var(--ph)) 1; padding-top: 8px; }

/* chapter 3: the Equation of the Present */
.present { margin: clamp(26px, 5vh, 48px) auto 0; text-align: center; }
.present-eq { display: flex; justify-content: center; align-items: baseline; flex-wrap: nowrap; gap: clamp(2px, 1vw, 14px); }
.pt { all: unset; cursor: pointer; font-family: var(--serif); font-size: clamp(2rem, 7.4vw, 5.6rem); line-height: 1; padding: 6px clamp(2px, 0.8vw, 10px); border-radius: 12px; transition: background 0.2s, text-shadow 0.2s; }
.pt i { font-size: 1em; }
.pt sup { font-size: 0.45em; }
.pt.op { font-size: clamp(1.4rem, 4.6vw, 3.4rem); opacity: 0.85; }
.np-t { color: var(--np); }
.ph-t { color: var(--ph); }
.e-t { color: var(--seam); text-shadow: 0 0 40px rgba(236, 215, 164, 0.55); }
.pt:hover, .pt.on { background: rgba(236, 228, 210, 0.08); text-shadow: 0 0 30px currentColor; }
.present-cap { display: grid; gap: 6px; margin: 14px auto 0; max-width: 38rem; min-height: 5.2em; }
.present-name { color: var(--seam); font-weight: 600; font-size: 0.95rem; }
.present-say { font-size: 1.02rem; line-height: 1.5; color: var(--ivory); }

/* chapter 5: the Four Directions */
.four { margin: clamp(20px, 4vh, 40px) auto 0; max-width: 760px; }
.four svg { width: 100%; height: auto; overflow: visible; }
.four path { fill: none; stroke-linecap: round; }
.f-strong { stroke: url(#g-strong); stroke-width: 5; }
.f-weak { stroke: url(#g-weak); stroke-width: 1.6; }
.f-e { fill: #051320; stroke: var(--seam); stroke-width: 2; }
.f-el { fill: var(--seam); font-family: var(--serif); font-style: italic; font-size: 22px; }
.f-h { font-family: var(--serif); font-size: 26px; }
.f-s { font-family: var(--sans); font-size: 14px; fill: var(--ivory); }
.f-x { font-family: var(--sans); font-size: 12px; fill: var(--mist); }
.f-np .f-h { fill: var(--np); }
.f-ph .f-h { fill: var(--ph); }

/* ---------- chapter 12 ---------- */
.plain { max-width: 52rem; }
.plain-rule, .plain-row { margin: 0 auto 18px; font-size: clamp(1.02rem, 1.3vw, 1.12rem); line-height: 1.65; }
.plain-row { font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.34; color: var(--ivory); text-align: center; margin: 26px auto; }
.plain-row i { font-size: 1em; }
.spine { background: var(--panel); border: 1px solid var(--hair); border-radius: 18px; padding: clamp(18px, 3vw, 34px); margin: 30px 0; }
.spine-eq { margin: 0 0 18px; text-align: center; font-family: var(--serif); font-size: clamp(1.7rem, 5vw, 3.2rem); color: var(--seam); white-space: nowrap; }
.spine-eq i { font-size: 1em; }
.marks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.marks li { display: grid; grid-template-columns: minmax(9.5em, auto) 1fr; gap: 14px; font-size: 0.98rem; line-height: 1.5; }
.marks b { color: var(--seam); font-weight: 600; }
.plain h4 { margin: 34px 0 12px; font-family: var(--serif); font-weight: 500; font-size: 1.7rem; color: var(--ivory); }
.open { margin: 0; padding-left: 1.3em; display: grid; gap: 12px; font-size: 1rem; line-height: 1.6; }
.open b { color: var(--ivory); font-weight: 600; }
.open i { font-size: 1.05em; }
.plain-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 24px 0 0; }
.cur .btn { display: inline-block; padding: 12px 22px; border-radius: 999px; background: var(--seam); color: #051320; font-weight: 600; text-decoration: none; border: 1px solid var(--seam); }
.cur .btn.ghost { background: transparent; color: var(--seam); }
.cur .btn:hover { filter: brightness(1.08); }

/* ---------- the record ---------- */
.ledger { width: var(--w); margin: clamp(90px, 16vh, 170px) auto 0; scroll-margin-top: calc(var(--header-h, 68px) + 12px); }
.ledger h2, .cur-book h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4.4vw, 3.2rem); color: var(--ivory); }
.ledger-lede { margin: 12px 0 20px; max-width: 44rem; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--hair); font-size: 0.9rem; color: var(--mist); }
.chip span { opacity: 0.7; margin-left: 4px; }
.chip.on { border-color: var(--seam); color: var(--seam); }
.rows { display: grid; gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: 16px; overflow: hidden; }
.row { display: grid; grid-template-columns: 7.2em minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 18px; padding: 16px 18px; background: rgba(4, 14, 25, 0.86); font-size: 0.95rem; line-height: 1.5; }
.row[hidden] { display: none; }
.row p { margin: 0; }
.row-ch { color: var(--mist); }
.row-eq { font-family: var(--serif); font-size: 1.16rem; color: var(--ph); overflow-wrap: anywhere; }
.row-eq i { font-size: 1em; }
.row-at { color: var(--ivory); }
.row-at .v-line { position: relative; display: block; width: 54px; height: 2px; margin: 9px 0 10px; }

/* ---------- the book ---------- */
.cur-book { width: var(--w); margin: clamp(90px, 16vh, 170px) auto clamp(70px, 12vh, 130px); display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.cur-book img { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(236, 228, 210, 0.12); }
.book-sub { margin: 8px 0 18px; font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--seam); }
.cur-book p { line-height: 1.65; max-width: 38rem; }
.book-by { color: var(--mist); }
.cur-book .plain-links { justify-content: flex-start; }

/* ---------- narrow screens: the physics comes first, then the mirror, then what crossed ---------- */
@media (max-width: 860px) {
  .inst { aspect-ratio: 4 / 3; }
  .st-grid, .pair { grid-template-columns: minmax(0, 1fr); }
  .side.ph { order: 1; }
  .mid { order: 2; padding: 18px 0; }
  .side.np { order: 3; }
  .verdict { grid-template-columns: 2px 1fr; justify-items: start; align-items: center; gap: 14px; padding-left: 22px; }
  .verdict .v-line { width: 2px; height: 64px; transform: scaleY(0); transform-origin: top center; background: linear-gradient(180deg, var(--ph), var(--seam) 50%, var(--np)); }
  .v-inverse .verdict .v-line, .s-inverse .verdict .v-line { background: linear-gradient(180deg, var(--ph-2), var(--seam) 50%, var(--np-2)); }
  .s-stop .verdict .v-line { background: linear-gradient(180deg, var(--ph) 50%, transparent 50%); }
  .s-stop .verdict .v-line::after { width: 14px; height: 2px; }
  .st.in .verdict .v-line { transform: scaleY(1); }
  .v-text { text-align: left; justify-items: start; }
  .v-note { max-width: none; }
  .st .side.np > * { transform: translateY(10px); }
  .pair-ph { order: 1; } .pair-mid { order: 2; margin: 10px auto; width: 120px; } .pair-np { order: 3; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .cur-book { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .cur-book img { max-width: 240px; }
  .cur-book .plain-links { justify-content: center; }
  .marks li { grid-template-columns: 1fr; gap: 2px; }
  .hero-row i { font-size: clamp(5rem, 26vw, 9rem); }
}

@media (prefers-reduced-motion: reduce) {
  .verdict .v-line, .v-text, .st .side.np > * { transition: none; transform: none; opacity: 1; }
}

/* the site's footer sits above the mirror */
body.cur-page footer { position: relative; z-index: 2; background: var(--deeper, #030d17); }

/* 3D scenes: drag sideways to turn them */
.cur.is-3d .inst { cursor: grab; touch-action: pan-y; }
.cur.is-3d .inst.turning { cursor: grabbing; }
