/* ==========================================================================
   AuCore — Showcase page styles
   Only what the demos need; the design system carries the rest.
   ========================================================================== */

.demo { padding: 72px 0; border-top: 1px solid var(--line); }
.demo:first-of-type { border-top: 0; }
.demo-head { max-width: 640px; margin-bottom: 28px; }
.demo-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; margin-bottom: 12px;
  background: var(--accent-bg); color: var(--accent);
  font-family: var(--mono); font-size: .74rem; font-weight: 650;
}
.demo-body { position: relative; }

.stage {
  position: relative;
  display: grid; place-items: center;
  min-height: 280px; padding: 32px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
}
.stage-tall { min-height: 360px; }
.stage-quiet { background: var(--bg-2); }
.stage-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px;
}
.stage-note { font-size: .8rem; color: var(--text-3); margin-left: auto; }

/* ---------------------------------------------------------- 1 signature -- */

.sig-stroke { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.sig-ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.sig-pulse { fill: none; stroke: var(--accent); stroke-width: 1.4; }

/* ------------------------------------------------------------- 2 router -- */

.r-lane { fill: none; stroke: var(--line-2); stroke-width: 1.6; stroke-linecap: round; }
.r-node { fill: var(--accent); }
.r-packet { fill: var(--text); }
.r-token { fill: var(--accent-2); }
.r-label { font-family: var(--mono); font-size: 8px; fill: var(--text-3); }

/* --------------------------------------------------------------- 3 grid -- */

#grid-field {
  display: grid; gap: 5px; width: 100%; max-width: 640px;
  cursor: crosshair; touch-action: none;
}
.gf-cell {
  aspect-ratio: 1; border-radius: 3px;
  background: rgba(100, 112, 243, .22);
  will-change: transform, opacity;
}

/* -------------------------------------------------------------- 4 morph -- */

#morph-path { fill: url(#morphGrad); }
#morph-halo { fill: none; stroke: var(--accent-line); stroke-width: 1; stroke-dasharray: 4 8; }

/* ----------------------------------------------------------- 5 timeline -- */

.tl-wrap { display: grid; grid-template-columns: 54px 1fr; gap: 18px; width: 100%; max-width: 620px; }
.tl-rail { position: relative; }
.tl-rail::before {
  content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px;
  width: 2px; margin-left: -1px; background: var(--line); border-radius: 2px;
}
#tl-packet {
  position: absolute; left: 50%; top: 4px; width: 16px; height: 16px;
  margin-left: -8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg);
}
.tl-step { display: flex; gap: 12px; align-items: flex-start; height: 52px; }
.tl-dot {
  width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(168, 176, 189, .5);
}
.tl-title { font-size: .89rem; font-weight: 550; color: var(--text); }
.tl-sub { font-size: .78rem; color: var(--text-3); }
.tl-bar { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
#tl-progress { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; }

/* --------------------------------------------------------------- 6 text -- */

.tx-line {
  font-size: clamp(1.4rem, 3.6vw, 2.4rem); font-weight: 650;
  letter-spacing: -.025em; line-height: 1.2; text-align: center;
}
.tx-ch { display: inline-block; will-change: transform, opacity, filter; }
#tx-scramble {
  font-family: var(--mono); color: var(--accent);
  font-size: clamp(1.2rem, 3vw, 1.9rem); font-weight: 600;
}
#tx-cycle { position: relative; height: 46px; overflow: hidden; }
.tx-word {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 650;
  letter-spacing: -.02em; color: var(--text);
}

/* --------------------------------------------------------------- 7 data -- */

#data-bars { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 12px; }
.db-row { display: grid; grid-template-columns: 150px 1fr 46px; gap: 12px; align-items: center; }
.db-label { font-family: var(--mono); font-size: .76rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.db-fill { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); }
.db-val { font-family: var(--mono); font-size: .78rem; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
#data-spark { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
#data-area { fill: url(#sparkGrad); opacity: 0; }

/* --------------------------------------------------------------- 8 path -- */

#path-track { fill: none; stroke: var(--accent-line); stroke-width: 1.6; stroke-linecap: round; }
#path-rider { fill: var(--accent); }
.pt-node { fill: var(--accent-2); }

/* -------------------------------------------------------------- 9 cards -- */

#tilt-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; width: 100%; perspective: 1000px; }
@media (max-width: 820px) { #tilt-row { grid-template-columns: 1fr; } }
.tilt {
  position: relative; padding: 24px; border-radius: var(--radius-lg);
  background: var(--surface-2); border: 1px solid var(--line);
  transform-style: preserve-3d; will-change: transform;
}
.tilt-glow { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; transition: background .2s; }
.tilt h4 { margin: 0 0 6px; font-size: .95rem; }
.tilt p { margin: 0; font-size: .82rem; color: var(--text-3); }
.tilt-ic {
  display: grid; place-items: center; width: 34px; height: 34px;
  margin-bottom: 14px; border-radius: 10px;
  background: var(--accent-bg); color: var(--accent); font-size: 1rem;
}

/* --------------------------------------------------------------- 10 lab -- */

.lab-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 20px; width: 100%; align-items: start; }
@media (max-width: 900px) { .lab-wrap { grid-template-columns: 1fr; } }
#lab-grid { display: grid; gap: 5px; cursor: pointer; }
.lab-cell { aspect-ratio: 1; border-radius: 3px; background: rgba(100, 112, 243, .3); will-change: transform, opacity; }
#lab-controls { display: flex; flex-direction: column; gap: 14px; }
.lab-group > span { display: block; font-size: .74rem; font-weight: 600; color: var(--text-3); margin-bottom: 6px; }
.lab-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.lab-seg button {
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-3); font: inherit; font-size: .76rem; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.lab-seg button:hover { color: var(--text-2); border-color: var(--line-2); }
.lab-seg button[aria-selected="true"] { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
#lab-code { font-size: .74rem; line-height: 1.55; margin: 0; }

/* -------------------------------------------------------------- helpers -- */

.demo-toc {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 16px 0 0;
}
.demo-toc a {
  padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: .78rem; color: var(--text-2);
  transition: border-color .15s, color .15s;
}
.demo-toc a:hover { border-color: var(--accent-line); color: var(--accent); }

/* ==========================================================================
   Showcase v2 additions
   ========================================================================== */

/* ------------------------------------------------------------ hero field -- */

.sc-hero { position: relative; overflow: hidden; }
#sc-field { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
#sc-field > i { position: absolute; display: block; opacity: 0; will-change: transform, opacity; }
.scf-dot  { border-radius: 50%; background: var(--accent); }
.scf-ring { border-radius: 50%; border: 1.5px solid var(--accent); background: none; }
.scf-sq   { border-radius: 3px; background: var(--info); }
.sc-hero-in { position: relative; z-index: 1; }
.sc-ch { display: inline-block; will-change: transform, opacity, filter; }

/* sticky control bar */
.sc-bar {
  position: sticky; top: var(--nav-h); z-index: 40;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0; margin-bottom: 4px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.sc-bar .spacer { margin-left: auto; }

.demo-toc a[aria-current] {
  border-color: var(--accent); color: var(--accent); background: var(--accent-bg);
}

/* -------------------------------------------------------- 11 particles ---- */

#particle-stage {
  position: relative; overflow: hidden; cursor: crosshair;
  touch-action: none; min-height: 300px;
}
#particle-stage .pt {
  position: absolute; display: block; pointer-events: none;
  will-change: transform, opacity;
}
#pt-shock {
  position: absolute; width: 0; height: 0; margin: -95px 0 0 -95px;
  border: 1.5px solid var(--accent); border-radius: 50%;
  opacity: 0; pointer-events: none;
}
.pt-hint {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .84rem; color: var(--text-3); pointer-events: none;
}

