/* ============================================================
   STELLAR Broadband — Welcome redesign (SBB-478)
   Self-contained. Load AFTER css/style.css with a ?v= bump.
   All rules are scoped under .splash* / .tile* so they layer on
   top of Bootstrap without colliding with col-*, mt-*, etc.
   To restyle, edit a token below — not the rules.
   ============================================================ */

/* Brand typography — TTFs live alongside this file in css/ */
@font-face {
  font-family: "Varela Round";
  src: url("VarelaRound-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Varela";
  src: url("Varela-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Brand palette */
  --sbb-navy-950: #07203f;
  --sbb-navy-850: #0a2c50;
  --sbb-navy-700: #0e3d68;
  --sbb-blue-700: #15509e;
  --sbb-blue-500: #2f7cb0;
  --sbb-cyan-500: #4793cf;
  --sbb-cyan-300: #6fb8e6;
  --sbb-cyan-200: #a9dcfb;
  --sbb-white: #ffffff;

  /* Colors sampled directly from the approved mockup.
     Sky = medium teal-blue; tiles = dark blue (top) -> bright cyan (bottom). */
  --sbb-grad-cosmic:
    radial-gradient(95% 55% at 50% -10%, rgba(90,180,218,.30) 0%, transparent 55%),
    linear-gradient(180deg, #103f59 0%, #134d6b 38%, #185877 72%, #1b5f81 100%);
  --sbb-grad-tile:
    linear-gradient(180deg, rgba(0,91,149,.94) 12%, rgba(68,176,244,.94) 54%, rgba(130,229,255,.94) 100%);
  --sbb-grad-heading:
    linear-gradient(180deg, #005b95 0%, #82e5ff 50%, #44b0f4 100%);
}

/* ---- Self-contained reset -----------------------------------------
   The new theme ships without Bootstrap, so re-establish the few base
   rules it used to rely on (Bootstrap's reboot used to provide these). */
html, body { margin: 0; padding: 0; }

/* Legacy pages (login/signup/faq/ticket-form) keep the plain body background from
   style.css, but get the same twinkling stars layer as welcome.php via a fixed
   pseudo-element — no markup changes needed on those pages. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../images/stars.png") center top / cover no-repeat;
  pointer-events: none;
  animation: splash-twinkle 2.5s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

.splash { background-color: var(--sbb-navy-950); }   /* fallback behind the splash image */
.splash, .splash *, .splash *::before, .splash *::after { box-sizing: border-box; }
.splash a, .splash a:hover, .tile, .tile:hover { text-decoration: none; color: var(--sbb-white); }

/* ---- Accessibility (WCAG) -----------------------------------------
   Visible keyboard focus on every interactive element. Loaded on all
   pages, so it also restores focus rings the legacy CSS removed. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.tile:focus-visible,
.nav-link:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #8fd3ff !important;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip-to-content link: off-screen until focused */
.skip-link {
  position: absolute; left: 12px; top: -56px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: #08182e; color: #fff; text-decoration: none;
  font: 600 14px/1 'Montserrat', sans-serif;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* Respect reduced-motion for the nav transitions */
@media (prefers-reduced-motion: reduce) {
  .topnav__links, .topnav__backdrop, .topnav__toggle span, .nav-link, .nav-link::after,
  .tile, .custom-btn, .skip-link { transition: none !important; }
  .splash__bg, .splash__stars { animation: none !important; transform: rotateX(0deg) !important; }
  .splash__title, .splash__subtitle, .tile { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ---- Top navigation (2026, vanilla JS) ----------------------------- */
.topnav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: flex-start;
  gap: clamp(22px, 5vw, 56px);
  padding: 16px clamp(20px, 4vw, 48px);
  background: linear-gradient(180deg, rgba(8,24,46,.55) 0%, rgba(8,24,46,0) 100%);
  font-family: 'Montserrat', sans-serif;
}
.topnav__brand { display: inline-flex; }
.topnav__brand img { width: 150px; max-width: 50vw; height: auto; display: block; }

/* width/height/margin/background reset the broad legacy `nav {}` rule in
   style.css (these links are a <nav>), which would otherwise collapse and
   center the menu on the non-welcome pages. */
.topnav__links {
  display: flex; align-items: center; gap: clamp(18px, 2.4vw, 34px);
  width: auto; height: auto; margin: 0;
  background: none; border-radius: 0; box-shadow: none;
}
/* kill the legacy `nav:hover { box-shadow }` glow on the menu container */
.topnav__links:hover { box-shadow: none; }
.topnav__links .nav-link {
  position: relative; color: #d6ebfb; text-decoration: none;
  font-weight: 600; font-size: 15px; letter-spacing: .3px; padding: 6px 2px;
  transition: color .2s ease;
}
.topnav__links .nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px;
  background: linear-gradient(90deg, var(--sbb-cyan-300), var(--sbb-cyan-200));
  box-shadow: 0 0 10px rgba(120,200,255,.85);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.topnav__links .nav-link,
.topnav__links .nav-link:hover { text-decoration: none !important; }
.topnav__links .nav-link:hover,
.topnav__links .nav-link.is-active { color: #fff !important; }
.topnav__links .nav-link:hover::after,
.topnav__links .nav-link.is-active::after { transform: scaleX(1); }

/* Hamburger (hidden on desktop) */
.topnav__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 40px; padding: 8px; border: 0; cursor: pointer;
  background: transparent;
  margin-left: auto;   /* pin hamburger to the right on mobile */
}
.topnav__toggle span {
  display: block; height: 2px; width: 100%; border-radius: 2px;
  background: #d6ebfb; transition: transform .25s ease, opacity .2s ease;
}
.topnav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topnav__toggle.is-open span:nth-child(2) { opacity: 0; }
.topnav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* dimmed backdrop behind the mobile drawer (hidden on desktop) */
.topnav__backdrop { display: none; }

@media (max-width: 768px) {
  .topnav__toggle { display: flex; position: relative; z-index: 22; }
  .topnav__brand  { position: relative; z-index: 22; }

  .topnav__backdrop {
    display: block; position: fixed; inset: 0; z-index: 18;
    background: rgba(4,14,28,.55);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
  }
  .topnav__backdrop.is-open { opacity: 1; visibility: visible; }

  /* Slide-in drawer from the right */
  .topnav__links {
    position: fixed; top: 0; right: 0; z-index: 20;
    height: 100vh; width: min(80vw, 320px);
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 2px; padding: 92px 6px 24px;
    background: linear-gradient(160deg, rgba(9,28,52,.98) 0%, rgba(12,38,66,.98) 100%);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-left: 1px solid rgba(120,200,255,.25);
    box-shadow: -18px 0 44px rgba(4,14,30,.55);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.2,.8,.2,1);
  }
  .topnav__links.is-open { transform: translateX(0); }

  /* links slide in from the right, staggered */
  .topnav__links .nav-link {
    font-size: 20px; font-weight: 600; padding: 16px 24px; color: #eaf6ff;
    border: 0; border-bottom: 1px solid rgba(120,200,255,.12);
    opacity: 0; transform: translateX(22px);
    transition: opacity .4s ease, transform .4s ease, color .2s ease;
  }
  .topnav__links .nav-link::after { display: none; }
  .topnav__links.is-open .nav-link { opacity: 1; transform: translateX(0); }
  .topnav__links.is-open .nav-link:nth-child(1) { transition-delay: .12s; }
  .topnav__links.is-open .nav-link:nth-child(2) { transition-delay: .18s; }
  .topnav__links.is-open .nav-link:nth-child(3) { transition-delay: .24s; }
  .topnav__links.is-open .nav-link:nth-child(4) { transition-delay: .30s; }
  .topnav__links .nav-link.is-active { color: #fff; text-shadow: 0 0 14px rgba(120,200,255,.8); }
}

/* ---- Splash shell -------------------------------------------------- */
.splash {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #08182e;
  color: var(--sbb-white);
  perspective: 1100px;          /* higher = gentler, low-distortion 3D tilt */
  perspective-origin: center;
  padding: 60px 20px 0;
  font-family: 'Montserrat', sans-serif;
}

/* Background image on its own layer so we can animate it (transform only =
   GPU-composited, no repaint). Slow Ken Burns drift = subtle "rotating" feel. */
.splash__bg {
  position: absolute;
  inset: -10%;                /* buffer for the rotateX tilt, less crop than before */
  background-image: url("../images/welcome-page.png");
  background-position: center top;   /* sky up top, planet curve falls below the tiles */
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
  animation: splash-cube 9s ease-out infinite alternate;
  margin-top: -60px;          /* shifts the planet curve up into view */
}
/* Held flat facing us, then tips backward (top recedes) to the back */
@keyframes splash-cube {
  from { transform: rotateX(0deg); }     /* flat, facing us */
  to   { transform: rotateX(10deg); }    /* tipped back (more pronounced) */
}

/* Stars layer — sits above the planet background so the white stars stay
   bright, but behind the heading/tiles. Slow opacity pulse = gentle shine. */
.splash__stars {
  position: absolute;
  inset: 0;
  background: url("../images/stars.png") center top / cover no-repeat;
  background-position-x: left;
  z-index: 2;
  pointer-events: none;
  animation: splash-twinkle 2.5s ease-in-out infinite alternate;
}
@keyframes splash-twinkle {
  from { opacity: .35; }
  to   { opacity: 1; }
}

/* Top-anchored layout — content sits near the top, not vertically centered */
.splash--top { align-items: flex-start; padding-top: clamp(150px, 8vh, 150px);}

/* Logo pinned to the top-left corner */
.splash__lockup {
  position: absolute; top: 26px; left: 38px; z-index: 3;
  display: inline-flex; margin: 0;
}
.splash__logo { width: 150px; max-width: 60vw; height: auto; }
@media (max-width: 600px) {
  .splash__lockup { top: 18px; left: 20px; }
  .splash__logo { width: 120px; }
}

.splash__inner { position: relative; z-index: 3; width: 100%; max-width: 1000px; text-align: center; }

/* ---- Headings ------------------------------------------------------ */
.splash__head { margin-top: -40px; margin-bottom: 48px; }
.splash__title {
  font-size: clamp(40px, 7vw, 72px); font-weight: 800; letter-spacing: 1px;
  text-shadow: 0 3px 6px rgba(4,18,38,.6), 0 2px 22px rgba(50,140,200,.45);
  margin: 20px;
}
.splash__subtitle { opacity: .85; font-size: 16px; margin-top: 6px; color:#82e5ff;}

/* ---- Intro reveal: heading -> subtitle -> tiles, all after a 2s pause ---- */
@keyframes splash-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splash-fade    { from { opacity: 0; } to { opacity: 1; } }
.splash__title    { animation: splash-fade-up .2s ease-out 1s both; }
.splash__subtitle { animation: splash-fade-up .2s ease-out 1.06s both; }
/* opacity-only on tiles so the animation never overrides the hover lift */
.tile { animation: splash-fade .2s ease-out both; }
.tiles .tile:nth-child(1) { animation-delay: 1.12s; }
.tiles .tile:nth-child(2) { animation-delay: 1.18s; }
.tiles .tile:nth-child(3) { animation-delay: 1.24s; }

/* Optional glossy gradient text fill */
.splash__title--grad,
.splash__subtitle--grad {
  background: var(--sbb-grad-heading);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  opacity: 1;
}
@media (forced-colors: active) {
  .splash__title--grad,
  .splash__subtitle--grad {
    background: none;
    -webkit-text-fill-color: CanvasText;
    color: CanvasText;
  }
}

/* ---- Glassmorphic glowing tiles ------------------------------------ */
/* width/height/margin/background reset the broad `nav {}` rule in style.css
   (the .tiles container is a <nav>), which would otherwise shrink it to 40px. */
.tiles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  width: 100%; height: auto; margin: 0;
  background: none; border-radius: 0;
}
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  padding: 23px 24px 60px 20px;
  min-height: 230px;
  color: var(--sbb-white); text-align: center;
  border-radius: 18px;
  border: 1.5px solid rgba(120,215,255,.9);
  background: var(--sbb-grad-tile);
  backdrop-filter: blur(4px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.45) inset,
    0 0 0 1px rgba(120,215,255,.35),
    0 10px 40px rgba(10,40,80,.45),
    0 0 28px rgba(90,200,255,.55);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tile:hover {
  transform: translateY(-6px);
  border-color: rgba(180,235,255,1);
  box-shadow:
    0 1px 0 rgba(255,255,255,.55) inset,
    0 0 0 1px rgba(150,225,255,.5),
    0 16px 54px rgba(10,40,80,.55),
    0 0 44px rgba(120,215,255,.85);
}
.tile__icon { color: #fff; }
.tile__icon svg { width: 60px; height: 60px; }
.tile__icon .tile__img { width: 124px; height: 124px; display: block; }
/* glowing cyan ring around the SVG icon, to match the two PNG icons */
.tile__icon--ring {
  width: 92px; height: 92px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid rgba(140,220,255,.95);
  box-shadow: 0 0 16px rgba(110,200,255,.9), 0 0 34px rgba(90,185,255,.5),
              inset 0 0 12px rgba(120,205,255,.45);
  filter: none;
}
.tile__icon--ring svg { width: 48px; height: 48px; }
.tile__title { font-size: 22px; font-weight: 700; text-shadow: 0 1px 8px rgba(10,40,80,.4); }
.tile__sub { font-size: 19px; opacity: .9; max-width: 170px; }

/* ---- Accessibility ------------------------------------------------- */
.splash a:focus-visible,
.tile:focus-visible {
  outline: 3px solid var(--sbb-cyan-500);
  outline-offset: 3px;
}

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 768px) {
  .tiles { grid-template-columns: 1fr; }
}
