/* ==========================================================================
   MassMediaSolutions — shared stylesheet
   ========================================================================== */

:root {
  --bg: #0a0e14;
  --bg-alt: #0f151d;
  --bg-elevated: #141c26;
  --border: #22303e;
  --text: #e7edf4;
  --text-dim: #93a4b8;
  --text-faint: #5c6b7e;
  --accent: #34d399;
  --accent-2: #22d3ee;
  --accent-warm: #ffb454;
  --radius: 14px;
  --max-width: 1180px;
  --font-head: "Space Grotesk", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--text-dim); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Background texture: faint grid + glow, fixed behind content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60vw 40vw at 85% -10%, rgba(52, 211, 153, 0.14), transparent 60%),
    radial-gradient(50vw 35vw at -10% 20%, rgba(34, 211, 238, 0.10), transparent 60%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ---------------- Header / Nav ---------------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.brand .mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand .name-full { display: inline; }
.brand .name-tag {
  color: var(--accent);
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 4px;
}

nav.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

nav.nav-links > a {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
  padding: 8px 0;
}

nav.nav-links > a:hover,
nav.nav-links > a.active {
  color: var(--text);
}

nav.nav-links > a.active { color: var(--accent); }

.nav-cta {
  display: inline-flex;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121a;
  box-shadow: 0 8px 24px -8px rgba(52, 211, 153, 0.55);
}
.btn-primary:hover { box-shadow: 0 10px 30px -6px rgba(52, 211, 153, 0.7); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- Hero ---------------- */
.hero {
  padding: 96px 0 80px;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #f4feff 0%, var(--accent) 45%, rgba(52, 211, 153, 0.5) 100%);
  /* Static resting glow so the dot still glows even if the pulse animation is
     disabled (prefers-reduced-motion, or a renderer that skips animations). */
  box-shadow:
    0 0 3px 1px rgba(244, 254, 255, 0.9),
    0 0 9px 2px rgba(52, 211, 153, 0.85),
    0 0 18px 5px rgba(52, 211, 153, 0.5),
    0 0 30px 9px rgba(52, 211, 153, 0.25);
  animation: eye-glow 2.6s ease-in-out infinite;
}

@keyframes eye-glow {
  0%, 100% {
    box-shadow:
      0 0 3px 1px rgba(244, 254, 255, 0.9),
      0 0 9px 2px rgba(52, 211, 153, 0.85),
      0 0 18px 5px rgba(52, 211, 153, 0.5),
      0 0 30px 9px rgba(52, 211, 153, 0.25);
  }
  50% {
    box-shadow:
      0 0 5px 2px rgba(244, 254, 255, 1),
      0 0 16px 5px rgba(52, 211, 153, 1),
      0 0 32px 11px rgba(52, 211, 153, 0.8),
      0 0 54px 18px rgba(52, 211, 153, 0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow::before { animation: none; }
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  max-width: 820px;
}
.hero .lede {
  font-size: 1.15rem;
  max-width: 620px;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.page-hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
}
.page-hero .eyebrow { margin-bottom: 18px; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); max-width: 760px; }
.page-hero .lede { font-size: 1.05rem; max-width: 640px; margin-bottom: 0; }

/* ---------------- Stat strip ---------------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 12px;
}
.stat-strip .stat {
  background: var(--bg-alt);
  padding: 26px 22px;
}
.stat-strip .stat .num {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 4px;
  display: block;
}
.stat-strip .stat .label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ---------------- Sections ---------------- */
section { padding: 88px 0; }
section.tight { padding: 56px 0; }
.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}
.section-head .eyebrow { margin-bottom: 16px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

/* ---------------- Cards / grid ---------------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: rgba(52, 211, 153, 0.45); transform: translateY(-2px); }

.card .icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.card .icon svg { width: 22px; height: 22px; }

.card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card p { margin-bottom: 0; font-size: 0.95rem; }
.card a.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.feature-row.reverse .feature-visual { order: 2; }
.feature-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.97rem;
}
.feature-list li .dot {
  flex-shrink: 0;
  margin-top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 1px rgba(52, 211, 153, 0.6);
}
.feature-visual {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Line-chart draw-in, plays once the visual scrolls into view (see script.js) */
.chart-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.feature-visual.in-view .chart-line-1 {
  animation: draw-chart 1.5s cubic-bezier(0.65, 0.05, 0.36, 1) forwards;
}
.feature-visual.in-view .chart-line-2 {
  animation: draw-chart 1.5s cubic-bezier(0.65, 0.05, 0.36, 1) forwards;
  animation-delay: 0.25s;
}
@keyframes draw-chart {
  to { stroke-dashoffset: 0; }
}

/* Endpoint glow — built from SVG radial-gradient "halo" circles rather than
   CSS filter: drop-shadow(). Some browsers (WebKit in particular) can fail
   to paint filter effects on an SVG shape once transform-box: fill-box is
   also applied, silently dropping the glow. Gradient-filled geometry has no
   such dependency, so it always renders, animated or not. */
.dot-group {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.4);
}
.feature-visual.in-view .chart-endpoint {
  animation: endpoint-in 0.35s ease-out 1.5s forwards;
}
.feature-visual.in-view .orbit-endpoint {
  animation: endpoint-in 0.4s ease-out 0.05s forwards;
}
@keyframes endpoint-in {
  to { opacity: 1; transform: scale(1); }
}

.dot-halo {
  transform-box: fill-box;
  transform-origin: center;
}
.feature-visual.in-view .dot-halo-inner {
  animation: halo-pulse-inner 2.4s ease-in-out 1.85s infinite;
}
.feature-visual.in-view .dot-halo-outer {
  animation: halo-pulse-outer 2.4s ease-in-out 1.85s infinite;
}
.feature-visual.in-view .orbit-endpoint .dot-halo-inner { animation-delay: 0.45s; }
.feature-visual.in-view .orbit-endpoint .dot-halo-outer { animation-delay: 0.45s; }

@keyframes halo-pulse-inner {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}
@keyframes halo-pulse-outer {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.4); }
}

