/* ============================================================
   HEINOUX · ME.VISUALS — palette + wordmark aligned to NexBDM
   Shell Navy · Cyan signal · Syne + DM Sans
   Videos are the feature: content never overlays them.
   ============================================================ */

:root {
  /* Shell */
  --shell:      #0B1628;
  --surface:    #0F172A;
  --ink:        #050810;

  /* Signal */
  --cyan:       #22D3EE;
  --cyan-600:   #0891B2;
  --cyan-glow:  rgba(34, 211, 238, 0.35);

  /* Success (sparing, on-brand) */
  --emerald:    #34D399;

  /* Type */
  --white:      #FFFFFF;
  --slate-300:  #CBD5E1;
  --slate-500:  #64748B;
  --slate-700:  #334155;

  /* Rhythm */
  --rail-pad:   clamp(16px, 2.4vw, 40px);
  --edge:       clamp(20px, 4vw, 64px);
  --maxw:       1440px;

  /* Typography */
  --f-display:  "Syne", "Poppins", "Montserrat", "Segoe UI", Arial, sans-serif;
  --f-body:     "DM Sans", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--shell);
  color: var(--white);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* clip, not hidden: hidden creates a scroll container and breaks
     position:sticky / pinning in some browsers */
  overflow-x: clip;
}
html { scroll-behavior: auto; }
body { min-height: 100vh; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--cyan); color: var(--ink); }

.cyan-word { color: var(--cyan); }

/* ============================================================
   BRAND RAILS (fixed)
   ============================================================ */

.rail {
  position: fixed;
  z-index: 100;
  color: var(--white);
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}
.rail > * { pointer-events: auto; }

.rail-top {
  top: 0; left: 0; right: 0;
  padding: var(--rail-pad) var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(to bottom, rgba(11, 22, 40, 0.65) 0%, rgba(11, 22, 40, 0) 100%);
}

.wordmark-heinoux {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--white);
}
.mark-dot {
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 1;    }
  50%      { transform: scale(1.4); opacity: 0.55; }
}

.rail-right { display: inline-flex; align-items: center; gap: 28px; }
.rail-link {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate-300);
  transition: color 240ms ease;
}
.rail-link:hover { color: var(--cyan); }
.foot-tag a { color: var(--slate-300); }
.foot-tag a:hover { color: var(--cyan); }

/* Official NexBDM wordmark (white PNG, trimmed) */
.nexbdm-lockup { display: inline-flex; align-items: center; }
.nexbdm-logo { height: 30px; width: auto; display: block; }
.foot-logo   { height: 26px; }

/* ============================================================
   HERO — full-bleed orbit, pinned by ScrollTrigger (not sticky)
   ============================================================ */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  background: var(--ink);
  overflow: hidden;
}

#orbit-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.06) 0%, rgba(5, 8, 16, 1) 70%);
}
.hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.hero-fallback.on { opacity: 1; }
#orbit-canvas.off { opacity: 0; }

/* Feathered edges only — no scrim over the subject */
.hero-edge {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(11, 22, 40, 0.4) 0%, transparent 18%, transparent 82%, rgba(11, 22, 40, 0.55) 100%);
  pointer-events: none;
}

.hero-copy {
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  bottom: clamp(24px, 5vh, 64px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
}

/* KINETIC DISPLAY TYPE — hero size is set by JS (fit-to-width) */
.display {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.86;
  color: var(--white);
  margin: 0;
}
.display-hero {
  font-size: 12vw;              /* pre-JS fallback only */
  letter-spacing: -0.045em;
  text-transform: uppercase;
  white-space: nowrap;
  width: max-content;
  max-width: 100%;
  /* mask: rising letters are clipped inside the line box, so they can
     never leak below the headline while hidden */
  overflow: hidden;
}
.display-hero .char {
  display: inline-block;
  transform: translateY(120%);
  opacity: 0;
  will-change: transform, opacity;
  transition:
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 500ms ease;
  transition-delay: var(--char-delay, 0ms);
}
.display-hero.revealed .char {
  transform: translateY(0);
  opacity: 1;
}
.display-section {
  font-size: clamp(48px, 8vw, 132px);
  letter-spacing: -0.035em;
  line-height: 0.92;
}
.display-finale {
  font-size: clamp(44px, 7.5vw, 124px);
  letter-spacing: -0.03em;
  line-height: 0.94;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--slate-300);
}
.hero-meta .tick {
  font-size: 14px;
  color: var(--cyan);
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* ============================================================
   STATS — intro line + cards
   ============================================================ */

.stats {
  position: relative;
  z-index: 10;
  padding: clamp(72px, 11vh, 140px) var(--edge);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(34, 211, 238, 0.07), transparent 55%),
    var(--shell);
  border-top: 1px solid rgba(34, 211, 238, 0.14);
}
.stats-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.stats-head { margin-bottom: clamp(36px, 5vh, 64px); }
.stats-lead {
  max-width: 860px;
  font-size: clamp(20px, 2.2vw, 32px);
  line-height: 1.35;
  color: var(--white);
  margin: 14px 0 0;
  font-weight: 500;
}
.stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 28px);
}
@media (max-width: 800px) {
  .stats-cards { grid-template-columns: 1fr; }
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(28px, 3.5vw, 48px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 2px solid rgba(34, 211, 238, 0.55);
  border-radius: 4px;
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 300ms ease;
}
.stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.5);
}
.stat-card .num {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(64px, 8vw, 128px);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--white);
}
.stat-card .num[data-suffix]:after {
  content: attr(data-suffix);
  color: var(--cyan);
}
.stat-card .label {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
}
.stat-card .caption {
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate-300);
}

