/* ==========================================================
   Home hero (static) + process animation section.

   The TOP hero (.hero on index.html) is now a lightweight, instantly-rendered
   text block — eyebrow + name (single <h1>) + lead over a cheap blueprint grid.
   It carries NO animation and needs NO JavaScript: the markup is the final look.

   The one-take process animation (OP 05 sand casting -> OP 80 dispatch) lives in a
   scroll-in ".proc" section. js/hero.js initialises each .proc on its page and
   plays it once, started by an IntersectionObserver when it scrolls into view.
   Loaded after styles.css + theme-light.css so these rules win.
   ========================================================== */

/* ---------- TOP HERO: static, instant, no animation ---------- */
[data-theme="light"] .hero,.hero{position:relative;min-height:100vh;min-height:100svh;display:flex;flex-direction:column;justify-content:center;
  align-items:center;text-align:center;overflow:hidden;
  padding:max(120px,calc(env(safe-area-inset-top) + 96px)) max(40px,env(safe-area-inset-right)) max(80px,env(safe-area-inset-bottom)) max(40px,env(safe-area-inset-left));
  background:
    radial-gradient(70% 55% at 50% 8%, rgba(var(--accent-rgb),.10), transparent 70%),
    radial-gradient(50% 45% at 88% 78%, rgba(var(--accent3-rgb),.10), transparent 70%),
    linear-gradient(180deg,#fbfdff 0%,#eaf1f8 52%,#ffffff 100%)}
.hero__tech{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none}
[data-theme="light"] .hero__blueprint,.hero__blueprint{position:absolute;inset:0;display:block;
  background-image:
    linear-gradient(rgba(var(--accent-rgb),.20) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb),.20) 1px, transparent 1px),
    linear-gradient(rgba(var(--accent-rgb),.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb),.10) 1px, transparent 1px);
  background-size:160px 160px,160px 160px,32px 32px,32px 32px;
  -webkit-mask-image:radial-gradient(ellipse 72% 64% at 50% 44%,#000 22%,transparent 80%);
  mask-image:radial-gradient(ellipse 72% 64% at 50% 44%,#000 22%,transparent 80%)}

.hero .hero__content{position:relative;z-index:5;max-width:900px;display:flex;flex-direction:column;align-items:center;gap:20px}

/* primary title: the business name, visually dominant */
.hero__name{--nls:5px;position:relative;margin:0;font-family:var(--display);font-weight:500;text-transform:uppercase;
  font-size:clamp(3rem,10vw,6rem);line-height:1.02;letter-spacing:var(--nls);color:var(--ink);
  text-shadow:0 1px 0 rgba(255,255,255,.6);overflow-wrap:anywhere;text-wrap:balance;padding-bottom:.18em}
.hero__name-l{display:inline-block}
.hero__name-l:nth-child(2){color:var(--accent)}
/* static accent underline centred under the name block; sized to the name's width */
.hero__name-rule{position:absolute;left:50%;transform:translateX(-50%);bottom:0;width:min(100%,9.5em);height:3px;background:var(--accent);border-radius:2px}

/* eyebrow tagline above the name */
.hero__h2{--ls:3px;margin:0;font-family:var(--mono);font-weight:500;text-transform:uppercase;
  font-size:clamp(.72rem,1.4vw,.92rem);line-height:1.5;letter-spacing:var(--ls);color:var(--body);
  overflow-wrap:anywhere;text-wrap:balance}
.hero__l1,.hero__l2{display:inline-block}
.hero__hl{color:var(--accent)}
[data-theme="light"] .hero__lead,.hero__lead{font-family:var(--text);font-size:clamp(1.25rem,2.4vw,1.65rem);line-height:1.55;color:var(--body);max-width:680px;margin:0}

@media(max-width:768px){
  [data-theme="light"] .hero__blueprint,.hero__blueprint{background-size:96px 96px,96px 96px,24px 24px,24px 24px;
    -webkit-mask-image:radial-gradient(ellipse 90% 58% at 50% 40%,#000 18%,transparent 84%);
    mask-image:radial-gradient(ellipse 90% 58% at 50% 40%,#000 18%,transparent 84%)}
  .hero__tech::before{display:none}
}
@media(max-width:600px){
  [data-theme="light"] .hero,.hero{min-height:100svh;min-height:100dvh;
    padding:max(96px,calc(env(safe-area-inset-top) + 80px)) max(24px,env(safe-area-inset-right)) max(112px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left))}
  .hero__name{--nls:2px;font-size:clamp(2rem,12vw,3.2rem);line-height:1.05}
  .hero__name-l{display:block;max-width:100%}
  .hero__name-rule{width:min(100%,8em)}
  .hero__h2{--ls:1px;font-size:clamp(1rem,4.6vw,1.5rem)}
  .hero__l1,.hero__l2{display:block;max-width:100%}
  .hero__lead{font-size:clamp(1.05rem,4vw,1.3rem);max-width:100%}
  .hero .hero__content{gap:14px;max-width:100%;width:100%}
}

/* ==========================================================
   PROCESS ANIMATION SECTION (.proc) — the repositioned one-take take.
   Host for js/hero.js. Reserves height to avoid layout shift while it boots.
   The stage holds the same canvas/SVG scaffolding the old top hero had; its
   settled frame reveals the name + headline just as the original animation did.
   ========================================================== */
.proc{position:relative;overflow:hidden;
  background:
    radial-gradient(70% 55% at 50% 8%, rgba(var(--accent-rgb),.10), transparent 70%),
    radial-gradient(50% 45% at 88% 78%, rgba(var(--accent3-rgb),.10), transparent 70%),
    linear-gradient(180deg,#ffffff 0%,#eef4fa 52%,#ffffff 100%)}
.proc__head{position:relative;z-index:6;text-align:center;
  padding:clamp(48px,8vw,96px) max(24px,env(safe-area-inset-right)) 0 max(24px,env(safe-area-inset-left))}
.proc__cap{margin:0;font-family:var(--mono);font-weight:500;text-transform:uppercase;letter-spacing:3px;
  font-size:clamp(.7rem,1.3vw,.85rem);color:var(--accent)}
.proc__lead{margin:.6em auto 0;max-width:640px;font-family:var(--text);color:var(--body);
  font-size:clamp(.95rem,1.6vw,1.12rem);line-height:1.6}

/* full-viewport stage under the fixed 72px nav: a fixed height reserves the space (no CLS) and
   svh does not jump with the mobile URL bar; every station gets the whole frame to itself */
.proc.section{padding-top:0;padding-bottom:0}
.proc__stage{--proc-nav:72px;position:relative;width:100%;
  height:calc(100vh - var(--proc-nav));height:calc(100svh - var(--proc-nav));min-height:560px;max-height:1080px;
  display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;overflow:hidden;
  padding:clamp(40px,7vw,96px) max(40px,env(safe-area-inset-right)) clamp(48px,8vw,96px) max(40px,env(safe-area-inset-left))}

.proc__tech{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none}
[data-theme="light"] .proc__blueprint,.proc__blueprint{position:absolute;inset:0;display:block;
  background-image:
    linear-gradient(rgba(var(--accent-rgb),.20) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb),.20) 1px, transparent 1px),
    linear-gradient(rgba(var(--accent-rgb),.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb),.10) 1px, transparent 1px);
  background-size:160px 160px,160px 160px,32px 32px,32px 32px;
  -webkit-mask-image:radial-gradient(ellipse 72% 64% at 50% 44%,#000 22%,transparent 80%);
  mask-image:radial-gradient(ellipse 72% 64% at 50% 44%,#000 22%,transparent 80%)}

/* decorative layers (all aria-hidden) */
.proc__fx{position:absolute;inset:0;width:100%;height:100%;max-width:none;z-index:2;pointer-events:none;display:none}
[data-theme="light"] .proc__scrim,.proc__scrim{position:absolute;inset:0;z-index:3;pointer-events:none;background:
  radial-gradient(46% 34% at 50% 46%, rgba(255,255,255,.82) 0%, rgba(255,255,255,.45) 55%, transparent 78%),
  linear-gradient(180deg, rgba(255,255,255,.5) 0%, transparent 22%, transparent 74%, rgba(255,255,255,.85) 100%)}
.proc__carry{position:absolute;inset:0;width:100%;height:100%;max-width:none;z-index:4;pointer-events:none;display:none;overflow:visible}
.proc__carry line{stroke:var(--accent);stroke-width:2px;stroke-linecap:butt;fill:none}
.proc__carry rect{fill:#fff;stroke:var(--accent);stroke-width:1px}

/* machining HUD (intro only) */
.proc__hud{position:absolute;left:max(24px,env(safe-area-inset-left),calc(50% - 600px));top:40px;z-index:5;display:none;pointer-events:none;
  font-family:var(--mono);font-size:11px;letter-spacing:2px;text-transform:uppercase;color:var(--body);text-align:left;
  line-height:1.5;white-space:nowrap;text-shadow:0 0 2px #fff,0 0 6px #fff,0 0 12px rgba(255,255,255,.9)}
.proc .hud__op{color:var(--accent);font-weight:500}
.proc .hud__op::before{content:"";display:inline-block;width:24px;height:1px;background:var(--accent);vertical-align:middle;margin-right:10px}
.proc .hud__name{color:var(--ink);margin-left:10px}
.proc .hud__dro{display:block;margin-top:4px;margin-left:34px;font-variant-numeric:tabular-nums}

.proc__content{position:relative;z-index:5;max-width:900px;display:flex;flex-direction:column;align-items:center;gap:20px}

/* the revealed name (NOT an <h1>: each page already has its single h1) */
.proc__name{--nls:5px;position:relative;margin:0;font-family:var(--display);font-weight:500;text-transform:uppercase;
  font-size:clamp(3rem,10vw,6rem);line-height:1.02;letter-spacing:var(--nls);color:var(--ink);
  text-shadow:0 1px 0 rgba(255,255,255,.6);overflow-wrap:anywhere;text-wrap:balance;padding-bottom:.18em}
.proc__name-l{display:inline-block}
.proc__name-l:nth-child(2){color:var(--accent)}
.proc__name-rule{position:absolute;left:var(--name-rule-l,0px);right:var(--name-rule-r,0px);bottom:0;height:3px;background:var(--accent);border-radius:2px}

/* ---------- intro-only states (JS adds .is-intro to the .proc section) ---------- */
.proc.is-intro .proc__fx,.proc.is-intro .proc__carry,.proc.is-intro .proc__hud{display:block}
/* the wordmark is clipped as a whole (JS animates this same element's clip-path during the reveal) */
.proc.is-intro .proc__name{clip-path:inset(100% 0 0 0)}
.proc.is-intro .proc__name-rule,.proc.is-intro .proc__scrim{opacity:0}
/* loop hand-off: the wordmark and wash fade out before the take restarts from the closed mould */
.proc.is-out .proc__content,.proc.is-out .proc__scrim{opacity:0 !important;transition:opacity .35s cubic-bezier(.23,1,.32,1)}

@media(max-width:768px){
  [data-theme="light"] .proc__blueprint,.proc__blueprint{background-size:96px 96px,96px 96px,24px 24px,24px 24px;
    -webkit-mask-image:radial-gradient(ellipse 90% 58% at 50% 40%,#000 18%,transparent 84%);
    mask-image:radial-gradient(ellipse 90% 58% at 50% 40%,#000 18%,transparent 84%)}
}
@media(max-width:600px){
  .proc__stage{min-height:520px;
    padding:clamp(32px,8vw,64px) max(24px,env(safe-area-inset-right)) clamp(40px,10vw,72px) max(24px,env(safe-area-inset-left))}
  .proc__name{--nls:2px;font-size:clamp(2rem,12vw,3.2rem);line-height:1.05}
  .proc__name-l{display:block;max-width:100%}
  .proc__content{gap:14px;max-width:100%;width:100%}
  .proc__hud{top:24px;left:max(16px,env(safe-area-inset-left));font-size:10px;letter-spacing:1.4px}
}

/* ---------- Company film (home page, under the hero) ---------- */
/* The hero takes the video's own 4:3 shape at full page width: no stretch, no crop, no zoom. */
[data-theme="light"] .hero.hero--film{display:block;min-height:0;height:auto;aspect-ratio:4/3;padding:0;background:#0d1b2a;overflow:hidden}
.hero__video{position:absolute;inset:0;z-index:0;width:100%;height:100%;object-fit:contain;background:#0d1b2a}
/* dark band at the top so the white menu always reads */
.hero__shade{position:absolute;inset:0 0 auto 0;height:140px;z-index:1;pointer-events:none;
  background:linear-gradient(180deg,rgba(13,27,42,.70),rgba(13,27,42,0))}
/* title block sits at the bottom of the first screen, on its own soft dark fade */
[data-theme="light"] .hero.hero--film .hero__content{position:absolute;left:0;right:0;z-index:5;max-width:none;width:auto;
  top:max(96px,min(calc(100svh - 280px),calc(100% - 280px)));padding:0 max(24px,env(safe-area-inset-left));gap:14px;align-items:center}
.hero--film .hero__content::before{content:"";position:absolute;left:0;right:0;top:-110px;bottom:-60px;z-index:-1;pointer-events:none;
  background:linear-gradient(180deg,rgba(13,27,42,0),rgba(13,27,42,.72) 40%,rgba(13,27,42,.72) 70%,rgba(13,27,42,0) 100%)}
.hero--film .hero__name{color:#fff;font-size:clamp(2.2rem,6.4vw,4.8rem);text-shadow:0 2px 20px rgba(0,0,0,.6)}
.hero--film .hero__name-l:nth-child(2){color:#5cd0ff}
.hero--film .hero__lead{color:#fff;font-size:clamp(1.05rem,2vw,1.4rem);text-shadow:0 1px 12px rgba(0,0,0,.7)}
@media(min-width:769px){
  [data-theme="light"] .has-film .nav:not(.scrolled) .nav__links a{color:#fff;opacity:1;text-shadow:0 1px 8px rgba(0,0,0,.5)}
  [data-theme="light"] .has-film .nav:not(.scrolled) .nav__links a.is-active{color:#5cd0ff}
}
[data-theme="light"] .has-film .nav:not(.scrolled) .wordmark span{color:#fff;text-shadow:0 1px 8px rgba(0,0,0,.5)}
[data-theme="light"] .has-film .nav:not(.scrolled) .nav__menu:not(.open) .nav__bars,
[data-theme="light"] .has-film .nav:not(.scrolled) .nav__menu:not(.open) .nav__bars::before,
[data-theme="light"] .has-film .nav:not(.scrolled) .nav__menu:not(.open) .nav__bars::after{background:#fff}
@media(max-width:600px){.hero--film .hero__name{font-size:clamp(2rem,11vw,3rem)}}
@media(prefers-reduced-motion:reduce){.hero__video{display:none}}
/* phones: portrait cut of the video fills the whole first screen, title sits on it at the bottom */
@media(max-width:768px){
  [data-theme="light"] .hero.hero--film{aspect-ratio:auto;height:100vh;height:100svh;min-height:520px;padding:0}
  .hero--film .hero__video{object-fit:cover;object-position:center}
  .hero__shade{height:100%;background:linear-gradient(180deg,rgba(13,27,42,.65) 0,rgba(13,27,42,0) 110px,rgba(13,27,42,0) 52%,rgba(13,27,42,.88) 100%)}
  [data-theme="light"] .hero.hero--film .hero__content{position:absolute;left:0;right:0;bottom:0;top:auto;
    padding:0 24px max(36px,calc(env(safe-area-inset-bottom) + 28px));gap:12px}
  .hero--film .hero__content::before{display:none}
  .hero--film .hero__lead{font-size:clamp(1rem,4.2vw,1.2rem);line-height:1.45}
}

/* title block centred in the middle of the first screen */
[data-theme="light"] .hero.hero--film .hero__content{top:50vh;top:50svh;bottom:auto;transform:translateY(-50%)}
.hero--film .hero__content::before{display:block;top:-90px;bottom:-90px;
  background:radial-gradient(ellipse 70% 50% at 50% 50%,rgba(13,27,42,.62),rgba(13,27,42,0) 100%)}
@media(max-width:768px){
  [data-theme="light"] .hero.hero--film .hero__content{top:50%;bottom:auto;transform:translateY(-50%);padding:0 24px}
  .hero__shade{background:linear-gradient(180deg,rgba(13,27,42,.65) 0,rgba(13,27,42,0) 110px,rgba(13,27,42,.25) 100%)}
}

/* ALL devices: the hero is exactly one screen tall, so one scroll reaches the animation.
   The page picks a video cut that matches the screen shape (wide / 4:3 / portrait), so cover only trims a sliver. */
[data-theme="light"] .hero.hero--film{aspect-ratio:auto;height:100vh;height:100svh;min-height:480px;padding:0}
.hero--film .hero__video{object-fit:cover;object-position:center;height:100%}
.hero__shade{height:100%;background:linear-gradient(180deg,rgba(13,27,42,.65) 0,rgba(13,27,42,0) 120px,rgba(13,27,42,.20) 100%)}
[data-theme="light"] .hero.hero--film .hero__content{top:50%;bottom:auto;transform:translateY(-50%)}
