/* ════════════════════════════════════════════════════════════
   BETA DESIGN STUDIO — CINEMATIC THEME  ·  "NOIR ATELIER"
   Loaded AFTER style.css. Re-tokens the whole site to a warm
   near-black + champagne-brass palette and adds the 3D /
   film-grade layer: preloader, letterbox, WebGL canvas,
   vignette, tilt cards, film-strip, hero choreography.
   ════════════════════════════════════════════════════════════ */

/* ─────────────── 1 · TOKENS — NOIR ATELIER ─────────────── */
:root {
  --c-bg:        #0b0a08;                      /* warm near-black */
  --c-bg-2:      #14110d;
  --c-paper:     #121009;                      /* panels / mega menu */
  --c-white:     #f4efe4;
  --c-ink:       #ece5d8;                      /* bone — primary text */
  --c-ink-2:     #ece5d8;
  --c-mute:      #a89f90;
  --c-mute-2:    #6b6354;
  --c-line:      rgba(236, 229, 216, 0.14);
  --c-line-2:    rgba(236, 229, 216, 0.26);
  --c-accent:    #c9a86a;                      /* champagne brass */
  --c-accent-lt: #e8d5ae;
  --c-deep:      #060504;

  --panel:       #100e0a;                      /* explicit dark panel */
  --panel-2:     #181410;
  --brass:       #c9a86a;
  --brass-lt:    #e8d5ae;
  --bone:        #ece5d8;

  --ease-cine:   cubic-bezier(0.76, 0, 0.18, 1);
}

html { background: var(--c-bg); }
::selection { background: var(--brass); color: #0b0a08; }

/* Film grain — re-tuned for dark (white noise, screen blend) */
body::before {
  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.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.05;
  mix-blend-mode: screen;
  z-index: 6;
}
/* Ambient orbs — warm brass haze instead of gray */
body::after {
  background:
    radial-gradient(42% 36% at 16% 18%, rgba(201, 168, 106, 0.07), transparent 62%),
    radial-gradient(46% 40% at 86% 80%, rgba(232, 213, 174, 0.05), transparent 62%),
    radial-gradient(34% 30% at 62% 8%,  rgba(120, 96, 58, 0.08),  transparent 60%);
}
.ambient-shapes { color: var(--brass); }
.ambient-shapes .shape { opacity: 0.07; }

/* ─────────────── 2 · WEBGL CANVAS + VIGNETTE ─────────────── */
#bd-3d {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
}
#bd-3d canvas { display: block; width: 100%; height: 100%; }

.cine-vignette {
  position: fixed; inset: 0;
  z-index: 5; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 58%, rgba(4, 3, 2, 0.55) 100%),
    linear-gradient(180deg, rgba(4,3,2,0.35) 0%, transparent 14%, transparent 86%, rgba(4,3,2,0.45) 100%);
}

/* Page content must float above the scene */
main, section, footer, .ticker-wrap { position: relative; z-index: 2; }

/* ─────────────── 3 · CINEMATIC PRELOADER ─────────────── */
#bd-cine-loader {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--c-deep);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 28px;
  transition: clip-path 1.1s var(--ease-cine);
  clip-path: inset(0 0 0 0);
}
#bd-cine-loader.is-done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.bd-loader-brand {
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.5em; text-transform: uppercase;
  color: var(--c-mute);
}
.bd-loader-count {
  font-family: var(--f-display);
  font-weight: 300; font-style: italic;
  font-size: clamp(4.5rem, 12vw, 9rem);
  line-height: 1; color: var(--bone);
  font-variant-numeric: tabular-nums;
}
.bd-loader-count::after { content: '%'; font-size: 0.32em; color: var(--brass); margin-left: 0.1em; font-style: normal; }
.bd-loader-bar-wrap { width: min(280px, 60vw); height: 1px; background: rgba(236,229,216,0.12); overflow: hidden; }
.bd-loader-bar { width: 100%; height: 100%; background: var(--brass); transform: scaleX(0); transform-origin: left; }

