/* ============ Base ============ */
:root {
  --bg: #0a0806;
  --amber: #ffb238;
  --amber-hi: #ffd88c;
  --amber-lo: #a8640a;
  --amber-glow: rgba(255, 168, 40, 0.45);
  --text: #f1e5d0;
  --body: #e2d4bc;
  --muted: #ad9b80;
  --dim: #77684f;
  --ok: #9be37a;
  --line: rgba(255, 190, 110, 0.12);
  --tape: #ece0b4;
  --font-c: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  --font-b: "IBM Plex Sans", system-ui, sans-serif;
  --font-m: "IBM Plex Mono", ui-monospace, monospace;
  --u: clamp(28px, calc((100svh - 210px) / 13.4), 46px);
  --rack-w: 340px;
  --topbar: 64px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100svh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--amber); color: #1a1006; }
:focus-visible { outline: 2px solid var(--amber-hi); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.aisle { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; transform: scale(1.04); }

/* ============ LEDs ============ */
.led {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: #2e2111; box-shadow: inset 0 0 1px #000;
}
.led.on, .powered .led {
  background: var(--amber);
  box-shadow: 0 0 4px var(--amber), 0 0 9px var(--amber-glow);
}
.led.ok, .powered .led.ok { background: var(--ok); box-shadow: 0 0 4px var(--ok), 0 0 9px rgba(155, 227, 122, 0.45); }
.powered .led.off { background: #2e2111; box-shadow: inset 0 0 1px #000; }
.powered .led.blink { animation: flick var(--d, 1.7s) steps(1) infinite; animation-delay: var(--dl, 0s); }
@keyframes flick {
  0%, 100% { opacity: 1; } 12% { opacity: 0.2; } 18% { opacity: 1; }
  47% { opacity: 0.15; } 53% { opacity: 1; } 71% { opacity: 0.3; } 76% { opacity: 1; }
}

/* ============ Démarrage ============ */
.boot {
  position: fixed; inset: 0; z-index: 70; background: #050302;
  display: grid; place-items: center; padding: 24px; cursor: pointer;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-inner { width: min(620px, 100%); }
.boot-log {
  margin: 0; min-height: 16em; white-space: pre-wrap;
  font-family: var(--font-m); font-size: 13px; line-height: 1.75; color: #d9c7a6;
}
.boot-log .ok { color: var(--ok); }
.boot-log .dim { color: var(--dim); }
.boot-log .caret { display: inline-block; width: 0.6em; height: 1.1em; background: #d9c7a6; vertical-align: -0.2em; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ============ Barre du haut ============ */
.topbar {
  position: relative; z-index: 10; height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 8, 6, 0.85);
}
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.brand strong { font-family: var(--font-c); font-weight: 700; font-size: 19px; letter-spacing: 0.01em; white-space: nowrap; }
.brand-title { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 8px; flex: none; }

.btn {
  appearance: none; border: 1px solid var(--amber); background: var(--amber); color: #1b1105;
  font-family: var(--font-c); font-weight: 600; font-size: 14px; letter-spacing: 0.02em;
  padding: 8px 15px; border-radius: 3px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--amber-hi); border-color: var(--amber-hi); }
.btn-ghost { background: transparent; color: var(--text); border-color: rgba(255, 190, 110, 0.3); }
.btn-ghost:hover { background: rgba(255, 178, 56, 0.08); border-color: var(--amber); color: var(--text); }

/* ============ Scène ============ */
.scene { position: relative; z-index: 5; height: calc(100svh - var(--topbar)); }
.stage {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  perspective: 2200px; perspective-origin: 50% 42%;
}
.cam { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transform-style: preserve-3d; transform-origin: 50% 50%; transition: transform 0.9s var(--ease); }
.row {
  position: relative;
  display: flex; align-items: flex-end; gap: 6px;
  transform-style: preserve-3d; transform-origin: 50% 50%;
  opacity: 0; transition: opacity 0.9s ease;
}
.row.ready { opacity: 1; }
.hint {
  position: absolute; left: 0; right: 0; bottom: 18px; margin: 0; text-align: center;
  font-size: 14px; color: var(--muted);
  opacity: 0; transition: opacity 0.5s;
}
.cam:has(.row.ready) ~ .hint { opacity: 1; }
/* en 3D, les conteneurs inclinés passent devant les équipements : seuls les équipements captent les clics */
@media (min-width: 761px) {
  .cam, .row, .rack, .rack-body, .units { pointer-events: none; }
  .unit, .rail, .rack-cap { pointer-events: auto; }
}
.scene.is-open .stage .hint { opacity: 0; }

/* ============ Baie ============ */
.rack { width: var(--rack-w); flex: none; transform-style: preserve-3d; position: relative; }
.rack[data-rack] .rail span, .rack[data-rack] .rack-cap { cursor: pointer; }

/* chemin de câbles au dessus de la rangée */
.tray {
  position: absolute; left: -400px; right: -400px; top: -62px; height: 16px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(0, 0, 0, 0.45) 22px 26px),
    linear-gradient(180deg, #8a6a1c, #5e4712 60%, #3a2c0b);
  border-top: 2px solid #a8842a; border-radius: 2px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
}
.rack::before {
  content: ""; position: absolute; top: -46px; left: 18%; width: 22px; height: 46px; pointer-events: none;
  background: repeating-linear-gradient(90deg, #1b1916 0 3px, #2f2b25 3px 5px, #1a2a3a 5px 7px, #2f2b25 7px 9px);
  border-radius: 2px 2px 0 0; opacity: 0.9;
}
.rack::after {
  content: ""; position: absolute; top: -46px; right: 22%; width: 12px; height: 46px; pointer-events: none;
  background: repeating-linear-gradient(90deg, #2a2620 0 3px, #3d362c 3px 5px, #6b5418 5px 7px);
  border-radius: 2px 2px 0 0; opacity: 0.85;
}

/* baies des autres clients */
.nb-rack { cursor: not-allowed; }
.nb-rack .unit { cursor: not-allowed; }
.nb-rack .tape { background: #d9d2c0; opacity: 0.85; }
.nb-rack .rack-body { position: relative; }
.nb-rack.door .rack-body::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateZ(9px);
  background: radial-gradient(circle, transparent 0 1.1px, rgba(12, 10, 7, 0.86) 1.5px) 0 0 / 5px 5px;
  border: 3px solid #241f19; box-shadow: inset 0 0 0 1px #3a3128;
}
.nb-rack.door .rack-body::before {
  content: ""; position: absolute; right: 10px; top: 42%; width: 5px; height: 60px; z-index: 1; pointer-events: none; transform: translateZ(10px);
  background: linear-gradient(90deg, #5a4c3d, #2a241d); border-radius: 3px;
}
.nb-rack .units { filter: brightness(0.82); }
.rack-cap {
  height: 30px; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #2d271f, #17130f);
  border: 1px solid #3c3228; border-bottom-color: #000;
  display: flex; align-items: center; justify-content: space-between; padding: 0 12px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.08);
}
.rack-cap .tape { font-size: 10.5px; }
.rack-cap small { font-family: var(--font-m); font-size: 9px; color: var(--dim); letter-spacing: 0.1em; }
.rack-cap-bottom { height: 16px; border-radius: 0 0 5px 5px; border-top-color: #000; border-bottom-color: #3c3228; padding: 0 22px; }
.foot { width: 30px; height: 6px; background: #0a0806; border-radius: 0 0 3px 3px; transform: translateY(11px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.8); }

.rack-body {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 22px;
  background: #0c0a08;
  border-left: 1px solid #3c3228; border-right: 1px solid #3c3228;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9), 0 40px 70px rgba(0, 0, 0, 0.55);
  transform-style: preserve-3d;
}
.rail { display: flex; flex-direction: column; background: linear-gradient(90deg, #1a1612, #262019 50%, #1a1612); }
.rail span {
  height: var(--u); position: relative; display: block;
  border-bottom: 1px dashed rgba(255, 190, 110, 0.06);
  font-family: var(--font-m); font-size: 8px; color: var(--dim); text-align: center; line-height: 1; padding-top: 4px;
}
.rail span::before, .rail span::after {
  content: ""; position: absolute; left: 50%; width: 6px; height: 6px; margin-left: -3px;
  background: #050403; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 220, 170, 0.06);
}
.rail span::before { top: 38%; }
.rail span::after { top: 68%; }
.units { display: flex; flex-direction: column; transform-style: preserve-3d; }

/* étiquette d'étiqueteuse */
.tape {
  display: inline-block; white-space: nowrap;
  font-family: var(--font-c); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  font-size: clamp(9px, calc(var(--u) * 0.24), 11px); line-height: 1.5;
  color: #1a140a; background: var(--tape);
  padding: 0 6px; border-radius: 1px;
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* ============ Équipements ============ */
.unit {
  --h: 1;
  position: relative; display: flex; align-items: stretch;
  height: calc(var(--u) * var(--h)); width: 100%;
  padding: 0; margin: 0; border: 0; text-align: left;
  background: linear-gradient(180deg, #2c261f 0%, #211c17 18%, #1a1612 82%, #110e0b 100%);
  border-top: 1px solid rgba(255, 220, 170, 0.07);
  border-bottom: 1px solid #000;
  transform-style: preserve-3d; transform: translateZ(1px);
  transition: transform 0.7s var(--ease), box-shadow 0.5s var(--ease);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.unit.static { cursor: default; }
.unit::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: rgba(4, 3, 2, 0.4); opacity: 0; transition: opacity 0.5s;
}
.row.has-out .unit:not(.is-out)::after { opacity: 1; }
.row.has-out .unit:not(.is-out):not(.static):hover::after { opacity: 0.15; }
.unit:not(.static):not(.nb):hover { transform: translateZ(4px); }
.unit.is-out {
  transform: translateZ(40px); z-index: 3;
  box-shadow: 0 26px 46px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 178, 56, 0.5);
}
.unit:focus-visible { outline-offset: -2px; }

.unit .side {
  position: absolute; left: 0; top: 0; height: 100%; width: 40px; pointer-events: none;
  transform-origin: left center; transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(0, 0, 0, 0.45) 9px 11px), linear-gradient(90deg, #3a3128, #15110d);
  opacity: 0; transition: opacity 0.35s;
}
.unit.is-out .side { opacity: 1; }

.ear {
  width: 20px; flex: none;
  background: linear-gradient(90deg, #1b1713, #2d271f 50%, #1b1713);
  display: flex; flex-direction: column; justify-content: space-around; align-items: center;
}
.ear i {
  width: 8px; height: 8px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 35% 35%, #8a7a66, #3a3128 60%, #1a1612);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}
.ear i::after { content: ""; position: absolute; left: 1px; right: 1px; top: 3.5px; height: 1px; background: #1a1612; transform: rotate(35deg); }
.unit[style*="--h:1"] .ear i:nth-child(2) { display: none; }

.face { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 10px; position: relative; }
.leds { display: flex; gap: 5px; flex: none; }
.leds.col { flex-direction: column; gap: 4px; }
.vent {
  flex: 1; align-self: stretch; margin: 22% 0; min-width: 12px; border-radius: 2px; opacity: 0.8;
  background: repeating-linear-gradient(90deg, #070605 0 3px, transparent 3px 6px);
}
.handle {
  width: 7px; align-self: stretch; margin: 16% 0; border-radius: 4px; flex: none;
  background: linear-gradient(90deg, #4a3f33, #1f1a15); box-shadow: 1px 0 0 rgba(0, 0, 0, 0.8);
}

.bays { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; flex: none; width: 30%; height: 70%; }
.bay { background: linear-gradient(180deg, #17130f, #0d0b09); border: 1px solid #2f2820; border-radius: 2px; position: relative; }
.bay::before { content: ""; position: absolute; left: 3px; right: 9px; top: 50%; height: 2px; margin-top: -1px; background: repeating-linear-gradient(90deg, #2d261e 0 2px, transparent 2px 4px); }
.bay .led { position: absolute; right: 3px; top: 50%; margin-top: -2px; width: 4px; height: 4px; }

.lcd {
  flex: 1; min-width: 0; height: 64%; border-radius: 3px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #1c1204, #2a1a05);
  border: 1px solid #000; box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.8);
  display: flex; flex-direction: column; justify-content: center; padding: 0 10px;
  font-family: var(--font-m); color: #3a250a; text-transform: uppercase;
}
.lcd::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px); }
.powered .lcd { color: var(--amber); text-shadow: 0 0 6px rgba(255, 168, 40, 0.35); background: linear-gradient(180deg, #2a1904, #3b2506); }
.lcd-1 { font-size: clamp(10px, calc(var(--u) * 0.29), 14px); font-weight: 600; letter-spacing: 0.08em; white-space: nowrap; }
.lcd-2 { font-size: clamp(8px, calc(var(--u) * 0.19), 9.5px); letter-spacing: 0.12em; opacity: 0.8; white-space: nowrap; overflow: hidden; }
.lcd-2 span { display: inline-block; padding-left: 100%; animation: marquee 15s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
.knob {
  width: calc(var(--u) * 0.62); height: calc(var(--u) * 0.62); border-radius: 50%; flex: none; position: relative;
  background: radial-gradient(circle at 35% 30%, #5a4c3d, #231d17 65%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), inset 0 0 0 2px #15110d;
}
.knob::after { content: ""; position: absolute; left: 50%; top: 14%; width: 2px; height: 30%; margin-left: -1px; background: var(--amber); border-radius: 1px; }

/* ports RJ45 : une seule taille sur tous les équipements (patch panel, switch, cartes réseau) */
.ports { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(6, var(--rj-w)); grid-auto-rows: var(--rj-h); gap: 1px; align-content: center; justify-content: end; }
.port {
  position: relative; background: #050403; border: 1px solid #3a3128; border-radius: 1px;
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.9);
}
.port.plugged::after {
  content: ""; position: absolute; left: 1px; right: 1px; top: 25%; bottom: -45%;
  border-radius: 1px 1px 2px 2px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.6);
}
.port.hot { box-shadow: 0 0 0 2px var(--amber), 0 0 12px var(--amber-glow); }
.port.hot .led { animation: none !important; background: var(--amber-hi); }

.swports { flex: 1; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 3px; }
.swblk { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, var(--rj-h)); grid-auto-columns: var(--rj-w); gap: 1px; }
.swport { background: #050403; border: 1px solid #332b22; border-radius: 1px; position: relative; }
.swport .led { position: absolute; left: 50%; top: 1px; margin-left: -1.5px; width: 3px; height: 3px; border-radius: 0; }
.swport.hot { border-color: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }

.sleds { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; height: 76%; min-width: 0; }
.sled {
  background: linear-gradient(180deg, #2a241d, #15120e); border: 1px solid #3a3128; border-radius: 2px;
  display: flex; align-items: center; gap: 5px; padding: 0 5px; min-width: 0; position: relative;
}
.sled small { font-family: var(--font-m); font-size: clamp(7px, calc(var(--u) * 0.18), 8.5px); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sled.empty { background: repeating-linear-gradient(90deg, #0b0907 0 2px, #17130f 2px 4px); }
.sled.empty::after { display: none; }
.sled::after { content: ""; position: absolute; right: 4px; top: 18%; bottom: 18%; width: 3px; border-radius: 2px; background: #0b0907; }

.kvm-grip { flex: 1; height: 38%; border-radius: 3px; background: linear-gradient(180deg, #3a3128, #1a1612); box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.1); }
.fw-lcd { font-family: var(--font-m); font-size: clamp(8px, calc(var(--u) * 0.2), 9.5px); padding: 1px 5px; border-radius: 2px; background: #140d03; color: #3a250a; border: 1px solid #000; white-space: nowrap; }
.powered .fw-lcd { color: var(--ok); }

.pdu .face { justify-content: space-between; }
.outlets { display: flex; gap: 5px; }
.outlet { width: calc(var(--u) * 0.34); height: calc(var(--u) * 0.34); border-radius: 3px; background: #0b0907; border: 1px solid #3a3128; position: relative; }
.outlet::before, .outlet::after { content: ""; position: absolute; top: 35%; width: 2px; height: 30%; background: #2d261e; }
.outlet::before { left: 30%; } .outlet::after { right: 30%; }
.pdu-meter { font-family: var(--font-m); font-size: 10px; color: #3a250a; background: #140d03; padding: 0 5px; border-radius: 2px; }
.powered .pdu-meter { color: var(--amber); }
/* panneau grillagé : rien à ouvrir derrière */
.unit.locked { cursor: default; }
.blank .face {
  margin: 4px 0; border-radius: 2px;
  background:
    radial-gradient(circle, #050403 0 1.25px, transparent 1.6px) 0 0 / 5px 5px,
    linear-gradient(180deg, #2c261f, #1c1814);
  box-shadow: inset 0 0 0 1px #3a3128, inset 0 2px 4px rgba(0, 0, 0, 0.6);
}
.cm .face { gap: 4px; justify-content: space-between; }
.cm .face i { flex: 1; height: 52%; background: linear-gradient(180deg, #17130f, #0a0806); border-radius: 0 0 4px 4px; border: 1px solid #2a241d; border-top: 0; }

/* ============ Câble ============ */
.cable { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; overflow: visible; opacity: 0; transition: opacity 0.4s; }
.cable.on { opacity: 1; }
.cable path { fill: none; stroke-linecap: round; }
.cable-shadow { stroke: rgba(0, 0, 0, 0.55); stroke-width: 8; transform: translate(0, 6px); }
.cable-body { stroke: #6b3f08; stroke-width: 4.5; }
.cable-flow { stroke: var(--amber-hi); stroke-width: 1.8; stroke-dasharray: 2 16; animation: flow 0.9s linear infinite; }
.cable-plug { fill: var(--amber); }
@keyframes flow { to { stroke-dashoffset: -18; } }

/* ============ Panneau ============ */
.panel {
  position: fixed; z-index: 7;
  top: calc(var(--topbar) + 16px); right: 16px; bottom: 16px; width: min(580px, 42vw);
  display: flex; flex-direction: column;
  background: #120e0a;
  border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  transform: translateX(calc(100% + 40px)); visibility: hidden;
  transition: transform 0.7s var(--ease), visibility 0.7s;
}
.panel.open { transform: none; visibility: visible; }
.grab { display: none; }
.scrim { display: none; }

.panel-inner {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 clamp(22px, 2.6vw, 40px) 32px;
  scrollbar-width: thin; scrollbar-color: #4a3a26 transparent;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.panel-inner.swap { opacity: 0; transform: translateY(6px); }

.ph {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  margin: 0 calc(clamp(22px, 2.6vw, 40px) * -1) 26px; padding: 12px clamp(22px, 2.6vw, 40px);
  background: #120e0a; border-bottom: 1px solid var(--line);
  font-family: var(--font-m); font-size: 11px; color: var(--dim);
}
.ph-close {
  margin-left: auto; appearance: none; background: none; border: 1px solid transparent; border-radius: 3px;
  color: var(--muted); font-family: var(--font-b); font-size: 13px; padding: 3px 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.ph-close:hover { color: var(--text); border-color: var(--line); }
.ph-close svg { width: 12px; height: 12px; }

.title { font-family: var(--font-c); font-weight: 700; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.05; letter-spacing: -0.005em; margin: 0 0 8px; text-wrap: balance; }
.lede { font-size: 17px; color: var(--muted); margin: 0 0 24px; max-width: 56ch; }
.prose { max-width: 62ch; }
.prose p { color: var(--body); font-size: 16.5px; line-height: 1.75; margin: 0 0 16px; }
.prose strong { color: var(--amber-hi); font-weight: 600; }

.dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); margin: 0 0 26px; border-top: 1px solid var(--line); }
.dl dt, .dl dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.dl dt { font-size: 13px; color: var(--dim); padding-top: 12px; }
.dl dd { font-size: 15.5px; color: var(--text); }
.dl dd a { text-decoration: none; border-bottom: 1px solid rgba(255, 178, 56, 0.45); }
.dl dd a:hover { color: var(--amber); border-bottom-color: var(--amber); }
.dl dd .sub { color: var(--muted); }

.h3 { font-family: var(--font-c); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 30px 0 12px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* compétences */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.skill { border-top: 1px solid var(--line); padding-top: 12px; }
.skill-n { font-family: var(--font-m); font-size: 11px; color: var(--amber); }
.skill h3 { font-family: var(--font-c); font-weight: 600; font-size: 18px; line-height: 1.25; margin: 2px 0 8px; }
.skill ul { margin: 0; padding: 0; list-style: none; }
.skill li { position: relative; padding-left: 14px; color: var(--body); font-size: 14.5px; line-height: 1.55; margin-bottom: 4px; }
.skill li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; background: var(--amber-lo); }

/* environnement */
.techs { display: flex; flex-wrap: wrap; gap: 6px; }
.tech { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; border: 1px solid #332b22; border-radius: 3px; font-size: 14.5px; cursor: default; transition: border-color 0.2s; }
.tech:hover { border-color: var(--amber); }
.sw-n { display: block; font-family: var(--font-m); font-size: 10.5px; color: var(--dim); margin-top: 2px; }

/* parcours DayHosting */
.timeline { list-style: none; margin: 0 0 8px; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 10px; bottom: 16px; width: 1px; background: #3a3128; }
.timeline li { position: relative; padding: 0 0 22px 26px; }
.timeline .led { position: absolute; left: 0; top: 8px; }
.timeline .when { font-family: var(--font-m); font-size: 12px; color: var(--muted); }
.timeline h3 { font-family: var(--font-c); font-weight: 600; font-size: 21px; margin: 0 0 6px; line-height: 1.2; }
.timeline p { margin: 0; color: var(--body); line-height: 1.72; max-width: 62ch; }

.topo { border: 1px solid #2a241d; border-radius: 4px; background: rgba(5, 4, 3, 0.55); padding: 8px 6px 2px; margin: 0 0 8px; }
.topo svg { display: block; width: 100%; height: auto; }
.topo .link { stroke: #4a3a26; stroke-width: 1.5; fill: none; }
.topo .node rect, .topo .node circle { fill: #15110d; stroke: #5a4a36; stroke-width: 1.2; }
.topo text { font-family: var(--font-m); font-size: 10px; fill: var(--muted); }
.topo .grp { fill: rgba(255, 178, 56, 0.03); stroke: rgba(255, 178, 56, 0.3); stroke-dasharray: 4 4; }
.topo .grp-label { fill: var(--amber); font-size: 9px; }
.topo .pkt { fill: var(--amber-hi); }
.note { font-size: 13.5px; color: var(--muted); margin: 0 0 18px; }

/* formation */
.edu { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.edu li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.edu .led { margin-top: 8px; }
.edu h3 { font-family: var(--font-c); font-weight: 600; font-size: 19px; line-height: 1.25; margin: 0 0 2px; }
.edu p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* console KVM */
.console {
  border: 1px solid #3a3128; border-radius: 5px; overflow: hidden; background: #0b0703; margin: 4px 0 8px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}
.console-bar { display: flex; gap: 8px; align-items: center; padding: 7px 12px; background: #17130f; border-bottom: 1px solid #2d261e; font-family: var(--font-m); font-size: 11px; color: var(--dim); }
.console pre {
  margin: 0; padding: 16px 16px 20px; min-height: 21em; white-space: pre-wrap;
  font-family: var(--font-m); font-size: 13.5px; line-height: 1.75; color: #e8c88a;
}
.console .pr { color: var(--ok); }
.console .mu { color: var(--body); }
.console .caret { display: inline-block; width: 0.6em; height: 1.1em; background: #e8c88a; vertical-align: -0.2em; animation: caret 1s steps(1) infinite; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.pager button {
  appearance: none; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--muted); font-size: 14px;
}
.pager button:hover { color: var(--amber); }

.panel-inner > *:not(.ph) { animation: rise 0.5s var(--ease) both; }
.panel-inner > *:nth-child(3) { animation-delay: 0.04s; }
.panel-inner > *:nth-child(4) { animation-delay: 0.08s; }
.panel-inner > *:nth-child(n+5) { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ Version CV ============ */
.cvdoc { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: rgba(6, 4, 3, 0.94); animation: fadein 0.3s ease; }
.cvdoc[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } }
.cvdoc-bar {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px clamp(16px, 3vw, 36px); background: rgba(10, 8, 6, 0.96); border-bottom: 1px solid var(--line);
}
.cvdoc-bar-title { font-family: var(--font-c); font-weight: 600; font-size: 16px; }
.cvdoc-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cv-page { width: min(860px, calc(100% - 32px)); margin: 28px auto 64px; }
.cv-page a { display: block; border-radius: 3px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); overflow: hidden; background: #fff; }
.cv-page img { display: block; width: 100%; height: auto; }
.cv-page a:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.cv-hint { display: none; margin: 12px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
@media (max-width: 760px) { .cv-page { margin-top: 18px; } .cv-hint { display: block; } }
@media print { .cv-hint { display: none !important; } }

.m-intro, .rack-tabs, .hint-mob { display: none; }
.term-chips {
  display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; flex: none;
  border-bottom: 1px solid #241e18; background: #0e0a07; scrollbar-width: none;
}
.term-chips::-webkit-scrollbar { display: none; }
.term-chips button {
  flex: none; appearance: none; border: 1px solid #3a3128; background: #15110d; color: var(--muted);
  font-family: var(--font-m); font-size: 12px; padding: 4px 9px; border-radius: 3px; cursor: pointer;
}
.term-chips button:hover { color: var(--text); border-color: var(--amber-lo); }

/* ============ Mobile et tablette ============ */
@media (max-width: 1180px) {
  .panel { width: min(560px, 58vw); }
}
@media (max-width: 760px) {
  :root { --u: clamp(28px, calc((100svh - 300px) / 12), 42px); --rack-w: min(420px, calc(100vw - 56px)); --topbar: 56px; }
  body { overflow-y: auto; }
  .topbar { position: sticky; top: 0; }
  .brand-title { display: none; }
  .btn { padding: 7px 12px; font-size: 13px; }
  .scene { height: auto; }
  .stage { position: static; display: block; perspective: none; padding: 16px 0 96px; }
  .cam, .row { transform: none !important; }
  .cam { position: static; width: 100%; max-width: 100vw; }
  .row { width: 100%; }
  .row {
    flex-direction: row; align-items: flex-start; gap: 12px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    padding: 4px 28px 18px; scrollbar-width: none;
  }
  .row::-webkit-scrollbar { display: none; }
  .rack[data-rack] { scroll-snap-align: center; scroll-snap-stop: always; }
  .m-intro { display: block; padding: 0 20px 12px; }
  .m-title { margin: 0; font-family: var(--font-c); font-weight: 600; font-size: 18px; line-height: 1.3; }
  .m-meta { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
  .rack-tabs { display: flex; gap: 6px; padding: 0 16px 14px; overflow-x: auto; scrollbar-width: none; }
  .rack-tab {
    flex: 1; appearance: none; border: 1px solid #3a3128; background: #15110d; color: var(--muted);
    font-family: var(--font-c); font-weight: 600; font-size: 14px; padding: 8px 6px; border-radius: 4px; white-space: nowrap;
  }
  .rack-tab b { color: var(--dim); margin-right: 3px; }
  .rack-tab.on { color: #1b1105; background: var(--amber); border-color: var(--amber); }
  .rack-tab.on b { color: #5a3a05; }
  .hint-desk { display: none; }
  .hint-mob { display: inline; }
  .eth, .rj45 { display: none !important; }
  .scene.is-open ~ .laptop { opacity: 0; pointer-events: none; }
  .nb-rack, .tray, .rack::before, .rack::after, .r-side, .r-top { display: none; }
  .stage { cursor: auto; }
  .hint { position: static; margin-top: 26px; }
  .unit:not(.static):hover { transform: none; }
  .unit.is-out { transform: translateX(10px); }
  .unit .side { display: none; }
  .cable { display: none; }

  .scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(3, 2, 1, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.4s; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; z-index: 30; width: auto; max-width: 760px; margin: 0 auto;
    height: 86svh; border-radius: 14px 14px 0 0; border-bottom: 0;
    transform: translateY(105%);
    box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.7);
  }
  .panel.open { transform: none; }
  .grab { display: block; position: absolute; top: 7px; left: 50%; margin-left: -22px; width: 44px; height: 4px; border-radius: 2px; background: #3a3128; z-index: 3; }
  .ph { padding-top: 20px; }
}
@media (max-width: 640px) {
  .skills { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { padding: 10px 0 0; border-bottom: 0; }
  .dl dd { padding-top: 2px; }
}
@media (max-width: 400px) {
  .bays { display: none; }
  #print { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}



/* ============ Volume des baies (3D) ============ */
.rack { --rack-d: calc(var(--rack-w) * 0.9); }
.rack-body { position: relative; }
.r-side, .r-top { position: absolute; pointer-events: none; backface-visibility: visible; }
.r-side {
  top: 0; bottom: 0; width: var(--rack-d);
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.6) 0 1.3px, transparent 1.7px) 0 0 / 8px 8px,
    linear-gradient(90deg, #3b332a, #241f19 60%, #15120e);
  border: 1px solid #3a3128;
}
.r-left { left: 0; transform-origin: left center; transform: rotateY(90deg); }
.r-right { right: 0; transform-origin: right center; transform: rotateY(-90deg); }
.r-top {
  left: 0; right: 0; top: 0; height: var(--rack-d);
  transform-origin: top center; transform: rotateX(-90deg);
  background:
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(0, 0, 0, 0.5) 14px 16px),
    linear-gradient(180deg, #4a4034, #2a241d 50%, #1a1612);
  border: 1px solid #5a4c3d; box-shadow: inset 0 2px 0 rgba(255, 220, 170, 0.12);
}
.r-top i { position: absolute; left: 16%; top: 18px; width: 30%; height: 26px; border-radius: 3px; background: #050403; box-shadow: inset 0 0 0 2px #241f19; }

/* cordons de brassage */
.cables { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; transform: translateZ(6px); }
.cables path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cables .c-sh { stroke: rgba(0, 0, 0, 0.55); stroke-width: 5.5; transform: translate(1px, 3px); }
.cables .c-bd { stroke-width: 3.6; }
.cables .c-hi { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; transform: translate(-0.6px, -0.6px); }
/* les câbles d'un équipement sorti avancent avec lui (même course que .unit.is-out) */
.cables-u { transition: transform 0.7s var(--ease); }
.cables-u.is-out { transform: translateZ(45px); }

/* carte réseau toujours branchée */
.nic {
  position: relative; flex: none; width: var(--rj-w); height: var(--rj-h); align-self: center;
  background: #050403; border: 1px solid #4f4436; border-radius: 1px;
}
.nic-boot {
  position: absolute; left: -1px; right: -1px; top: 2px; height: 14px; border-radius: 1px 1px 3px 3px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 40%, rgba(0, 0, 0, 0.3)), var(--c);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.nic-boot::before { content: ""; position: absolute; left: 1px; right: 1px; top: -1px; height: 4px; background: rgba(235, 225, 205, 0.5); border-radius: 1px; }
.port.plugged::after { background: linear-gradient(180deg, var(--c, #d98f1f), color-mix(in srgb, var(--c, #d98f1f) 60%, #000)); }
.swport.plugged::after {
  content: ""; position: absolute; left: -1px; right: -1px; top: 35%; bottom: -75%; border-radius: 1px;
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 60%, #000));
}

.stage .unit, .stage .rail, .stage .rack-cap { cursor: pointer; }
.stage .unit.locked, .stage .nb-rack .unit { cursor: not-allowed; }

/* ============ Projets ============ */
.git-tabs { display: flex; gap: 6px; margin: 0 0 18px; }
.git-tab {
  appearance: none; border: 1px solid #3a3128; background: #15110d; color: var(--muted); cursor: pointer;
  font-family: var(--font-c); font-weight: 600; font-size: 15px; padding: 7px 14px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 8px;
}
.git-tab span { font-family: var(--font-m); font-size: 11px; background: rgba(0, 0, 0, 0.3); padding: 1px 6px; border-radius: 3px; }
.git-tab.on { background: var(--amber); color: #1b1105; border-color: var(--amber); }
.git-loading { color: var(--muted); display: flex; align-items: center; gap: 10px; }
.git-profile { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: rgba(0, 0, 0, 0.2); margin: 0 0 18px; }
.git-profile img, .git-ico { width: 46px; height: 46px; border-radius: 4px; flex: none; border: 1px solid #3a3128; }
.git-ico { display: grid; place-items: center; background: #1d1813; font-family: var(--font-m); color: var(--amber); }
.git-profile div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.git-profile b { font-family: var(--font-m); font-size: 15px; }
.git-profile div span { font-size: 13px; color: var(--muted); }
.git-empty { color: var(--muted); }
.lang-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 4px 0 10px; }
.lang-bar span { background: var(--c); }
.lang-legend { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--body); }
.lang-legend span { color: var(--dim); font-family: var(--font-m); font-size: 11px; }
.lang-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 0; }
.repos { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.repo {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; grid-template-areas: "bay main go" "bay meta go";
  gap: 3px 12px; align-items: center; text-decoration: none;
  padding: 11px 14px 11px 10px; border-radius: 4px;
  background: linear-gradient(180deg, #221d17, #17130f); border: 1px solid #2f281f;
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.05);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.repo:hover, .repo:focus-visible { border-color: var(--amber); transform: translateX(4px); background: linear-gradient(180deg, #2a231b, #1a1612); }
.repo-bay { grid-area: bay; align-self: stretch; display: grid; place-items: center; background: #0b0907; border-radius: 2px; border: 1px solid #2a241d; }
.repo-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; }
.repo-main b { font-family: var(--font-m); font-weight: 600; font-size: 14.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-desc { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.repo-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--font-m); font-size: 11.5px; color: var(--dim); }
.repo-go { grid-area: go; color: var(--dim); font-size: 16px; transition: color 0.2s; }
.repo:hover .repo-go { color: var(--amber); }

/* ============ Console SSH ============ */
/* port RJ45 des équipements */
.jack {
  position: relative; flex: none; width: 18px; height: 15px; align-self: center;
  background: #050403; border: 1px solid #4f4436; border-radius: 2px;
  box-shadow: inset 0 3px 4px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 220, 170, 0.06);
}
.jack::before { content: ""; position: absolute; left: 3px; right: 3px; top: 2px; height: 4px; background: repeating-linear-gradient(90deg, #a8842a 0 1px, transparent 1px 2px); opacity: 0.55; }
.jack .jl, .jack .ja { position: absolute; bottom: 1px; width: 4px; height: 2px; background: #2a2010; }
.jack .jl { left: 1px; }
.jack .ja { right: 1px; }
.jack.plugged .jl { background: var(--ok); box-shadow: 0 0 4px var(--ok); }
.jack.plugged .ja { background: var(--amber); box-shadow: 0 0 4px var(--amber); animation: flick 0.6s steps(1) infinite; }
.jack .jack-boot {
  position: absolute; left: -3px; right: -3px; top: 3px; height: 22px; z-index: 2; display: none;
  border-radius: 2px 2px 5px 5px;
  background: linear-gradient(90deg, #6a6357, #a59c8c 40%, #8a8274 70%, #645d52);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.jack .jack-boot::before { content: ""; position: absolute; left: 2px; right: 2px; top: -2px; height: 8px; background: rgba(235, 225, 205, 0.45); border-radius: 1px; }
.jack .jack-boot::after { content: ""; position: absolute; left: 50%; top: 10px; width: 8px; height: 3px; margin-left: -4px; background: rgba(0, 0, 0, 0.35); border-radius: 1px; }
.jack.seating .jack-boot, .jack.plugged .jack-boot { display: block; }
.jack.seating .jack-boot { animation: seat 0.2s ease-in both; }
@keyframes seat { from { transform: translateY(10px) scale(1.4); opacity: 0.2; } to { transform: none; opacity: 1; } }
.jack.plugged { cursor: grab; }
.unit.eth-linked:not(.is-out):not(:hover) { transform: translateZ(3px); }
.unit.clicked .face { animation: click 0.2s ease-out; }
@keyframes click { 35% { transform: translateY(1px); } }

.rj45.pushing { transition: transform 0.2s ease-in, opacity 0.2s ease-in; opacity: 0; }
.rj45.gone { opacity: 0; pointer-events: none; }
.laptop.moving { cursor: grabbing; }

.term { resize: both; overflow: hidden; min-width: 340px; min-height: 220px; max-width: calc(100vw - 16px); max-height: calc(100svh - 16px); }
.term-bar { cursor: move; user-select: none; touch-action: none; }
.term.moving { transition: none; }

.laptop {
  position: fixed; left: 22px; bottom: 16px; z-index: 8;
  width: 92px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.7));
}
.laptop svg { width: 92px; height: auto; display: block; }
.laptop .tape { font-size: 10px; }
.laptop-caret { animation: caret 1s steps(1) infinite; }

.eth { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; overflow: visible; }
.eth path { fill: none; stroke-linecap: round; }
.eth-shadow { stroke: rgba(0, 0, 0, 0.5); stroke-width: 7; transform: translate(0, 5px); }
.eth-body { stroke: #7d7568; stroke-width: 5; }
.eth-hi { stroke: rgba(255, 245, 225, 0.22); stroke-width: 1.5; transform: translate(-1px, -1px); }

.rj45 {
  position: fixed; left: 0; top: 0; z-index: 9; width: 22px; height: 34px;
  transform-origin: 11px 0; cursor: grab; touch-action: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}
.rj45 svg { width: 22px; height: 34px; display: block; }
.rj45.held { cursor: grabbing; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.7)); }
.rj45:focus-visible { outline-offset: 2px; }

.unit.eth-ok { box-shadow: 0 0 0 2px var(--ok), 0 0 18px rgba(155, 227, 122, 0.35); }
.unit.eth-no { box-shadow: 0 0 0 2px #c0503a; }
.unit.eth-linked .face::after {
  content: ""; position: absolute; right: 8px; top: 6px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 6px var(--ok); animation: flick 0.8s steps(1) infinite;
}

.term {
  position: fixed; left: 16px; bottom: 16px; z-index: 45;
  width: min(700px, calc(100vw - 32px)); height: min(460px, 64svh);
  display: flex; flex-direction: column;
  background: #0b0805; border: 1px solid #3a3128; border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75);
  opacity: 0; transform: translateY(16px) scale(0.98); transform-origin: bottom left;
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}
.term[hidden] { display: none; }
.term.on { opacity: 1; transform: none; }
.term-bar {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px;
  background: #17130f; border-bottom: 1px solid #2d261e; border-radius: 6px 6px 0 0;
  font-family: var(--font-m); font-size: 12px; color: var(--muted);
}
.term-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-close { appearance: none; background: none; border: 1px solid #3a3128; border-radius: 3px; color: var(--muted); font-size: 12px; padding: 2px 8px; cursor: pointer; }
.term-close:hover { color: var(--text); border-color: var(--amber-lo); }
.term-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 16px; cursor: text;
  font-family: var(--font-m); font-size: 13.5px; line-height: 1.6; color: #e8c88a;
  scrollbar-width: thin; scrollbar-color: #4a3a26 transparent;
}
.term-out .tl { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }
.term-out .mu { color: var(--muted); }
.term-out .err { color: #ff8a6a; }
.t-ps1 { color: var(--ok); }
.t-dir { color: #8fc1ff; }
.t-art { color: var(--amber); }
.term-line { display: flex; align-items: baseline; }
.term-line .t-ps1 { white-space: pre; flex: none; }
.term-line input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 0;
  font: inherit; color: #f3e7d3; caret-color: var(--amber);
}

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px);
  background: #17130f; border: 1px solid #3a3128; color: var(--text); font-size: 14px;
  padding: 8px 14px; border-radius: 4px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .laptop { left: auto; right: 12px; bottom: 12px; width: 64px; }
  .hint { text-align: left; padding: 0 92px 0 20px; font-size: 13px; }
  .laptop svg { width: 64px; }
  .term { left: 0 !important; right: 0; top: auto !important; bottom: 0 !important; width: 100% !important; height: 72svh !important; border-radius: 12px 12px 0 0; resize: none; min-width: 0; }
  .term-bar { cursor: default; }
  .term-body { font-size: 12.5px; }
  #open-ssh { display: none; }
}

/* ============ Impression : le CV ============ */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; overflow: visible; }
  .aisle, .boot, .topbar, .scene, .cable, .cvdoc-bar, .laptop, .eth, .rj45, .term, .toast { display: none !important; }
  .cvdoc, .cvdoc[hidden] { display: block !important; position: static; background: none; overflow: visible; animation: none; }
  .cv-page { width: 100%; margin: 0; }
  .cv-page a { box-shadow: none; border-radius: 0; }
}

/* ---------- Refonte 11/2026 : statut, réalisations, certifications ---------- */
.brand-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text); white-space: nowrap; padding-left: 14px; border-left: 1px solid var(--line); }
.brand-status .led { width: 6px; height: 6px; }

.stack2 { flex: 1; min-width: 0; height: 84%; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.stack2 .tape { flex: none; }
.mon {
  flex: 1; align-self: stretch; min-width: 0; border-radius: 3px; position: relative; overflow: hidden;
  background: #0d0a06; border: 1px solid #000; box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.85);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, 1fr); column-gap: 8px; align-items: center; padding: 2px 6px;
  font-family: var(--font-m); font-size: clamp(7px, calc(var(--u) * 0.19), 9px); color: #3a250a; text-transform: uppercase; letter-spacing: 0;
}
.mon::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px); }
.powered .mon { color: var(--amber); }
.mon-l { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-l i { width: 4px; height: 4px; flex: none; background: currentColor; opacity: 0.7; }
.sleds.certs { flex: 1; align-self: stretch; height: auto; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 3px; }
.sleds.certs .sled { padding: 0 3px; justify-content: center; }
.sleds.certs .sled::after { display: none; }
.powered .sleds.certs .sled:not(.old):not(.empty) { box-shadow: inset 0 -2px 0 rgba(155, 227, 122, 0.55); }
.sleds.certs .sled small { font-size: clamp(6.5px, calc(var(--u) * 0.17), 8px); letter-spacing: 0; color: var(--body); }
.sled.old small { opacity: 0.55; }

.status-line { display: flex; align-items: flex-start; gap: 10px; margin: -8px 0 22px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.status-line .led { margin-top: 7px; flex: none; }
.status-line b { display: block; color: var(--text); font-weight: 600; font-size: 16px; }
.missions { list-style: none; margin: 0 0 22px; padding: 0; border-top: 1px solid var(--line); }
.missions li { position: relative; padding: 11px 0 11px 16px; border-bottom: 1px solid var(--line); color: var(--body); font-size: 15.5px; line-height: 1.55; }
.missions li::before { content: ""; position: absolute; left: 0; top: 1.25em; width: 5px; height: 5px; background: var(--amber-lo); }
.missions strong { color: var(--amber-hi); font-weight: 600; }
.cases { display: grid; gap: 30px; }
.case h3 { font-family: var(--font-c); font-weight: 600; font-size: 21px; line-height: 1.2; margin: 0 0 2px; }
.case-where { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; }
.case-dl { grid-template-columns: 130px minmax(0, 1fr); margin-bottom: 10px; }
.case-dl dd { font-size: 15px; line-height: 1.55; }
.case-go { appearance: none; background: none; border: 0; padding: 4px 0; color: var(--amber); font: inherit; font-size: 14px; cursor: pointer; border-bottom: 1px solid rgba(255, 178, 56, 0.4); }
.case-go:hover { color: var(--amber-hi); border-bottom-color: var(--amber-hi); }
@media (max-width: 1180px) { .brand-status { display: none; } }
:root { --rj-w: 11px; --rj-h: 10px; }
@media (max-width: 760px) { .cables-u.is-out { transform: translate3d(10px, 0, 45px); } }
@media (max-width: 760px) { .case-dl { grid-template-columns: 1fr; } .case-dl dt { border-bottom: 0; padding-bottom: 0; } }
