/*
 * ================================================================
 *  BlueWave IT — theme.css
 *  Shared across all pages: tokens, reset, base typography,
 *  body backgrounds, header, footer, back-to-top, layout helpers,
 *  reveal animation, section labels, eyebrow pills, gradient text.
 *
 *  Load order: theme.css → components.css → [page].css
 * ================================================================
 */


/* ================================================================
   1. DESIGN TOKENS
   ================================================================ */

:root {

  /* ── Color palette – dark mode defaults ── */
  --bg:             #060e1a;
  --bg-alt:         #0a1523;
  --bg-card:        rgba(255,255,255,0.038);
  --bg-card-hover:  rgba(255,255,255,0.065);
  --text:           #eef4fc;
  --muted:          #7d9ab8;
  --muted-2:        #a4bdd4;
  --line:           rgba(255,255,255,0.09);
  --line-strong:    rgba(255,255,255,0.14);

  /* ── Brand colors ── */
  --cyan:           #00c2cb;
  --cyan-2:         #38d9e8;
  --cyan-3:         #b2f5ff;
  --blue:           #0f4c81;
  --blue-mid:       #1565a8;
  --green:          #3ee89a;
  --amber:          #ffcf4e;
  --danger:         #ff5f5f;

  /* ── Effects ── */
  --glow-cyan:      rgba(0,194,203,0.22);
  --shadow:         0 20px 64px rgba(0,0,0,0.50);
  --shadow-sm:      0 8px 28px rgba(0,0,0,0.30);
  --shadow-card:    0 4px 24px rgba(0,0,0,0.22), 0 1px 4px rgba(0,0,0,0.12);

  /* ── Layout ── */
  --max:            1240px;
  --header-h:       72px;

  /* ── Radius scale ── */
  --radius:         20px;
  --radius-sm:      12px;
  --radius-xs:      8px;

  /* ── Typography ──
     --font-display : Syne     — hero headlines, large display text
     --font-heading : Questrial — section headings (h1–h3)
     --font-body    : DM Sans   — body copy, UI text
     --font-mono    : DM Mono   — code, metrics, counters
  ── */
  --font-display:   'Questrial',      sans-serif;
  --font-heading:   'Questrial', sans-serif;
  --font-body:      'DM Sans',   sans-serif;
  --font-mono:      'DM Mono',   monospace;
}


/* ── Light mode token overrides ── */
body.theme-light {
  --bg:             #f3f8fd;
  --bg-alt:         #e8f1fa;
  --bg-card:        rgba(255,255,255,0.82);
  --bg-card-hover:  rgba(255,255,255,0.96);
  --text:           #0a1628;
  --muted:          #4d6b88;
  --muted-2:        #3d5a74;
  --line:           rgba(10,22,40,0.09);
  --line-strong:    rgba(10,22,40,0.15);
  --glow-cyan:      rgba(0,194,203,0.14);
  --shadow:         0 20px 64px rgba(10,22,40,0.14);
  --shadow-sm:      0 8px 28px rgba(10,22,40,0.10);
  --shadow-card:    0 4px 24px rgba(10,22,40,0.10), 0 1px 4px rgba(10,22,40,0.06);
}


/* ================================================================
   2. RESET & BASE
   ================================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  overflow-x: hidden;
  transition: background 250ms ease, color 250ms ease;

  /* ── Dark mode ambient background ── */
  background:
    radial-gradient(ellipse 80% 55% at 0% 0%,   rgba(0,194,203,0.13), transparent 50%),
    radial-gradient(ellipse 60% 45% at 100% 8%,  rgba(15,76,129,0.12), transparent 50%),
    radial-gradient(ellipse 90% 50% at 50% 100%, rgba(15,76,129,0.07), transparent 60%),
    linear-gradient(180deg, #060e1a 0%, #07101e 100%);
}

