/* Background layers, the home hero "stage", staggered intro, and buttons.
   Loaded after style.css and site.css on every public page. */

/* ---------- Shared GhostFibers background (every page except Home) ---------- */
.fx-bg { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.fx-overlay { position: fixed; inset: 0; z-index: -1; background: rgba(8, 42, 47, 0.8); pointer-events: none; }
body.home .fx-bg, body.home .fx-overlay { display: none; }
/* Used when the browser has no WebGL2 (or JS is off): a very soft static glow. */
.fx-bg.fx-fallback {
  background:
    radial-gradient(ellipse at 15% 10%, rgba(201, 164, 92, 0.28), transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(192, 192, 192, 0.16), transparent 55%);
}
.fx-bg canvas { display: block; }

/* ---------- Home hero: a big rounded panel holding the drifting photo wall ---------- */
.hero {
  position: relative;
  margin: 14px 16px 0;
  height: calc(100vh - 28px);
  height: calc(100svh - 28px);
  min-height: 600px;
  max-height: 980px;
  border-radius: 32px;
  overflow: hidden;
  background: #082A2F;
  border: 1px solid var(--border);
  isolation: isolate;
}

/* GridMotion wall (built by public/js/grid-motion.js) */
.gm-host, .gm { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #082A2F; }
.gm-stage {
  position: absolute;
  inset: 0;
  perspective: var(--gm-persp, 1400px);
  perspective-origin: 50% 45%;
  /* soft edge fade: opaque in the middle, melting into the panel at the edges */
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 var(--gm-fx, 9%), #000 calc(100% - var(--gm-fx, 9%)), transparent),
    linear-gradient(to bottom, transparent, #000 var(--gm-fy, 13%), #000 calc(100% - var(--gm-fy, 13%)), transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 var(--gm-fx, 9%), #000 calc(100% - var(--gm-fx, 9%)), transparent),
    linear-gradient(to bottom, transparent, #000 var(--gm-fy, 13%), #000 calc(100% - var(--gm-fy, 13%)), transparent);
  mask-composite: intersect;
}
.gm-grid { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; overflow: hidden; will-change: transform; }
.gm-row { display: flex; width: max-content; flex: 0 0 auto; will-change: transform; }
.gm-tile {
  position: relative;
  flex: 0 0 auto;
  display: block;
  overflow: hidden;
  background: var(--gm-tile, #0F3A40);
  border: 1px solid var(--gm-border, rgba(255, 255, 255, 0.06));
  border-radius: var(--gm-radius, 22px);
}
.gm-tile img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; transition: transform 0.6s ease; }
a.gm-tile { cursor: pointer; }
a.gm-tile:hover img { transform: scale(1.06); }
.gm-gray .gm-tile img { filter: grayscale(1); }
.gm-text {
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  font-family: var(--font-heading);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--gold);
  background: radial-gradient(circle at 50% 40%, #134349, var(--gm-tile, #0F3A40));
}
/* darkness over the wall, with a brighter spotlight that follows the pointer */
.gm-dim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 440px at var(--sx, 50%) var(--sy, 50%), rgba(8, 42, 47, var(--gm-spot, 0.22)) 0%, rgba(8, 42, 47, var(--gm-dim, 0.55)) 100%);
}

/* Behind the text only: dark vignette (readability), warm gold glow, film grain */
.gm-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 52% 46% at 50% 52%, rgba(8, 42, 47, 0.85) 0%, rgba(8, 42, 47, 0.6) 42%, rgba(8, 42, 47, 0) 100%);
}
.gm-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 40% 34% at 50% 48%, rgba(201, 164, 92, 0.2), transparent 70%);
}
.gm-grain {
  position: absolute;
  inset: -60px;
  z-index: 4;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.1s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-18px, 12px); }
  40%  { transform: translate(14px, -20px); }
  60%  { transform: translate(-10px, -8px); }
  80%  { transform: translate(20px, 16px); }
  100% { transform: translate(0, 0); }
}

/* Centered headline block above the wall; only the buttons take clicks, so tiles stay clickable around it */
.hero-copy {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px clamp(20px, 5vw, 64px) 70px;
  pointer-events: none;
}
.hero-copy a, .hero-copy button { pointer-events: auto; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 clamp(14px, 2.4vh, 26px);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(8, 42, 47, 0.6);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero-kicker strong { color: var(--gold-light); font-weight: 600; }
.hero-kicker i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: inline-block; }

