* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body { background: #081a30; }
body.home { overflow-x: hidden; }

/* HERO LAYOUT */
.hero-pin {
  position: relative;
  height: 600vh;
}

.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #06152a;
  position: sticky;
  top: 0;
}

.home-content {
  padding: 6vh 8vw 10vh;
  color: #e7eefb;
  margin-top: -20vh;
}

/* Optional header gradient area (if used elsewhere) */
.hero-header {
  position: relative;
  z-index: 2;

  padding-left: 8vw;
  padding-right: 8vw;
  padding-top: 9vh;
  padding-bottom: 4vh;

  background: linear-gradient(
    to bottom,
    rgba(6, 21, 42, 0.98),
    rgba(6, 21, 42, 0.82),
    rgba(6, 21, 42, 0.35),
    rgba(6, 21, 42, 0.0)
  );
}

/* Text (X/Y refined by JS) */
.hero-text {
  position: absolute;
  z-index: var(--hero-z, 2);
  left: 8vw;               /* fallback: JS sets left = first tile x */
  top: 38%;                /* desktop base */
  transform: translateY(var(--hero-ty, 0px)) scale(calc(var(--hero-scale, 1) * var(--hero-fit-scale, 1)));
  transform-origin: left top;
  opacity: var(--hero-opacity, 1);
  will-change: transform, opacity;
  pointer-events: none;
}

/* Brand block */
.brand {
  display: inline-block;
  color: #f2f6ff;
  position: relative;
  --pred-size-start: 56px;
  --pred-size-end: 60px;
  --lab-size-start: 128px;
  --lab-size-end: 56px;
  --lab-mt-start: 6px;
  --lab-mt-end: 0px;
  --tag-size-start: 21px;
  --tag-size-end: 22px;
  --rule-w-start: 100%;
  --rule-w-end: 2px;
  --rule-h-start: 2px;
  --rule-h-end: 28px;
  --rule-angle: 90deg;
  --rule-mt-start: 12px;
  --rule-mt-end: 0px;
  --rule-mb-start: 20px;
  --rule-mb-end: 0px;
  --inline-gap-start: 0px;
  --inline-gap-end: 14px;
}

.brand.is-absolute {
  display: block;
  width: var(--brand-w, auto);
  height: var(--brand-h, auto);
}

.brand.is-absolute .brand-prediction,
.brand.is-absolute .brand-lab,
.brand.is-absolute .brand-rule,
.brand.is-absolute .brand-tagline {
  position: absolute;
  left: 0;
  top: 0;
}

.brand.is-inline-measure {
  display: inline-flex;
  align-items: center;
  gap: var(--inline-gap-end);
  white-space: nowrap;
}

.brand.is-inline-measure-mobile {
  display: block;
  white-space: normal;
}

.brand.is-inline-measure-mobile .brand-prediction,
.brand.is-inline-measure-mobile .brand-lab {
  display: inline-block;
  vertical-align: baseline;
}

.brand.is-inline-measure-mobile .brand-lab {
  margin-left: var(--inline-gap-end);
}

.brand.is-inline-measure-mobile .brand-rule,
.brand.is-inline-measure-mobile .brand-tagline {
  display: block;
}

.brand-prediction,
.brand-lab,
.brand-rule,
.brand-tagline {
  transform: translate(var(--tx, 0px), var(--ty, 0px));
  will-change: transform;
}

/* =========================
   MOBILE-FIRST TYPOGRAPHY
   ========================= */

/* Prediction */
.brand-prediction {
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--pred-size, 56px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.0;
  opacity: 0.92;

  text-shadow:
    0 0 18px rgba(150, 180, 255, 0.22),
    0 0 42px rgba(120, 140, 255, 0.14);
}

/* LAB */
.brand-lab {
  font-family: "Stick No Bills", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--lab-size, 128px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.92;
  margin-top: var(--lab-mt, 6px);
  opacity: 0.98;

  text-shadow:
    0 0 22px rgba(150, 180, 255, 0.24),
    0 0 56px rgba(140, 110, 255, 0.16);
}

/* Rule */
.brand-rule {
  width: var(--rule-w, 100%);
  height: var(--rule-h, 2px);
  margin: var(--rule-mt, 18px) 0 var(--rule-mb, 14px) 2px;
  background: linear-gradient(
    var(--rule-angle, 90deg),
    rgba(140, 110, 255, 0.0),
    rgba(140, 110, 255, 0.75),
    rgba(90, 210, 255, 0.55)
  );
  opacity: 0.9;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
}

/* Tagline */
.brand-tagline {
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--tag-size, 21px);
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: rgba(210, 225, 255, 0.82);
  text-shadow: 0 0 22px rgba(90, 210, 255, 0.12);
}

/* Canvas */
.hero-canvas {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow: hidden;
}

#brandCanvas {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

/* =========================
   DESKTOP / WEB (big hero)
   ========================= */
@media (min-width: 1024px) {
  .brand {
    --pred-size-start: 120px;
    --pred-size-end: 90px;
    --lab-size-start: 328px;
    --lab-size-end: 84px;
    --tag-size-start: 35px;
    --tag-size-end: 28px;
    --rule-h-start: 3px;
    --rule-h-end: 36px;
    --rule-mt-start: 10px;
    --rule-mb-start: 30px;
    --inline-gap-end: 18px;
  }

  .brand-prediction {
    font-size: var(--pred-size, 120px);
    line-height: 1.0;
  }

  .brand-lab {
    font-size: var(--lab-size, 328px);
    font-weight: 600;
    line-height: 0.88;
  }

  .brand-tagline {
    font-size: var(--tag-size, 35px);
    line-height: 1.25;
  }

  .brand-rule {
    height: var(--rule-h, 3px);
    margin: var(--rule-mt, 22px) 0 var(--rule-mb, 18px) 2px;
  }
}

/* =========================
   MOBILE tweaks (layout)
   ========================= */
@media (max-width: 640px) {
  body.home { overflow-x: hidden; }

  /* base lower on mobile; JS will still clamp precisely under the menu */
  .hero-text {
    top: 46%;
  }

  .hero-header {
    padding-left: 6vw;
    padding-right: 6vw;
    padding-top: 7vh;
    padding-bottom: 3vh;
  }
  .brand {
    --pred-size-end: 46px;
    --lab-size-end: 42px;
    --tag-size-end: 16px;
    --rule-h-end: 2px;
    --inline-gap-end: 10px;
  }
}
