/* ============================================================
   ABSOLUTE CORE — COMPONENTS + GOLD GLOW / BUTTON SYSTEM
   Link AFTER core-tokens.css. Contains: base, grain (3%), gold
   mesh, buttons, cards, forms, aspect-ratio utilities, scroll
   reveals, shimmer skeletons, confirmation morph, page fades.
   Animate transform/opacity ONLY.
   Spec: ~/workspace/system/ABSOLUTE-CORE-SYSTEM-2026-11-20.md
   ============================================================ */

/* — Base — */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--base);
  color: var(--cream);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--gold); color: var(--base); }
a { color: var(--cyan); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* Industry accent wash: a whisper of the trade color over the core. */
.accent-wash { position: relative; }
.accent-wash::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--accent-wash);
}

/* — Film grain overlay (3%) on full-bleed sections: class="grain".
     Fixed full-page variant: class="grain-fixed" on a wrapper. — */
.grain { position: relative; isolation: isolate; }
.grain::after, .grain-fixed::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}
.grain-fixed::after { position: fixed; z-index: 90; }
.grain > * { position: relative; z-index: 2; }

/* — Gold mesh: soft radial gold at 4%, hero corners ONLY: class="gold-mesh" — */
.gold-mesh { position: relative; }
.gold-mesh::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(560px 380px at 0% 0%, rgba(230,179,77,0.04), transparent 65%),
    radial-gradient(560px 380px at 100% 0%, rgba(230,179,77,0.04), transparent 65%);
}

/* — Buttons: gold fill takes CREAM text; press = scale 0.96, spring back — */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font: 600 15px/1 var(--font); letter-spacing: 0.01em;
  padding: 14px 26px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast) var(--ease-out-expo),
              background var(--duration-fast) var(--ease-out-expo),
              border-color var(--duration-fast) var(--ease-out-expo);
  will-change: transform;
}
.btn:active { transform: scale(0.96); }                  /* physical press */
.btn-gold { background: var(--gold); color: var(--cream); }
.btn-gold:hover { background: var(--gold-bright); box-shadow: var(--glow-hover); }
.btn-gold:active { background: var(--gold-deep); box-shadow: var(--shadow-pressed); }
.btn-ghost {
  background: transparent; color: var(--cream);
  border-color: var(--gold-border);
}
.btn-ghost:hover { box-shadow: var(--glow-hover); border-color: var(--gold); }
.btn-cyan { /* the ONE secondary CTA allowed per page */
  background: transparent; color: var(--cyan); border-color: rgba(73,194,255,0.35);
}
.btn-cyan:hover { box-shadow: 0 0 12px rgba(73,194,255,0.25); }

/* — Confirmation morph (400ms): button → checkmark + gold radial flash — */
.btn.is-done {
  background: var(--success); color: var(--base); pointer-events: none;
  transition: background 400ms var(--ease-out-expo);
  animation: core-flash 400ms var(--ease-out-expo);
}
.btn.is-done .btn-label { opacity: 0; transform: scale(0.6); }
.btn .btn-label { transition: opacity var(--duration-fast) var(--ease-out-expo), transform var(--duration-fast) var(--ease-out-expo); }
.btn.is-done::after {
  content: ""; position: absolute; width: 22px; height: 12px;
  border-left: 3px solid var(--base); border-bottom: 3px solid var(--base);
  transform: rotate(-45deg) translateY(-2px);
}
@keyframes core-flash {
  0% { box-shadow: 0 0 0 rgba(230,179,77,0); }
  35% { box-shadow: 0 0 34px rgba(230,179,77,0.55); }
  100% { box-shadow: 0 0 0 rgba(230,179,77,0); }
}

/* — Cards: Level 2 surface + 1px gold-20% border.
     Hover: lift 4px, soft gold shadow, film loop fades 0.8 → 1.0. — */
.card {
  background: var(--surface-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-normal) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-expo),
              border-color var(--duration-normal) var(--ease-out-expo);
}
.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--glow-gold), var(--shadow-card);
  border-color: var(--gold);
}
.card video.core-video { opacity: 0.8; transition: opacity var(--duration-normal) var(--ease-out-expo); }
.card:hover video.core-video { opacity: 1; }

/* — Forms: resting border 1px cream/30% → focus 1.5px gold + 4px glow.
     Errors are the ONLY danger color. — */
.field input, .field textarea, .field select {
  width: 100%; background: var(--surface-1); color: var(--cream);
  border: 1px solid var(--cream-30); border-radius: var(--r-sm);
  padding: 13px 16px; font: 400 15px/1.4 var(--font);
  transition: border-color var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-fast) var(--ease-out-expo);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border: 1.5px solid var(--gold);
  box-shadow: 0 0 4px rgba(230,179,77,0.50), 0 0 0 4px rgba(230,179,77,0.10);
}
.field .error { color: var(--danger); font-size: 13px; margin-top: var(--s-1); }
.field.has-error input { border-color: var(--danger); }

/* — Aspect-ratio utilities: reserve the space, nothing ever shifts — */
.ar-16x9 { aspect-ratio: 16 / 9; } .ar-9x16 { aspect-ratio: 9 / 16; }
.ar-4x3  { aspect-ratio: 4 / 3; }  .ar-1x1  { aspect-ratio: 1 / 1; }
.ar-3x2  { aspect-ratio: 3 / 2; }  .ar-21x9 { aspect-ratio: 21 / 9; }

/* — Scroll reveals: fade + rise 24px, staggered 80ms via --i (set by core-utils.js) — */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.is-in {
  opacity: 1; transform: translateY(0);
  transition: opacity var(--duration-normal) var(--ease-out-expo),
              transform var(--duration-normal) var(--ease-out-expo);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}

/* — Gold shimmer skeleton: reserved space until media loads (zero layout shift) — */
.skeleton {
  background: linear-gradient(100deg, var(--surface-1) 40%, rgba(230,179,77,0.10) 50%, var(--surface-1) 60%);
  background-size: 200% 100%;
  animation: core-shimmer 1.6s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes core-shimmer { to { background-position: -200% 0; } }
.media-frame { position: relative; overflow: hidden; background: var(--surface-1); }
.media-frame > img, .media-frame > video, .media-frame > canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}

/* — Page/section fade (300ms) + LIVE WALKTHROUGH gold flash — */
.page-enter { animation: core-page-in var(--dur-page) var(--ease-out-expo); }
@keyframes core-page-in { from { opacity: 0; } to { opacity: 1; } }
.flash-gold { animation: core-flash var(--duration-normal) var(--ease-out-expo); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .skeleton { animation: none; }
  .card:hover, .btn-gold:hover { transform: none; }
  .card video.core-video { opacity: 1; }
}

/* Video orchestrator rev 2026-11-20 (bq-20261120-135200): tap-to-play badge —
   mobile walkthroughs only; hidden on desktop and once playing. */
.vid-tap-badge{display:none}
@media (max-width:767px){
  .work-img .vid-tap-badge{display:block;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:3;background:rgba(5,5,7,.85);color:#ffd98a;border:1px solid rgba(255,217,138,.7);border-radius:999px;padding:9px 18px;font-size:13.5px;font-weight:700;letter-spacing:.06em;pointer-events:none}
  .work-img.cv-playing .vid-tap-badge{display:none}
  .work-img .work-live{display:none}
}
