/* ==========================================================================
   THE LAYOUT. — hero
   The spotlit stage and the walking man are drawn on the WebGL canvas.
   Everything in this file is the DOM layered over it: header, eyebrow,
   headline, services row, mobile menu, boot veil.
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  src: url('../../public/fonts/archivo-var.woff2') format('woff2');
  font-weight: 100 900; font-stretch: 62% 125%;
  font-style: normal; font-display: block;
}
/* Oswald is still the UI face of the scenes further down the page */
@font-face {
  font-family: 'Oswald';
  src: url('../../public/fonts/oswald-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Oswald';
  src: url('../../public/fonts/oswald-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Oswald';
  src: url('../../public/fonts/oswald-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Oswald';
  src: url('../../public/fonts/oswald-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Oswald';
  src: url('../../public/fonts/oswald-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --cream:    #f3efe6;
  /* the accent is the logo's own red (sampled from logo.png); the names stay
     --gold/--gold-hot so every rule that uses the accent follows it */
  --brand-red: #fb141a;
  --gold:     #fb141a;
  --gold-hot: #ff7a7e;
  --paper:    #ededed;
  --black:    #000;
  --panel:    #0a0a0c;
  --dim:      #8c8c8c;
  --dimmer:   #5f5f5f;

  --ui:   'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --sans: 'Archivo', 'Helvetica Neue', Arial, system-ui, sans-serif;

  --hdr-h: clamp(64px, 10.5vh, 104px);
  --edge:  clamp(20px, 3.65vw, 70px);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.76, 0, .24, 1);
  --ease-expo: cubic-bezier(.19, 1, .22, 1);

  /* pointer parallax, written by the frame loop (-1..1) */
  --px: 0;
  --py: 0;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #000;
  color: var(--cream);
  font-family: var(--sans);
  /* the document scrolls now that more scenes follow the hero; sideways
     overflow is CLIPPED, not hidden - overflow-x:hidden promotes body to a
     scroll container, which silently breaks every position:sticky pin in the
     scenes below (the canvas scrolls away and leaves bare background) */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* nothing may paint before the sequence is ready to start on true black */
html.is-booting .hero,
html.is-booting .hdr { opacity: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.stage-wrap {
  position: fixed; inset: 0;
  overflow: hidden;
  background: #000;
  z-index: 1;
}

/* the founder film: portrait, standing on the right where the reference
   puts him (~69% across, head at ~17%, shoes at ~89%). Its own ground is
   near-black, so its edges are feathered into the page's black and the
   spotlight above him and the floor pool below read as the room. */
.hero__film {
  --fh: 86vh;
  position: absolute;
  top: 8vh;
  left: calc(69vw - var(--fh) * 9 / 32);
  height: var(--fh);
  width: calc(var(--fh) * 9 / 16);
  object-fit: cover;
  display: block;
  background: #000;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 18%, #000 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 9%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 18%, #000 82%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 9%, #000 88%, transparent 100%);
  mask-composite: intersect;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.is-film .hero__film { opacity: 1; }

/* ==========================================================================
   Header
   ========================================================================== */

.hdr {
  position: absolute; top: 0; left: 0; right: 0;
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  padding: 0 var(--edge);
  z-index: 20;
  pointer-events: none;
}
.hdr > * { pointer-events: auto; }

.hdr__mark {
  flex: 0 0 auto;
  display: block;
  line-height: 0;
  text-decoration: none;
}
.hdr__logo {
  display: block;
  height: clamp(20px, 1.55vw, 30px);
  width: auto;
}

.hdr__nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.hdr__nav ul {
  display: flex;
  gap: clamp(22px, 2.65vw, 52px);
  list-style: none;
  margin: 0; padding: 0;
}
.hdr__nav a {
  position: relative;
  display: block;
  padding: 8px 0;
  font-size: clamp(11px, .8vw, 15px);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  opacity: .88;
  transition: opacity .35s var(--ease-out), color .35s var(--ease-out);
}
.hdr__nav a::after {                      /* hairline that draws in on hover */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease-expo);
}
.hdr__nav a:hover, .hdr__nav a:focus-visible { opacity: 1; color: #fff; }
.hdr__nav a:hover::after, .hdr__nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hdr__cta {
  position: relative;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(18px, 1.35vw, 26px);
  height: clamp(38px, 2.4vw, 47px);
  border: 1px solid rgba(251, 20, 26, .6);
  font-size: clamp(11px, .8vw, 15px);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
  transition: color .45s var(--ease-out), border-color .45s var(--ease-out);
}
.hdr__cta::before {                       /* gold fill that rises on hover */
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--gold);
  transform: translateY(101%);
  transition: transform .55s var(--ease-expo);
}
.hdr__cta svg {
  width: 11px; height: 11px;
  transition: transform .5s var(--ease-expo);
}
.hdr__cta:hover, .hdr__cta:focus-visible { color: #0b0b0b; border-color: var(--gold); }
.hdr__cta:hover::before, .hdr__cta:focus-visible::before { transform: none; }
.hdr__cta:hover svg, .hdr__cta:focus-visible svg { transform: translate(2px, -2px); }

.hdr__burger { display: none; }

/* staggered arrival ------------------------------------------------------ */
.hdr__mark, .hdr__nav li, .hdr__cta, .hdr__burger {
  opacity: 0;
  transform: translateY(-12px);
}
.is-header .hdr__mark,
.is-header .hdr__nav li,
.is-header .hdr__cta,
.is-header .hdr__burger {
  opacity: 1;
  transform: none;
  transition: opacity .8s var(--ease-out), transform .9s var(--ease-out),
              color .45s var(--ease-out), border-color .45s var(--ease-out);
}
.is-header .hdr__nav li { transition-delay: calc(.12s + var(--i, 0) * .07s); }
.is-header .hdr__cta    { transition-delay: .42s; }

/* ==========================================================================
   Hero copy — laid out off the reference frame (1586x992): the name block
   from 24.5% down and ~52% across, the tagline and a gold rule under it, the
   services row on a hairline near the foot, the founder standing on the
   right at ~69% across.
   ========================================================================== */

.hero {
  --name-w: min(52vw, 81vh, 980px);
  position: absolute; inset: 0;
  z-index: 10;
  pointer-events: none;
  padding: 0 var(--edge);
}

/* --- the name: two supplied PNG lines, stacked like the reference --------- */
.hero__name {
  position: absolute;
  left: var(--edge);
  top: 24.5vh;
  width: var(--name-w);
  margin: 0;
  display: grid;
  transform: translate3d(calc(var(--px, 0) * -8px), calc(var(--py, 0) * -5px), 0);
}
.hero__nameLine {
  position: relative;
  display: block;
  line-height: 0;
  /* the reveal: each line wipes open left to right out of a blur */
  clip-path: inset(0 100% 0 0);
  opacity: 0;
  filter: blur(12px);
  transform: translate3d(-34px, 0, 0);
}
.hero__nameLine img {
  display: block;
  width: 100%;
  height: auto;
}
.hero__nameLine:nth-child(2) img { width: 100.9%; }   /* ADANI's ink is 10px wider */
.is-title .hero__nameLine {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition:
    clip-path 1.25s var(--ease-expo),
    opacity .5s ease,
    filter 1.1s var(--ease-out),
    transform 1.4s var(--ease-expo);
}
.is-title .hero__nameLine:nth-child(2) { transition-delay: .16s; }
/* a light that crosses the painted letters once they have landed, masked to
   the letterforms themselves */
.hero__nameLine::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 220, 200, .55) 50%, transparent 62%);
  background-size: 260% 100%;
  background-position: 120% 0;
  -webkit-mask: var(--mask) center / 100% 100% no-repeat;
  mask: var(--mask) center / 100% 100% no-repeat;
  mix-blend-mode: screen;
  pointer-events: none;
}
.hero__nameLine:nth-child(1) { --mask: url('../../public/hero/name-vishal.png'); }
.hero__nameLine:nth-child(2) { --mask: url('../../public/hero/name-adani.png'); }
.is-settled .hero__nameLine::after { animation: nameLight 8s var(--ease-in-out) .2s infinite; }
.is-settled .hero__nameLine:nth-child(2)::after { animation-delay: .45s; }
@keyframes nameLight {
  0%, 70% { background-position: 120% 0; }
  100%    { background-position: -40% 0; }
}

/* --- tagline + gold rule ----------------------------------------------------- */
.hero__tag {
  position: absolute;
  left: var(--edge);
  top: calc(24.5vh + var(--name-w) * 485 / 1060 + 2.2vh);
  margin: 0;
  font-size: clamp(14px, 1.55vw, 27px);
  font-weight: 400;
  letter-spacing: .9em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #f1f1f1;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
}
.is-tag .hero__tag {
  opacity: 1;
  letter-spacing: .42em;
  transform: none;
  transition: opacity 1s ease, letter-spacing 1.8s var(--ease-expo), transform 1.2s var(--ease-expo);
}
.hero__rule {
  position: absolute;
  left: var(--edge);
  top: calc(24.5vh + var(--name-w) * 485 / 1060 + 2.2vh + clamp(14px, 1.55vw, 27px) * 1.2 + 3.4vh);
  width: clamp(48px, 4.6vw, 80px);
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
}
.is-tag .hero__rule { transform: none; transition: transform 1.1s var(--ease-expo) .45s; }

/* --- services row on its hairline ------------------------------------------ */
.hero__services {
  position: absolute;
  left: var(--edge);
  bottom: 9.5vh;
  width: min(45vw, 780px);
  margin: 0;
  padding: 2.4vh 0 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 10px;
  font-size: clamp(10px, .72vw, 13px);
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #d8d8d8;
}
.hero__services::before {                /* the hairline above the row */
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: rgba(255, 255, 255, .45);
  transform: scaleX(0);
  transform-origin: left;
}
.is-services .hero__services::before { transform: none; transition: transform 1.3s var(--ease-expo); }
.hero__services li {
  display: flex;
  align-items: center;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(12px);
}
.hero__services li + li::before {
  content: '/';
  margin: 0 1.3em;
  color: var(--gold);
  letter-spacing: 0;
}
.is-services .hero__services li {
  opacity: 1;
  transform: none;
  transition: opacity .9s var(--ease-out), transform 1s var(--ease-expo);
  transition-delay: calc(.25s + var(--i, 0) * .09s);
}

/* --- sound toggle ------------------------------------------------------------ */
.hero__sound {
  position: absolute;
  right: var(--edge);
  bottom: 9.5vh;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px 11px 16px;
  border-radius: 999px;
  border: 1px solid rgba(251, 20, 26, .55);
  background: rgba(8, 8, 10, .45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--cream);
  font: 600 11px/1 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: background .35s ease, border-color .35s ease, color .35s ease;
}
.is-services .hero__sound {
  opacity: 1;
  transform: none;
  transition: opacity .8s ease .6s, transform 1s var(--ease-expo) .6s,
              background .35s ease, border-color .35s ease, color .35s ease;
}
.hero__sound:hover,
.hero__sound:focus-visible { background: var(--gold); border-color: var(--gold); color: #0b0b0b; outline: none; }
.hero__bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.hero__bars i {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  transition: height .3s ease;
}
/* while the voice is on, the bars move */
.hero__sound[aria-pressed="true"] .hero__bars i { animation: bar 1s ease-in-out infinite; }
.hero__sound[aria-pressed="true"] .hero__bars i:nth-child(2) { animation-delay: -.3s; }
.hero__sound[aria-pressed="true"] .hero__bars i:nth-child(3) { animation-delay: -.6s; }
.hero__sound[aria-pressed="true"] .hero__bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes bar {
  0%, 100% { height: 4px; }
  50%      { height: 14px; }
}
/* muted: a gentle pulse asks for a tap */
.hero__sound[aria-pressed="false"].is-asking { animation: ask 2.2s ease-in-out infinite; }
@keyframes ask {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 20, 26, .0); }
  50%      { box-shadow: 0 0 0 8px rgba(251, 20, 26, .18); }
}

/* ==========================================================================
   Mobile menu
   ========================================================================== */

.menu {
  position: absolute; inset: 0;
  z-index: 18;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 34px;
  background: rgba(6, 6, 8, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease, visibility .45s;
}
.is-menu .menu { opacity: 1; visibility: visible; }
.menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.menu ul a {
  display: block;
  text-align: center;
  text-decoration: none;
  font-size: clamp(38px, 11vw, 60px);
  font-weight: 700;
  font-stretch: 90%;
  line-height: 1.08;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .4s ease, transform .55s var(--ease-out), color .3s;
}
.menu ul a:hover { color: var(--gold); }
.is-menu .menu ul a {
  opacity: 1;
  transform: none;
  transition-delay: calc(.06s + var(--i, 0) * .05s);
}
.menu__cta { margin-left: 0; }

/* ==========================================================================
   Boot / loading — deliberately almost invisible
   ========================================================================== */

.boot {
  position: absolute; inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: #000;
  transition: opacity .5s ease-out, visibility .5s;
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.boot__bar {
  width: min(148px, 26vw);
  height: 1px;
  background: rgba(255, 255, 255, .13);
  overflow: hidden;
  opacity: 0;
  animation: bootIn .5s ease-out .35s forwards;   /* only if loading is slow */
}
.boot__bar i {
  display: block; height: 100%; width: 0%;
  background: var(--gold);
  transition: width .3s ease-out;
}
@keyframes bootIn { to { opacity: 1; } }

.boot__enter {
  position: absolute;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .28);
  background: transparent;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  padding: 14px 30px 13px;
  cursor: pointer;
  transition: background .35s, border-color .35s, color .35s;
}
.boot__enter:hover { background: var(--gold); border-color: var(--gold); color: #0b0b0b; }

/* WebGL unavailable: the copy still stands on a plain dark panel */
.is-fallback .stage-wrap {
  background: radial-gradient(60% 80% at 72% 40%, #1b2530 0%, #07080a 70%);
}

/* ==========================================================================
   Small screens — the stage stays, the copy stacks over its lower half
   ========================================================================== */

@media (max-width: 760px) {
  .hdr__nav, .hdr > .hdr__cta { display: none; }
  .hdr__burger {
    display: grid;
    gap: 6px;
    margin-left: auto;
    appearance: none; border: 0; background: none; padding: 8px 0;
    cursor: pointer;
  }
  .hdr__burger span {
    display: block; width: 26px; height: 1.5px; background: var(--cream);
    transition: transform .4s var(--ease-out);
  }
  .hdr__burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .hdr__burger[aria-expanded="true"] span:last-child  { transform: translateY(-3.75px) rotate(-45deg); }

  /* the founder stands in the upper part of the screen, whole; the name,
     tagline and services stack beneath him */
  .hero__film {
    --fh: 58svh;
    top: calc(var(--hdr-h) - 4px);
    left: calc(50vw - var(--fh) * 9 / 32);
  }
  .hero { --name-w: min(84vw, 460px); }
  .hero__name { top: calc(var(--hdr-h) + 56svh); transform: none; }
  .hero__tag {
    top: calc(var(--hdr-h) + 56svh + var(--name-w) * 485 / 1060 + 12px);
    font-size: clamp(11px, 3.4vw, 15px);
    letter-spacing: .3em;
  }
  .is-tag .hero__tag { letter-spacing: .26em; }
  .hero__rule { display: none; }
  .hero__services {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 58px);
    right: var(--edge);
    width: auto;
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    column-gap: 22px;
    row-gap: 9px;
    padding-top: 12px;
    font-size: 9.5px;
    letter-spacing: .16em;
  }
  .hero__services li::before,
  .hero__services li + li::before {
    content: '';
    width: 4px; height: 4px;
    margin: 0 9px 0 0;
    background: var(--gold);
    opacity: .7;
  }
  .hero__sound {
    right: auto;
    left: var(--edge);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    padding: 9px 14px 9px 12px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hdr__mark, .hdr__nav li, .hdr__cta, .hdr__burger,
  .hero__nameLine, .hero__tag, .hero__rule, .hero__services::before,
  .hero__services li, .hero__sound, .hero__film {
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
  .hero__nameLine::after, .hero__bars i { animation: none !important; }
}

/* --------------------------------------------------------------------------
   Safety net (the inline script in index.html): if the modules never start,
   the two WebGL scenes show a still of their finished composition instead of
   an empty stage, and the fixed hero stays behind the page
   -------------------------------------------------------------------------- */
.is-fallback .chrono__pin {
  background: #000 url('../../public/years/timeline-static.jpg') center / cover no-repeat;
}
.is-fallback .chrono__pin > * { visibility: hidden; }
.is-fallback .gallery__pin {
  background: #000 url('../../public/projects/projects-static.jpg') center / cover no-repeat;
}
.is-fallback .gallery__pin > * { visibility: hidden; }
