/*
Theme Name: Numestra
Theme URI: https://numestra.com
Author: Numestra
Author URI: https://numestra.com
Description: Professional CIMA/CGMA exam preparation and mentoring theme for Numestra. Designed for finance professionals and students.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: numestra
Tags: education, finance, professional, clean, blue
*/

/* =============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================= */
:root {
  --blue:       #0030ff;
  --blue-dark:  #0022cc;
  --blue-deep:  #001580;
  --blue-light: #e8ecff;
  --blue-mid:   #3358ff;
  --cream:      #faf9f5;
  --cream-dark: #f0ede4;
  --white:      #ffffff;
  --ink:        #0a0e1a;
  --ink-mid:    #2c3150;
  --ink-soft:   #5a6080;
  --ink-faint:  #9aa0bc;
  --gold:       #c9a84c;
  --gold-light: #f5e6b8;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius:    6px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(0,48,255,0.06);
  --shadow:    0 8px 32px rgba(0,48,255,0.10);
  --shadow-lg: 0 20px 64px rgba(0,48,255,0.14);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-w: 1200px;
  --nav-h: 76px;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-dark); }

::selection { background: var(--blue); color: #fff; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); font-weight: 600; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 600; }
h3 { font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.05rem; font-weight: 600; }

p { margin-bottom: 1rem; color: var(--ink-mid); }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  display: block;
  margin-bottom: 0.75rem;
}

.lead {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.7;
  color: var(--ink-soft);
}

/* =============================================
   LAYOUT UTILITIES
   ============================================= */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.container--narrow { max-width: 780px; }
.container--wide   { max-width: 1440px; }

.section { padding: clamp(4rem, 8vw, 8rem) 0; }
.section--sm { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section--lg { padding: clamp(5rem, 10vw, 11rem) 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn--primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,48,255,0.25);
}

.btn--secondary {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn--secondary:hover {
  background: var(--blue);
  color: #fff;
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(10,14,26,0.2);
}
.btn--ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn--white {
  background: #fff;
  color: var(--blue);
  border-color: #fff;
}
.btn--white:hover {
  background: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.btn--lg { padding: 1.05rem 2.5rem; font-size: 1rem; }
.btn--sm { padding: 0.6rem 1.4rem; font-size: 0.82rem; }

/* =============================================
   NAVIGATION
   ============================================= */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(250,249,245,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,48,255,0.08);
  transition: all var(--transition);
}

.site-nav.scrolled {
  height: 62px;
  box-shadow: 0 4px 20px rgba(0,48,255,0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.nav-logo__mark {
  width: 36px;
  height: 36px;
  background: var(--blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-logo__text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-mid);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--blue);
  background: var(--blue-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all var(--transition);
}

@media (max-width: 900px) {
  .nav-links, .nav-actions .btn--secondary { display: none; }
  .nav-hamburger { display: flex; }
}

/* Mobile nav overlay */
.nav-mobile {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cream);
  z-index: 999;
  padding: 2rem;
  transform: translateX(100%);
  transition: transform var(--transition);
}
.nav-mobile.open { transform: translateX(0); }
.nav-mobile ul { list-style: none; }
.nav-mobile ul li + li { border-top: 1px solid var(--cream-dark); }
.nav-mobile ul a {
  display: block;
  padding: 1rem 0;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
}

/* =============================================
   HERO COMPONENTS
   ============================================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: var(--cream);
}

.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,48,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,48,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero__bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
}
.hero__bg-blob--1 {
  width: 600px; height: 600px;
  top: -100px; right: -100px;
  background: var(--blue);
}
.hero__bg-blob--2 {
  width: 400px; height: 400px;
  bottom: 50px; left: -100px;
  background: var(--gold);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--blue-light);
  border: 1px solid rgba(0,48,255,0.2);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.75rem;
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.hero__title span.blue { color: var(--blue); }
.hero__title span.serif-italic { font-style: italic; }

.hero__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.hero__stats {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0,48,255,0.1);
  flex-wrap: wrap;
}

.hero__stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.hero__stat-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.3rem;
  font-weight: 500;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid rgba(0,48,255,0.08);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0,48,255,0.2);
}

.card--blue {
  background: var(--blue);
  border-color: transparent;
  color: #fff;
}

.card--blue h3, .card--blue p, .card--blue .eyebrow {
  color: rgba(255,255,255,0.9);
}

.card__icon {
  width: 52px;
  height: 52px;
  background: var(--blue-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.4rem;
}

.card--blue .card__icon {
  background: rgba(255,255,255,0.15);
}

/* =============================================
   SECTION HEADER
   ============================================= */
.section-header {
  margin-bottom: 3.5rem;
}

.section-header--center {
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3.5rem;
}

/* =============================================
   FEATURE STRIP / BANNER
   ============================================= */
.feature-banner {
  background: var(--blue);
  color: #fff;
  padding: 1.25rem 0;
  overflow: hidden;
}

.feature-banner__track {
  display: flex;
  gap: 4rem;
  animation: marquee 28s linear infinite;
  white-space: nowrap;
}

.feature-banner__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
}

.feature-banner__dot {
  width: 5px;
  height: 5px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* =============================================
   TESTIMONIALS
   ============================================= */
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid rgba(0,48,255,0.08);
  position: relative;
}

.testimonial-card__quote {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.testimonial-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  font-family: var(--font-display);
}

.testimonial-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}
.testimonial-card__role {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.stars {
  display: flex;
  gap: 2px;
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 4.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand p { font-size: 0.88rem; line-height: 1.7; margin-top: 1rem; }

.footer-col h5 {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.footer-col ul { list-style: none; }
.footer-col ul li + li { margin-top: 0.6rem; }
.footer-col ul a {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  transition: color var(--transition);
}
.footer-col ul a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

/* =============================================
   PAGE HERO (inner pages)
   ============================================= */
.page-hero {
  background: var(--blue);
  padding: calc(var(--nav-h) + 4rem) 0 4rem;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

.page-hero__content { position: relative; z-index: 2; }
.page-hero h1, .page-hero p { color: #fff; }
.page-hero .eyebrow { color: rgba(255,255,255,0.7); }

/* =============================================
   BLOG & ARTICLE CARDS
   ============================================= */
.article-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0,48,255,0.07);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0,48,255,0.18);
}

.article-card__img {
  aspect-ratio: 16/9;
  background: var(--blue-light);
  position: relative;
  overflow: hidden;
}

.article-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--blue-light), #d4dcff);
}

