@import url("https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap");

/* ==========================================================================
   hero.css — intro overlay, matched to the live B-Square page.

   Reference, taken from https://bsquareparivar.in/ and its stylesheet:
     header   solid white, w-95%, rounded-xl, floating, soft shadow
     accent   #2c70ee  (Apply Online pill, .sign-in-btn)
     ink      #536171  slate body text
     paper    #ffffff  the site's own ground
     signal   #008dd2  hairline borders

   Layout contract:
     the SITE is full width, exactly like the live page — never boxed
     the HERO photo is full bleed
     only the FILM sits in a box, with air on both sides
   ========================================================================== */

:root {
  --sq-ink: #060e1a;
  --sq-ink-2: #08121f;
  --sq-blue: #2c70ee;
  --sq-blue-txt: #4d9bff;
  --sq-blue-lt: #64a5eb;
  --sq-signal: #008dd2;
  --sq-slate: #536171;
  --sq-paper: #ffffff;

  --hero-font: "Share Tech Mono", ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
  --mono-font: "Share Tech Mono", ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;

  /* the film sits in a box with air on both sides */
  --gutter: clamp(12px, 2.2vw, 48px);
  --box-w: min(1560px, calc(100% - var(--gutter) * 2));

  --header-h: 118px;
}

/* ---------- layout: full width site, full bleed hero, boxed film ---------- */

html {
  background: #ffffff;
  overflow-x: hidden;
}

body {
  background: #ffffff;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

/* the site itself is full width, exactly like the live page — never boxed */
#nothing {
  width: 100%;
  max-width: none;
  background: var(--sq-paper);
}

/* the real site header: floating rounded bar, like the live page */
.header-container {
  z-index: 500 !important;
  background-color: rgba(255, 255, 255, 0.9) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 141, 210, 0.16) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(9, 24, 45, 0.12) !important;

  width: min(95vw, 1840px) !important;
  max-width: 95vw !important;
  top: 10px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}

/* the bar may be wide — the nav inside keeps a readable rhythm instead of
   spreading to the corners, which is what read as "stretched" */
.header-container {
  padding-left: clamp(8px, 1.4vw, 28px) !important;
  padding-right: clamp(8px, 1.4vw, 28px) !important;
}

@media (min-width: 1500px) {
  .nav-links { gap: 2.75rem !important; font-size: 1.15rem !important; }
}

@media (max-width: 1500px) and (min-width: 1000px) {
  .nav-links { gap: 1.1rem !important; font-size: 1.02rem !important; }
}

/* ---------- shell ---------- */

.hero,
.reel {
  position: relative;
  overflow: hidden;
  background: var(--sq-ink);
  isolation: isolate;
}

.hero {
  z-index: 20;
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  border-radius: 0;
}

.reel {
  z-index: 15;
  /* the film is a framed box, centred on the page with air above and below —
     never butted straight against the hero photograph */
  --reel-max-h: 84svh;
  width: min(var(--box-w), calc(var(--reel-max-h) * 16 / 9));
  aspect-ratio: 16 / 9;
  height: auto;
  padding: 0;
  margin: clamp(22px, 4.5vh, 60px) auto clamp(22px, 4.5vh, 60px);
  background: #000;
  border-radius: clamp(10px, 1.1vw, 20px);
  box-shadow: 0 26px 70px -28px rgba(9, 24, 45, 0.5);
}

/* ---------- hero: photograph, full bleed ---------- */

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
  /* no upscale transform — the source is 1672x941, blowing it up is what
     made the photo look soft and stretched on wide screens */
  transform: none;
  filter: saturate(1.06) contrast(1.06) brightness(0.88);
}