/* ─────────────── 4 · LETTERBOX APERTURE ─────────────── */
.cine-bars { position: fixed; inset: 0; z-index: 9500; pointer-events: none; }
.cine-bars::before, .cine-bars::after {
  content: ''; position: absolute; left: 0; right: 0; height: 50.5vh;
  background: var(--c-deep);
  transition: transform 1.5s var(--ease-cine) 0.55s;
}
.cine-bars::before { top: 0;    transform-origin: top; }
.cine-bars::after  { bottom: 0; transform-origin: bottom; }
body.is-loaded .cine-bars::before { transform: scaleY(0); }
body.is-loaded .cine-bars::after  { transform: scaleY(0); }

/* ─────────────── 5 · NAV / MEGA / FOOTER on dark ─────────────── */
#navbar.scrolled {
  background: rgba(11, 10, 8, 0.72);
  border-bottom: 1px solid var(--c-line);
}
#navbar { z-index: 100; }
.nav-menu-btn:hover { background: var(--brass); color: #0b0a08; border-color: var(--brass); }

.mega-overlay { background: var(--panel); }
.mega-overlay::before {
  background-image: linear-gradient(to right, rgba(236,229,216,0.05) 1px, transparent 1px);
}
.mega-col:hover { background: rgba(236, 229, 216, 0.035); }
.mega-brand-col { background: var(--c-deep); color: var(--bone); }
.mega-preview-col { background: var(--c-deep); }
.mega-back { color: var(--bone); border-color: rgba(236,229,216,0.35); }
.mega-back:hover { background: var(--brass); border-color: var(--brass); color: #0b0a08; }

footer { background: var(--c-deep); color: var(--bone); }
.footer-logo { color: var(--bone); }
footer::before { background: linear-gradient(90deg, transparent, var(--brass), transparent); }

#preloader { background: var(--c-deep); }   /* legacy preloader, if any page still renders one */

/* Cards / papers that flipped with tokens get a soft brass edge */
.page-hero-bg { filter: brightness(0.6) saturate(0.85); }
img { filter: saturate(0.92); }

/* ─────────────── 6 · CINE HERO (index.php) ─────────────── */
.cine-hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 160px var(--pad) 48px;
  overflow: clip;
}
.cine-hero-eyebrow {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 28px;
}
.cine-hero-eyebrow::before { content: ''; width: 48px; height: 1px; background: var(--brass); }

.cine-hero-title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(3rem, 9.2vw, 8.6rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--bone);
  max-width: 14ch;
}
.cine-hero-title em {
  font-style: italic; font-weight: 300;
  color: var(--brass-lt);
}
/* Masked line reveal */
.line-mask { display: block; overflow: hidden; }
.line-mask > span {
  display: block;
  transform: translateY(115%) rotate(1.2deg);
  transition: transform 1.3s var(--ease-cine);
}
body.is-loaded .line-mask > span { transform: translateY(0) rotate(0); }
body.is-loaded .line-mask:nth-child(2) > span { transition-delay: 0.95s; }
body.is-loaded .line-mask:nth-child(3) > span { transition-delay: 1.1s; }
.line-mask:nth-child(1) > span { transition-delay: 0.8s; }

.cine-hero-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; margin-top: 56px; flex-wrap: wrap;
  opacity: 0; transform: translateY(24px);
  transition: opacity 1s var(--ease-cine) 1.5s, transform 1s var(--ease-cine) 1.5s;
}
body.is-loaded .cine-hero-foot { opacity: 1; transform: none; }
.cine-hero-meta { display: flex; gap: clamp(24px, 4vw, 64px); flex-wrap: wrap; }
.cine-meta-item { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--c-mute); line-height: 2; }
.cine-meta-item strong { display: block; color: var(--bone); font-size: 12px; letter-spacing: 0.18em; font-weight: 500; }