.article-card__body {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card__tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.article-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.article-card__meta {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.article-card__read {
  font-weight: 600;
  color: var(--blue);
  font-size: 0.82rem;
}

/* =============================================
   PRODUCT CARDS
   ============================================= */
.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0,48,255,0.08);
  transition: all var(--transition);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card--featured {
  border-color: var(--blue);
  border-width: 2px;
}

.product-card__badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--blue);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem;
  border-radius: 100px;
}

.product-card__header {
  background: linear-gradient(135deg, var(--blue-light), #d4dcff);
  padding: 2.5rem 2rem;
  text-align: center;
}

.product-card__icon-wrap {
  width: 64px;
  height: 64px;
  background: var(--white);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow-sm);
}

.product-card__body { padding: 2rem; }

.product-card__price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.product-card__price span { font-size: 1rem; color: var(--ink-soft); }

.product-card__features {
  list-style: none;
  margin: 1.5rem 0;
}
.product-card__features li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--ink-mid);
  border-bottom: 1px solid var(--cream-dark);
}
.product-card__features li:last-child { border-bottom: none; }
.product-card__features li::before {
  content: '✓';
  color: var(--blue);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

/* =============================================
   PRICING TABLE
   ============================================= */
.pricing-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  border: 2px solid rgba(0,48,255,0.1);
  transition: all var(--transition);
  position: relative;
}

.pricing-card--popular {
  border-color: var(--blue);
  transform: scale(1.03);
}

.pricing-card__popular-label {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 1.25rem;
  border-radius: 100px;
  white-space: nowrap;
}

/* =============================================
   ACCORDION (FAQ)
   ============================================= */