@media (prefers-reduced-motion: reduce) {
  .chart-line { stroke-dashoffset: 0; animation: none !important; }
  .dot-group { opacity: 1; transform: none; animation: none !important; }
  .dot-halo { animation: none !important; }
  .orbit-dots { opacity: 1; animation: none !important; }
}

/* Orbit diagram (About page) — rings of dots spin slowly in opposite directions */
.orbit-dots {
  transform-box: view-box;
  transform-origin: 200px 120px;
  opacity: 0;
}
.feature-visual.in-view .orbit-dots-inner {
  animation:
    orbit-fade 0.4s ease-out 0.1s forwards,
    orbit-spin 22s linear 0.5s infinite;
}
.feature-visual.in-view .orbit-dots-outer {
  animation:
    orbit-fade 0.4s ease-out 0.3s forwards,
    orbit-spin-reverse 32s linear 0.5s infinite;
}
@keyframes orbit-fade { to { opacity: 1; } }
@keyframes orbit-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes orbit-spin-reverse { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }

.service-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding: 40px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 28px;
}
.service-block + .service-block { margin-top: 24px; }
.service-block .num {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--accent);
  opacity: 0.8;
}
.service-block h3 { font-size: 1.35rem; margin-bottom: 10px; }
.service-block ul {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.service-block ul li {
  font-size: 0.92rem;
  color: var(--text-dim);
  padding-left: 20px;
  position: relative;
}
.service-block ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
}

/* ---------------- CTA banner ---------------- */
.cta-banner {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(53,208,224,0.10), rgba(91,140,255,0.08));
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-banner h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 8px; }
.cta-banner p { margin-bottom: 0; }

/* ---------------- Contact ---------------- */
.contact-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 56px;
  text-align: center;
}
.contact-card .icon-lg {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.contact-card .icon-lg svg { width: 30px; height: 30px; }
.contact-card h2 { font-size: 1.8rem; }
.contact-card .email {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--accent);
  margin: 4px 0 28px;
}
.contact-meta {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.contact-meta .item {
  text-align: left;
  min-width: 180px;
}
.contact-meta .item .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.contact-meta .item .val {
  font-weight: 600;
  color: var(--text);
}

/* ---------------- Footer ---------------- */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
  margin-top: 40px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { max-width: 320px; font-size: 0.92rem; }
.footer-cols {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}
.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 10px;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .feature-row { grid-template-columns: 1fr; gap: 32px; }
  .feature-row.reverse .feature-visual { order: 0; }
  .service-block { grid-template-columns: 1fr; }
  .service-block ul { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  nav.nav-links {
    position: fixed;
    inset: 76px 0 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    height: calc(100vh - 76px);
  }
  nav.nav-links.open { transform: translateX(0); }
  nav.nav-links a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--border); }
  .nav-cta { width: 100%; margin-top: 16px; }
  .nav-cta .btn { width: 100%; }
  .nav-toggle { display: flex; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .cta-banner { padding: 36px; flex-direction: column; text-align: center; }
  .contact-card { padding: 32px; }
  .footer-top { flex-direction: column; }
}