.cine-scroll-cue {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--c-mute);
}
.cine-scroll-cue .cue-line {
  width: 1px; height: 56px; overflow: hidden; position: relative;
  background: rgba(236,229,216,0.15);
}
.cine-scroll-cue .cue-line::after {
  content: ''; position: absolute; left: 0; top: -100%;
  width: 100%; height: 100%; background: var(--brass);
  animation: cueDrop 2.2s var(--ease-cine) infinite;
}
@keyframes cueDrop { 0% { top: -100%; } 55% { top: 0; } 100% { top: 100%; } }

/* ─────────────── 7 · GENERIC SECTION SYSTEM ─────────────── */
.cine-section { padding: clamp(96px, 12vh, 160px) var(--pad); }
.cine-inner   { max-width: var(--maxw); margin: 0 auto; }
.cine-label {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--f-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--brass); margin-bottom: 40px;
}
.cine-label::after { content: ''; flex: 1; height: 1px; background: var(--c-line); }
.cine-h2 {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(2.1rem, 4.6vw, 4.2rem);
  line-height: 1.06; letter-spacing: -0.02em;
  color: var(--bone); max-width: 20ch;
}
.cine-h2 em { font-style: italic; color: var(--brass-lt); }
.cine-lede { color: var(--c-mute); font-size: clamp(1rem, 1.3vw, 1.15rem); max-width: 56ch; line-height: 1.8; }

/* Scroll reveal primitives */
[data-reveal] { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease-cine), transform 1s var(--ease-cine); transition-delay: var(--d, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ─────────────── 8 · MANIFESTO + STATS ─────────────── */
.cine-manifesto { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(40px, 6vw, 110px); align-items: end; }
.cine-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--c-line); border: 1px solid var(--c-line); margin-top: 72px; }
.cine-stat { background: var(--c-bg); padding: 36px 28px; }
.cine-stat-num {
  font-family: var(--f-display); font-weight: 300; font-style: italic;
  font-size: clamp(2.4rem, 4.4vw, 4rem); line-height: 1; color: var(--bone);
}
.cine-stat-num .plus { color: var(--brass); font-style: normal; font-size: 0.55em; vertical-align: super; }
.cine-stat-cap { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--c-mute); margin-top: 14px; }

/* ─────────────── 9 · FILM-STRIP PORTFOLIO ─────────────── */
.cine-strip-wrap { overflow: visible; }
.cine-strip {
  display: flex; gap: clamp(18px, 2.4vw, 36px);
  overflow-x: auto; padding: 16px 4px 36px;
  scroll-snap-type: x proximity;
  scrollbar-width: none; cursor: grab;
  perspective: 1200px;
}
.cine-strip::-webkit-scrollbar { display: none; }
.cine-strip.dragging { cursor: grabbing; scroll-snap-type: none; }
.cine-frame {
  position: relative; flex: 0 0 auto;
  width: clamp(280px, 32vw, 460px);
  scroll-snap-align: start;
  text-decoration: none; color: inherit;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease);
  will-change: transform;
}
.cine-frame-media {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--panel-2);
  border: 1px solid var(--c-line);
}
.cine-frame-media::after {            /* moving glare follows the tilt */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(232,213,174,0.13), transparent 55%);
  opacity: 0; transition: opacity 0.4s ease;
}
.cine-frame:hover .cine-frame-media::after { opacity: 1; }
.cine-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(22%) brightness(0.88) saturate(0.9);
  transform: scale(1.04);
  transition: filter 0.7s var(--ease), transform 1.1s var(--ease);
}
.cine-frame:hover img { filter: grayscale(0%) brightness(1) saturate(1); transform: scale(1.0); }
.cine-frame-index {
  position: absolute; top: 14px; left: 16px; z-index: 2;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.3em;
  color: var(--brass-lt); mix-blend-mode: difference;
}
.cine-frame-info { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 16px; }
.cine-frame-title { font-family: var(--f-display); font-weight: 400; font-size: 1.18rem; color: var(--bone); }
.cine-frame-cat { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--c-mute); white-space: nowrap; }
.cine-strip-hint { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--c-mute-2); margin-top: 8px; display: flex; align-items: center; gap: 12px; }
.cine-strip-hint::before { content: ''; width: 32px; height: 1px; background: var(--c-line-2); }

