/* ============================================================
   SCOTT McAULEY — Design System & Custom Styles
   Stack: Tailwind CDN + Custom CSS
   Fonts: Syne (display) + DM Sans (body)
   Palette: Night Navy / Electric Teal / Ember Orange
   ============================================================ */

/* ---------- 1. CSS Custom Properties ---------- */
:root {
  --night:       #060D1F;
  --navy:        #0D1F3C;
  --slate:       #1A3050;
  --dim:         #2C4462;
  --steel:       #5F7A99;
  --mist:        #A8BDD0;
  --cream:       #F5F2ED;
  --ivory:       #EDEAE3;
  --white:       #FFFFFF;

  --teal:        #00E5CC;
  --teal-dim:    #00B8A3;
  --teal-glow:   rgba(0, 229, 204, 0.18);
  --ember:       #FF6435;
  --ember-dim:   #E0522A;
  --sky:         #4A9FFF;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-dark: 0 8px 40px rgba(0,0,0,0.4);
  --shadow-teal: 0 0 40px rgba(0,229,204,0.2);
}

/* ---------- 2. Base Reset & Body ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--navy);
  background: var(--cream);
  overflow-x: hidden;
}

/* ---------- 3. Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- 4. Navigation ---------- */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
  padding: 1.5rem 0;
}

#nav.scrolled {
  background: rgba(6, 13, 31, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
  padding: 1rem 0;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.nav-logo span { color: var(--teal); }

.nav-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover { color: var(--white); }

.nav-link.active { color: var(--teal); }

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1.5px;
  background: var(--teal);
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* Mobile Nav */
#mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--night);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

#mobile-menu.open { display: flex; }

#mobile-menu .nav-link {
  font-size: 1.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--white);
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.22s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ember);
  color: var(--white);
  padding: 0.8rem 1.75rem;
}

.btn-primary:hover {
  background: var(--ember-dim);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 100, 53, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  padding: 0.75rem 1.6rem;
  border: 1.5px solid rgba(255,255,255,0.25);
}

.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-1px);
}

.btn-teal {
  background: var(--teal);
  color: var(--night);
  padding: 0.8rem 1.75rem;
}

.btn-teal:hover {
  background: var(--teal-dim);
  transform: translateY(-1px);
  box-shadow: var(--shadow-teal);
}

.btn-dark {
  background: var(--navy);
  color: var(--white);
  padding: 0.8rem 1.75rem;
}

.btn-dark:hover {
  background: var(--slate);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.55rem 1.2rem;
  font-size: 0.82rem;
}

/* ---------- 6. Dark Section Base ---------- */
.section-dark {
  background: var(--night);
  color: rgba(255,255,255,0.88);
}

.section-navy {
  background: var(--navy);
  color: rgba(255,255,255,0.88);
}

/* ---------- 7. Noise Texture Overlay ---------- */
.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ---------- 8. Grid Decoration (Hero bg) ---------- */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ---------- 9. Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.card-dark {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.card-dark:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(0,229,204,0.25);
  transform: translateY(-3px);
}

/* ---------- 10. Tags & Badges ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  line-height: 1;
}

.tag-teal     { background: rgba(0,229,204,0.12); color: var(--teal-dim); }
.tag-ember    { background: rgba(255,100,53,0.12); color: var(--ember-dim); }
.tag-sky      { background: rgba(74,159,255,0.12); color: var(--sky); }
.tag-white    { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.7); }
.tag-navy-inv { background: var(--navy); color: rgba(255,255,255,0.7); }
.tag-muted    { background: var(--ivory); color: var(--steel); }

/* ---------- 11. Automation Flow SVG ---------- */
#automation-svg {
  width: 100%;
  max-width: 520px;
  height: auto;
  overflow: visible;
}

.flow-node-bg {
  fill: rgba(255,255,255,0.04);
  stroke: rgba(0,229,204,0.3);
  stroke-width: 1;
}

.flow-node-glow {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.5;
  opacity: 0.6;
}

.flow-line {
  fill: none;
  stroke: rgba(0,229,204,0.2);
  stroke-width: 1.5;
}

.flow-dots {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  stroke-dasharray: 4 18;
  stroke-linecap: round;
  animation: flowDots 2.8s linear infinite;
}

.flow-dots.d2 { animation-delay: -0.9s; animation-duration: 3.2s; }
.flow-dots.d3 { animation-delay: -1.8s; animation-duration: 2.5s; }
.flow-dots.d4 { animation-delay: -0.45s; animation-duration: 3.8s; }
.flow-dots.d5 { animation-delay: -2.2s; animation-duration: 2.9s; }
.flow-dots.d6 { animation-delay: -1.1s; animation-duration: 3.5s; }
.flow-dots.d7 { animation-delay: -0.7s; animation-duration: 2.7s; }
.flow-dots.d8 { animation-delay: -2.8s; animation-duration: 4s; }

@keyframes flowDots {
  from { stroke-dashoffset: 44; }
  to   { stroke-dashoffset: -44; }
}

.node-ring {
  fill: none;
  stroke: rgba(0,229,204,0.15);
  stroke-width: 1;
  transform-origin: center;
  animation: ringPulse 3s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { r: 28; opacity: 0; }
  50%       { r: 40; opacity: 1; }
}

.node-icon-text {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  fill: var(--teal);
  text-anchor: middle;
  dominant-baseline: middle;
  letter-spacing: 0.02em;
}

/* ---------- 12. Hero ---------- */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.25rem;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--teal);
}

/* ---------- 13. Stat Bar ---------- */
.stat-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.25rem;
  letter-spacing: -0.04em;
  color: var(--teal);
  line-height: 1;
}