.accordion {
  border: 1px solid rgba(0,48,255,0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.accordion-item + .accordion-item {
  border-top: 1px solid rgba(0,48,255,0.1);
}

.accordion-trigger {
  width: 100%;
  background: none;
  border: none;
  padding: 1.4rem 1.75rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  transition: background var(--transition);
}

.accordion-trigger:hover { background: var(--cream-dark); }
.accordion-trigger.open { background: var(--blue-light); color: var(--blue); }

.accordion-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: transform var(--transition);
  flex-shrink: 0;
}
.accordion-trigger.open .accordion-icon { transform: rotate(45deg); background: var(--blue); color: #fff; }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.accordion-body.open { max-height: 500px; }
.accordion-body__inner {
  padding: 0 1.75rem 1.4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* =============================================
   DIVIDERS
   ============================================= */
.divider {
  border: none;
  height: 1px;
  background: rgba(0,48,255,0.08);
  margin: 3rem 0;
}

/* =============================================
   TAGS / PILLS
   ============================================= */
.tag {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid rgba(0,48,255,0.15);
}

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}
.form-control {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 1.5px solid rgba(0,48,255,0.15);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,48,255,0.1);
}
textarea.form-control { min-height: 130px; resize: vertical; }

/* =============================================
   UTILITIES
   ============================================= */
.text-blue  { color: var(--blue); }
.text-ink   { color: var(--ink); }
.text-soft  { color: var(--ink-soft); }
.text-white { color: #fff; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.bg-blue    { background: var(--blue); }
.bg-cream   { background: var(--cream); }
.bg-white   { background: var(--white); }
.bg-ink     { background: var(--ink); }
.bg-blue-light { background: var(--blue-light); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.pt-nav { padding-top: var(--nav-h); }

.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* =============================================
   ANIMATIONS
   ============================================= */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: none;
}

.fade-up:nth-child(1) { transition-delay: 0.05s; }
.fade-up:nth-child(2) { transition-delay: 0.12s; }
.fade-up:nth-child(3) { transition-delay: 0.19s; }
.fade-up:nth-child(4) { transition-delay: 0.26s; }
.fade-up:nth-child(5) { transition-delay: 0.33s; }
.fade-up:nth-child(6) { transition-delay: 0.4s; }

/* =============================================
   PRINT
   ============================================= */
@media print {
  .site-nav, .site-footer, .hero__bg { display: none; }
  body { background: white; }
}

/* =============================================
   RESPONSIVE — TABLET & MOBILE
   All inline grid styles use !important to
   override template-level inline styles
   ============================================= */

/* ── Tablet (max 1024px) ── */
@media (max-width: 1024px) {

  /* Global grid overrides */
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }

  /* Hero — hide visual card, single column */
  .hero > .container,
  .hero .container { grid-template-columns: 1fr !important; }
  .hero-visual { display: none !important; }

  /* All two-column inline grids */
  [style*="grid-template-columns:1fr 1.6fr"],
  [style*="grid-template-columns:1fr 2fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns:1fr 300px"],
  [style*="grid-template-columns:220px 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 2rem !important; }

  /* Pricing — remove featured card lift */
  .pricing-card--popular { transform: none !important; margin-top: 0 !important; }

  /* Products sticky filter */
  .products-filter { position: static !important; flex-wrap: wrap; }

  /* About two-col */
  .about-grid { grid-template-columns: 1fr !important; }

  /* Blog sidebar */
  .blog-sidebar,
  [style*="grid-template-columns:1fr 300px"] > aside { display: none !important; }

  /* Legal sidebar */
  [style*="grid-template-columns:220px 1fr"] > aside { display: none !important; }

  /* Article TOC sidebar */
  .article-toc { display: none !important; }
}

/* ── Mobile (max 768px) ── */
@media (max-width: 768px) {

  /* Root adjustments */
  :root { --nav-h: 64px; }

  /* Typography scale down */
  h1 { font-size: clamp(1.9rem, 8vw, 2.8rem) !important; }
  h2 { font-size: clamp(1.6rem, 6vw, 2.2rem) !important; }
  h3 { font-size: clamp(1.15rem, 4vw, 1.5rem) !important; }
  .lead { font-size: 1rem !important; }

  /* Section spacing */
  .section    { padding: 3rem 0 !important; }
  .section--sm { padding: 2rem 0 !important; }
  .section-header--center { margin-bottom: 2rem !important; }

  /* Container padding */
  .container { padding: 0 1.1rem !important; }

  /* Hero */
  .hero {
    min-height: auto !important;
    padding: calc(var(--nav-h) + 2.5rem) 0 3rem !important;
  }
  .hero__actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  .hero__actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  .hero__stats {
    flex-wrap: wrap !important;
    gap: 1.25rem 2rem !important;
    margin-top: 2rem !important;
  }
  .hero__stat-num { font-size: 1.8rem !important; }
  .hero__badge  { font-size: 0.68rem !important; }

  /* Page hero */
  .page-hero {
    padding: calc(var(--nav-h) + 2rem) 0 2.5rem !important;
  }
  .page-hero h1 { font-size: clamp(1.7rem, 7vw, 2.4rem) !important; }
  .page-hero__content { gap: 0.75rem !important; }

  /* All grids single column on mobile */
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr !important; }

  /* Inline grids */
  [style*="display:grid"],
  [style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }

  /* Cards */
  .card { padding: 1.5rem !important; }
  .card__icon { width: 44px !important; height: 44px !important; }

  /* Buttons */
  .btn    { padding: 0.8rem 1.6rem !important; font-size: 0.875rem !important; }
  .btn--lg { padding: 0.9rem 1.8rem !important; font-size: 0.95rem !important; }
  .btn--sm { padding: 0.55rem 1.1rem !important; font-size: 0.8rem !important; }

  /* Nav CTA — hide secondary button on very small screens */
  .nav-actions .btn--secondary { display: none !important; }

  /* Marquee */
  .feature-banner__track { animation-duration: 18s !important; }
  .feature-banner__item  { font-size: 0.76rem !important; gap: 0.5rem !important; }

  /* Accordion */
  .accordion-trigger      { padding: 1rem 1.1rem !important; font-size: 0.88rem !important; }
  .accordion-body__inner  { padding: 0 1.1rem 1rem !important; font-size: 0.87rem !important; }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  /* Forms */
  .grid-2[style*="gap"] { grid-template-columns: 1fr !important; }
  .form-control { font-size: 16px !important; } /* prevents iOS zoom on focus */

  /* Products filter nav */
  [style*="display:flex"][style*="gap:.75rem"] {
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
  }

  /* Pricing cards stack */
  .pricing-card { padding: 1.75rem 1.5rem !important; }

  /* Product cards */
  .product-card__header { padding: 1.5rem !important; }
  .product-card__body   { padding: 1.5rem !important; }

  /* Testimonial cards */
  .testimonial-card { padding: 1.5rem !important; }
  .testimonial-card__quote { font-size: 1rem !important; }

  /* Author box on single post */
  .author-box {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  /* Article entry content */
  .entry-content h2 { font-size: 1.3rem !important; }
  .entry-content p  { font-size: 0.92rem !important; }

  /* Stacked contact grid */
  #contact-form { padding: 1.75rem !important; }

  /* Section CTA flex */
  [style*="display:flex"][style*="justify-content:center"] {
    flex-direction: column !important;
    align-items: center !important;
  }
}

/* ── Small mobile (max 480px) ── */
@media (max-width: 480px) {

  :root { --nav-h: 60px; }

  .container { padding: 0 0.9rem !important; }

  h1 { font-size: 1.75rem !important; }
  h2 { font-size: 1.5rem !important; }

  .nav-logo__text { font-size: 1.25rem !important; }
  .nav-logo__mark { width: 30px !important; height: 30px !important; }

  .card { padding: 1.1rem !important; border-radius: 10px !important; }

  .hero__stats { gap: 1rem !important; }
  .hero__stat-num { font-size: 1.6rem !important; }

  .btn { padding: 0.75rem 1.35rem !important; }

  .footer-grid { gap: 1.5rem !important; }

  /* Prevent tiny text on legal pages */
  .accordion-body__inner { font-size: 0.85rem !important; line-height: 1.7 !important; }
}

/* ── Touch device improvements ── */
@media (hover: none) and (pointer: coarse) {

  /* Larger tap targets */
  .btn     { min-height: 48px !important; }
  .nav-links a { min-height: 44px !important; padding: 0.75rem 1rem !important; }
  .accordion-trigger { min-height: 52px !important; }
  .form-control { min-height: 48px !important; }

  /* Remove hover effects that don't work on touch */
  .card:hover      { transform: none !important; box-shadow: none !important; }
  .btn:hover       { transform: none !important; }
  .article-card:hover { transform: none !important; box-shadow: none !important; }

  /* Active state feedback instead */
  .btn:active         { transform: scale(0.97) !important; }
  .card:active        { opacity: 0.92 !important; }
  .article-card:active { opacity: 0.92 !important; }
}

/* =============================================
   Z-INDEX & STACKING FIX
   Prevents page sections bleeding over footer
   ============================================= */

/* Explicit stacking order — everything below nav */
:root {
  --z-base:    0;
  --z-sticky:  10;
  --z-mobile:  999;
  --z-nav:     1000;
}

/* Nav always on top */
.site-nav   { z-index: var(--z-nav) !important; }
.nav-mobile { z-index: var(--z-mobile) !important; }

/* Footer always above sticky sidebars & filter bars */
.site-footer {
  position: relative;
  z-index: 20 !important;
  clear: both;
}

/* Products sticky filter — must be below footer */
[style*="position:sticky"][style*="z-index:10"],
.products-filter { z-index: var(--z-sticky) !important; }

/* Sections with z-index:2 — isolate their stacking context
   so they don't poke through the footer */
section { isolation: isolate; }

/* Sticky sidebars — below footer */
aside[style*="position:sticky"],
[style*="position:sticky;top:calc"] {
  z-index: 5 !important;
}

/* Hero background blobs — keep behind content, never above footer */
.hero__bg-blob { z-index: 0 !important; }
.hero__bg      { z-index: 0 !important; }
.hero > .container { position: relative; z-index: 1 !important; }

/* Page hero decorative overlay — behind content */
.page-hero::before { z-index: 0 !important; }
.page-hero__content { z-index: 1 !important; }

/* Fade-up elements — never above footer */
.fade-up { z-index: auto !important; }

/* Pricing/product cards on hover — cap their z */
.card:hover,
.product-card:hover,
.pricing-card:hover,
.article-card:hover { z-index: 2 !important; }

/* Blue CTA sections — ensure footer renders above */
section[style*="background:var(--blue)"],
section[style*="background:#0030ff"] {
  position: relative;
  z-index: 1;
}

/* Main content wrapper — never above nav or footer */
#main-content,
main { position: relative; z-index: 0; }