/* ─────────────── 10 · SERVICES — ATELIER LEDGER ─────────────── */
.cine-services { margin-top: 64px; border-top: 1px solid var(--c-line); }
.cine-service {
  position: relative;
  display: grid; grid-template-columns: 80px 1.1fr 1.6fr auto;
  align-items: center; gap: clamp(16px, 3vw, 48px);
  padding: 36px 8px;
  border-bottom: 1px solid var(--c-line);
  text-decoration: none; color: inherit;
  transition: background 0.45s var(--ease), padding 0.45s var(--ease);
}
.cine-service:hover { background: rgba(236,229,216,0.03); padding-left: 24px; }
.cine-service-num { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.3em; color: var(--c-mute-2); }
.cine-service-title { font-family: var(--f-display); font-weight: 300; font-size: clamp(1.5rem, 2.6vw, 2.4rem); color: var(--bone); transition: color 0.4s ease; }
.cine-service:hover .cine-service-title { color: var(--brass-lt); }
.cine-service-desc { color: var(--c-mute); font-size: 0.95rem; line-height: 1.75; max-width: 52ch; }
.cine-service-arrow {
  width: 48px; height: 48px; border: 1px solid var(--c-line-2); border-radius: 50%;
  display: grid; place-items: center; color: var(--bone);
  transition: all 0.4s var(--ease);
}
.cine-service:hover .cine-service-arrow { background: var(--brass); border-color: var(--brass); color: #0b0a08; transform: rotate(-45deg); }
/* hover preview image floats beside cursor — pure CSS pinned right */
.cine-service-peek {
  position: absolute; right: 110px; top: 50%;
  width: 200px; aspect-ratio: 4/3;
  object-fit: cover;
  transform: translateY(-50%) scale(0.86) rotate(2deg);
  opacity: 0; pointer-events: none;
  border: 1px solid var(--c-line-2);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
  z-index: 3;
  filter: brightness(0.92);
}
.cine-service:hover .cine-service-peek { opacity: 1; transform: translateY(-50%) scale(1) rotate(0); }

/* ─────────────── 11 · PROCESS — SEQUENCE ─────────────── */
.cine-process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--c-line); border: 1px solid var(--c-line); margin-top: 64px; }
.cine-step { background: var(--c-bg); padding: 40px 32px 48px; position: relative; transition: background 0.45s ease; }
.cine-step:hover { background: var(--panel-2); }
.cine-step-num {
  font-family: var(--f-display); font-style: italic; font-weight: 300;
  font-size: 2.6rem; color: transparent;
  -webkit-text-stroke: 1px var(--brass);
  line-height: 1;
}
.cine-step-title { font-family: var(--f-display); font-weight: 400; font-size: 1.35rem; color: var(--bone); margin: 22px 0 12px; }
.cine-step-desc { color: var(--c-mute); font-size: 0.92rem; line-height: 1.75; }

/* ─────────────── 12 · TESTIMONIALS — DARK STAGE ─────────────── */
.cine-quotes { position: relative; min-height: 300px; }
.cine-quote {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.9s var(--ease-cine), transform 0.9s var(--ease-cine);
  pointer-events: none;
}
.cine-quote.active { opacity: 1; transform: none; pointer-events: auto; }
.cine-quote-text {
  font-family: var(--f-display); font-weight: 300; font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2.4rem); line-height: 1.35;
  color: var(--bone); max-width: 30ch;
}
.cine-quote-text::before { content: '“'; color: var(--brass); }
.cine-quote-text::after  { content: '”'; color: var(--brass); }
.cine-quote-who { margin-top: 28px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--c-mute); }
.cine-quote-who strong { color: var(--brass-lt); font-weight: 500; }
.cine-quote-dots { display: flex; gap: 10px; margin-top: 48px; }
.cine-quote-dot { width: 28px; height: 2px; background: var(--c-line-2); border: 0; cursor: pointer; padding: 0; transition: background 0.3s ease; }
.cine-quote-dot.active { background: var(--brass); }