.hero--nophoto .hero__media {
  background:
    radial-gradient(110% 80% at 50% 10%, rgba(44, 112, 238, 0.34) 0%, rgba(44, 112, 238, 0.09) 40%, transparent 72%),
    linear-gradient(180deg, #0a1524 0%, #050c16 60%, #060e1a 100%);
}

/* ---------- hero: effects ---------- */

.hero__rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.5;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* the film is playing: park the canvas so it stops stealing frames */
.hero__rain.is-parked {
  opacity: 0.16;
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(100, 165, 235, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 165, 235, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(130% 90% at 50% 44%, #000 14%, transparent 74%);
  -webkit-mask-image: radial-gradient(130% 90% at 50% 44%, #000 14%, transparent 74%);
  animation: hero-grid-pan 28s linear infinite;
}

@keyframes hero-grid-pan {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 64px, 64px 0; }
}

.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(125% 90% at 50% 46%, transparent 20%, rgba(4, 10, 18, 0.62) 76%, rgba(4, 10, 18, 0.94) 100%),
    linear-gradient(180deg, rgba(4, 10, 18, 0.9) 0%, rgba(4, 10, 18, 0.22) 24%, transparent 52%, rgba(4, 10, 18, 0.72) 88%, rgba(4, 10, 18, 0.95) 100%);
}

.hero__scan {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.14;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(100, 165, 235, 0.16) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  animation: hero-scan 10s linear infinite;
}

@keyframes hero-scan {
  from { background-position: 0 -100vh; }
  to   { background-position: 0 100vh; }
}

/* ---------- hero: text column ---------- */

.hero__inner {
  position: relative;
  z-index: 6;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: calc(var(--header-h) + 24px) clamp(16px, 3vw, 48px) clamp(64px, 10vh, 104px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(16px, 2.4vh, 28px);
}

.hero__kicker {
  margin: 0;
  font-family: var(--mono-font);
  font-size: clamp(10px, 0.86vw, 13px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(190, 219, 245, 0.82);
  opacity: 0;
  animation: hero-fade-up 0.7s 0.1s ease-out forwards;
}

.hero__kicker b {
  color: var(--sq-blue-txt);
  font-weight: 400;
}

.hero__dots::after {
  content: "";
  animation: hero-ellipsis 1.4s steps(4, end) infinite;
}

@keyframes hero-ellipsis {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}

/* ONE LINE — mono, measured, never wraps, never clipped. */
.hero__title {
  margin: 0;
  margin-top: calc(1.02em * 3 - 0.3em);
  font-family: var(--hero-font);
  font-weight: 400;
  /* conservative pre-JS size; hero.js measures the line and fits it exactly
     to the hero box so all 45 characters fill the width edge to edge */
  font-size: min(3.6vw, 72px);
  max-width: none;
  width: 100%;
  line-height: 1.05;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  color: #f2f8ff;
  white-space: nowrap;
  text-shadow: 0 0 32px rgba(0, 0, 0, 0.6);
}

.hero__line {
  display: flex;
  justify-content: center;
  white-space: nowrap;
}

/* Per-character cell. Each letter owns a short column of glyphs above it
   that scrolls downward forever — the letter is the tail of its own rain. */
.hero__line .ch {
  position: relative;
  display: inline-block;
  opacity: 0;
  transform: translateY(-0.7em);
  animation: hero-char-drop 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 22ms + 0.1s);
  will-change: transform, opacity;
}

.hero__line .ch.sp {
  width: 0.34em;
}

.hero__line .ch__ch {
  display: inline-block;
}

.hero__line .ch__tail {
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 0.46em;
  height: calc(1.02em * 2.1);
  margin-left: -0.23em;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.34;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 38%, rgba(0, 0, 0, 0.6) 74%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 38%, rgba(0, 0, 0, 0.6) 74%, #000 100%);
}

.hero__line .ch__roll {
  display: block;
  animation: hero-tail-fall var(--tail-dur, 1.1s) linear infinite;
  animation-delay: var(--tail-delay, 0s);
  will-change: transform;
  text-align: center;
}

.hero__line .ch__roll i {
  display: block;
  height: 1.02em;
  line-height: 1.02;
  font-style: normal;
  font-size: 0.64em;
  color: #64a5eb;
  text-shadow: 0 0 7px rgba(44, 112, 238, 0.4);
}

@keyframes hero-tail-fall {
  from { transform: translateY(-1.02em); }
  to   { transform: translateY(0); }
}

.hero__line .ch.hot {
  color: var(--sq-blue-txt);
  text-shadow:
    0 0 14px rgba(77, 155, 255, 0.65),
    0 0 46px rgba(44, 112, 238, 0.4);
}

.hero__line .ch.hot .ch__roll i {
  color: #c9e4ff;
  text-shadow: 0 0 12px rgba(77, 155, 255, 0.8);
}

@keyframes hero-char-drop {
  0%   { opacity: 0; transform: translateY(-0.7em); filter: blur(3px); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* thin blue rule under the line */
.hero__rule {
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--sq-blue) 20%, var(--sq-blue-lt) 50%, var(--sq-blue) 80%, transparent);
  box-shadow: 0 0 20px rgba(44, 112, 238, 0.6);
  animation: hero-rule 1.4s 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hero-rule {
  to { width: min(620px, 64vw); }
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.5vw, 24px);
  font-family: var(--mono-font);
  font-size: clamp(9px, 0.76vw, 12px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(178, 208, 236, 0.62);
  opacity: 0;
  animation: hero-fade-up 0.9s 0.95s ease-out forwards;
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero__meta span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sq-blue-lt);
  box-shadow: 0 0 10px rgba(100, 165, 235, 0.85);
  animation: hero-pulse 2.4s ease-in-out infinite;
}

.hero__meta span:nth-child(2)::before { animation-delay: 0.4s; }
.hero__meta span:nth-child(3)::before { animation-delay: 0.8s; }

@keyframes hero-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.28; }
}

@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- hero: scroll cue ---------- */

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 3vh, 32px);
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  font-family: var(--mono-font);
  font-size: 10px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(178, 208, 236, 0.66);
  text-decoration: none;
  opacity: 0;
  animation: hero-fade-up 1s 1.2s ease-out forwards;
}

