/*
Theme Name: Blackstone Advanced Technologies
Theme URI: https://blackadvtech.com
Author: Blackstone Advanced Technologies
Description: Cinematic single-page theme for Blackstone Advanced Technologies — custom sheet metal manufacturing. Scroll-scrubbed canvas sequences with Lenis + GSAP ScrollTrigger.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: blackstone-advanced-technologies
*/

/* ————————————————————————————————
   Blackstone Advanced Technologies
   off-black · steel blue · serif/sans
———————————————————————————————— */

:root {
  --bg: #08090b;
  --bg-2: #0c0e12;
  --ink: #e9e9e4;
  --ink-dim: rgba(233, 233, 228, 0.55);
  --ink-faint: rgba(233, 233, 228, 0.28);
  --accent: #6f8dff;
  --accent-dim: rgba(111, 141, 255, 0.4);
  --hairline: rgba(233, 233, 228, 0.12);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--bg); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

/* ——— Preloader ——— */
#preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.9s ease, visibility 0.9s;
}
#preloader.done { opacity: 0; visibility: hidden; }
.preloader__inner { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.preloader__mark {
  font-family: var(--serif); font-size: 64px; font-weight: 500;
  color: var(--ink); line-height: 1;
}
.preloader__bar {
  width: 180px; height: 1px; background: var(--hairline);
  position: relative; overflow: hidden;
}
.preloader__bar span {
  position: absolute; inset: 0; transform-origin: left;
  transform: scaleX(0); background: var(--accent);
  transition: transform 0.25s ease;
  display: block;
}
.preloader__pct {
  font-size: 10px; letter-spacing: 0.4em; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ——— Scroll progress ——— */
#scrollProgress {
  position: fixed; top: 0; left: 0; right: 0; height: 1px; z-index: 90;
  background: var(--accent); transform-origin: left; transform: scaleX(0);
  opacity: 0.8; pointer-events: none;
}

/* ——— Nav ——— */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 44px;
  mix-blend-mode: normal;
  pointer-events: none;
}
.nav a { pointer-events: auto; }
.nav__mark {
  text-decoration: none;
  display: flex; align-items: center;
}
.nav__logo {
  height: 80px; width: auto;
  display: block;
}
.nav__actions {
  display: flex; align-items: center; gap: 12px;
}
.nav__cta {
  font-size: 10px; font-weight: 400; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--hairline); padding: 12px 22px; border-radius: 999px;
  transition: border-color 0.4s ease, color 0.4s ease, background 0.4s ease;
  background: rgba(8, 9, 11, 0.25); backdrop-filter: blur(6px);
}
.nav__cta:hover { border-color: var(--accent); color: var(--accent); }

/* ——— Shared stage bits ——— */
canvas { display: block; width: 100%; height: 100%; }

.stage-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.btn {
  display: inline-block;
  font-family: var(--sans); font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  border: 1px solid rgba(233, 233, 228, 0.25);
  padding: 18px 42px; border-radius: 999px;
  transition: border-color 0.5s ease, color 0.5s ease, letter-spacing 0.5s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); letter-spacing: 0.42em; }

/* ——— 01 · Hero ——— */
.hero__stage {
  position: relative; height: 100vh; overflow: hidden; background: var(--bg);
}
#orbitCanvas { position: absolute; inset: 0; }
.hero__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 45%, rgba(8, 9, 11, 0.75) 100%),
    linear-gradient(to bottom, rgba(8, 9, 11, 0.55), transparent 22%, transparent 72%, rgba(8, 9, 11, 0.85));
}

.hero__title {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none;
  padding-bottom: 6vh;
}
.hero__eyebrow {
  font-size: 10px; font-weight: 400; letter-spacing: 0.52em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 3.2vh; opacity: 0;
}
.hero__name { display: flex; flex-direction: column; align-items: center; }
.hero__name-main {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(52px, 9.5vw, 148px);
  letter-spacing: 0.18em; text-transform: uppercase;
  line-height: 1.02; color: var(--ink);
  text-shadow: 0 2px 60px rgba(0, 0, 0, 0.6);
  opacity: 0;
}
.hero__name-sub {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(11px, 1.35vw, 19px);
  letter-spacing: 0.85em; text-transform: uppercase;
  color: var(--ink-dim); margin-top: 2.6vh;
  padding-left: 0.85em; /* balance tracking */
  opacity: 0;
}

