/* ==========================================================================
   Spokup Digital 4.8.1 — cinematic homepage hero (additive, front page only)
   Layers:  1 photograph · 2 atmosphere · 3 interface (existing hero markup) · 4 reactive light
   The photograph is never edited: every effect below is an independent layer.
   ========================================================================== */

:root {
  --cine-bg: #04100f;                 /* deep teal-black */
  --cine-x: 18%;                      /* focal point, landscape */
  --cine-y: 22%;
  --cine-stage-h: clamp(430px, 64svh, 660px);   /* stacked layouts */
  --cine-x-m: 38%;                    /* focal point, portrait phones */
}

/* ---------- Layer 1 · photographic foundation ---------- */
.hero.has-cine { background: var(--cine-bg); isolation: isolate; overflow: hidden; }
.hero.has-cine::before { display: none; }               /* replaces the legacy flat gradient */
.cine-stage { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--cine-bg); pointer-events: none; }
.cine-photo { position: absolute; inset: -5% -1.5%; will-change: transform; transform: translate3d(0, 0, 0); }
.cine-photo picture, .cine-photo img { display: block; width: 100%; height: 100%; }
.cine-photo img { object-fit: cover; object-position: var(--cine-x) var(--cine-y); max-width: none; user-select: none; -webkit-user-drag: none; }

/* very wide screens: keep the face in frame */
@media (min-aspect-ratio: 21/9) { :root { --cine-y: 26%; } }

/* ---------- Layer 2 · atmospheric & lighting engine ---------- */
.cine-atmo, .cine-scroll, .cine-grain, .cine-light { position: absolute; pointer-events: none; }
.cine-atmo, .cine-scroll, .cine-grain { inset: 0; }
.cine-atmo {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(2, 12, 12, .72) 0, rgba(2, 12, 12, .28) 13%, rgba(2, 12, 12, 0) 28%),            /* navigation legibility */
    linear-gradient(90deg, rgba(3, 14, 13, .9) 0, rgba(3, 14, 13, .62) 22%, rgba(3, 14, 13, .2) 40%, rgba(3, 14, 13, 0) 56%), /* copy column */
    radial-gradient(70% 60% at 78% 36%, rgba(34, 72, 56, .14), rgba(34, 72, 56, 0) 70%),                           /* foliage undertone */
    linear-gradient(0deg, rgba(2, 12, 12, .62) 0, rgba(2, 12, 12, 0) 34%);                                         /* grounded floor */
}
.cine-scroll { z-index: 2; background: linear-gradient(180deg, rgba(2, 12, 12, .5), rgba(2, 12, 12, .92)); opacity: calc(var(--cine-p, 0) * .85); }
.cine-grain {
  z-index: 3; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.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 .55 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* ---------- Layer 4 · cursor-reactive ambient light (composited transform only) ---------- */
.cine-light {
  z-index: 4; left: 0; top: 0; width: 46vmax; height: 46vmax; margin: -23vmax 0 0 -23vmax;
  background: radial-gradient(closest-side, rgba(128, 190, 172, .13), rgba(86, 140, 126, .06) 45%, rgba(86, 140, 126, 0) 100%);
  opacity: 0; transition: opacity .6s ease; will-change: transform; transform: translate3d(-50vw, -50vh, 0);
}
.cine-light.is-live { opacity: 1; }
@media (hover: none), (prefers-reduced-motion: reduce) { .cine-light { display: none; } }

/* ---------- Layer 3 · interface above the photograph ---------- */
.hero.has-cine .hero-grid { position: relative; z-index: 5; }
.hero.has-cine .hero-copy h1,
.hero.has-cine .hero-copy .lede,
.hero.has-cine .hero-copy .eyebrow { text-shadow: 0 1px 28px rgba(0, 0, 0, .5); }
.hero.has-cine .hero-copy .lede { color: rgba(236, 243, 239, .88); }
.hero.has-cine .btn.ghost { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); background: rgba(255, 255, 255, .04); }
.hero.has-cine .trustline { color: rgba(236, 243, 239, .78); }

@media (min-width: 1024px) and (min-aspect-ratio: 13/10) {
  .hero.has-cine { min-height: max(100svh, 620px); padding: calc(var(--header-h) + 28px) 0 clamp(40px, 7vh, 88px); }
  .hero.has-cine .hero-grid {
    width: min(1760px, calc(100% - clamp(40px, 8vw, 180px)));
    grid-template-columns: minmax(0, clamp(300px, 29vw, 640px)) minmax(0, clamp(300px, 23vw, 420px));
    justify-content: space-between; align-items: center;
  }
  .hero.has-cine .hero-copy h1 { font-size: clamp(2rem, 1rem + 1.35vw, 3.6rem); line-height: 1.04; }
  .hero.has-cine .hero-copy .lede { font-size: clamp(.95rem, .8rem + .3vw, 1.15rem); max-width: 46ch; }
  .hero.has-cine .hero-stage { align-self: end; width: 100%; max-width: 420px; justify-self: end; aspect-ratio: auto; display: grid; gap: 14px; }
  .hero.has-cine .spokup-interactive-scene { position: relative; inset: auto; aspect-ratio: 1 / .86; }
  .hero.has-cine .metric-float { position: relative; right: auto; bottom: auto; width: 100%; padding: 14px 18px; }
  .hero.has-cine .metric-float strong { font-size: 1.5rem; }
  .hero.has-cine .floating-platform { min-width: 0; padding: 8px 12px 8px 8px; }
  .hero.has-cine .floating-platform small { display: none; }
  .hero.has-cine .platform-chatgpt { top: 4%; } .hero.has-cine .platform-gemini { top: 10%; }
  .hero.has-cine .platform-perplexity { bottom: 8%; } .hero.has-cine .platform-copilot { bottom: 14%; }
}