body.theme-light {
  background:
    radial-gradient(ellipse 80% 55% at 0% 0%,  rgba(0,194,203,0.07), transparent 50%),
    radial-gradient(ellipse 60% 45% at 100% 8%, rgba(15,76,129,0.06), transparent 50%),
    linear-gradient(180deg, #f3f8fd 0%, #edf4fb 100%);
}

/* ── Typography defaults ── */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
}

h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

/* h1/h2 use Questrial; h4+ uses Syne for smaller display labels */

a  { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
p { margin: 0; }

/* ── Select element theming ── */
select {
  background-color: var(--bg-alt);
  color: var(--text);
}
select option {
  background-color: #ffffff;
  color: #000000;
}


/* ================================================================
   3. LAYOUT UTILITIES
   ================================================================ */

/* Max-width centered wrapper used on every section */
.container {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

/* ── Section spacing ── */
section { padding: 68px 0; }

/* ── Alternating background band (e.g. services, FAQ) ── */
.band {
  background: var(--bg-alt);
  border-top:    1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ── Reusable grid helpers ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; }


/* ================================================================
   4. REVEAL ANIMATION
   Controlled by IntersectionObserver in site.js.
   Add class="reveal" to any section child for scroll-in effect.
   Add reveal-delay-1/2/3 for staggered entrances.
   ================================================================ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity   650ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible      { opacity: 1; transform: translateY(0); }
.reveal-delay-1         { transition-delay:  80ms; }
.reveal-delay-2         { transition-delay: 160ms; }
.reveal-delay-3         { transition-delay: 240ms; }


/* ================================================================
   5. SECTION HEADER PATTERN
   Used at the top of most sections:
   <div class="section-head">
     <span class="section-label">Label</span>
     <h2>Heading</h2>
     <p>Subheading paragraph</p>
   </div>
   ================================================================ */

/* ── Section label pill ── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(56,217,232,0.18);
  background: rgba(255,255,255,0.03);
  color: var(--cyan-3);
  font-size: 0.80rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan-2);
  box-shadow: 0 0 0 6px rgba(56,217,232,0.10);
}
body.theme-light .section-label {
  background: rgba(10,22,40,0.04);
  color: var(--blue-mid);
}

/* ── Section head wrapper ── */
.section-head { margin-bottom: 36px; }
.section-head h2 {
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  line-height: 1.05;
  margin-bottom: 14px;
}
.section-head p {
  color: var(--muted-2);
  max-width: 62ch;
  font-size: 1.06rem;
}

/* ── Eyebrow pill (hero variant — slightly larger) ── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(56,217,232,0.20);
  background: rgba(255,255,255,0.03);
  color: #c6f7ff;
  font-size: 0.83rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-2);
  box-shadow: 0 0 0 7px rgba(56,217,232,0.10);
  flex: 0 0 auto;
}
body.theme-light .eyebrow {
  background: rgba(10,22,40,0.04);
  color: var(--blue-mid);
}

/* ── Gradient text span (used inside headings) ── */
.gradient-text {
  background: linear-gradient(105deg, #4beaf4 0%, #00c2cb 45%, #6af0fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.theme-light .gradient-text {
  background: linear-gradient(105deg, #006f80 0%, #007f8f 50%, #009ab0 100%);
  -webkit-background-clip: text;
  background-clip: text;
}


/* ================================================================
   6. HEADER & NAVIGATION
   ================================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: rgba(6,14,26,0.70);
  border-bottom: 1px solid var(--line);
  transition: background 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
body.theme-light .site-header {
  background: rgba(243,248,253,0.80);
}
.site-header.scrolled {
  background: rgba(6,14,26,0.94);
  box-shadow: 0 8px 32px rgba(0,0,0,0.30);
  border-bottom-color: var(--line-strong);
}
body.theme-light .site-header.scrolled {
  background: rgba(243,248,253,0.96);
  box-shadow: 0 8px 32px rgba(10,22,40,0.10);
}

/* ── Nav bar row ── */
.nav {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* ── Logo ── */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(0,194,203,0.25), rgba(15,76,129,0.30));
  border: 1px solid rgba(56,217,232,0.24);
  box-shadow: 0 0 28px rgba(0,194,203,0.16);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.logo-mark img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}
.logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-wordmark strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.logo-wordmark span {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ── Nav links (desktop) ── */
.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}
.nav-links a {
  position: relative;
  color: var(--muted-2);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  transition: color 160ms ease, background 160ms ease;
}
.nav-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
body.theme-light .nav-links a:hover {
  background: rgba(10,22,40,0.05);
}
/* Active page indicator — add class="active" to the matching link */
.nav-links a.active {
  color: var(--cyan-2);
}

/* ── Nav right (toggles + hamburger) ── */
.nav-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

/* ── Toggle group (theme / lang switchers) ── */
.toggle-group {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
body.theme-light .toggle-group {
  background: rgba(10,22,40,0.04);
}
.toggle-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  transition: all 180ms ease;
}
.toggle-btn.active {
  background: rgba(56,217,232,0.15);
  color: var(--text);
}

/* ── Mobile hamburger ── */
.nav-toggle {
  display: none;         /* shown via media query below */
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
}

/* ── Mobile menu drawer ── */
.mobile-menu {
  display: none;
  padding: 0 0 14px;
}
.mobile-menu.open {
  display: grid;
  gap: 8px;
}
.mobile-menu a,
.mobile-menu .m-row {
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  font-weight: 500;
}
.mobile-menu .m-row {
  flex-wrap: wrap;
  gap: 8px;
}
.mobile-menu-theme { padding: 11px 14px; }


/* ================================================================
   7. FOOTER
   ================================================================ */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 48px 0 36px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

/* ── Footer brand column ── */
.footer-brand p {
  color: var(--muted);
  font-size: 0.90rem;
  margin: 14px 0 0;
  max-width: 36ch;
  line-height: 1.6;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

/* ── Footer link columns ── */
.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.footer-col ul a {
  color: var(--muted-2);
  font-size: 0.92rem;
  transition: color 160ms ease;
}
.footer-col ul a:hover { color: var(--text); }

/* ── Footer bottom bar ── */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-legal { display: flex; gap: 20px; }
.footer-legal a {
  color: var(--muted);
  transition: color 160ms ease;
}
.footer-legal a:hover { color: var(--text); }


/* ================================================================
   8. BACK TO TOP BUTTON
   ================================================================ */

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(6,14,26,0.88);
  backdrop-filter: blur(10px);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 200ms ease;
  box-shadow: var(--shadow-sm);
  z-index: 70;
}
.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
body.theme-light .back-to-top {
  background: rgba(255,255,255,0.90);
}


/* ================================================================
   9. RESPONSIVE BREAKPOINTS (shared)
   ================================================================ */

/* ── Hide desktop nav, show hamburger ── */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-cta    { display: none; }
}

/* ── Collapse most grids to single column ── */
@media (max-width: 980px) {
  section { padding: 52px 0; }

  .footer-grid,
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
}

/* ── Small phone adjustments ── */
@media (max-width: 600px) {
  /* Hide "Managed IT Services" wordmark subtitle */
  .logo-wordmark span { display: none; }

  /* Hide hero eyebrow pill on very small screens */
  .eyebrow { display: none; }

  /* Hide theme toggle from nav bar — visible in mobile menu instead */
  .nav-right .toggle-group[aria-label="Theme switcher"] { display: none; }

  /* Compact toggle buttons */
  .toggle-btn { padding: 5px 8px; font-size: 0.76rem; }
  .toggle-group { padding: 3px; }

  /* Stack nav: logo fills row 1, controls fill row 2 */
  .nav {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    min-height: unset;
  }
  .logo       { flex: 1 1 auto; }
  .nav-right  { flex: 0 0 auto; gap: 6px; margin-left: auto; }
}