/* --------------------------------------------------------- 12 network ----- */

#net-canvas {
  display: block; width: 100%; height: 320px;
  cursor: crosshair; touch-action: none;
}

/* ---------------------------------------------------------- 13 liquid ----- */

#liquid-path { fill: url(#liquidGrad); }
.lq-orbit { fill: none; stroke: var(--accent-line); stroke-width: 1; stroke-dasharray: 3 9; }

/* -------------------------------------------------------- 14 odometer ----- */

#odo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; }
@media (max-width: 780px) { #odo-row { grid-template-columns: 1fr; } }
.odo-block { text-align: center; }
.odo { display: flex; justify-content: center; gap: 2px; }
.odo-col {
  display: block; width: 0.68em; height: 1.3em; overflow: hidden;
  font-family: var(--mono); font-size: clamp(1.5rem, 4vw, 2.3rem);
  font-weight: 650; line-height: 1.3em;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 5px; color: var(--accent);
}
.odo-strip { display: block; will-change: transform; }
.odo-strip b { display: block; height: 1.3em; font-weight: 650; text-align: center; }

/* -------------------------------------------------------- 15 marquee ------ */

.mq { overflow: hidden; padding: 7px 0; }
.mq-track { display: flex; gap: 10px; width: max-content; will-change: transform; }
.mq-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 99px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .78rem; color: var(--text-2);
  will-change: transform; cursor: default;
}
.mq-chip b { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.mq-fade { position: relative; }
.mq-fade::before, .mq-fade::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 90px; z-index: 2; pointer-events: none;
}
.mq-fade::before { left: 0;  background: linear-gradient(90deg, var(--surface), transparent); }
.mq-fade::after  { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }

/* -------------------------------------------------------- 16 loaders ------ */

#loader-row {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; width: 100%;
}
@media (max-width: 900px) { #loader-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { #loader-row { grid-template-columns: repeat(2, 1fr); } }
.ld-cell {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 12px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line);
}
.ld-box { position: relative; width: 46px; height: 46px; display: grid; place-items: center; }
.ld-name { font-size: .72rem; color: var(--text-3); }

#ld-orbit i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--accent);
}
#ld-orbit i:nth-child(2) { inset: 7px;  border-top-color: var(--info); }
#ld-orbit i:nth-child(3) { inset: 14px; border-top-color: var(--ok); }

#ld-pulse i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0;
}

#ld-eq { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
#ld-eq i { display: block; width: 5px; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: bottom; }

#ld-morph i { display: block; width: 30px; height: 30px; background: var(--accent); }

#ld-arc { display: block; }
#ld-arc-path { fill: none; stroke: var(--accent); stroke-width: 3.4; stroke-linecap: round; }
.ld-arc-bg  { fill: none; stroke: var(--line); stroke-width: 3.4; }

#ld-dots { display: flex; gap: 6px; align-items: center; height: 34px; }
#ld-dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ------------------------------------------------------------- 17 iso ----- */

.iso-wrap { perspective: 900px; width: 100%; display: grid; place-items: center; }
#iso-grid {
  display: grid; gap: 4px; width: min(420px, 78vw);
  transform: rotateX(58deg) rotateZ(45deg);
  transform-style: preserve-3d;
}
.iso-cell {
  aspect-ratio: 1; border-radius: 2px;
  background: rgba(100, 112, 243, .28);
  will-change: transform, background-color;
}

/* ---------------------------------------------------------- 18 magnet ----- */

#magnet-field {
  display: grid; gap: 10px; width: 100%; max-width: 600px;
  cursor: crosshair; touch-action: none;
}
.mg-dot {
  aspect-ratio: 1; width: 100%; border-radius: 50%;
  background: var(--accent); opacity: .3;
  will-change: transform, opacity;
}
