/* ===================================================================
   The scroll-driven stage, in the portfolio's language.

   theme.css carries the tokens and the site chrome (navbar, preloader,
   overlays, cards); this file is only the parts particular to the 3D
   stage — the subject's ground, the callouts, and the readouts around it.
   =================================================================== */

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: #2a1a00;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--transition-base);
}
.skip-link:focus { transform: none; }

/* The instruments are near-white and lit by a neutral studio rig, so the
   stage is its own dark room rather than the page gradient. A gradient
   running behind a floating object reads as a seam. */
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  z-index: 1;
  background: var(--stage-ground);
}

/* A slow gold bloom under the subject, so the floor is felt, not drawn. */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 46% 30% at 50% 76%, rgba(245, 200, 66, .10), transparent 70%);
}

.drawing-grid {
  position: absolute;
  z-index: 0;
  inset: 72px 0 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(to right, rgba(245, 200, 66, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 200, 66, .05) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 34%, black 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 34%, black 100%);
}

canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.annotation-layer { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.annotation-layer svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ------------------------------------------------------------ callouts */
.callout {
  position: absolute;
  width: 232px;
  padding: 11px 14px 12px;
  background: linear-gradient(135deg, rgba(32, 14, 18, .92), rgba(46, 18, 24, .88));
  border: 1px solid var(--border-color);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  opacity: 0;
  transform: translate(-8px, calc(-50% + 4px));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5), 0 0 24px rgba(245, 200, 66, .07);
  transition: opacity .36s cubic-bezier(0.16, 1, 0.3, 1), transform .36s cubic-bezier(0.16, 1, 0.3, 1);
}
.callout.on { opacity: 1; transform: translate(0, -50%); }
.callout b {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
.callout span {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.5;
}

/* --------------------------------------------------------- title block */
.title-block {
  position: absolute;
  z-index: 5;
  top: 122px;
  left: 0;
  right: 0;
  pointer-events: none;
}
.title-block .container { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }

.kicker {
  margin: 0 0 10px;
  font-family: var(--font-pirate);
  font-size: 1.1rem;
  letter-spacing: .05em;
  color: var(--gold-dark);
}

.title-block h1 {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -.01em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .55);
}

.intro {
  max-width: 34ch;
  margin: 16px 0 0;
  color: var(--text-secondary);
  font-size: .92rem;
  line-height: 1.6;
}

/* ------------------------------------------------------------- readout */
.readout {
  position: absolute;
  z-index: 5;
  top: 128px;
  right: 24px;
  width: 208px;
  border-top: 1px solid var(--gold);
  pointer-events: none;
}
.readout div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.readout span { color: var(--text-muted); }
.readout strong { font-weight: 600; text-align: right; color: var(--text-primary); }
.readout .live { color: var(--gold); }
.readout .live i {
  display: inline-block;
  width: 6px; height: 6px;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  background: #00d26a;
  animation: pulseDot 2s ease-in-out infinite;
}

/* ------------------------------------------------------------- chapter */
.chapter {
  position: absolute;
  z-index: 5;
  right: 24px;
  bottom: 176px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  pointer-events: none;
}
.chapter span { color: var(--gold); font: 600 10px/1 var(--font-mono); letter-spacing: .1em; }
.chapter strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ------------------------------------------------------------ timeline */
.timeline {
  position: absolute;
  z-index: 6;
  left: 24px;
  right: 24px;
  bottom: 96px;
  display: grid;
  grid-template-columns: 1fr 88px;
  align-items: center;
  gap: 22px;
}
.timeline__track { height: 2px; border-radius: 2px; background: rgba(245, 200, 66, .14); position: relative; }
.timeline__track > i {
  display: block; height: 2px; width: 0; border-radius: 2px;
  background: var(--treasure-gradient);
  box-shadow: 0 0 10px rgba(245, 200, 66, .5);
}
.timeline__track > b {
  position: absolute; top: -3px; left: 0;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(245, 200, 66, .7);
  transform: translateX(-50%);
}
.timeline__value {
  text-align: right;
  font: 600 10px/1 var(--font-mono);
  letter-spacing: .1em;
  color: var(--text-muted);
}

/* ------------------------------------------------------- product switch */
.product-switch {
  position: absolute;
  z-index: 7;
  left: 24px;
  right: 24px;
  bottom: 26px;
  display: flex;
  border-top: 1px solid var(--border-color);
}
.product-switch button {
  appearance: none;
  min-width: 188px;
  padding: 15px 38px 0 0;
  display: flex;
  gap: 10px;
  border: 0;
  background: none;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
  transition: color var(--transition-base);
}
.product-switch button:hover,
.product-switch button:focus-visible,
.product-switch button.is-active { color: var(--text-primary); }
.product-switch button:focus-visible { outline: 1px solid var(--gold); outline-offset: 5px; }
.product-switch button span { font: 600 9.5px/1.2 var(--font-mono); letter-spacing: .1em; color: var(--text-muted); }
.product-switch button strong { font-family: var(--font-display); font-size: .82rem; font-weight: 600; }
.product-switch button.is-active span { color: var(--gold); }

.build-note {
  position: absolute;
  z-index: 5;
  right: 24px;
  bottom: 23px;
  margin: 0;
  color: var(--text-muted);
  font: 500 8.5px/1.5 var(--font-mono);
  letter-spacing: .05em;
  text-align: right;
  text-transform: uppercase;
  opacity: .8;
}

.track { height: 760vh; position: relative; z-index: 0; }

@media (max-width: 900px) {
  .title-block { top: 108px; }
  .title-block h1 { max-width: 11ch; }
  .intro { display: none; }
  .readout { right: 18px; top: 114px; width: 184px; }
  .timeline { left: 18px; right: 18px; }
  .product-switch { left: 18px; right: 18px; }
  .build-note { display: none; }
}

@media (max-width: 680px) {
  .stage { min-height: 600px; }
  .drawing-grid { inset: 60px 0 0; }
  .title-block { top: 92px; }
  .title-block h1 { max-width: none; font-size: 1.5rem; }
  .title-block h1 br { display: none; }
  .kicker { margin-bottom: 6px; font-size: .95rem; }
  .readout { top: auto; bottom: 182px; right: 18px; width: 158px; }
  .readout div:nth-child(1), .readout div:nth-child(2) { display: none; }
  .chapter { left: 18px; right: auto; bottom: 188px; }
  .chapter strong { font-size: 1.15rem; }
  .timeline { bottom: 114px; grid-template-columns: 1fr; }
  .timeline__value { display: none; }
  .product-switch button { min-width: 0; flex: 1; padding-right: 8px; }
  .callout { width: 156px; padding: 8px 10px; }
  .callout span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .callout { transition: none; }
}