/* ============================================================
   Shared section chrome
   ============================================================ */

.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.section-head {
  margin-bottom: clamp(36px, 5vh, 72px);
}
.section-eye {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cyan);
}
.section-head .display { margin-top: 18px; }

/* ============================================================
   VIDEO FEATURE — the clips are the show. Full width, full
   brightness, framed like a screen. Nothing on top of them.
   ============================================================ */

.video-feature {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 76vh;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow:
    0 0 0 1px rgba(5, 8, 16, 0.9),
    0 24px 80px rgba(5, 8, 16, 0.7),
    0 0 60px rgba(34, 211, 238, 0.1);
  background: var(--ink);
  margin-bottom: clamp(32px, 5vh, 64px);
}
.video-feature video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================================
   PILLARS
   ============================================================ */

.pillars {
  position: relative;
  padding: clamp(96px, 14vh, 180px) var(--edge);
  background: var(--shell);
}
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .pillars-grid { grid-template-columns: 1fr; }
}
.pillar {
  position: relative;
  padding: 40px 32px 44px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  transition: border-color 300ms ease, transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}
.pillar.in { opacity: 1; transform: translateY(0); }
.pillar:hover { border-color: rgba(34, 211, 238, 0.5); }
.pill-num {
  display: block;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--cyan);
  letter-spacing: 0.3em;
  margin-bottom: 24px;
}
.pillar h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(24px, 2.6vw, 34px);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 16px;
  color: var(--white);
}
.pillar p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--slate-300);
  margin: 0;
}

/* ============================================================
   WORK
   ============================================================ */

.work {
  position: relative;
  padding: clamp(96px, 14vh, 180px) var(--edge);
  background:
    radial-gradient(ellipse at 85% 10%, rgba(34, 211, 238, 0.05), transparent 55%),
    var(--ink);
}
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.work-card-os { grid-column: span 2; }
@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-card-os { grid-column: span 1; }
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  overflow: hidden;
  transition:
    border-color 300ms ease,
    transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
  cursor: pointer;
}
.work-card:hover {
  border-color: rgba(34, 211, 238, 0.55);
  transform: translateY(-6px);
}

.wc-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
}
.wc-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: scale(1.01);
  transition: transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.work-card:hover .wc-preview img { transform: scale(1.05); }

.wc-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 22px;
  padding: 28px 28px 30px;
}
.work-card-os .wc-row { padding-bottom: 8px; }
.wc-index {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--cyan);
  letter-spacing: 0.3em;
  padding-top: 8px;
}
.wc-body h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(26px, 3vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 10px;
}
.wc-body p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--slate-300);
  margin: 0;
  max-width: 60ch;
}
.wc-arrow {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--white);
  transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1), color 300ms;
  padding-top: 4px;
}
.work-card:hover .wc-arrow {
  transform: translate(6px, -6px);
  color: var(--cyan);
}

/* Company OS module cards */
.os-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  padding: 20px 28px 30px;
}
@media (max-width: 1100px) { .os-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .os-grid { grid-template-columns: 1fr; } }
.os-module {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px 24px;
  background: rgba(11, 22, 40, 0.85);
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 4px;
  transition: transform 450ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 300ms ease;
}
.os-module:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.55);
}
.os-module svg {
  width: 22px;
  height: 22px;
  fill: var(--cyan);
  stroke: var(--cyan);
}
.os-module h4 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  margin: 2px 0 0;
  color: var(--white);
}
.os-module p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--slate-300);
  margin: 0;
}

/* ============================================================
   FINALE
   ============================================================ */

.finale {
  position: relative;
  padding: clamp(120px, 18vh, 240px) var(--edge) clamp(48px, 6vh, 88px);
  background:
    radial-gradient(ellipse at 20% 30%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(52, 211, 153, 0.06), transparent 60%),
    var(--shell);
  border-top: 1px solid rgba(34, 211, 238, 0.15);
}
.finale-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 44px 0 88px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 22px 30px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  transition:
    transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1),
    background 300ms ease,
    color 300ms ease,
    border-color 300ms ease;
}
.btn-primary {
  background: var(--cyan);
  color: var(--ink);
  box-shadow: 0 8px 40px rgba(34, 211, 238, 0.35);
}
.btn-primary:hover { transform: translateY(-3px); background: var(--white); }
.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-3px);
}

.foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(203, 213, 225, 0.12);
}
@media (max-width: 800px) { .foot { grid-template-columns: 1fr; } }
.foot-left { display: flex; flex-direction: column; gap: 14px; }
.foot-tag {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin: 0;
}
.socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: flex-end;
}
@media (max-width: 800px) { .socials { justify-content: flex-start; } }
.socials a {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate-300);
  transition: color 240ms ease;
}
.socials a:hover { color: var(--cyan); }
.colophon {
  margin: 40px 0 0;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--slate-500);
}

/* ============================================================
   Global grain overlay
   ============================================================ */

.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' 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.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  animation: grain 1.4s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-12px, 4px); }
  40%  { transform: translate(8px, -6px); }
  60%  { transform: translate(-6px, 10px); }
  80%  { transform: translate(4px, -8px); }
  100% { transform: translate(0, 0); }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .grain { display: none; }
  .display-hero .char { transform: none; opacity: 1; }
}