.hero h1 {
  font-size: clamp(3rem, 9vw, 7.8rem);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 clamp(16px, 2.6vh, 26px);
  text-transform: uppercase;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.55);
}
.hero h1 .line { display: block; }
.hero h1 .accent { color: var(--gold); }
/* slow gold shimmer on "PIECES" */
.shimmer {
  background: linear-gradient(100deg, #9A7838 0%, #C9A45C 28%, #F1DFAE 48%, #C9A45C 68%, #9A7838 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  animation: blur-in 1s cubic-bezier(0.22, 1, 0.36, 1) forwards, shimmer 7s linear infinite;
  animation-delay: var(--delay, 0s), 1.2s;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -160% 0; } }
.hero-sub {
  margin: 0;
  max-width: 31em;
  font-size: clamp(0.95rem, 1.35vw, 1.1rem);
  color: rgba(242, 239, 234, 0.82);
  font-weight: 300;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: clamp(20px, 3.4vh, 34px); }

/* Round rotating badge, bottom-right of the hero */
.hero-badge {
  position: absolute;
  z-index: 5;
  right: clamp(16px, 2.2vw, 30px);
  bottom: clamp(16px, 2.2vw, 30px);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--gold);
  transition: transform 0.3s ease, border-color 0.3s;
}
.hero-badge:hover { border-color: var(--gold); transform: scale(1.06); }
.hero-badge svg.ring { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); animation: spin 26s linear infinite; }
.hero-badge svg.ring text { font-family: var(--font-body); font-size: 9.2px; font-weight: 600; letter-spacing: 1.6px; fill: var(--gold-light); text-transform: uppercase; }
.hero-badge .badge-arrow { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Staggered intro (headline words reveal) ---------- */
.reveal, .blur-word {
  opacity: 0;
  animation: reveal-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}
.blur-word {
  display: inline-block;
  filter: blur(14px);
  transform: translateY(0.3em);
  animation-name: blur-in;
  animation-duration: 1s;
}
@keyframes reveal-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes blur-in { from { opacity: 0; filter: blur(14px); transform: translateY(0.3em); } to { opacity: 1; filter: blur(0); transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: #082A2F; }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); }
.btn-gold::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
  pointer-events: none;
}
.btn-gold:hover::after { left: 130%; }
.btn-outline { background: transparent; color: var(--gold-light); }
.btn-outline:hover { background: var(--gold); border-color: var(--gold); color: #082A2F; }
button.btn { font-family: var(--font-body); cursor: pointer; }

/* ---------- Mobile hero ---------- */
@media (max-width: 800px) {
  .hero { margin: 10px 10px 0; height: calc(100svh - 20px); min-height: 560px; border-radius: 26px; }
  .hero-copy { padding: 84px 18px 80px; }
  .hero-actions .btn { flex: 1 1 0; padding: 14px 10px; font-size: 0.7rem; letter-spacing: 0.08em; }
  .hero-badge { width: 76px; height: 76px; right: 12px; bottom: 12px; }
  .hero-badge svg.ring text { font-size: 9.6px; }
  .hero-kicker { white-space: nowrap; }
  .hero-kicker .kick-extra { display: none; }
}

/* ---------- Reduced motion (system setting, or the Animations switch) ---------- */
html.reduce-motion .shimmer { animation: none; -webkit-text-fill-color: transparent; opacity: 1; filter: none; transform: none; }
html.reduce-motion .hero-badge svg.ring, html.reduce-motion .gm-grain { animation: none; }
html.reduce-motion .reveal,
html.reduce-motion .blur-word { animation: none; opacity: 1; filter: none; transform: none; }
html.reduce-motion .btn-gold::after { display: none; }

/* ---------- Hero text on the left, bolder headline ---------- */
.hero-copy { align-items: flex-start; justify-content: center; text-align: left; padding-left: clamp(24px, 6vw, 96px); padding-right: 40%; }
.hero-actions { justify-content: flex-start; }
.hero-sub { max-width: 28em; }
.gm-vignette { background: radial-gradient(ellipse 60% 75% at 22% 52%, rgba(8, 42, 47, 0.9) 0%, rgba(8, 42, 47, 0.65) 48%, rgba(8, 42, 47, 0) 100%); }
.gm-glow { background: radial-gradient(ellipse 36% 40% at 20% 50%, rgba(201, 164, 92, 0.24), transparent 70%); }
.hero h1 { font-size: clamp(3rem, 8vw, 7.2rem); }
.hero h1 .line:first-child { color: #F7F3EA; }
@media (max-width: 800px) { .hero-copy { padding-right: 20px; padding-left: 20px; } }