.hero__cue:hover,
.hero__cue:focus-visible {
  color: var(--sq-blue-txt);
  text-decoration: none;
}

.hero__cue i {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, rgba(100, 165, 235, 0.9), transparent);
  animation: hero-drop 2s ease-in-out infinite;
}

@keyframes hero-drop {
  0%   { transform: scaleY(0.2); transform-origin: top; opacity: 0.2; }
  50%  { transform: scaleY(1);   transform-origin: top; opacity: 1; }
  100% { transform: scaleY(0.2); transform-origin: bottom; opacity: 0.2; }
}

/* ---------- reel: the film, nothing else ---------- */

.reel__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
  outline: none;
  border: 0;
  pointer-events: none;
}

/* no native chrome, no overlay, no controls — ever */
.reel__video::-webkit-media-controls,
.reel__video::-webkit-media-controls-panel,
.reel__video::-webkit-media-controls-play-button,
.reel__video::-webkit-media-controls-start-playback-button,
.reel__video::-webkit-media-controls-timeline,
.reel__video::-webkit-media-controls-volume-slider,
.reel__video::-webkit-media-controls-mute-button,
.reel__video::-webkit-media-controls-fullscreen-button,
.reel__video::-webkit-media-controls-overlay-play-button,
.reel__video::-webkit-media-controls-enclosure {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* while the film plays the header's backdrop blur is the single most
   expensive repaint on the page — swap it for an opaque bar for those
   seconds, then hand the blur back */
html.reel-live .header-container {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background-color: rgba(255, 255, 255, 0.97) !important;
}

/* the hero is off screen: nothing in it needs to keep animating */
.hero.is-idle *,
.hero.is-idle *::before,
.hero.is-idle *::after {
  animation-play-state: paused !important;
}

/* ---------- tablet ---------- */

@media (max-width: 1100px) {
  .header-container {
    width: 96vw !important;
    max-width: 96vw !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .hero__inner {
    padding-left: clamp(14px, 4vw, 32px);
    padding-right: clamp(14px, 4vw, 32px);
  }

  .hero__meta {
    font-size: 10px;
    letter-spacing: 0.14em;
  }
}

/* ---------- phone ---------- */

@media (max-width: 760px) {
  :root {
    --gutter: 12px;
  }

  .header-container {
    top: 8px !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    border-radius: 14px !important;
  }

  .hero {
    min-height: 100svh;
  }

  .hero__inner {
    padding: calc(var(--header-h) + 18px) 14px clamp(72px, 12vh, 104px);
    gap: 14px;
  }

  .hero__kicker {
    font-size: 9px;
    letter-spacing: 0.18em;
  }

  .hero__title {
    margin-top: calc(1.02em * 2.4);
    letter-spacing: 0;
  }

  .hero__line .ch { animation-delay: calc(var(--i) * 10ms + 0.1s); }

  .hero__meta {
    font-size: 8.5px;
    letter-spacing: 0.1em;
    gap: 8px 14px;
  }

  .hero__meta span::before {
    width: 5px;
    height: 5px;
  }

  .hero__cue {
    font-size: 9px;
    letter-spacing: 0.3em;
  }

  .hero__cue i { height: 28px; }

  /* the film keeps air on both sides on a phone too, and the same 16:9 box */
  .reel {
    --reel-max-h: 58svh;
    margin-top: clamp(18px, 3vh, 32px);
    margin-bottom: clamp(18px, 3vh, 32px);
    border-radius: 10px;
  }

  .hero__scan { opacity: 0.1; }
}

@media (max-width: 420px) {
  .hero__kicker { display: none; }
  .hero__meta { font-size: 8px; }
}

/* ---------- motion sensitivity ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero__grid,
  .hero__scan,
  .hero__meta span::before,
  .hero__cue i {
    animation: none !important;
  }

  .hero__line .ch {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .hero__kicker,
  .hero__meta,
  .hero__cue {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__rule { width: min(620px, 64vw) !important; }
}