/* ─────────────── 13 · JOURNAL CARDS ─────────────── */
.cine-journal { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.5vw, 36px); margin-top: 64px; }
.cine-post { text-decoration: none; color: inherit; display: block; transform-style: preserve-3d; transition: transform 0.5s var(--ease); }
.cine-post-media { overflow: hidden; aspect-ratio: 16/10; border: 1px solid var(--c-line); background: var(--panel-2); }
.cine-post-media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(30%) brightness(0.85); transform: scale(1.05); transition: all 0.8s var(--ease); }
.cine-post:hover .cine-post-media img { filter: none; transform: scale(1); }
.cine-post-cat { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass); margin: 18px 0 8px; }
.cine-post-title { font-family: var(--f-display); font-weight: 400; font-size: 1.25rem; line-height: 1.3; color: var(--bone); }
.cine-post-date { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--c-mute-2); margin-top: 10px; }

/* ─────────────── 14 · GRAND CTA ─────────────── */
.cine-cta { text-align: center; padding: clamp(120px, 18vh, 220px) var(--pad); }
.cine-cta-title {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 6.4rem); line-height: 1.02;
  letter-spacing: -0.02em; color: var(--bone);
}
.cine-cta-title em { font-style: italic; color: var(--brass-lt); }
.btn-cine {
  display: inline-flex; align-items: center; gap: 16px;
  margin-top: 56px; padding: 22px 48px;
  font-family: var(--f-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: #0b0a08; background: var(--brass);
  border: 1px solid var(--brass);
  text-decoration: none;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), transform 0.25s ease;
  will-change: transform;
}
.btn-cine:hover { background: transparent; color: var(--brass-lt); }
.btn-cine-ghost { background: transparent; color: var(--bone); border-color: var(--c-line-2); }
.btn-cine-ghost:hover { border-color: var(--brass); color: var(--brass-lt); }

/* ─────────────── 15 · TICKER ─────────────── */
.cine-ticker { overflow: hidden; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); padding: 22px 0; }
.cine-ticker-track { display: flex; gap: 64px; width: max-content; animation: tickerMove 32s linear infinite; }
.cine-ticker span {
  font-family: var(--f-display); font-weight: 300; font-style: italic;
  font-size: clamp(1.2rem, 2vw, 1.8rem); color: var(--c-mute);
  display: inline-flex; align-items: center; gap: 64px; white-space: nowrap;
}
.cine-ticker span::after { content: '✦'; font-size: 0.7em; color: var(--brass); font-style: normal; }
@keyframes tickerMove { to { transform: translateX(-50%); } }

/* ─────────────── 16 · RESPONSIVE + A11Y ─────────────── */
@media (max-width: 1024px) {
  .cine-service { grid-template-columns: 56px 1fr auto; }
  .cine-service-desc, .cine-service-peek { display: none; }
  .cine-process { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .cine-manifesto { grid-template-columns: 1fr; align-items: start; }
  .cine-stats { grid-template-columns: 1fr; }
  .cine-process, .cine-journal { grid-template-columns: 1fr; }
  .cine-hero { padding-top: 130px; }
  .cine-frame { width: 78vw; }
  .cine-service-arrow { width: 38px; height: 38px; }
}

a:focus-visible, button:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .cine-bars::before, .cine-bars::after { transition: none; transform: scaleY(0); }
  .line-mask > span { transition: none; transform: none; }
  .cine-hero-foot { transition: none; opacity: 1; transform: none; }
  [data-reveal] { transition: none; opacity: 1; transform: none; }
  .cine-ticker-track { animation: none; }
  .cine-scroll-cue .cue-line::after { animation: none; }
  body::after { animation: none; }
  .ambient-shapes .shape { animation: none; }
}

/* No-WebGL fallback: a still architectural gradient instead of the scene */
body.no-3d #bd-3d {
  background:
    radial-gradient(60% 50% at 70% 30%, rgba(201,168,106,0.08), transparent 60%),
    linear-gradient(180deg, #0e0c09 0%, #0b0a08 100%);
}
