/* « Les parties de l'ordinateur » : isometric hairline figures, the live part takes the accent (see js/ordi.js).
   Colours come from the site tokens; .light (a light band) only swaps the neutrals, the accent stays the same. */
.ordi {
  --o-body: #14171c; --o-deck: #1b1f26; --o-wall: #101216; --o-recess: #0c0e11; --o-line: #68717d; --o-detail: #363d47; --o-ink: #eef0f3;
  --o-glass: #1f1410; --o-on: #4d2716; --o-on-top: #663220; --o-on-deep: #2e170d; --o-hi: #ffb08e; --o-panel: var(--surface);
  display: grid; gap: 18px;
}
.light .ordi, .ordi.light {
  --o-body: #f1f0eb; --o-deck: #fbfaf7; --o-wall: #e4e2dc; --o-recess: #e9e7e1; --o-line: #6f757d; --o-detail: #bdbbb3; --o-ink: #101215;
  --o-glass: #fff1ea; --o-on: #ffd3c0; --o-on-top: #ffe4d8; --o-on-deep: #ffc3aa; --o-hi: #a83d14;
}
/* this page is a big picture: the documentation menu goes under it, as it does on small screens */
.docs-grid:has(.ordi) { grid-template-columns: minmax(0, 1fr); }
.docs-grid:has(.ordi) .docnav { position: static; max-height: none; order: 2; }
.docs-grid:has(.ordi) .docmain { max-width: none; order: 1; }
.ordi > p { max-width: 68ch; }
.ordi > .ordi-intro { max-width: 92ch; }
.ordi-intro { font-size: 19px; color: var(--muted); }

.ordi-app { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(280px, 1fr); grid-template-areas: "stage card" "chips chips"; gap: 16px; }
.ordi-stage { grid-area: stage; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 10px 14px 14px; display: grid; gap: 4px; min-width: 0; position: relative; }
.ordi-stage .ordi-tools { position: absolute; top: 16px; left: 16px; right: 16px; }
.ordi-fig { min-width: 0; }
.ordi-svg { display: block; width: 100%; height: auto; touch-action: manipulation; -webkit-user-select: none; user-select: none; font-family: var(--sans); }
.ordi-tools, .ordi-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.ordi-btn, .ordi-chip { font: 600 15.5px var(--sans); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; min-height: 44px; padding: 0 18px; cursor: pointer; transition: border-color .15s, background .15s; }
.ordi-btn:hover, .ordi-chip:hover { border-color: var(--accent); }
.ordi-btn[aria-pressed="true"], .ordi-chip[aria-pressed="true"], .ordi-play { background: var(--accent); border-color: var(--accent); color: #111; }
.ordi-card { grid-area: card; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: clamp(20px, 2.4vw, 30px); display: grid; grid-template-rows: 1fr auto; gap: 18px; min-width: 0; }
.ordi-card-txt { display: grid; gap: 14px; align-content: start; }
.ordi-k { font: 500 12.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.docbody .ordi-name { font-size: clamp(27px, 2.7vw, 36px); margin: 0; line-height: 1.08; }
.ordi-what { font-size: 18.5px; line-height: 1.5; }
.ordi-dyk { border-left: 3px solid var(--accent); padding: 10px 0 10px 16px; color: var(--muted); font-size: 16.5px; line-height: 1.5; }
.ordi-dyk strong { display: block; color: var(--ink); font-size: 15px; }
.ordi-chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 8px; }
.ordi-chip { font-size: 15px; padding: 0 15px; font-weight: 500; }

/* no script: the same content as plain cards */
.ordi .ordi-parts, .ordi .ordi-zooms, .ordi .ordi-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ordi .ordi-parts { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ordi-parts > li, .ordi-zooms > li, .ordi-steps > li { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; display: grid; gap: 10px; align-content: start; }
.ordi-parts h3, .ordi-zooms h3 { font-size: 20px; }
.ordi-js .ordi-parts, .ordi-js .ordi-h-parts, .ordi:not(.ordi-js) .ordi-zoomp { display: none; }
.ordi .ordi-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); counter-reset: s; }
.ordi-steps > li { counter-increment: s; font-size: 15.5px; line-height: 1.45; color: var(--muted); transition: border-color .2s; }
.ordi-js .ordi-steps > li { cursor: pointer; }
.ordi-steps > li::before { content: "0" counter(s); font: 500 13px var(--mono); color: var(--accent-text); }
.ordi-steps strong { color: var(--ink); font-size: 16.5px; line-height: 1.25; }
.ordi-steps > li.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ordi .ordi-zooms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ordi-zooms p { color: var(--muted); font-size: 16px; line-height: 1.5; }
.ordi-zoom { display: block; width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 6px; cursor: pointer; transition: border-color .15s; }
.ordi-zoom:hover, .ordi-zoom[aria-pressed="true"] { border-color: var(--accent); }
.ordi-safe { max-width: 68ch; }

