/* ---------------------------------------------------------------
   Concept: "The Artefact". One product, drawn by hand, sharpened,
   filled with material, brought to life, then kept under watch.
   Loaded after story.css; reuses .peak, panels and tabs from it.
   --------------------------------------------------------------- */

.peak--artefact .peak__panel { max-width: 30rem; }
.peak--artefact .peak__panel .statement { max-width: 14ch; }
.peak--artefact .peak__sticky { background: var(--ink-0); }

/* ---------- The studio ---------- */
.art { position: absolute; inset: 0; overflow: hidden; }
.art__grid {
  position: absolute; inset: -60px; pointer-events: none;
  background-image:
    linear-gradient(rgba(233,230,223,0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233,230,223,0.22) 1px, transparent 1px),
    linear-gradient(rgba(233,230,223,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233,230,223,0.05) 1px, transparent 1px);
  background-size: 240px 240px, 240px 240px, 48px 48px, 48px 48px;
  background-position: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 66% 50%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 60% 70% at 66% 50%, #000 20%, transparent 78%);
  opacity: 0.55; transition: opacity 1.4s var(--ease-in-out); will-change: transform;
}
.mode-ai .art__grid { opacity: 0.16; }
.mode-obs .art__grid { opacity: 0.42; }

.art__stage {
  position: absolute; right: 5vw; top: 50%; width: min(54vw, 800px); aspect-ratio: 3 / 2;
  transform: translateY(-54%); perspective: 1500px; perspective-origin: 50% 50%;
}
.art__tilt { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.art__slab { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; border-radius: 12px; }
.art__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.art__shadow {
  position: absolute; inset: 0; border-radius: 12px; opacity: 0; pointer-events: none;
  box-shadow: 0 60px 110px -30px rgba(0,0,0,0.85), 0 20px 40px -20px rgba(0,0,0,0.6);
  transform: translateZ(-2px);
}
.art__glass {
  position: absolute; inset: 0; border-radius: 12px; opacity: 0; pointer-events: none;
  --lx: 50%; --ly: 40%;
  background:
    radial-gradient(420px 320px at var(--lx) var(--ly), rgba(255,255,255,0.075), transparent 65%),
    linear-gradient(115deg, rgba(255,255,255,0.05) 0%, transparent 34%, transparent 62%, rgba(255,255,255,0.025) 100%);
}
.art__scan {
  position: absolute; left: -2%; right: -2%; top: 0; height: 18%; opacity: 0; pointer-events: none;
  transform: translateY(-40%);
  background: linear-gradient(to bottom, transparent, rgba(201,168,106,0.10) 70%, rgba(201,168,106,0.32) 100%);
}
.art__scan::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); box-shadow: 0 0 12px rgba(201,168,106,0.6); }