.hero__midline, .hero__endline {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; opacity: 0;
}
.hero__midline p, .hero__endline p {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 4vw, 58px); line-height: 1.25;
  color: var(--ink);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.7);
}
.hero__endline em { color: var(--accent); font-style: italic; }

.hero__cue {
  position: absolute; bottom: 4.5vh; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.hero__cue span {
  font-size: 9px; letter-spacing: 0.5em; text-transform: uppercase; color: var(--ink-faint);
}
.hero__cue i {
  width: 1px; height: 44px; background: linear-gradient(var(--accent), transparent);
  display: block; animation: cueDrop 2.2s ease-in-out infinite;
}
@keyframes cueDrop {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ——— 02 · Story ——— */
.story { background: var(--bg); position: relative; }
.story::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 120px;
  background: linear-gradient(var(--accent-dim), transparent);
}
.story__stage {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 22vh 24px;
}
.story__kicker {
  font-size: 10px; font-weight: 400; letter-spacing: 0.5em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 5vh;
}
.story__line {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 5.4vw, 78px); line-height: 1.18;
  margin-bottom: 4.5vh;
}
.story__sub {
  font-size: clamp(13px, 1.15vw, 16px); line-height: 2.1;
  color: var(--ink-dim); letter-spacing: 0.04em;
  margin-bottom: 7vh;
}

/* ——— Story video variant ——— */
.story--video { position: relative; overflow: hidden; }
.story__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.35; pointer-events: none;
}
.story--video .story__stage { position: relative; }

/* ——— 03 · Macro ——— */
.macro__stage {
  position: relative; height: 100vh; overflow: hidden; background: var(--bg);
}
#macroCanvas { position: absolute; inset: 0; }
.macro__shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(8, 9, 11, 0.7), transparent 25%, transparent 70%, rgba(8, 9, 11, 0.8));
}
.macro__caption {
  position: absolute; left: 8vw; bottom: 16vh; opacity: 0;
  display: flex; gap: 20px; align-items: baseline;
}
.macro__caption--right { left: auto; right: 8vw; text-align: right; flex-direction: row-reverse; }
.cap-index {
  font-size: 10px; letter-spacing: 0.3em; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.macro__caption p {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 3vw, 44px); line-height: 1.3; color: var(--ink);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.8);
}

/* ——— 04 · Engineering ——— */
.eng__stage {
  position: relative; height: 100vh; overflow: hidden; background: var(--bg-2);
}
.eng__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.85;
}
.eng__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, rgba(8, 9, 11, 0.88) 0%, rgba(8, 9, 11, 0.45) 45%, rgba(8, 9, 11, 0.82) 100%),
    linear-gradient(to bottom, rgba(8, 9, 11, 0.6), transparent 30%, transparent 70%, rgba(8, 9, 11, 0.7));
}
.eng__head { position: absolute; left: 8vw; top: 50%; transform: translateY(-50%); max-width: 34vw; }
.eng__kicker {
  font-size: 10px; font-weight: 400; letter-spacing: 0.5em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 3.4vh;
}
.eng__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(38px, 5vw, 74px); line-height: 1.14;
}

.eng__specs {
  position: absolute; right: 8vw; top: 50%; transform: translateY(-50%);
  list-style: none; width: min(420px, 38vw);
}
.spec {
  display: flex; gap: 26px; padding: 3.4vh 0;
  border-bottom: 1px solid var(--hairline);
  opacity: 0.18; transform: translateX(24px);
}
.spec:first-child { border-top: 1px solid var(--hairline); }
.spec__num {
  font-size: 10px; letter-spacing: 0.2em; color: var(--accent);
  padding-top: 6px; font-variant-numeric: tabular-nums;
}
.spec__body h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(20px, 1.9vw, 28px); letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.spec__body p {
  font-size: 12.5px; line-height: 1.8; color: var(--ink-dim); letter-spacing: 0.03em;
}