@media (max-width: 1000px) {
  .ordi-app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "chips" "card"; }
  .ordi-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .ordi-chip { flex: none; scroll-snap-align: start; }
  .ordi .ordi-steps, .ordi .ordi-zooms { grid-template-columns: minmax(0, 1fr); }
  .ordi-stage { padding: 10px 8px 6px; border-radius: 18px; }
  .ordi-stage .ordi-tools { position: static; order: -1; }
}
@media (min-width: 601px) and (max-width: 1000px) { .ordi .ordi-zooms { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ordi .ordi-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- the drawing ---------- */
.ordi-svg .face { fill: var(--o-body); stroke: var(--o-line); stroke-width: 1.1; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill .25s, stroke .25s; }
.ordi-svg .face.top { fill: var(--o-deck); }
.ordi-svg .face.recess { fill: var(--o-recess); }
.ordi-svg .face.wallin { fill: var(--o-wall); }
.ordi-svg .face.chip { fill: var(--o-recess); }
.ordi-svg .detail, .ordi-svg .wire { fill: none; stroke: var(--o-detail); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; transition: stroke .25s; }
.ordi-svg .hit { fill: transparent; stroke: none; }
.ordi-svg .led { fill: var(--o-detail); }
.ordi-svg .glass.hot { fill: var(--o-glass); stroke: var(--accent); }
.ordi-svg .scr-line { fill: none; stroke: var(--accent); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.ordi-svg .scr-dot { fill: var(--accent); }
.ordi-svg .scr-t { fill: var(--o-hi); font-weight: 700; }
.ordi-caret { animation: ordi-blink 1.1s steps(1) infinite; }
.ordi-key .face { fill: transparent; stroke: none; }
.ordi-key text { fill: var(--o-line); font-weight: 700; }
.ordi-key.lit .face { fill: var(--accent); stroke: var(--o-hi); }
.ordi-key.lit text { fill: #111; }

.ordi-part { cursor: pointer; }
.ordi-part:hover .face { stroke: var(--o-ink); }
.ordi-part.sel { filter: url(#ordi-glow); }
.light .ordi-part.sel, .ordi.light .ordi-part.sel { filter: none; }   /* light: flat accent, no glow */
.ordi-part.sel .face { fill: var(--o-on); stroke: var(--accent); }
.ordi-part.sel .face.top { fill: var(--o-on-top); }
.ordi-part.sel .face.recess { fill: var(--o-on-deep); }
.ordi-part.sel .face.chip, .ordi-part.sel .led, .ordi-part.sel .hub { fill: var(--accent); stroke: var(--o-hi); }
.ordi-part.sel .detail, .ordi-part.sel .wire { stroke: var(--accent); }
.ordi-part.sel .ordi-key text { fill: var(--o-hi); }

.ordi-scene { transform-origin: 0 0; transition: transform .7s cubic-bezier(.3, .8, .3, 1); }
.ordi-mv { transition: transform .7s cubic-bezier(.3, .8, .3, 1); }
.ordi-wires { opacity: 0; transition: opacity .25s; pointer-events: none; }
.ordi-svg.open .ordi-wires { opacity: 1; transition: opacity .4s .5s; }
.ordi-svg.open.near .ordi-wires { opacity: 0; transition: opacity .2s; }
.ordi-wires .wire { stroke: var(--o-line); stroke-dasharray: 3 5; }
.ordi-svg .wire-under { fill: none; stroke: var(--o-panel); stroke-width: 5; vector-effect: non-scaling-stroke; stroke-linecap: round; opacity: .8; }
.ordi-svg .trace { stroke: transparent; }
.ordi-svg .wire.hot { stroke: var(--accent); stroke-width: 1.8; stroke-dasharray: none; }
.ordi-svg .pulse { fill: none; stroke: var(--o-hi); stroke-width: 3.5; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 120 1200; stroke-dashoffset: 120; opacity: 0; pointer-events: none; }
.ordi-svg .pulse.go { animation: ordi-flow .5s linear; }
.ordi-spin, .ordi-sweep { transform-box: fill-box; transform-origin: center; }
.ordi-part.sel .ordi-spin, .ordi-svg.seq .ordi-spin, .ordi-svg.run .ordi-spin { animation: ordi-turn 1.5s linear infinite; }
.ordi-svg.run .ordi-sweep { animation: ordi-sweep 1.9s ease-in-out infinite alternate; }
.ordi-svg.run .heat { animation: ordi-flow 1.7s linear infinite; }
/* a close-up that is running: the working pieces take the accent (this is all there is with reduced motion) */
.ordi-svg.run .face.platter, .ordi-svg.run .face.arm, .ordi-svg.run .face.pipe { stroke: var(--accent); fill: var(--o-on); }
.ordi-svg.run .face.pipe.top { fill: var(--o-on-top); }
.ordi-svg.run .face.live, .ordi-svg.run .hub, .ordi-cell.lit .face { fill: var(--accent); stroke: var(--o-hi); }
.ordi-svg.run .blade, .ordi-svg.run .ordi-spin .detail { stroke: var(--accent); }
.ordi-cell .face { transition: none; }
@keyframes ordi-flow { 0% { stroke-dashoffset: 120; opacity: 1; } 90% { opacity: 1; } 100% { stroke-dashoffset: -1000; opacity: 0; } }
@keyframes ordi-turn { to { transform: rotate(360deg); } }
@keyframes ordi-sweep { from { transform: rotate(-5deg); } to { transform: rotate(17deg); } }
@keyframes ordi-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ordi *, .ordi-svg * { animation: none !important; transition: none !important; } }
.ordi-btn:focus-visible, .ordi-chip:focus-visible, .ordi-zoom:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
