/* PERCEPTION R2 — Mercurial Conservatory alignment + Jeanette Andrews teaching layer.
   Replaces the former warm/brown pass with the cool Hg instrument palette while
   retaining restrained gold as a secondary research-lineage accent. */
:root{
  --ph-void:#050607;
  --ph-void2:#080b0d;
  --ph-panel:#0b0f12;
  --ph-panel2:#10161a;
  --ph-silver:#dde5e6;
  --ph-ivory:#eef1ed;
  --ph-muted:#9aa6aa;
  --ph-faint:#6d7b80;
  --ph-cyan:#8bd9e3;
  --ph-cyan2:#b6eef3;
  --ph-gold:#c6a262;
  --ph-line:rgba(221,229,230,.15);
  --ph-cyan-line:rgba(139,217,227,.38);
  --ph-gold-line:rgba(198,162,98,.28);
}

/* ---------- Threshold / landing ---------- */
body.campus-shell.hg-mode-system{
  background:
    radial-gradient(72rem 42rem at 78% 3%,rgba(76,160,175,.11),transparent 58%),
    radial-gradient(54rem 36rem at 8% 23%,rgba(198,162,98,.045),transparent 64%),
    linear-gradient(180deg,var(--ph-void),#080b0d 48%,var(--ph-void))!important;
  color:var(--ph-silver)!important;
}
body.campus-shell.hg-mode-system::before{
  content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.18;
  background:repeating-linear-gradient(0deg,transparent 0 43px,rgba(255,255,255,.013) 44px,transparent 45px),linear-gradient(90deg,transparent 49.96%,rgba(255,255,255,.018) 50%,transparent 50.04%);
}
body.campus-shell .threshold{--cyan:var(--ph-cyan);--gold:var(--ph-gold);--line:var(--ph-line)}
body.campus-shell .copy h1{color:var(--ph-silver);text-wrap:balance}
body.campus-shell .copy>p{font-size:17px!important;color:#c2cdd0!important;max-width:720px;line-height:1.72!important}
body.campus-shell .copy>p strong{color:var(--ph-cyan2);font-weight:700}
body.campus-shell .eyebrow,body.campus-shell .illusion-aperture .micro{font-size:12px!important;color:var(--ph-gold)!important;letter-spacing:.18em!important}
body.campus-shell .instrument{
  background:linear-gradient(165deg,rgba(14,20,23,.97),rgba(5,7,8,.98))!important;
  border-color:var(--ph-line)!important;box-shadow:0 30px 90px rgba(0,0,0,.42),inset 0 0 0 1px rgba(139,217,227,.025)!important;
}
body.campus-shell .instrument:before{background:linear-gradient(115deg,transparent 0 46%,rgba(139,217,227,.07) 46.2% 46.45%,transparent 46.7%)!important}
body.campus-shell .instrument .node{background:linear-gradient(170deg,#0d1215,#080b0d)!important;border-color:var(--ph-line)!important}
body.campus-shell .instrument .node b{color:var(--ph-silver)!important}
body.campus-shell .instrument .node small{font-size:14px!important;color:var(--ph-muted)!important;line-height:1.5}
body.campus-shell .instrument .join{background:linear-gradient(var(--ph-cyan),rgba(139,217,227,.12),var(--ph-gold))!important}
body.campus-shell .instrument .culmination{border-color:var(--ph-gold-line)!important}
body.campus-shell .instrument .note{color:#7e8b8f!important}
body.campus-shell .illusion-aperture{
  background:radial-gradient(circle at 90% 8%,rgba(139,217,227,.07),transparent 32%),linear-gradient(150deg,rgba(13,19,22,.96),rgba(6,8,9,.96))!important;
  border-color:var(--ph-line)!important;padding:22px!important;
}
body.campus-shell .illusion-aperture:before{background:linear-gradient(var(--ph-gold),var(--ph-cyan))!important}
body.campus-shell .illusion-aperture h2{color:var(--ph-ivory)!important}
body.campus-shell .illusion-aperture>p{font-size:15px!important;color:#bcc7ca!important;line-height:1.7!important}
body.campus-shell .illusion-prompts{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important;margin-top:18px!important}
body.campus-shell .illusion-prompts div{border-top-color:var(--ph-line)!important;min-width:0}
body.campus-shell .illusion-prompts b{font-size:11px!important;color:var(--ph-cyan2)!important;letter-spacing:.14em!important}
body.campus-shell .illusion-prompts span{font-size:13px!important;color:var(--ph-muted)!important;line-height:1.55!important}
body.campus-shell .illusion-sources{gap:10px!important;margin-top:18px!important}
body.campus-shell .illusion-sources a{display:inline-flex;align-items:center;min-height:42px;padding:8px 11px;border:1px solid var(--ph-line)!important;color:#cae8eb!important;font-size:12px!important;line-height:1.35!important;text-decoration:none!important;background:#090d0f!important}
body.campus-shell .illusion-sources a:hover,body.campus-shell .illusion-sources a:focus-visible{color:#fff!important;border-color:var(--ph-cyan-line)!important;outline:2px solid rgba(139,217,227,.6)!important;outline-offset:2px!important;background:#0d1518!important}
body.campus-shell .illusion-boundary{color:#738186!important}
body.campus-shell .actions a{font-size:12px!important;min-height:46px!important;border-color:var(--ph-cyan-line)!important;background:#071014!important;color:#d8f6fa!important}
body.campus-shell .actions a.secondary{color:#aeb8ba!important;border-color:var(--ph-line)!important;background:#090b0c!important}

/* ---------- Integrated operating shell ---------- */
body.hg-mode-instruction{
  --bg:var(--ph-void);--panel:var(--ph-panel);--panel2:var(--ph-panel2);--ink:var(--ph-silver);--muted:var(--ph-muted);
  --line:#27343a;--line2:#43565d;--blue:var(--ph-cyan);--silver:var(--ph-silver);--amber:var(--ph-gold);--r:6px;
  background:
    radial-gradient(78rem 42rem at 76% -8%,rgba(76,160,175,.115),transparent 60%),
    radial-gradient(55rem 38rem at 10% 18%,rgba(198,162,98,.04),transparent 64%),
    linear-gradient(180deg,var(--ph-void),#080b0d 48%,var(--ph-void))!important;
  color:var(--ph-silver)!important;
}
body.hg-mode-instruction::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.17;background:repeating-linear-gradient(0deg,transparent 0 43px,rgba(255,255,255,.013) 44px,transparent 45px),linear-gradient(90deg,transparent 49.96%,rgba(255,255,255,.018) 50%,transparent 50.04%)}
body.hg-mode-instruction .shell{max-width:1480px}
body.hg-mode-instruction .top{border-bottom-color:var(--ph-line)!important;padding-bottom:14px!important}
body.hg-mode-instruction .brand{font-size:12px!important;color:#d8e3e5!important;letter-spacing:.15em!important}
body.hg-mode-instruction .control{gap:7px!important}
body.hg-mode-instruction .pill,body.hg-mode-instruction .mode{font-size:12px!important;border-color:var(--ph-line)!important;background:#090d0f!important;color:#9ca9ad!important;border-radius:3px!important;min-height:42px!important}
body.hg-mode-instruction .pill{display:inline-flex;align-items:center}
body.hg-mode-instruction .mode.active{background:var(--ph-silver)!important;color:#071014!important;border-color:var(--ph-silver)!important}
body.hg-mode-instruction .hero{padding-top:42px!important;gap:clamp(24px,4vw,58px)!important}
body.hg-mode-instruction .hero h1{font-family:Georgia,"Times New Roman",serif;font-weight:400!important;letter-spacing:-.05em!important}
body.hg-mode-instruction h1 span{color:var(--ph-cyan)!important;font-weight:400!important}
body.hg-mode-instruction .lede{color:#c8d2d5!important;line-height:1.68!important}
body.hg-mode-instruction .law{border-left-color:var(--ph-gold)!important;background:linear-gradient(90deg,rgba(198,162,98,.055),transparent 72%);padding-left:16px!important;color:#e1e6e6!important}
body.hg-mode-instruction .hero-card,body.hg-mode-instruction .card,body.hg-mode-instruction .record,body.hg-mode-instruction .integration,body.hg-mode-instruction .revelation,body.hg-mode-instruction .node,body.hg-mode-instruction .metric{
  background:linear-gradient(165deg,rgba(14,20,23,.96),rgba(6,9,10,.97))!important;
  border-color:var(--ph-line)!important;border-radius:6px!important;
}
body.hg-mode-instruction .hero-card{box-shadow:0 28px 85px rgba(0,0,0,.36)!important}
body.hg-mode-instruction .spine{gap:1px!important;background:var(--ph-line)!important}
body.hg-mode-instruction .spine>div{border:0!important;border-radius:0!important;background:#080c0e!important;min-height:132px}
body.hg-mode-instruction .spine strong,body.hg-mode-instruction .kicker{color:var(--ph-cyan2)!important}
body.hg-mode-instruction .spine span{color:#a9b5b8!important}
body.hg-mode-instruction .route{border-color:var(--ph-line)!important;background:rgba(6,9,10,.9)!important;border-radius:6px!important;padding:7px!important;box-shadow:0 12px 35px rgba(0,0,0,.22)!important}
body.hg-mode-instruction .route button{font-size:12px!important;min-height:40px!important;border-color:transparent!important;background:transparent!important;color:#9ca8ac!important;border-radius:3px!important;padding:8px 12px!important}
body.hg-mode-instruction .route button:hover{background:#0c1316!important;color:#d6e5e7!important;border-color:var(--ph-line)!important}
body.hg-mode-instruction .route button.active{background:var(--ph-silver)!important;color:#071014!important;border-color:var(--ph-silver)!important}
body.hg-mode-instruction .route .status{font-size:12px!important;color:#89979b!important;letter-spacing:.02em}
body.hg-mode-instruction .module-head p{color:#9ca9ad!important}
body.hg-mode-instruction .frame-wrap{border-color:var(--ph-line)!important;background:#070a0c!important;border-radius:6px!important;box-shadow:0 26px 82px rgba(0,0,0,.26)!important}
body.hg-mode-instruction .label,body.hg-mode-instruction .note{font-size:12px!important;color:#8f9ca0!important}
body.hg-mode-instruction .btn{font-size:13px!important;min-height:44px!important;border-color:var(--ph-line)!important;background:#0a0f11!important;color:#dce5e6!important;border-radius:3px!important}
body.hg-mode-instruction .btn.primary{background:var(--ph-silver)!important;color:#071014!important;border-color:var(--ph-silver)!important}
body.hg-mode-instruction .dot.live{background:var(--ph-cyan)!important;box-shadow:0 0 16px rgba(139,217,227,.28)!important}
body.hg-mode-instruction .reveal-node.live{border-color:var(--ph-cyan-line)!important;box-shadow:0 0 26px rgba(139,217,227,.07)!important}
body.hg-mode-instruction .reveal-node b{color:var(--ph-gold)!important}
body.hg-mode-instruction .arrow,body.hg-mode-instruction .reveal-arrow{background:#405158!important}
body.hg-mode-instruction .mode-feedback{flex-basis:100%;text-align:right;font:700 11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.1em;color:var(--ph-cyan)}

/* First-visit orientation */
.route-start{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px;align-items:center;margin:0 0 14px;padding:14px 16px;border:1px solid var(--ph-line);background:linear-gradient(90deg,rgba(139,217,227,.055),rgba(7,10,11,.88) 38%,rgba(198,162,98,.028));border-radius:6px}
.route-start .route-index{font:700 10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.16em;color:var(--ph-gold);text-transform:uppercase;white-space:nowrap}
.route-start strong{display:block;color:#e5eded;font:400 1.08rem/1.35 Georgia,"Times New Roman",serif}.route-start span{display:block;margin-top:3px;color:#8f9ca0;font-size:.82rem;line-height:1.5}

/* Jeanette Andrews teaching view */
.andrews-view{position:relative;overflow:hidden;border:1px solid var(--ph-line);background:radial-gradient(circle at 88% 6%,rgba(139,217,227,.08),transparent 24rem),linear-gradient(165deg,#0b1012,#060809 76%);padding:clamp(20px,3.4vw,42px);border-radius:6px;box-shadow:0 28px 90px rgba(0,0,0,.28)}
.andrews-view::before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(112deg,transparent 0 61%,rgba(139,217,227,.045) 61.1% 61.3%,transparent 61.4%)}
.andrews-head{position:relative;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(300px,.95fr);gap:clamp(24px,5vw,70px);align-items:end;padding-bottom:22px;border-bottom:1px solid var(--ph-line)}
.andrews-head h2{font:400 clamp(2.2rem,5vw,5rem)/.94 Georgia,"Times New Roman",serif;letter-spacing:-.045em;margin:.3rem 0 .7rem;color:var(--ph-silver)}
.andrews-head p{margin:0;color:#aebabc;line-height:1.65;max-width:70ch}
.andrews-thesis{border-left:2px solid var(--ph-gold);padding:2px 0 2px 16px;color:#dbe5e6;font:italic 400 1.03rem/1.6 Georgia,"Times New Roman",serif}
.andrews-rail{position:relative;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;margin-top:22px;background:var(--ph-line);border:1px solid var(--ph-line)}
.andrews-card{background:#080c0e;padding:18px;min-height:215px;display:flex;flex-direction:column}
.andrews-card .num{font:700 10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.15em;color:var(--ph-gold)}
.andrews-card h3{font:400 1.45rem/1.06 Georgia,"Times New Roman",serif;margin:.8rem 0 .55rem;color:#e4ebec}
.andrews-card p{margin:0;color:#98a5a9;line-height:1.58;font-size:.88rem}.andrews-card b{display:block;margin-top:auto;padding-top:16px;color:var(--ph-cyan2);font:700 10px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.09em;text-transform:uppercase}
.andrews-application{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,.62fr);gap:18px;margin-top:18px}
.andrews-map,.andrews-caution{border:1px solid var(--ph-line);background:#080c0e;padding:18px;border-radius:4px}
.andrews-map h3,.andrews-caution h3{font:400 1.3rem Georgia,"Times New Roman",serif;margin:.15rem 0 .7rem}.andrews-map p,.andrews-caution p{color:#99a6a9;line-height:1.62;margin:.4rem 0}
.andrews-map .map-steps{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.andrews-map .map-steps span{border:1px solid var(--ph-line);padding:7px 9px;font:700 10px/1 ui-monospace,monospace;letter-spacing:.08em;color:#bfdae0;text-transform:uppercase;background:#0a0f11}
.andrews-caution{border-color:var(--ph-gold-line);background:linear-gradient(145deg,rgba(198,162,98,.045),#080b0d 44%)}
.andrews-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}
.andrews-source-note{margin-top:16px;color:#6f7d81;font-size:.76rem;line-height:1.55}.andrews-source-note a{color:#aacfd4;text-decoration:none;border-bottom:1px solid rgba(139,217,227,.28)}

/* Embedded module context panels */
.andrews-context{border:1px solid rgba(139,217,227,.24);background:linear-gradient(110deg,rgba(139,217,227,.055),rgba(7,11,13,.76));padding:15px 16px;margin:12px 0 16px;border-radius:5px}
.andrews-context strong{display:block;color:#e1ebec;margin:.4rem 0;font-family:Georgia,"Times New Roman",serif;font-weight:400;font-size:1.12rem}.andrews-context p{margin:.35rem 0 0!important;color:#99a8ac!important;font-size:.88rem!important;line-height:1.6!important}.andrews-context .micro{color:#b8e8ee!important}
.notice-question{font:400 clamp(1.45rem,2.6vw,2rem)/1.08 Georgia,"Times New Roman",serif!important;color:#e3eaeb!important;margin:.35rem 0 .65rem!important}

body.hg-mode-instruction .mw-wrapper-return,body.hg-mode-instruction .hgat-campus-return{border-color:var(--ph-line)!important;background:rgba(5,8,9,.94)!important}
body.hg-mode-instruction .hgat-campus-return a{font-size:11px!important;color:#cfdee0!important;border-color:var(--ph-line)!important}
body.hg-mode-instruction .hgat-campus-return span{font-size:10px!important;color:var(--ph-gold)!important}

@media(max-width:980px){body.campus-shell .illusion-prompts{grid-template-columns:1fr 1fr!important}.andrews-rail{grid-template-columns:1fr 1fr}.andrews-head,.andrews-application{grid-template-columns:1fr}}
@media(max-width:700px){.route-start{grid-template-columns:1fr}.route-start .btn{width:100%}.andrews-rail{grid-template-columns:1fr}.andrews-card{min-height:0}.andrews-actions .btn{flex:1 1 180px}.andrews-head h2{font-size:clamp(2.2rem,12vw,3.8rem)}}
@media(max-width:640px){body.hg-mode-instruction .mode-feedback{text-align:left}.illusion-sources a{width:100%}body.campus-shell .illusion-prompts{grid-template-columns:1fr!important}body.hg-mode-instruction .mw-wrapper-return{position:static!important;display:flex!important;width:calc(100% - 24px)!important;margin:18px 12px 8px!important;min-height:44px!important;justify-content:center!important;box-shadow:none!important}body.hg-mode-instruction .hgat-campus-return{position:static!important;width:calc(100% - 24px)!important;margin:0 12px 18px!important;justify-content:center!important;box-shadow:none!important}body.hg-mode-instruction .hgat-campus-return span{display:none!important}body.hg-mode-instruction .hgat-campus-return a{flex:1 1 0;text-align:center;min-height:42px;display:grid;place-items:center}}
@media(prefers-reduced-motion:reduce){body.campus-shell::before,body.hg-mode-instruction::before{display:none}}


/* R29 refinement — Andrews Lens as a perceptual mirror chamber, not a carnival skin. */
.andrews-view::after{content:"";position:absolute;inset:-12% -5%;pointer-events:none;opacity:.42;background:linear-gradient(74deg,transparent 0 18%,rgba(176,236,244,.035) 18.2% 18.55%,transparent 18.8% 47%,rgba(198,162,98,.028) 47.2% 47.5%,transparent 47.8% 72%,rgba(176,236,244,.026) 72.2% 72.5%,transparent 72.8%),radial-gradient(ellipse at 17% 40%,rgba(139,217,227,.055),transparent 18%),radial-gradient(ellipse at 82% 67%,rgba(198,162,98,.04),transparent 19%);transform:skewX(-5deg) scale(1.08);mix-blend-mode:screen}
.andrews-head,.andrews-rail,.andrews-application,.andrews-actions,.andrews-source-note{position:relative;z-index:1}
.andrews-card{position:relative;overflow:hidden;transition:transform .28s ease,border-color .28s ease,box-shadow .28s ease,background .28s ease}
.andrews-card::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(112deg,transparent 0 44%,rgba(222,248,250,.035) 44.2% 44.7%,transparent 45% 100%);transform:translateX(-18%)}
.andrews-thesis{position:relative;box-shadow:-14px 0 34px rgba(139,217,227,.025)}
.funhouse-entry{box-shadow:0 0 0 1px rgba(139,217,227,.10) inset,0 8px 28px rgba(139,217,227,.06)}
.dynamic-observation-entry{border-color:rgba(139,217,227,.32);background:linear-gradient(90deg,rgba(139,217,227,.085),rgba(7,10,11,.9) 44%,rgba(198,162,98,.035))}
@media(min-width:981px) and (prefers-reduced-motion:no-preference){
  .andrews-card:nth-child(1){transform:perspective(1100px) rotateY(1.1deg) translateY(3px)}
  .andrews-card:nth-child(2){transform:perspective(1100px) rotateY(-1.2deg) translateY(-2px)}
  .andrews-card:nth-child(3){transform:perspective(1100px) rotateY(1.35deg) translateY(2px)}
  .andrews-card:nth-child(4){transform:perspective(1100px) rotateY(-1deg) translateY(-3px)}
  .andrews-card:hover,.andrews-card:focus-within{z-index:2;transform:perspective(1100px) rotateY(0) translateY(-4px) scale(1.012);background:#0a0f11;box-shadow:0 22px 55px rgba(0,0,0,.32),0 0 32px rgba(139,217,227,.055)}
  .andrews-thesis{transform:skewY(-.35deg)}
}
@media(prefers-reduced-motion:reduce){.andrews-view::after{transform:none;opacity:.24}.andrews-card{transform:none!important}}

/* R29 editorial refinement — epistemic type hierarchy.
   Serif carries interpretation; sans carries apparatus; mono carries state. */
body.hg-mode-instruction{
  --ph-serif:Georgia,"Times New Roman",serif;
  --ph-sans:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --ph-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
body.hg-mode-instruction h1,
body.hg-mode-instruction h2,
body.hg-mode-instruction h3{font-family:var(--ph-serif)!important;font-weight:400!important}
body.hg-mode-instruction .lede,
body.hg-mode-instruction .law,
body.hg-mode-instruction .module-head>p,
body.hg-mode-instruction .overview-grid .card>p,
body.hg-mode-instruction .integration>p,
body.hg-mode-instruction .revelation>p,
body.hg-mode-instruction .andrews-map>p,
body.hg-mode-instruction .andrews-caution>p{font-family:var(--ph-serif)!important}
body.hg-mode-instruction .lede{font-size:clamp(1.08rem,1.65vw,1.28rem)!important;line-height:1.62!important;max-width:72ch}
body.hg-mode-instruction .law{font-size:1rem!important;line-height:1.6!important}
body.hg-mode-instruction .kicker,
body.hg-mode-instruction .label,
body.hg-mode-instruction .statusline,
body.hg-mode-instruction .route,
body.hg-mode-instruction .mode,
body.hg-mode-instruction .pill,
body.hg-mode-instruction .spine,
body.hg-mode-instruction .metric{font-family:var(--ph-sans)!important}
body.hg-mode-instruction .route-index,
body.hg-mode-instruction .mode-feedback,
body.hg-mode-instruction .reveal-node b,
body.hg-mode-instruction .reveal-ledger b,
body.hg-mode-instruction .metric span{font-family:var(--ph-mono)!important}