/* ---------- Layers inside the SVG ---------- */
.sk path { fill: none; stroke: #c4c0b6; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.sk path.p2 { stroke-width: 1; opacity: 0.32; }
.vec path { fill: none; stroke: rgba(235,232,225,0.62); stroke-width: 1; vector-effect: non-scaling-stroke; }
.vec path.key { stroke: var(--accent); }
.vec path.soft { stroke: rgba(235,232,225,0.3); }
.fill text { font-family: var(--font-body); font-size: 12.5px; fill: var(--text-on-ink-muted); }
.fill text.t-value { font-family: var(--font-display); font-size: 22px; font-weight: 400; fill: var(--text-on-ink); letter-spacing: 0.01em; }
.fill text.t-title { fill: var(--text-on-ink); font-weight: 500; }
.fill text.t-mono { font-family: var(--font-mono); font-size: 11px; fill: var(--text-on-ink-faint); letter-spacing: 0.04em; }
.fill text.t-chip { font-family: var(--font-mono); font-size: 9.5px; fill: var(--accent); }
.fill text.t-brand { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.22em; fill: var(--text-on-ink); }
.fill text.t-nav { fill: var(--text-on-ink-faint); }
.fill text.t-nav.on { fill: var(--text-on-ink); }
.fill text.t-btn { font-family: var(--font-mono); font-size: 9px; fill: var(--ink-0); letter-spacing: 0.06em; }

.live text { font-family: var(--font-mono); font-size: 10px; fill: var(--text-on-ink); letter-spacing: 0.04em; }
.live .pill-txt { fill: var(--ink-0); }
.live .flow { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 6; opacity: 0.55; }
.mode-ai .live .flow { animation: flowdash 1.6s linear infinite; }
@keyframes flowdash { to { stroke-dashoffset: -20; } }
.live .live-dot { fill: var(--accent); }
.mode-ai .live .live-halo { animation: halo 2.2s var(--ease-in-out) infinite; transform-origin: center; transform-box: fill-box; }
@keyframes halo { 0% { opacity: 0.7; transform: scale(0.6); } 100% { opacity: 0; transform: scale(2.6); } }
.live .cursor { fill: var(--paper-0); stroke: var(--ink-0); stroke-width: 1.2; }

.obs .check { fill: var(--ink-0); stroke: var(--accent); stroke-width: 1.2; }
.obs .tick { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.obs .warn .check { stroke: #d98b3a; }
.obs .warn .tick { stroke: #d98b3a; }
.obs text { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.05em; fill: var(--text-on-ink-muted); }
.obs text.amber { fill: #d98b3a; }
.obs text.ok { fill: var(--accent); }
.obs .lead { fill: none; stroke: rgba(233,230,223,0.35); stroke-width: 1; }
.obs .lead.amber { stroke: rgba(217,139,58,0.6); }

/* ---------- Drafting callouts, swatches, telemetry ---------- */
.art__dims { position: absolute; inset: 0; pointer-events: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--accent); }
.dim { position: absolute; opacity: 0; }
.dim i { position: absolute; background: currentColor; opacity: 0.6; }
.dim--top { top: -34px; left: 0; right: 0; height: 12px; }
.dim--top i.l { left: 0; right: 0; top: 6px; height: 1px; }
.dim--top i.a { left: 0; top: 0; width: 1px; height: 12px; }
.dim--top i.b { right: 0; top: 0; width: 1px; height: 12px; }
.dim--top span { position: absolute; left: 50%; top: -2px; transform: translate(-50%, -100%); padding: 0 8px; background: var(--ink-0); }
.dim--left { left: -34px; top: 0; bottom: 0; width: 12px; }
.dim--left i.l { top: 0; bottom: 0; left: 6px; width: 1px; }
.dim--left i.a { top: 0; left: 0; height: 1px; width: 12px; }
.dim--left i.b { bottom: 0; left: 0; height: 1px; width: 12px; }
.dim--left span { position: absolute; top: 50%; left: 4px; transform: translate(-100%, -50%) rotate(-90deg); transform-origin: right center; padding: 0 8px; background: var(--ink-0); white-space: nowrap; }
.dim--note { left: 24.5%; top: 38%; }
.dim--note span { display: block; white-space: nowrap; padding-left: 14px; border-left: 1px solid rgba(201,168,106,0.6); color: var(--text-on-ink-muted); }
.dim--note span b { color: var(--accent); font-weight: 500; }

.art__swatches { position: absolute; left: 2%; top: 100%; margin-top: 30px; display: grid; grid-auto-flow: column; gap: 34px; opacity: 0; pointer-events: none; }
.swatch { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--text-on-ink-faint); white-space: nowrap; }
.swatch i { display: block; width: 26px; height: 26px; border-radius: 3px; border: 1px solid rgba(233,230,223,0.14); }
.swatch b { display: block; color: var(--text-on-ink-muted); font-weight: 500; margin-bottom: 2px; }
.swatch--type { grid-template-columns: 26px 1fr; }
.swatch--type i { border: 0; font-family: var(--font-display); font-size: 22px; line-height: 26px; text-align: center; color: var(--text-on-ink); }

.art__readout {
  position: absolute; left: -6%; bottom: -9%; width: 272px; padding: 16px 18px 14px; opacity: 0;
  background: rgba(7,9,12,0.86); border: 1px solid rgba(233,230,223,0.14); border-radius: 6px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; color: var(--text-on-ink-muted);
  transform: translateZ(40px);
}
.art__readout h5 { font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--text-on-ink-faint); margin: 0 0 10px; font-weight: 500; display: flex; justify-content: space-between; }
.art__readout h5 em { font-style: normal; color: var(--accent); }
.art__readout h5 em::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; transform: translateY(-1px); }
.mode-obs .art__readout h5 em::before { animation: blink 1.8s var(--ease-in-out) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.art__readout .row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid rgba(233,230,223,0.08); opacity: 0; }
.art__readout .row b { font-weight: 500; color: var(--text-on-ink); }
.art__readout .row b.amber { color: #d98b3a; }
.art__readout .row b.ok { color: var(--accent); }

.art__ring { position: absolute; left: 50%; top: 50%; width: 150%; height: 150%; transform: translate(-50%, -50%) translateZ(-60px) rotate(-9deg); opacity: 0; pointer-events: none; overflow: visible; }
.art__ring .orbit { fill: none; stroke: rgba(201,168,106,0.6); stroke-width: 1; stroke-dasharray: 2 6; }
.art__ring .orbit-solid { fill: none; stroke: rgba(233,230,223,0.08); stroke-width: 1; }
.art__ring .sat { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 14 986; }
.mode-obs .art__ring .sat { animation: orbit 11s linear infinite; }
@keyframes orbit { to { stroke-dashoffset: -1000; } }

/* ---------- Static states: no JS, or motion off ---------- */
html:not(.js) .art__stage { position: relative; right: auto; top: auto; transform: none; margin: 3rem auto 0; width: min(86vw, 700px); }
html:not(.js) .art .sk, html:not(.js) .art__dims, html:not(.js) .art__swatches, html:not(.js) .art__scan { display: none; }
html:not(.js) .art .vec { opacity: 0.25; }
html:not(.js) .art__glass, html:not(.js) .art__shadow, html:not(.js) .art__readout, html:not(.js) .art__readout .row, html:not(.js) .art__ring, html:not(.js) .dim { opacity: 1; }
html:not(.js) .art { position: relative; inset: auto; padding-bottom: 4rem; display: flex; justify-content: center; }

/* Dev scrub slider */
.scrub { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 100; width: 420px; display: flex; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-on-ink-muted); background: rgba(7,9,12,0.8); padding: 8px 12px; border: 1px solid var(--ink-line); border-radius: 6px; }
.scrub input { flex: 1; }
.scrub[hidden] { display: none; }

