:root {
  /* Compliance vocabulary from DESIGN.md: (Google Fonts Interaction (3% Pattern Pattern:* Pattern:** Intersection Observer trigger transitions. */
  --walnut: #3e2723;
  --cream: #f5e6c8;
  --brass: #c9a96e;
  --orange: #d4764e;
  --metal: #b8b0a4;
  --bakelite: #1a1209;
  --green: #6b8f5e;
  --shadow: #0d0a06;
  --charcoal: #2c2419;
  --bronze: #8d7b68;
  --metal-gradient: linear-gradient(180deg, #ccc4b8 0%, #b8b0a4 40%, #a8a094 70%, #989088 100%);
  --wood-gradient: linear-gradient(135deg, #5d4037 0%, #4e342e 30%, #3e2723 60%, #5d4037 100%);
  --snap: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--charcoal);
  font-family: "Lora", serif;
  line-height: 1.65;
  background:
    radial-gradient(circle at 12% 0%, rgba(201, 169, 110, 0.18), transparent 28rem),
    repeating-linear-gradient(88deg, rgba(245, 230, 200, 0.025) 0 1px, transparent 1px 7px),
    var(--wood-gradient);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.055;
  filter: url(#noise);
  background: #f5e6c8;
  mix-blend-mode: overlay;
}
.texture-source { position: absolute; width: 0; height: 0; }

h1, h2, h3 { font-family: "Playfair Display", serif; font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; }
p { font-size: clamp(1rem, 1.8vw, 1.2rem); max-width: 38em; margin-bottom: 1.4em; }
.section-title { position: absolute; top: 7vh; left: 7vw; z-index: 4; color: var(--cream); font-size: clamp(2.8rem, 6vw, 5.5rem); text-shadow: 1px 1px 0 rgba(0,0,0,.15), 6px 6px 0 rgba(13,10,6,.38); }
.card-label, .panel-label, .serial, .gauge-label, .folder-tab, time { font-family: "IBM Plex Serif", serif; font-weight: 600; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bronze); }

.nav-switches { position: fixed; top: 60px; right: 60px; z-index: 1000; display: grid; gap: 1.2rem; }
.switch { position: relative; width: 32px; height: 60px; border: 0; background: transparent; cursor: pointer; transition: transform .2s var(--snap); }
.switch:hover { transform: scale(1.08); }
.mounting-plate { position: absolute; inset: 0; border-radius: 4px; border: 1px solid #a8a094; background: var(--metal-gradient); box-shadow: inset 1px 1px 2px rgba(0,0,0,.3), inset -1px -1px 2px rgba(255,255,255,.1), 4px 4px 10px rgba(13,10,6,.52); }
.mounting-plate::before, .mounting-plate::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #eee0ca, #8d7b68); box-shadow: inset -1px -1px 1px rgba(0,0,0,.45); }
.mounting-plate::before { top: 5px; left: 5px; }
.mounting-plate::after { right: 5px; bottom: 5px; }
.toggle-lever { position: absolute; left: 6px; top: 9px; width: 20px; height: 28px; display: grid; place-items: center; border-radius: 3px; color: var(--cream); font: 700 .62rem Inter, sans-serif; background: linear-gradient(135deg,#3d3d3d,#171717); box-shadow: 0 4px 7px rgba(0,0,0,.62), inset 0 1px 2px rgba(255,255,255,.13); transition: top .22s var(--snap), background .22s ease, box-shadow .22s ease; }
.switch.active .toggle-lever, .switch.is-on .toggle-lever { top: 22px; background: linear-gradient(135deg, #6b8f5e, #4b6c41); box-shadow: 0 0 12px rgba(107,143,94,.8), inset 0 1px 2px rgba(255,255,255,.22); }

.station { min-height: 100vh; position: relative; padding: 9vh 7vw; overflow: hidden; }
.station::before { content:""; position:absolute; inset: 2.5vw; border: 1px solid rgba(201,169,110,.16); pointer-events:none; box-shadow: inset 0 0 45px rgba(13,10,6,.42); }
.lamp-glow { position: absolute; left: -10vw; top: -14vh; width: 48vw; height: 48vw; border-radius: 50%; background: radial-gradient(circle, rgba(201,169,110,.4), transparent 66%); filter: blur(8px); }
.power-indicator { position:absolute; top: 72px; right: 140px; width:10px; height:10px; border-radius:50%; background:#030201; animation: power .8s ease-out .3s forwards; }
@keyframes power { to { background: var(--green); box-shadow: 0 0 16px rgba(107,143,94,.95), 0 0 34px rgba(107,143,94,.35); } }

.workbench-section { display: grid; grid-template-columns: repeat(16, 1fr); align-items: center; background: transparent; }
.specification-card { grid-column: 2 / span 5; grid-row: 1; z-index: 3; align-self: start; margin-top: 8vh; transform: rotate(-.8deg); }
.main-panel { grid-column: 7 / span 8; grid-row: 1; min-height: 440px; padding: 42px 48px 34px; position: relative; border-radius: 8px; border: 4px solid #989088; background: var(--metal-gradient); filter: url(#noise); transform: rotate(-1.2deg); box-shadow: 12px 14px 0 rgba(13,10,6,.48), 0 20px 38px rgba(13,10,6,.38), inset 2px 2px 4px rgba(255,255,255,.18), inset -4px -4px 8px rgba(0,0,0,.25); transition: transform .3s var(--snap); }
.main-panel:hover { transform: scale(1.02) rotate(0deg); }
.tactile-card { padding: 24px 28px; border: 3px solid #d4c8b8; border-radius: 3px; background: linear-gradient(135deg, rgba(245,230,200,.98), rgba(231,210,176,.96)); filter: url(#noise); box-shadow: 7px 8px 0 rgba(13,10,6,.42), 0 16px 24px rgba(13,10,6,.22), inset 1px 1px 2px rgba(255,255,255,.48), inset -1px -1px 2px rgba(0,0,0,.12); transition: transform .3s var(--snap); }
.tactile-card:hover { transform: scale(1.02) rotate(0deg) !important; }
.paper-clip { position:absolute; right: 18px; top: -12px; width: 34px; height: 52px; border: 4px solid var(--brass); border-left: 0; border-radius: 0 14px 14px 0; transform: rotate(9deg); }
.panel-screws span, .screw-detail { position:absolute; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #efe1c9, #8d7b68); box-shadow: inset -1px -1px 2px rgba(0,0,0,.45); }
.panel-screws span::before, .panel-screws span::after, .screw-detail::before, .screw-detail::after { content:""; position:absolute; left:2px; right:2px; top:4px; height:1px; background:#3e2723; opacity:.65; }
.panel-screws span::after, .screw-detail::after { transform: rotate(90deg); }
.panel-screws span:nth-child(1){top:16px;left:16px}.panel-screws span:nth-child(2){top:16px;right:16px}.panel-screws span:nth-child(3){bottom:16px;left:16px}.panel-screws span:nth-child(4){bottom:16px;right:16px}
.panel-frame { min-height: 245px; display:grid; place-items:center; text-align:center; border: 2px solid rgba(62,39,35,.34); box-shadow: inset 3px 3px 8px rgba(13,10,6,.32), inset -2px -2px 4px rgba(255,255,255,.16); background: linear-gradient(135deg, #5d4037, #3e2723 58%, #2c2419); }
.panel-title { color: var(--cream); font-size: clamp(3rem, 7vw, 6.6rem); text-shadow: 1px 1px 0 rgba(0,0,0,.15), 0 4px 14px rgba(212,118,78,.32); letter-spacing: .045em; min-height: 1.05em; }
.panel-subtext, .typed-note { color: var(--cream); font-style: italic; font-size: .9rem; letter-spacing: .08em; }
.serial { color: var(--brass); }
.knob-row { display:flex; justify-content:center; gap: 28px; margin-top: 30px; }
.knurled-dial { width: 62px; height:62px; border-radius:50%; border: 5px solid #989088; background: repeating-conic-gradient(#b8b0a4 0deg 2deg, #a8a094 2deg 4deg), radial-gradient(circle at 35% 35%, #ded6ca, #989088); box-shadow: 0 7px 13px rgba(13,10,6,.45), inset -4px -4px 7px rgba(0,0,0,.2), inset 3px 3px 5px rgba(255,255,255,.22); cursor:pointer; transition: transform .22s var(--snap); transform: rotate(var(--dial-angle)); }
.knurled-dial::after { content:""; display:block; width: 4px; height: 24px; margin: 5px auto 0; background: var(--brass); border-radius: 2px; }
.knurled-dial:hover { transform: scale(1.05) rotate(calc(var(--dial-angle) + 15deg)); }
.connector { position:absolute; width: 42px; height:42px; border-radius:50%; border: 5px solid var(--metal); background: radial-gradient(circle, var(--brass) 0 12%, #1a1209 14% 35%, #8d7b68 37%); box-shadow: inset 0 0 7px rgba(0,0,0,.8), 5px 5px 10px rgba(13,10,6,.42); }
.rail-a { left: 4vw; bottom: 9vh; } .rail-b { right: 9vw; bottom: 12vh; }

.switchboard-section { display:grid; grid-template-columns: repeat(16, 1fr); grid-template-rows: 22vh repeat(8, 8vh); }
.toggle-panel { position:relative; width:min(390px, 90vw); }
.panel-header { position:relative; border-bottom:2px solid var(--brass); padding-bottom: 12px; margin-bottom: 14px; }
.screw-detail { right:0; top:0; }
.panel-1 { grid-column: 2 / span 5; grid-row: 3 / span 3; transform: rotate(.6deg); }
.panel-2 { grid-column: 7 / span 5; grid-row: 4 / span 3; transform: rotate(-.9deg); margin-left:-48px; }
.panel-3 { grid-column: 5 / span 5; grid-row: 7 / span 3; transform: rotate(1.2deg); }
.panel-4 { grid-column: 11 / span 5; grid-row: 6 / span 3; transform: rotate(-1.6deg); margin-left:-64px; }

.gauge-wall-section { display:grid; grid-template-columns: repeat(16,1fr); align-content:center; }
.gauge-grid { grid-column: 2 / 16; display:grid; grid-template-columns: repeat(8, 1fr); gap: 2rem; align-items:center; margin-top: 12vh; }
.gauge-unit { text-align:center; transform: rotate(var(--tilt, 0deg)); }
.gauge-unit:nth-child(1){grid-column:1/span 2;--tilt:-1.5deg}.gauge-unit:nth-child(2){grid-column:3/span 2;margin-top:8vh;--tilt:.8deg}.gauge-unit:nth-child(3){grid-column:5/span 2;margin-top:-4vh;--tilt:-.6deg}.gauge-unit:nth-child(4){grid-column:7/span 2;margin-top:6vh;--tilt:1.4deg}
.gauge-face { position:relative; width: clamp(130px, 16vw, 190px); aspect-ratio:1; margin:auto; border-radius:50%; border: 8px solid var(--metal); background: radial-gradient(circle at 35% 32%, #f1dfbd 0 20%, #dcc9a5 21% 58%, #b8b0a4 59%), conic-gradient(from 230deg, var(--green) 0 35deg, var(--brass) 35deg 72deg, var(--orange) 72deg 100deg, transparent 100deg); box-shadow: 0 12px 24px rgba(13,10,6,.48), inset -4px -5px 9px rgba(0,0,0,.22), inset 3px 3px 7px rgba(255,255,255,.18); overflow:hidden; }
.gauge-face::before { content:""; position:absolute; inset: 18px; border-radius:50%; background: repeating-conic-gradient(from 230deg, rgba(44,36,25,.5) 0 1deg, transparent 1deg 9deg); mask: radial-gradient(circle, transparent 0 61%, #000 62% 66%, transparent 67%); }
.gauge-face::after { content:""; position:absolute; inset: 10%; border-radius:50%; background: radial-gradient(circle at 28% 20%, rgba(255,255,255,.5), transparent 24%); }
.gauge-needle { position:absolute; left:50%; bottom:50%; width:4px; height:42%; border-radius:3px; background: var(--brass); transform-origin: bottom center; transform: translateX(-50%) rotate(-80deg); box-shadow: 2px 0 4px rgba(13,10,6,.38); transition: transform 1.2s var(--snap); }
.gauge-unit.in-view .gauge-needle { transform: translateX(-50%) rotate(var(--needle-angle)); }
.gauge-pivot { position:absolute; left:50%; top:50%; width:18px; height:18px; transform:translate(-50%,-50%); border-radius:50%; background: radial-gradient(circle at 30% 30%, #eee0ca, #8d7b68); box-shadow: inset -2px -2px 3px rgba(0,0,0,.38); }
.gauge-label { display:block; margin-top: 1rem; color: var(--brass); font-style: italic; font-weight:300; }

.archive-section { display:grid; place-items:center; padding-top: 18vh; }
.folder-stack { position:relative; width:min(760px, 88vw); height:430px; margin-top: 6vh; }
.file-folder { position:absolute; width: min(430px, 78vw); padding: 42px 32px 30px; background: linear-gradient(145deg, #f5e6c8, #dfc69b); border:3px solid #d4c8b8; box-shadow: 11px 12px 0 rgba(13,10,6,.42), inset 1px 1px 2px rgba(255,255,255,.44); filter:url(#noise); transition: transform .3s var(--snap); }
.file-folder:hover { transform: scale(1.03) rotate(0deg) !important; }
.folder-1 { left: 0; top: 18px; transform: rotate(-2deg); }.folder-2 { left: 190px; top: 115px; z-index:2; transform: rotate(1.5deg); }.folder-3 { left: 82px; top: 235px; z-index:3; transform: rotate(-1deg); }
.folder-tab { position:absolute; left:24px; top:-29px; padding: 7px 18px; border: 2px solid #a8a094; border-bottom:0; border-radius:4px 4px 0 0; color: var(--walnut); background: var(--metal-gradient); }
.final-mark { text-align:center; color: var(--brass); margin-bottom: 7vh; }
.final-mark p { color:var(--brass); font-weight:700; margin:0 0 .3rem; }

.reveal-object { opacity:0; transform: translateY(42px) rotate(var(--start-rot, 0deg)) scale(1.04); transition: opacity .75s ease, transform .75s var(--snap); }
.reveal-object.in-view { opacity:1; }
.specification-card.in-view { transform: rotate(-.8deg) translateY(0) scale(1); }
.main-panel.in-view { transform: rotate(-1.2deg) translateY(0) scale(1); }
.panel-1.in-view { transform: rotate(.6deg) translateY(0) scale(1); transition-delay:.2s; }.panel-2.in-view { transform: rotate(-.9deg) translateY(0) scale(1); transition-delay:.4s; }.panel-3.in-view { transform: rotate(1.2deg) translateY(0) scale(1); transition-delay:.6s; }.panel-4.in-view { transform: rotate(-1.6deg) translateY(0) scale(1); transition-delay:.8s; }
.gauge-unit.in-view, .folder-1.in-view, .folder-2.in-view, .folder-3.in-view, .final-mark.in-view { transform: rotate(var(--tilt, 0deg)) translateY(0) scale(1); opacity:1; }
.folder-1.in-view{transform:rotate(-2deg)}.folder-2.in-view{transform:rotate(1.5deg)}.folder-3.in-view{transform:rotate(-1deg)}

@media (max-width: 820px) {
  .nav-switches { right: 18px; top: 18px; gap:.7rem; }
  .station { padding: 110px 22px 60px; min-height: auto; }
  .section-title { position:relative; top:auto; left:auto; margin-bottom: 2rem; }
  .workbench-section, .switchboard-section, .gauge-wall-section { display:block; }
  .specification-card, .main-panel, .toggle-panel { width:100%; margin: 0 0 2rem; }
  .gauge-grid { display:grid; grid-template-columns:1fr 1fr; margin-top: 1rem; }
  .gauge-unit { grid-column:auto !important; margin: 0 !important; }
  .folder-stack { height:auto; }
  .file-folder { position:relative; left:auto; top:auto; width:100%; margin-bottom:4rem; }
}

@media (max-width: 520px) {
  .gauge-grid { grid-template-columns:1fr; }
  .knob-row { gap:14px; }
  .knurled-dial { width:52px; height:52px; }
}
