/* Shared visual language with the portfolio; simulation colours remain semantic. */
:root {
  color-scheme: dark;
  --bg: #090f10; --panel: #152020; --border: #455048;
  --text: #eee9d9; --text-body: #c0c8c1; --text-dim: #a7b1aa;
  --cyan: #92decb; --purple: #c3b0ef; --coral: #f2ba6b;
  --gold: #e6c574; --display: Georgia, 'Times New Roman', serif;
}
html { scroll-behavior: smooth; scrollbar-color: #bda565 #151d1b; }
body { background: radial-gradient(ellipse at 14% 10%, #68512c21, transparent 48%), radial-gradient(ellipse at 90% 50%, #3364531a, transparent 52%), var(--bg); }
button, select, input { font: inherit; }
select, select option { color: #eee9d9; background-color: #182322; }
button, a, summary, select { -webkit-tap-highlight-color: transparent; }
.hub-page { padding: 46px clamp(20px, 4.8vw, 90px) 70px; }
#hub-header { display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; width: 100%; max-width: 1400px; gap: 6%; margin: 22px auto 42px; }
.atelier-eyebrow { color: var(--gold); text-transform: uppercase; font: 600 11px/1.6 var(--sans); letter-spacing: .17em; }
#hub-header h1 { font: 500 clamp(38px, 4.7vw, 72px)/1.08 var(--display); color: #f0e6c7; letter-spacing: -.03em; margin: 22px 0; }
#hub-header h1 em { color: var(--gold); font-weight: 400; text-shadow: 0 0 30px #ddb44726; }
#hub-header .tagline { color: #d2d7ca; font-size: clamp(16px, 1.4vw, 21px); line-height: 1.55; max-width: 44ch; }
.hub-thesis { font-size: 15px; line-height: 1.75; max-width: 59ch; }
.hero-instrument { max-width: 440px; width: 100%; justify-self: center; }
.hero-instrument svg { display: block; width: 100%; }
.instrument-orbit { transform-origin: 210px 210px; animation: instrument-orbit 28s linear infinite; }
@keyframes instrument-orbit { to { transform: rotate(360deg); } }
.hub-start { color: #f4daa0; background: linear-gradient(120deg, #c39e4630, #132322); border-color: #c4a962; box-shadow: inset 0 1px #fff0bf21, 0 0 24px #c7a34813; border-radius: 12px; padding: 13px 20px; }
.hub-start:hover { background: #b79d4930; border-color: #ffe3a1; box-shadow: 0 0 24px #e9c96b26; }
#hub-grid { max-width: 1400px; display: flex; flex-direction: column; gap: 36px; }
.path-strip { background: #15211dbb; border-color: #be9c454a; border-radius: 16px; padding: 14px; gap: 8px; }
.path-step { padding: 9px 12px; border-radius: 9px; border-color: #8b805349; font-size: 12px; background: #0c1413; }
.path-num { background: #ddc78c; color: #17201b; width: 22px; height: 22px; }
.path-arrow { opacity: .5; }
.path-label { flex-basis: 100%; margin-bottom: 3px; }
.sim-section { display: block; scroll-margin-top: 28px; }
.sim-section-header { margin: 0 0 23px; padding: 0 0 0 18px; border-color: var(--section-accent, var(--gold)); }
.sim-section-header h2 { color: #eae1c4; font: 500 clamp(24px, 2.2vw, 34px)/1.25 var(--display); margin: 0 0 13px; }
.sim-section-header p { color: var(--text-body); font-size: 15px; max-width: 100ch; line-height: 1.8; }
.sim-section-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
#sec-6 .sim-section-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.sim-card { min-width: 0; border-radius: 20px; border-color: #8c80504d; background: linear-gradient(145deg, #22322c99, #171a15c9 60%, #111918); box-shadow: inset 0 1px #eee7ba18, 0 14px 30px #0003; animation: none; }
.sim-card.is-new, .sim-card.is-rebuilt, .sim-card.is-fixed { border-color: #8c80504d; box-shadow: inset 0 1px #eee7ba18, 0 14px 30px #0003; }
.sim-card:hover { transform: translateY(-4px); border-color: var(--section-accent, var(--gold)); box-shadow: 0 15px 35px #0005, 0 0 18px #e6c57415; }
.sim-card::before { height: 1px; opacity: .75; }
.card-preview { height: auto; aspect-ratio: 16/9; background: #0c1315; border-bottom: 1px solid #bba26533; }
.card-preview-img { object-fit: contain; }
.card-info { padding: 22px; }
.card-info h2 { color: #ede4c9; font: 500 25px/1.2 var(--display); margin: 10px 0 14px; }
.card-info p { font-size: 14px; line-height: 1.7; color: var(--text-body); }
.card-mechanism { display: block; color: #a6d7c9; font-size: 11px; line-height: 1.65; padding-top: 13px; border-top: 1px solid #a19e6230; margin-top: 17px; }
.card-launch { display: inline-flex; color: var(--gold); font-size: 12px; border: 1px solid #bba26555; padding: 6px 11px; border-radius: 7px; margin-top: 16px; gap: 18px; }
.card-rigor, .card-conv { font-size: 10px; border-width: 1px; padding: 3px 8px; margin: 0 7px 4px 0; background: #0b1313; }
.seed-aside { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 18px 22px; background: #141f1bcc; border: 1px solid #82734b55; border-radius: 14px; }
.seed-aside p { color: var(--text-body); max-width: 85ch; font-size: 14px; }
.seed-aside strong { color: #ecdca9; display: block; margin-bottom: 5px; }
.seed-aside a, .chapter-link, .capstone-table a, .hidden-shelf a { display: inline-block; padding: 7px 11px; border: 1px solid #9c8c544f; border-radius: 8px; text-decoration: none; color: var(--gold); }
.seed-aside a { flex-shrink: 0; }
.chapter-bridge { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 24px; border: 1px solid #d1b76b55; background: linear-gradient(120deg, #d7b5620d, #60ad920c); border-radius: 18px; margin-bottom: 24px; }
.chapter-bridge h3 { color: var(--gold); font: 500 24px/1.3 var(--display); margin-bottom: 10px; }
.chapter-bridge p { color: var(--text-body); font-size: 14px; line-height: 1.75; }
.chapter-bridge .equation { font-family: var(--mono); color: #a5daca; font-size: 14px; margin: 8px 0; }
.turning-point { border: 1px solid #c8a65b88; border-radius: 24px; background: radial-gradient(ellipse at 10% 0%, #bba15916, transparent 65%), #121c19; padding: clamp(22px,3vw,40px); box-shadow: inset 0 1px #f2d68733, 0 0 38px #dab84b0b; scroll-margin-top: 24px; }
.turning-point h2 { color: #f1dfae; font: 500 clamp(27px,2.6vw,40px)/1.2 var(--display); margin: 12px 0 18px; }
.turning-point > p { color: var(--text-body); font-size: 15px; max-width: 90ch; }
.turning-body { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: 30px; margin-top: 24px; }
.turning-body svg { width: 100%; max-height: 320px; background: radial-gradient(ellipse, #629a7820, transparent 65%), #0c1313; border: 1px solid #a8a57033; border-radius: 18px; }
.turning-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.turning-choices button { cursor: pointer; padding: 10px 14px; color: #becbc1; background: #0c1513; border: 1px solid #7b81674d; border-radius: 9px; }
.turning-choices button[aria-pressed=true] { color: #ffedb5; border-color: #e4c16d; background: #b5963926; box-shadow: 0 0 16px #e4c16d1c; }
.turning-copy { min-height: 128px; color: var(--text-body); font-size: 14px; line-height: 1.75; }
.turning-copy strong { display: block; color: #f1dfb0; font-size: 18px; margin-bottom: 8px; }
.turning-readout { display: flex; gap: 20px; margin: 14px 0; color: #9cdfca; font: 14px var(--mono); flex-wrap: wrap; }
.turning-note { color: #b7c3b6; font: 11px/1.7 var(--mono); margin-top: 10px; }
.whats-new { margin: 0; background: #17231d88; border-color: #8b805344; }
.capstone > details > summary { padding: 16px; cursor: pointer; color: var(--gold); background: #17231d; border: 1px solid var(--border); border-radius: 12px; }
.capstone-table td { border-color: #66774c30; padding: 10px; }
.cap-mech { color: #b2d4c7; }
.cap-fam { white-space: normal; }
/* The instrument shell stays compact; colours in plots retain their meaning. */
#header { padding: 14px 20px; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid #b9a45b44; background: linear-gradient(110deg,#293229c9,#111918); }
#sim-title { font: 500 24px/1.2 var(--display); color: #eee0b4; }
#back-btn { display: inline-flex; border: 1px solid #a6976055; border-radius: 9px; padding: 7px 12px; color: var(--gold); background: #0d1513; }
.alt-links { flex-wrap: wrap; }
.alt-link { background: #10201c; border-color: #7fbc9b4d; border-radius: 8px; padding: 6px 9px; }
#controls-bar { background: linear-gradient(115deg,#27332b88,#121c1b); border-bottom: 1px solid #b9a45b44; }
.ctrl-btn, .ctrl-select { border-radius: 8px; border-color: #a592564f; color: #eee4cb; background: #1b2924; }
.ctrl-btn:hover { border-color: #ebcf83; background: #c3a74626; }
.ctrl-label, .ctrl-toggle { color: #b9c3b7; }
.ctrl-slider { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; accent-color: #dec578; }
.ctrl-slider::-webkit-slider-runnable-track { height: 5px; border-radius: 10px; background: linear-gradient(90deg,#998249,#467d70); }
.ctrl-slider::-moz-range-track { height: 5px; border-radius: 10px; background: linear-gradient(90deg,#998249,#467d70); }
.ctrl-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -5.5px; border: 0; border-radius: 50%; background: #f0d991; box-shadow: 0 0 9px #e0bf7670; }
.ctrl-slider::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #f0d991; box-shadow: 0 0 9px #e0bf7670; }
.slider-group.slider-highlight .ctrl-slider::-webkit-slider-thumb { background: #ffc23c; }
.slider-group.slider-highlight .ctrl-slider::-moz-range-thumb { background: #ffc23c; }
.ctrl-slider:focus-visible { outline: 2px solid #ebcf83; outline-offset: 3px; }
/* Forced colours (Windows contrast themes) drop the gradient, thumb fill and glow above, which would leave nothing painted; draw the slider in system colours instead. */
@media (forced-colors: active) {
  .ctrl-slider::-webkit-slider-runnable-track { forced-color-adjust: none; background: CanvasText; }
  .ctrl-slider::-moz-range-track { forced-color-adjust: none; background: CanvasText; }
  .ctrl-slider::-webkit-slider-thumb { forced-color-adjust: none; box-sizing: border-box; background: ButtonText; border: 2px solid Canvas; box-shadow: none; }
  .ctrl-slider::-moz-range-thumb { forced-color-adjust: none; box-sizing: border-box; background: ButtonText; border: 2px solid Canvas; box-shadow: none; }
  .slider-group.slider-highlight .ctrl-slider::-webkit-slider-thumb { background: Highlight; }
  .slider-group.slider-highlight .ctrl-slider::-moz-range-thumb { background: Highlight; }
}
#main-view { padding: 16px; gap: 16px; }
.canvas-square { border: 1px solid #b4a46166; border-radius: 17px; overflow: hidden; box-shadow: inset 0 1px #e6d39033, 0 9px 24px #0004; background: #0c1518; }
.reading-next { color: #e9cd83; background: #b5994b0b; border-color: #b5994b33; padding: 9px 20px; }
.sim-one-liner { color: #bdcbbf; padding: 9px 20px; font-size: 13px; background: #12201baa; border-bottom: 1px solid #79977933; }
.sim-one-liner strong { color: #dcca94; margin-right: 9px; }
#desc-toggle { width: 30px; height: 30px; padding: 0; border-color: #bfa568; color: var(--gold); background: #111b18; }
#description-panel { top: 90px; }
#desc-content { color: #c9d0c6; border-color: #c4aa6a88; border-radius: 18px; padding: 24px; box-shadow: 0 16px 60px #000a; background: #17241f; }
.raw-phase-toggle, .transform-toggle { background: #14211ef0; border-radius: 9px; animation: none; }
@media (max-width:1000px) { .sim-section-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } #hub-header { gap: 3%; } }
@media (max-width:650px) { #hub-header { grid-template-columns: 1fr; margin-top: 0; } .hero-instrument { display: none; } .sim-section-grid, #sec-1 .sim-section-grid, #sec-6 .sim-section-grid { grid-template-columns: 1fr; } .chapter-bridge, .turning-body { grid-template-columns: 1fr; } .seed-aside { align-items: start; flex-direction: column; } .path-arrow { display: none; } .hub-page { padding-top: 28px; } #header .alt-links { flex-basis: 100%; } #sim-title { font-size: 21px; } #main-view { padding: 10px; gap: 10px; } }
@media (prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
html.is-background .instrument-orbit { animation-play-state: paused; }
.area-derivation { margin: 15px 0; padding: 12px; background: #0d1917; border: 1px solid #79957777; border-radius: 10px; }
.area-derivation summary { color: #e7d39b; cursor: pointer; }
.area-derivation a { display: inline-block; color: #a0dcc4; border: 1px solid #77976b66; padding: 5px 8px; margin: 4px 0; border-radius: 6px; text-decoration: none; }
.simulation-records { margin: 6px 18px 28px; padding: 14px 20px; background: #14221d; border: 1px solid #b39c5788; border-radius: 14px; flex-shrink: 0; }
.simulation-records summary { color: var(--gold); cursor: pointer; }
.simulation-records-content { margin-top: 18px; color: var(--text-body); font-size: 13px; }
.simulation-records-content > p { max-width: 95ch; line-height: 1.8; margin-bottom: 20px; }
.simulation-records-content table { font-size: 13px !important; }
.simulation-records-content td { padding: 8px; border-bottom: 1px solid #849c6933; }
