/* PRO-ETUDES — "AutoCAD plan to BIM model" section (dist/bim-scene.js): a dark CAD model space with
   layer colours, axis bubbles and a crosshair in plan view, then a rotatable 3D model. */
.bim-section { position: relative; isolation: isolate; overflow: hidden; background: radial-gradient(ellipse at 15% 0%, #1e53a540, transparent 55%), var(--night, #0a1628); color: #fff; }
.bim-section:before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--hex); background-size: 56px 97px;
  mask-image: radial-gradient(ellipse at 100% 100%, #000, transparent 55%); -webkit-mask-image: radial-gradient(ellipse at 100% 100%, #000, transparent 55%); }
.bim-heading { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: end; margin-bottom: 36px; }
.bim-heading h2 { color: #fff; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.1; letter-spacing: -.035em; margin: 0; }
.bim-heading>p { color: #c9d3e0; font-size: 17px; line-height: 1.7; margin: 0; }

.bim-viewer { --archi: #e8eef7; --struct: #f7761f; --fluid: #38bdf8; --elec: #facc15; --annot: #ef4444;
  border: 1px solid #ffffff24; border-radius: 16px; overflow: hidden; background: #0d1117; box-shadow: 0 40px 90px -40px #000000b3, inset 0 1px 0 #ffffff14; }
.bim-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 12px 14px; background: linear-gradient(#1a212c, #141a23); border-bottom: 1px solid #ffffff1a; }
.bim-views, .bim-layers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bim-toolbar button { border: 1px solid #ffffff26; background: #ffffff0a; color: #dbe3ee; border-radius: 6px; padding: 7px 12px; font: 600 13px/1.2 var(--body); display: inline-flex; align-items: center; gap: 8px; transition: background .2s, border-color .2s, color .2s; }
.bim-toolbar button:hover { background: #ffffff17; }
.bim-views button[aria-pressed=true] { background: var(--accent, #f7761f); border-color: var(--accent, #f7761f); color: #0a1628; }
.bim-layers-label { font: 500 10px/1 var(--mono); letter-spacing: .12em; color: #8fa0b6; margin-inline-end: 4px; }
.bim-layers button i { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.bim-layers .layer-archi i { color: var(--archi); } .bim-layers .layer-struct i { color: var(--struct); }
.bim-layers .layer-fluid i { color: var(--fluid); } .bim-layers .layer-elec i { color: var(--elec); }
.bim-layers button[aria-pressed=false] { color: #8fa0b6; text-decoration: line-through; }
.bim-layers button[aria-pressed=false] i { opacity: .3; }

.bim-stage { position: relative; aspect-ratio: 1000 / 600; cursor: grab; touch-action: pan-y;
  background: radial-gradient(#ffffff14 1px, transparent 1.2px) 0 0 / 24px 24px, radial-gradient(ellipse at 50% 40%, #16202e, #0d1117 70%); }
.bim-stage:active { cursor: grabbing; }
.is-plan .bim-stage { cursor: none; }
.bim-stage:focus-visible { outline: 3px solid var(--accent, #f7761f); outline-offset: -3px; }
.bim-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bim-path { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: opacity .3s; }
.bim-archi { stroke: var(--archi); stroke-opacity: .7; }
.bim-struct { stroke: var(--struct); stroke-width: 1.2; }
.bim-fluid { stroke: var(--fluid); stroke-width: 1.6; }
.bim-elec { stroke: var(--elec); stroke-width: 1.3; }
.bim-annot { stroke: var(--annot); stroke-opacity: .75; stroke-dasharray: 18 4 2 4; }
.bim-dims { stroke: #9fb3cc; stroke-opacity: .8; }
.bim-fill { fill: #3b7bf0; fill-opacity: .07; stroke: none; }
.bim-bubble, .bim-dim-text { transition: opacity .4s; }
.bim-viewer:not(.is-plan) .bim-bubble, .bim-viewer:not(.is-plan) .bim-dim-text { opacity: .55; }
.bim-bubble circle { fill: #0d1117; stroke: var(--annot); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bim-bubble text, .bim-dim-text { fill: #e8eef7; font: 600 13px/1 var(--mono); }
.bim-dim-text { fill: #9fb3cc; font-size: 12px; }
.bim-cross { fill: none; stroke: #e8eef7; stroke-opacity: .55; stroke-width: 1; vector-effect: non-scaling-stroke; }
.hide-archi .bim-archi, .hide-archi .bim-fill { display: none; }
.hide-struct .bim-struct { display: none; }
.hide-fluid .bim-fluid { display: none; }
.hide-elec .bim-elec { display: none; }

.bim-hud { position: absolute; left: 14px; right: 14px; display: flex; gap: 18px; align-items: center; pointer-events: none; font: 500 11px/1 var(--mono); letter-spacing: .1em; color: #9fb3cc; }
.bim-hud-top { top: 14px; justify-content: space-between; }
.bim-hud-bottom { bottom: 14px; justify-content: flex-start; }
.bim-hud-bottom b { color: #e8eef7; font-weight: 600; margin-inline-start: 4px; }
.bim-hud-top>span:not(.bim-compass) { padding: 6px 9px; border: 1px solid #ffffff1f; border-radius: 5px; background: #0d1117cc; }
.bim-mode-plan, .is-plan .bim-mode-model { display: none; }
.is-plan .bim-mode-plan { display: inline; }
.bim-compass { position: relative; width: 38px; height: 38px; border: 1px solid #ffffff33; border-radius: 50%; display: grid; place-content: center; color: #e8eef7; background: #0d1117cc; }
.bim-compass i { position: absolute; inset: 4px; }
.bim-compass i:before { content: ''; position: absolute; left: 50%; top: 0; width: 0; height: 0; transform: translateX(-50%); border: 5px solid transparent; border-top: 0; border-bottom: 9px solid var(--accent, #f7761f); }
.bim-hud-bottom { direction: ltr; }
.bim-note { margin: 0; padding: 11px 14px; font-size: 13px; color: #8fa0b6; border-top: 1px solid #ffffff14; background: #0d1117; }
.bim-hint { color: #dbe3ee; }
.is-plan .bim-hint { visibility: hidden; }

/* Intro: the plan is traced, layer after layer. */
@media (prefers-reduced-motion: no-preference) {
  .is-drawing .bim-path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: bim-draw 1.6s cubic-bezier(.65, 0, .35, 1) forwards; }
  .is-drawing .bim-dims { animation-delay: .1s; } .is-drawing .bim-annot { animation-delay: .2s; }
  .is-drawing .bim-archi { animation-delay: .35s; } .is-drawing .bim-struct { animation-delay: .6s; }
  .is-drawing .bim-fluid { animation-delay: .85s; } .is-drawing .bim-elec { animation-delay: 1.05s; }
}
@keyframes bim-draw { to { stroke-dashoffset: 0; } }

@media (max-width: 900px) {
  .bim-heading { grid-template-columns: 1fr; gap: 16px; }
  .bim-stage { aspect-ratio: 4 / 3.4; }
  .bim-layers-label { display: none; }
}
@media (max-width: 560px) {
  .bim-toolbar button { padding: 7px 9px; font-size: 12px; }
  .bim-hud { font-size: 9px; gap: 10px; }
  .bim-compass { width: 30px; height: 30px; }
}