/* ---------- Responsive: stacked cinematic layout (phones, tablets, tall windows) ---------- */
@media (max-width: 1023px), (max-aspect-ratio: 13/10) {
  .hero.has-cine { display: block; min-height: 0; padding: 0 0 56px; }
  .cine-stage { position: relative; inset: auto; height: var(--cine-stage-h); }
  .cine-photo img { object-position: var(--cine-x-m) 30%; }
  .cine-atmo {
    background:
      linear-gradient(180deg, rgba(2, 12, 12, .72) 0, rgba(2, 12, 12, .2) 16%, rgba(2, 12, 12, 0) 30%),
      radial-gradient(80% 60% at 70% 36%, rgba(34, 72, 56, .14), rgba(34, 72, 56, 0) 70%),
      linear-gradient(0deg, var(--cine-bg) 0, rgba(4, 16, 15, .55) 9%, rgba(4, 16, 15, 0) 28%);
  }
  .hero.has-cine .hero-grid { margin-top: -6px; width: calc(100% - 40px); grid-template-columns: 1fr; gap: 36px; }
  .hero.has-cine .hero-copy h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.1rem); }
  .hero.has-cine .hero-stage { justify-self: center; max-width: 440px; }
}
@media (min-width: 600px) and (max-width: 1023px) { :root { --cine-x-m: 26%; } }
@media (max-width: 560px) { .hero.has-cine .actions .btn { width: 100%; justify-content: center; } }

/* the photograph settles in; no JS needed, and skipped when motion is reduced */
@media (prefers-reduced-motion: no-preference) {
  .cine-photo img { animation: cine-in 1.4s cubic-bezier(.2, .8, .2, 1) both; }
  .cine-atmo { animation: cine-fade 1.8s ease both; }
}
@keyframes cine-in { from { opacity: 0; transform: scale(1.025); } to { opacity: 1; transform: none; } }
@keyframes cine-fade { from { opacity: .35; } to { opacity: 1; } }

/* ==========================================================================
   Navigation: transparent over the photograph, dark glass once scrolled
   ========================================================================== */
body.is-front-page .site-header {
  position: fixed; left: 0; right: 0; top: 0;
  background: transparent; border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), -webkit-backdrop-filter .4s var(--ease), backdrop-filter .4s var(--ease);
}
body.is-front-page.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.is-front-page.admin-bar .site-header { top: 46px; } }
body.is-front-page .site-header.is-scrolled,
body.is-front-page .site-header.open {
  background: rgba(5, 16, 15, .74); border-bottom-color: rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: saturate(1.25) blur(18px); backdrop-filter: saturate(1.25) blur(18px);
}
body.is-front-page .site-header::after { background: var(--green); }

/* wordmark: white-on-dark version only on the homepage */
.brand .brand-on-dark { display: none; }
body.is-front-page .brand .brand-on-dark { display: block; }
body.is-front-page .brand .brand-on-light { display: none; }

body.is-front-page .primary-menu a, body.is-front-page .primary-menu > li > a.menu-link { color: #fff; }
body.is-front-page .primary-menu a::after { background: var(--green); }
body.is-front-page .x-extra-menu { border-left-color: rgba(255, 255, 255, .24); }
body.is-front-page .primary-menu a:focus-visible, body.is-front-page .nav-toggle:focus-visible,
body.is-front-page .nav-cta:focus-visible, body.is-front-page .site-search :focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

body.is-front-page .nav-cta { background: #fff; color: #000; border-color: #fff; }
body.is-front-page .nav-cta:hover { background: var(--green); border-color: var(--green); color: #000; }
body.is-front-page .nav-cta:active { transform: translateY(1px); }

body.is-front-page .site-search input[type="search"] {
  background: transparent; color: #fff;
  border: 0 !important; border-bottom: 1px solid rgba(255, 255, 255, .55) !important;   /* same underline style as the mono layer, on dark */
}
body.is-front-page .site-search input[type="search"]:focus { border-bottom-color: var(--green) !important; box-shadow: none; }
body.is-front-page .site-search input[type="search"]::placeholder { color: rgba(255, 255, 255, .62); }
body.is-front-page .site-search .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .4); background: transparent; }
body.is-front-page .site-search .btn.ghost:hover { background: #fff; color: #000; }

body.is-front-page .nav-toggle { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .55); }

/* collapsed menu panel (matches the theme's two collapse breakpoints) */
@media (max-width: 1280px) {
  body.is-front-page .primary-nav {
    background: rgba(4, 14, 13, .97); border-bottom: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 24px 48px rgba(0, 0, 0, .45);
  }
  body.is-front-page .primary-menu a, body.is-front-page .primary-menu > li > a.menu-link { border-bottom-color: rgba(255, 255, 255, .12); }
  body.is-front-page .primary-menu a:hover { color: var(--green); }
  body.is-front-page .x-extra-menu { border-left: 0; padding-left: 0; }
}
@media (min-width: 1281px) {
  body.is-front-page .primary-menu a:hover { color: #fff; }
}

/* anchored sections clear the fixed header */
body.is-front-page [id] { scroll-margin-top: calc(var(--header-h) + 8px); }

/* reduced motion: everything is static */
@media (prefers-reduced-motion: reduce) {
  .cine-photo { transform: none !important; }
  body.is-front-page .site-header { transition: none; }
}