/* ---------- 14. Pillar Cards ---------- */
.pillar-card {
  padding: 2.25rem 2rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.28s ease;
  position: relative;
  overflow: hidden;
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pillar-card:hover::before { opacity: 1; }

.pillar-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* ---------- 15. Article Cards ---------- */
.article-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--slate), var(--dim));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.article-card-img::after {
  content: attr(data-icon);
  font-size: 2.5rem;
  opacity: 0.25;
}

/* ---------- 16. Lead Magnet Section ---------- */
.lead-magnet-glow {
  background: radial-gradient(ellipse 60% 80% at 85% 50%, rgba(0,229,204,0.08) 0%, transparent 70%);
}

/* ---------- 17. Form Elements ---------- */
.form-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input-light {
  background: var(--white);
  border: 1.5px solid rgba(13,31,60,0.18);
  color: var(--navy);
}

.form-input-light:focus {
  border-color: var(--teal-dim);
  box-shadow: 0 0 0 3px rgba(0,229,204,0.12);
}

.form-input-dark {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  color: var(--white);
}

.form-input-dark::placeholder { color: rgba(255,255,255,0.35); }

.form-input-dark:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,229,204,0.1);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--steel);
  margin-bottom: 0.45rem;
  letter-spacing: 0.02em;
}

.form-label-dark {
  color: rgba(255,255,255,0.6);
}

textarea.form-input { resize: vertical; min-height: 140px; }

/* ---------- 18. Footer ---------- */
footer {
  background: var(--night);
  color: rgba(255,255,255,0.55);
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.footer-link {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 2;
  display: block;
  transition: color 0.2s ease;
}

.footer-link:hover { color: var(--teal); }

/* ---------- 19. Progress Bar (Article) ---------- */
#read-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--ember));
  z-index: 2000;
  transition: width 0.1s linear;
}

/* ---------- 20. Social Links ---------- */
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.22s ease;
}

.social-link:hover {
  background: var(--teal-glow);
  border-color: rgba(0,229,204,0.4);
  color: var(--teal);
  transform: translateY(-2px);
}

/* ---------- 21. Divider ---------- */
.divider-teal {
  width: 48px;
  height: 3px;
  background: var(--teal);
  border-radius: 2px;
}

/* ---------- 22. Scroll Animations ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }
.fade-up-delay-4 { transition-delay: 0.4s; }

/* ---------- 23. Category Filter Tabs ---------- */
.filter-tab {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border-radius: 100px;
  border: 1.5px solid var(--ivory);
  background: transparent;
  color: var(--steel);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.filter-tab.active { background: var(--night); }

/* ---------- 24. Resource Cards ---------- */
.resource-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.14);
}

/* ---------- 25. Decorative Elements ---------- */
.teal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  display: inline-block;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 32px;
  height: 1.5px;
  background: var(--teal);
  flex-shrink: 0;
}

.section-label-dark {
  color: var(--teal);
}

/* ---------- 26. Responsive Utilities ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 640px)  { .container { padding: 0 2rem; } }
@media (min-width: 1024px) { .container { padding: 0 3rem; } }

/* ---------- 27. Hero Gradient Orbs ---------- */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.orb-teal {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,229,204,0.12) 0%, transparent 70%);
}

.orb-ember {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(255,100,53,0.08) 0%, transparent 70%);
}

/* ---------- 28. Blockquote ---------- */
blockquote {
  border-left: 3px solid var(--teal);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--ivory);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--slate);
  font-size: 1.05rem;
}

/* ---------- 29. Hamburger ---------- */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.8);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---------- 29b. Shared keyframe animations (used across pages) ---------- */

/* ringPulse — used by hero SVG node rings */
@keyframes ringPulse {
  0%, 100% { opacity: 0;   r: 30; }
  40%       { opacity: 0.6; r: 44; }
  60%       { opacity: 0.4; r: 50; }
}

/* Count-up stat animation trigger */
.stat-number[data-count] {
  transition: opacity 0.4s ease;
}

/* Enhanced card hover with teal border flash */
.card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,229,204,0.12);
}

/* Pillar card color-coded top border on hover */
.pillar-card:hover h3 { color: inherit !important; }

/* Smooth image lazy reveal */
img { opacity: 0; transition: opacity 0.5s ease; }
img.loaded, img[src] { opacity: 1; }

/* Animated underline links in article body */
#article-body a {
  background-image: linear-gradient(var(--teal), var(--teal));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s ease, color 0.2s ease;
  text-decoration: none;
  color: var(--teal-dim);
}
#article-body a:hover {
  background-size: 100% 1px;
  color: var(--teal);
}

/* Sticky filter bar shadow on scroll */
.filter-sticky-shadow {
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Hero headline entrance animation */
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-animate {
  animation: heroReveal 0.8s cubic-bezier(0.16,1,0.3,1) both;
}
.hero-animate.delay-1 { animation-delay: 0.15s; }
.hero-animate.delay-2 { animation-delay: 0.3s; }
.hero-animate.delay-3 { animation-delay: 0.45s; }
.hero-animate.delay-4 { animation-delay: 0.6s; }

/* Glowing CTA button pulse */
.btn-primary-pulse {
  animation: ctaPulse 2.5s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,100,53,0.4); }
  50%       { box-shadow: 0 0 0 10px rgba(255,100,53,0); }
}

/* ---------- 30. Misc utilities ---------- */
.text-teal  { color: var(--teal); }
.text-ember { color: var(--ember); }
.text-steel { color: var(--steel); }
.text-cream { color: var(--cream); }
.text-mist  { color: var(--mist); }

.bg-night  { background: var(--night); }
.bg-navy   { background: var(--navy); }
.bg-cream  { background: var(--cream); }
.bg-ivory  { background: var(--ivory); }
.bg-teal   { background: var(--teal); }
.bg-ember  { background: var(--ember); }

.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }
