/* ============================================================
   hero-cosmos.css - ORBIS Cosmic Hero
   Spec: docs/superpowers/specs/2026-04-17-orbis-cosmic-hero-design.md

   SCOPE DISCIPLINE:
   - Universal rules (apply everywhere): only things valid on both
     mobile and desktop without breaking mobile M1-M27 polish.
   - All cosmic-overlay + desktop-specific layout rules are wrapped
     in @media (min-width: 768px). Mobile sees none of them,
     so the original hero mobile styles from index.html stay intact.
   ============================================================ */

/* --------------------------------------------------------------
   UNIVERSAL (mobile + desktop)
   -------------------------------------------------------------- */

/* Old decorative elements we permanently retire on both viewports */
.hero .hero-spotlight { display: none !important; }
.hero .hero-wa-badge { display: none !important; }           /* D1: small pulsing badge */

/* Subheadline text moved from hero to typo-break (brief Plan C) */
.hero .hero-sub { display: none !important; }

/* Ambient neon sparkles layer - works on BOTH mobile and desktop now.
   Sits behind ORBIS + content. JS (tsParticles) populates it. */
.hero #hero-sparkles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease-in;
}
.hero #hero-sparkles.loaded { opacity: 1; }

/* Typo-break subheadline - safe on both viewports */
.typo-break .typo-sub {
  position: relative;
  z-index: 1;
  margin-top: clamp(40px, 6vh, 80px);
  font-family: var(--font-serif, Georgia), serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 40px);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  max-width: 920px;
  letter-spacing: -0.005em;
  text-shadow: 0 0 30px rgba(6,6,6,0.95), 0 0 60px rgba(6,6,6,0.8);
}
.typo-break .typo-sub strong {
  color: var(--tx-neon);
  font-style: normal;
  font-weight: 900;
  font-family: var(--font-body);
  letter-spacing: -0.02em;
}

/* Reduced-motion - safe universal */
@media (prefers-reduced-motion: reduce) {
  .hero .hero-nebula { animation: none !important; }
}


/* ==============================================================
   DESKTOP ONLY (≥ 768px) - everything cosmic lives here.
   Mobile sees none of these rules.
   ============================================================== */
@media (min-width: 768px) {

  /* Hero watermark: solid white ORBIS is the primary visual.
     Centered in the upper portion of the hero so the h1 + CTAs below
     get clean space. Pointer-events off at the container level so it
     never intercepts clicks on the CTAs/content layer (the globe slot
     re-enables its own pointer-events for drag-to-rotate). */
  .hero .hero-giant {
    opacity: 1 !important;
    pointer-events: none !important;
    top: 12vh !important;
    right: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
  .hero .hero-divider { display: none !important; }

  /* ════════════════════════════════════════════════════════════════
     ORBIS "O" → interactive wireframe globe (desktop only)
     The O letter is replaced by a perfectly round slot that holds:
       • a canvas that paints the rotating d3 globe
       • a thin white bezel ring (CSS border) reading as the "letter O"
       • a green italic "Hi" riding the upper-left of the globe
     Mobile: canvas hidden, .hero-giant-o-letter falls back to the
     real "O" glyph so the word still reads ORBIS.
     ═══════════════════════════════════════════════════════════════ */
  .hero .hero-giant-o-slot {
    display: inline-block;
    position: relative;
    width: 0.72em;
    height: 0.72em;
    vertical-align: baseline;
    margin: 0;
    line-height: 1;
    pointer-events: auto;
  }
  .hero .hero-giant-o-letter {
    display: none;
  }
  .hero .hero-giant-globe {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #000;
    cursor: grab;
    z-index: 1;
    -webkit-text-fill-color: initial;
  }
  .hero .hero-giant-globe:active { cursor: grabbing; }

  /* Thin white bezel — reads as the O letter silhouette */
  .hero .hero-giant-o-slot::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 0.01em solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 0.004em rgba(255, 255, 255, 0.2),
                0 8px 28px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 2;
  }

  /* Green italic "Hi" riding the upper-left edge of the globe */
  .hero .hero-giant-o-slot::after {
    content: "Hi";
    position: absolute;
    top: -0.03em;
    left: 0.04em;
    font-family: 'DM Serif Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.22em;
    color: var(--tx-neon);
    -webkit-text-fill-color: var(--tx-neon);
    text-transform: none;
    letter-spacing: -0.02em;
    line-height: 1;
    text-shadow:
      0 0 22px rgba(129, 255, 40, 0.55),
      0 0 44px rgba(129, 255, 40, 0.25),
      0 2px 4px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 3;
  }

  .hero {
    position: relative;
    height: 100vh;
    overflow: clip;
    background: #060606;
    background-image: none;
    cursor: crosshair;
  }

  /* (sparkles base styles moved to universal block above - works on mobile too) */

  /* --- Cosmos layer (masked by ORBIS letters) --- */
  .hero .hero-cosmos {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 38vh;                 /* letters occupy top 62% of hero */
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 500' preserveAspectRatio='xMidYMid meet'><text x='50%25' y='52%25' text-anchor='middle' dominant-baseline='middle' font-family='Inter, system-ui, sans-serif' font-size='300' font-weight='900' fill='white' letter-spacing='-14'>ORBIS</text></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 500' preserveAspectRatio='xMidYMid meet'><text x='50%25' y='52%25' text-anchor='middle' dominant-baseline='middle' font-family='Inter, system-ui, sans-serif' font-size='300' font-weight='900' fill='white' letter-spacing='-14'>ORBIS</text></svg>");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }

  .hero .hero-nebula {
    position: absolute;
    inset: -10%;
    background:
      radial-gradient(circle at 28% 42%, rgba(129, 255, 40, 0.55) 0%, transparent 38%),
      radial-gradient(circle at 72% 58%, rgba(138, 180, 255, 0.42) 0%, transparent 40%),
      radial-gradient(circle at 50% 50%, rgba(255, 170, 220, 0.22) 0%, transparent 55%),
      radial-gradient(circle at 15% 85%, rgba(255, 210, 128, 0.18) 0%, transparent 35%);
    filter: blur(28px);
    animation: heroNebulaDrift 24s ease-in-out infinite alternate;
    will-change: transform;
  }
  @keyframes heroNebulaDrift {
    0%   { transform: translate(-4%, 2%) scale(1.08); }
    100% { transform: translate(4%, -3%) scale(1.14); }
  }

  .hero .hero-stars-canvas,
  .hero .hero-shoot-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  .hero .hero-orbits {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  /* --- Eyebrow pinned top-left per site standard --- */
  .hero .hero-eyebrow {
    position: absolute !important;
    top: clamp(80px, 10vh, 100px);
    left: var(--pad-x, clamp(20px, 5vw, 80px));
    z-index: 20;
    font-family: var(--font-mono);
    /* bumped 12 -> 15 for readability */
    font-size: 15px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tx-neon);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    opacity: 1 !important;  /* override any leftover GSAP/original opacity:0 */
  }

  /* Bottom .hero-brand (Hospitality intelligence. under CTAs) is a
     duplicate of the top-left eyebrow. Hide on desktop to avoid
     repetition — the top-left eyebrow carries the brand label. */
  .hero .hero-brand { display: none !important; }
  .hero .hero-eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tx-neon);
    box-shadow: 0 0 12px rgba(129, 255, 40, 0.7);
    animation: heroEyebrowPulse 2.5s ease-in-out infinite;
    flex-shrink: 0;
  }
  @keyframes heroEyebrowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }

  /* --- Centered HUD overlay with text + CTAs --- */
  .hero .hero-content {
    position: relative;
    z-index: 5;
    height: 100%;
    max-width: none !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    /* bottom padding minimized so text sits near hero bottom edge,
       pulling it as far as possible from cosmic ORBIS above. */
    padding: 0 var(--pad-x, clamp(20px, 5vw, 80px)) clamp(8px, 1.5vh, 16px);
    pointer-events: none;
    text-align: center;
  }
  .hero .hero-content > * { pointer-events: auto; }

  .hero .hero-h1 {
    font-family: var(--font-body) !important;
    font-weight: 900 !important;
    /* Restored to pre-nowrap size. Text wraps naturally. */
    font-size: clamp(32px, 4.5vw, 56px) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.03em !important;
    /* Neon green headline — second line of the hero, sits between the
       white ORBIS (line 1) and the white italic slogan (line 3). */
    color: var(--tx-neon) !important;
    text-align: center !important;
    max-width: 1080px !important;
    margin: 0 0 24px !important;
    text-shadow: 0 0 40px rgba(6, 6, 6, 0.9), 0 0 80px rgba(6, 6, 6, 0.6);
    text-transform: none !important;
  }
  .hero .hero-h1 .h1-orbis-word {
    color: var(--tx-neon);
    font-style: normal;
  }
  .hero .hero-h1 .h1-hi-word {
    font-family: 'DM Serif Display', Georgia, serif !important;
    font-style: italic !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0;
    margin-right: 0.1em;
  }

  .hero .hero-slogan {
    font-family: 'DM Serif Display', Georgia, serif !important;
    font-style: italic !important;
    /* font scales with vw so the whole phrase always fits on ONE line
       (Temo strictly forbids wrapping on desktop). */
    font-size: clamp(20px, 2.5vw, 40px) !important;
    line-height: 1.35 !important;
    /* White italic serif — third line, softens the neon h1 above it. */
    color: rgba(255, 255, 255, 0.92) !important;
    text-align: center !important;
    max-width: none !important;
    display: block !important;
    margin: 0 0 36px !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
  }

  .hero .hero-ctas {
    display: flex !important;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 0 22px !important;
    padding: 0 !important;
  }

  .hero .hero-brand {
    font-family: var(--font-mono) !important;
    /* bumped 10 -> 13 */
    font-size: 13px !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    color: var(--tx-muted) !important;
    text-align: center !important;
    margin: 0 !important;
    opacity: 0.8;
  }

  .hero .hero-scroll {
    position: absolute;
    bottom: clamp(20px, 3vh, 32px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 10;
  }
  .hero .hero-scroll-text {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
  }
  .hero .hero-scroll-line {
    width: 1px;
    height: 26px;
    background: linear-gradient(180deg, var(--tx-neon), transparent);
    animation: heroScrollPulse 2s ease-in-out infinite;
  }
  @keyframes heroScrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.3); }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero .hero-scroll-line { animation: none !important; }
  }

} /* /min-width:768px */


/* ==============================================================
   MOBILE (< 768px)
   Hide the cosmic overlay AND the globe canvas. The "O" letter
   falls back to plain text so ORBIS reads as the word. Original
   mobile hero CSS from index.html is untouched.
   ============================================================== */
@media (max-width: 767px) {
  .hero .hero-cosmos { display: none !important; }
  /* sparkles now ENABLED on mobile - density tuned in JS for perf */
  .hero .hero-giant-globe { display: none !important; }
  .hero .hero-giant-o-slot {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
    vertical-align: baseline !important;
    line-height: inherit !important;
  }
  .hero .hero-giant-o-slot::before,
  .hero .hero-giant-o-slot::after { display: none !important; }
  .hero .hero-giant-o-letter { display: inline !important; }
}