/* ——— Capabilities (equipment) ——— */
.capa {
  position: relative;
  background: var(--bg-2);
  padding: 16vh 8vw 14vh;
}
.capa__stage { max-width: 1180px; margin: 0 auto; }
.capa__head { text-align: center; margin-bottom: 9vh; }
.capa__kicker {
  font-size: 10px; font-weight: 400; letter-spacing: 0.5em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 3vh;
}
.capa__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(38px, 5.4vw, 72px); line-height: 1.1;
}
.capa__grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6vh 5vw;
  margin-bottom: 9vh;
}
.capa__item {
  display: flex; gap: 22px;
  padding-top: 3vh;
  border-top: 1px solid var(--hairline);
}
.capa__num {
  font-size: 10px; letter-spacing: 0.2em; color: var(--accent);
  padding-top: 6px; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.capa__body h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(18px, 1.7vw, 23px); letter-spacing: 0.02em;
  margin-bottom: 1.6vh;
}
.capa__body ul { list-style: none; margin: 0; padding: 0; }
.capa__body li {
  position: relative;
  font-size: 12px; line-height: 1.85; color: var(--ink-dim); letter-spacing: 0.02em;
  padding-left: 15px;
  margin-bottom: 0.55em;
}
.capa__body li::before {
  content: "–";
  position: absolute; left: 0; color: var(--accent-dim);
}
.capa__cta { text-align: center; }

/* ——— 05 · Atmosphere / contact ——— */
.atm {
  position: relative; min-height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.atm__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0.9;
}
.atm__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 110% 80% at 50% 50%, transparent 30%, rgba(8, 9, 11, 0.72) 100%),
    linear-gradient(to bottom, rgba(8, 9, 11, 0.75), transparent 30%, transparent 60%, rgba(8, 9, 11, 0.92));
}
.atm__content {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6.5vh; padding: 24vh 24px 16vh;
}
.atm__line {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 5.2vw, 76px); line-height: 1.2;
  text-shadow: 0 2px 50px rgba(0, 0, 0, 0.8);
}
.btn--light { background: rgba(8, 9, 11, 0.3); backdrop-filter: blur(4px); }

.footer {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 26px 44px;
  border-top: 1px solid var(--hairline);
  background: rgba(8, 9, 11, 0.4); backdrop-filter: blur(8px);
}
.footer__mark { font-family: var(--serif); font-size: 13px; letter-spacing: 0.1em; }
.footer__meta {
  font-size: 9px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-faint);
}

/* ——— Reveal defaults (JS animates) ——— */
.reveal-item { opacity: 0; transform: translateY(36px); }

/* ——— Generic pages (Elementor / Divi Builder / block editor content) ——— */
.page-wrap {
  min-height: 100vh;
  max-width: 900px;
  margin: 0 auto;
  padding: 160px 8vw 120px;
}
.page-content__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(32px, 4.5vw, 56px); line-height: 1.15;
  margin-bottom: 4vh;
}
.page-content__body {
  font-size: 15px; line-height: 1.9; color: var(--ink-dim); letter-spacing: 0.01em;
}
.page-content__body p { margin-bottom: 1.6em; }
.page-content__body a { color: var(--accent); }
.page-content__body h2, .page-content__body h3, .page-content__body h4 {
  font-family: var(--serif); font-weight: 400; color: var(--ink);
  margin: 1.4em 0 0.6em; line-height: 1.25;
}
.page-content__body img { max-width: 100%; height: auto; }
.page-content__body ul, .page-content__body ol { margin: 0 0 1.6em 1.4em; }

/* Elementor/Divi build their own layout inside the_content() — let it run
   edge-to-edge instead of being boxed by the default page wrapper. */
.page-content:has(.elementor), .page-content:has(.et-l) { max-width: none; }
.page-wrap:has(.elementor), .page-wrap:has(.et-l) { max-width: none; padding-left: 0; padding-right: 0; }

/* ——— Responsive ——— */
@media (max-width: 900px) {
  .nav { padding: 20px 22px; }
  .eng__stage { height: auto; min-height: 100vh; padding: 16vh 0; }
  .eng__head {
    position: relative; left: auto; top: auto; transform: none;
    max-width: none; padding: 0 8vw 7vh;
  }
  .eng__specs {
    position: relative; right: auto; top: auto; transform: none;
    width: auto; margin: 0 8vw;
  }
  .macro__caption { left: 7vw; right: 7vw; bottom: 12vh; }
  .macro__caption--right { left: 7vw; right: 7vw; }
  .capa { padding: 12vh 7vw 9vh; }
  .capa__head { margin-bottom: 6vh; }
  .footer { flex-direction: column; gap: 10px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__cue i { animation: none; }
}
