/* COMPONENTS — reusable pieces of the visual system.
   glass / gold line / timeline (ruler, tracks, clips, keyframes, playhead,
   marker) / waveform / bounding box / timecode chip / nav / placeholder. */

/* ---- Smoked glass --------------------------------------------------- */
.glass {
  background: var(--glass-fallback);
  border: var(--glass-border);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-fill);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(112%);
    backdrop-filter: blur(var(--glass-blur)) saturate(112%);
  }
}
.glass--panel { border-radius: var(--radius-panel); }
.glass--chip  { border-radius: var(--radius-chip); }
/* tiny gold accent on a glass edge */
.glass--accent::before {
  content: ""; position: absolute; top: -1px; left: 22px; width: 36px; height: 1px;
  background: var(--c-gold);
}

/* ---- Gold line (recurring motif) ----------------------------------- */
.gold-line { display: block; background: var(--c-gold); }
.gold-line--h { height: 1px; width: 100%; }
.gold-line--v { width: 1px; height: 100%; }

/* ---- Timeline ------------------------------------------------------ */
.timeline { position: relative; display: grid; gap: 7px; }
.timeline__ruler {
  height: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(241, 232, 218, .22) 0 1px, transparent 1px 60px) left bottom / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, rgba(241, 232, 218, .12) 0 1px, transparent 1px 12px) left bottom / 100% 5px no-repeat;
  border-bottom: 1px solid var(--c-line-soft);
}
.track { position: relative; height: var(--track-h, 16px); }
.clip {
  position: absolute; top: 0; bottom: 0;
  left: var(--x); width: var(--w);
  border-radius: 2px;
  background: rgba(241, 232, 218, .065);
  border: 1px solid rgba(241, 232, 218, .1);
}
.clip--warm { background: rgba(156, 123, 60, .12); border-color: rgba(156, 123, 60, .28); }
.clip--active { border-color: var(--c-gold-a55); background: rgba(156, 123, 60, .16); }
.clip--audio {
  background: linear-gradient(180deg, rgba(77, 163, 255, .09), rgba(127, 214, 255, .04));
  border-color: rgba(127, 214, 255, .24);
  box-shadow: inset 0 0 12px rgba(77, 163, 255, .08);
  overflow: hidden;
}
.clip--audio .waveform { position: absolute; inset: 2px 0; width: 100%; height: calc(100% - 4px); color: rgba(127, 214, 255, .62); }

.keyframe {
  position: absolute; top: 50%; left: var(--x);
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  transform: rotate(45deg);
  border: 1px solid var(--c-gold-light);
  background: var(--c-bg-deep);
}
.keyframe--on { background: var(--c-gold); border-color: var(--c-gold); }
/* live hero: keyframes light up when the playhead passes (js/hero.js) */
.kf-live .keyframe { background: var(--c-bg-deep); border-color: var(--c-gold-light); transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out); }
.kf-live .keyframe.is-hit { background: #E3B65E; border-color: #F3D493; }
.keyframe::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(243, 196, 104, .85), rgba(243, 196, 104, 0));
}
.kf-live .keyframe.is-hit::after { animation: kf-flash .9s var(--ease-out) both; }
@keyframes kf-flash { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }

/* playhead: 1px gold line + head on the ruler */
.playhead { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--c-gold); transform-origin: top center; }
.playhead::before {
  content: ""; position: absolute; top: -2px; left: -4px; width: 9px; height: 11px;
  background: var(--c-gold);
  clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%);
}
.marker {
  position: absolute; width: 7px; height: 7px; margin-left: -3px;
  border-radius: 50%; border: 1px solid var(--c-gold-light);
}

/* ---- Waveform (SVG <symbol id="wf"> reused via <use>) -------------- */
.waveform { display: block; overflow: visible; }
.waveform use { stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }

/* ---- Bounding box (corner brackets + handles) ----------------------- */
.bbox { position: absolute; pointer-events: none; }
.bbox__c { position: absolute; width: 14px; height: 14px; border: 0 solid rgba(241, 232, 218, .42); }
.bbox__c::after {
  content: ""; position: absolute; width: 5px; height: 5px;
  background: var(--c-bg-deep); border: 1px solid var(--c-gold-light);
}
.bbox__c--tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.bbox__c--tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.bbox__c--bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.bbox__c--br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.bbox__c--tl::after { top: -3px; left: -3px; }
.bbox__c--tr::after { top: -3px; right: -3px; }
.bbox__c--bl::after { bottom: -3px; left: -3px; }
.bbox__c--br::after { bottom: -3px; right: -3px; }

/* ---- Timecode chip -------------------------------------------------- */
.tc-chip { position: absolute; padding: 10px 14px 11px; display: grid; gap: 4px; }
.tc-chip__label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-nano); font-weight: 500; letter-spacing: var(--track-mid); text-transform: uppercase; color: var(--c-ivory-dim); }
.tc-chip__label::before { content: ""; width: 6px; height: 6px; transform: rotate(45deg); background: var(--c-gold); }
.tc-chip__tc { position: relative; font-size: .95rem; font-weight: 400; letter-spacing: .06em; color: var(--c-ivory); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; white-space: nowrap; }
/* live timecode (js/hero.js): every digit in a fixed-width cell, so nothing shifts
   even if the font has no tabular figures; an amber copy fades in on each new second */
.tc-row { display: inline-flex; letter-spacing: 0; }
.tc-d { display: inline-block; width: .64em; text-align: center; }
.tc-s { display: inline-block; width: .34em; text-align: center; opacity: .7; }
.tc-row--glow {
  position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none;
  color: #F0C877; text-shadow: 0 0 6px rgba(240, 190, 96, .85), 0 0 14px rgba(224, 160, 64, .45);
  will-change: opacity;
}

/* ---- Site nav -------------------------------------------------------- */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 10; }
.site-nav {
  height: var(--nav-h);
  padding-inline: var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
}
.site-nav__brand {
  font-size: .75rem; font-weight: 500;
  letter-spacing: .32em; text-transform: uppercase; color: var(--c-ivory);
}
.site-nav__link {
  position: relative; padding-block: 6px;
  font-size: var(--fs-nav); font-weight: 400; letter-spacing: .04em; color: var(--c-ivory-muted);
  transition: color var(--dur-xs) var(--ease-out);
}
.site-nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--c-gold); transform: scaleX(.3); transform-origin: left;
  transition: transform var(--dur-sm) var(--ease-out);
}
.site-nav__link:hover, .site-nav__link:focus-visible { color: var(--c-ivory); }
.site-nav__link:hover::after, .site-nav__link:focus-visible::after { transform: scaleX(1); }

/* ---- Placeholder for future sections --------------------------------- */
.section-placeholder {
  min-height: 34vh;
  padding: 72px var(--pad-x);
  scroll-margin-top: 24px;
  display: grid; align-content: start; gap: 18px;
}
.section-placeholder__rule { height: 1px; max-width: 220px; background: linear-gradient(90deg, var(--c-gold), transparent); }
