/* =========================================================
   Aviox Blog — Homepage Stylesheet
   Design tokens + component styles (Bootstrap 5 as base grid)
   ========================================================= */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: local('Plus Jakarta Sans');
}

/* ---------- Design Tokens ---------- */
:root {
  --clr-primary: #6C63FF;
  --clr-primary-dark: #564FD6;
  --clr-secondary: #8B5CF6;
  --clr-accent: #00C2A8;
  --clr-bg: #F8FAFC;
  --clr-surface: #FFFFFF;
  --clr-surface-2: #F1F3F9;
  --clr-text: #111827;
  --clr-text-soft: #374151;
  --clr-gray: #6B7280;
  --clr-border: rgba(17, 24, 39, 0.08);

  --grad-primary: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-secondary) 100%);
  --grad-accent: linear-gradient(135deg, var(--clr-accent) 0%, #00E0C0 100%);
  --grad-mesh: radial-gradient(60% 60% at 15% 20%, rgba(108,99,255,0.16) 0%, rgba(108,99,255,0) 70%),
               radial-gradient(50% 50% at 85% 10%, rgba(139,92,246,0.14) 0%, rgba(139,92,246,0) 70%),
               radial-gradient(45% 45% at 90% 80%, rgba(0,194,168,0.12) 0%, rgba(0,194,168,0) 70%);

  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 100px;

  --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 12px 32px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 24px 64px rgba(17, 24, 39, 0.12);
  --shadow-glow: 0 8px 24px rgba(108, 99, 255, 0.25);

  --font-heading: 'Plus Jakarta Sans', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --container-max: 1400px;
  --nav-h: 84px;

  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Dark mode ---------- */
[data-theme="dark"] {
  --clr-bg: #0B0E17;
  --clr-surface: #131826;
  --clr-surface-2: #1A2032;
  --clr-text: #F3F4F6;
  --clr-text-soft: #CBD5E1;
  --clr-gray: #94A3B8;
  --clr-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45);
  --grad-mesh: radial-gradient(60% 60% at 15% 20%, rgba(108,99,255,0.22) 0%, rgba(108,99,255,0) 70%),
               radial-gradient(50% 50% at 85% 10%, rgba(139,92,246,0.18) 0%, rgba(139,92,246,0) 70%),
               radial-gradient(45% 45% at 90% 80%, rgba(0,194,168,0.16) 0%, rgba(0,194,168,0) 70%);
}

/* Astra (the parent theme) paints everything it styles — links, form labels,
   blockquotes, WordPress block defaults, post content — from its own palette
   variables, which it hard-codes to a light scheme on :root. Repointing those
   at this theme's tokens flips all of it in one place instead of overriding
   Astra's rules one at a time. Light mode keeps Astra's own values.
   `html[data-theme]` outranks Astra's `:root`, whichever order they load in. */
html[data-theme="dark"] {
  --ast-global-color-0: var(--clr-primary);       /* links / accent */
  --ast-global-color-1: var(--clr-primary-dark);  /* link hover */
  --ast-global-color-2: var(--clr-text);          /* headings, labels */
  --ast-global-color-3: var(--clr-text-soft);     /* body copy, quotes */
  --ast-global-color-4: var(--clr-surface);       /* card / content surface */
  --ast-global-color-5: var(--clr-bg);            /* page background */
  --ast-global-color-7: var(--clr-surface-2);     /* subtle background */
  --ast-border-color: var(--clr-border);
  --ast-single-post-border: var(--clr-border);
  --ast-comment-inputs-background: var(--clr-surface-2);
  --ast-code-block-background: var(--clr-surface-2);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
button { padding: 0; }
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease-premium), color 0.4s var(--ease-premium);
  overflow-x: hidden;
}
/* Astra paints the page background from the container class it puts on <body>
   (`.ast-separate-container { background-color: ... }`), which outranks the
   `body` rule above and pinned every page to Astra's light palette — dark mode
   included. This theme owns the page background, so claim it back for all of
   Astra's container layouts, at a specificity that wins regardless of the order
   Astra's inline dynamic CSS lands in the head. */
body.ast-separate-container,
body.ast-narrow-container,
body.ast-plain-container,
body.ast-page-builder-template {
  background-color: var(--clr-bg);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

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

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

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

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

:focus-visible {
  outline: 2.5px solid var(--clr-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-primary);
}
.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
}

.section-heading { margin-bottom: 2rem; }
.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 0.4rem 0 0.6rem;
}
.section-heading p { color: var(--clr-gray); font-size: 1.05rem; max-width: 560px; }
.section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

section { position: relative; padding: 3.5rem 0; }
@media (max-width: 767.98px) { section { padding: 2.75rem 0; } }

/* ---------- Buttons ---------- */
.btn-premium {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.9rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s var(--ease-premium), box-shadow 0.35s var(--ease-premium);
  isolation: isolate;
}
.btn-premium.btn-solid {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-premium.btn-solid:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(108,99,255,0.35); color: #fff; }

.btn-premium.btn-outline {
  background: transparent;
  color: var(--clr-text);
  border: 1.5px solid var(--clr-border);
}
.btn-premium.btn-outline:hover { transform: translateY(-3px); border-color: var(--clr-primary); color: var(--clr-primary); background: rgba(108,99,255,0.06); }

/* ripple */
.btn-premium .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transform: scale(0);
  animation: ripple-anim 0.6s var(--ease-premium);
  pointer-events: none;
}
.btn-premium.btn-outline .ripple { background: rgba(108,99,255,0.25); }
@keyframes ripple-anim { to { transform: scale(3); opacity: 0; } }

/* magnetic wrapper */
.magnetic { will-change: transform; }

/* ---------- Reading progress ---------- */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad-primary);
  z-index: 2000;
  transition: width 0.1s linear;
}

/* ---------- Navbar ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium), height 0.4s var(--ease-premium), backdrop-filter 0.4s var(--ease-premium);
}
.site-nav.scrolled {
  background: color-mix(in srgb, var(--clr-surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 4px 24px rgba(17,24,39,0.06);
  border-bottom: 1px solid var(--clr-border);
}
.nav-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--clr-text);
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; font-weight: 800;
  box-shadow: var(--shadow-glow);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  position: relative;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--clr-text-soft);
  padding: 6px 0;
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
  transition: width 0.3s var(--ease-premium);
}
.nav-links a:hover { color: var(--clr-text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--clr-primary); }

/* Resources dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--clr-text-soft);
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.25s;
}
.nav-dropdown-toggle i { font-size: 0.65rem; transition: transform 0.3s var(--ease-premium); }
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus {
  background-color: transparent;
  color: var(--clr-text);
  outline: none;
}
.nav-dropdown-toggle:focus-visible {
  outline: 2.5px solid var(--clr-accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.nav-dropdown.active .nav-dropdown-toggle { color: var(--clr-primary); }
.nav-dropdown.open .nav-dropdown-toggle i,
.nav-dropdown:hover .nav-dropdown-toggle i { transform: rotate(180deg); }

/* The outer element is the hoverable hit-box — it starts flush against the
   toggle (top: 100%, no dead gap) and uses padding-top to create the visual
   16px breathing room *inside* its own hoverable area instead of as empty
   space outside it. Without this, a mouse moving diagonally from the button
   into the menu crosses that gap, breaks :hover, and pointer-events: none
   kicks in immediately — closing the menu before a click can land. The
   visible card (background/border/shadow) and the slide-in animation live
   on the inner wrapper instead. */
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  padding-top: 16px;
  transform: translateX(-50%);
  min-width: 170px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-premium), visibility 0.25s;
  z-index: 10;
}
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.nav-dropdown-menu-inner {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  transform: translateY(-6px);
  transition: transform 0.25s var(--ease-premium);
}
.nav-dropdown.open .nav-dropdown-menu-inner,
.nav-dropdown:hover .nav-dropdown-menu-inner {
  transform: translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--clr-text-soft);
  transition: all 0.2s;
}
/* These links inherit .nav-links a::after (the full-width underline used for
   the top-level tabs) since they're still nested inside .nav-links — but a
   straight edge-to-edge underline reads as a misaligned stray border inside
   a small rounded dropdown item. The background tint below is this menu's
   own hover/active indicator, so cancel the inherited one. */
.nav-dropdown-menu a::after { content: none; }
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active { background: var(--clr-surface-2); color: var(--clr-primary); }

@media (max-width: 767.98px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    padding: 1rem 24px 1.5rem;
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s var(--ease-premium);
  }
  .nav-links.mobile-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav-links a { padding: 0.6rem 0; width: 100%; }
  .nav-toggle { display: flex; }

  .nav-dropdown { width: 100%; }
  .nav-dropdown-toggle { width: 100%; justify-content: space-between; padding: 0.6rem 0; }
  .nav-dropdown-menu {
    position: static;
    padding-top: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease-premium);
  }
  .nav-dropdown.open .nav-dropdown-menu { max-height: 160px; }
  .nav-dropdown-menu-inner {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 0 1rem;
    transform: none;
  }
}

.nav-actions { display: flex; align-items: center; gap: 0.85rem; }
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--clr-surface);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  cursor: pointer;
  transition: transform 0.3s var(--ease-premium), border-color 0.3s, background 0.3s;
}
.icon-btn:hover { transform: translateY(-2px); background-color: var(--clr-surface); color: var(--clr-text); border-color: var(--clr-primary); }
.icon-btn:focus { background-color: var(--clr-surface); color: var(--clr-text); border-color: var(--clr-primary); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + 2.5rem);
  padding-bottom: 3rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -10% -10% auto -10%;
  height: 140%;
  background: var(--grad-mesh);
  z-index: -2;
  pointer-events: none;
}
.hero-shape {
  position: absolute;
  border-radius: 40%;
  filter: blur(2px);
  z-index: -1;
  opacity: 0.55;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
}
@media (max-width: 991.98px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  padding: 0.5rem 1rem 0.5rem 0.6rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  color: var(--clr-text-soft);
  margin-bottom: 1.75rem;
}
.hero-rating .stars { color: #F5A524; letter-spacing: 1px; }
.hero-rating strong { color: var(--clr-text); }

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.08;
  margin-bottom: 1.4rem;
}
.hero h1 .highlight {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead-text {
  font-size: 1.15rem;
  color: var(--clr-gray);
  max-width: 480px;
  margin-bottom: 2.25rem;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }

.hero-stats { display: flex; gap: 2.5rem; }
.hero-stats .stat b {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
}
.hero-stats .stat span { color: var(--clr-gray); font-size: 0.85rem; }

/* Hero featured card */
.hero-visual { position: relative; min-height: 480px; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 1.5rem 3rem 3rem 1.5rem;
  background: var(--grad-primary);
  border-radius: var(--radius-lg);
  opacity: 0.16;
  transform: rotate(-4deg);
  z-index: 0;
}
.hero-card {
  position: relative;
  z-index: 1;
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--clr-border);
  transform: rotate(1.5deg);
}
.hero-card img { height: 300px; object-fit: cover; width: 100%; }
.hero-card .card-body-custom { padding: 1.6rem; }
.hero-card .badge-cat {
  position: absolute; top: 1rem; left: 1rem;
}
.hero-card h3 { font-size: 1.25rem; margin: 0.6rem 0 0.8rem; }
.hero-card .meta { display: flex; align-items: center; gap: 0.6rem; color: var(--clr-gray); font-size: 0.85rem; }
.hero-card .meta img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

.floating-chip {
  position: absolute;
  z-index: 2;
  background: color-mix(in srgb, var(--clr-surface) 85%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
  animation: float-y 6s ease-in-out infinite;
}
.floating-chip .fc-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
}
.chip-1 { top: -1.5rem; right: -1rem; animation-delay: 0s; }
.chip-1 .fc-icon { background: var(--grad-accent); }
.chip-2 { bottom: 1rem; left: -2.2rem; animation-delay: 1.2s; }
.chip-2 .fc-icon { background: var(--grad-primary); }
@media (max-width: 575.98px) { .chip-1, .chip-2 { display: none; } }

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.badge-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--grad-primary);
  color: #fff;
}
.badge-cat.accent { background: var(--grad-accent); }
.badge-cat.soft { background: rgba(108,99,255,0.1); color: var(--clr-primary); }

/* ---------- Sticky category chips ---------- */
.chip-row {
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 1rem 0;
  background: color-mix(in srgb, var(--clr-bg) 92%, transparent);
  backdrop-filter: blur(10px);
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-pill {
  flex: 0 0 auto;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-text-soft);
  cursor: pointer;
  transition: all 0.25s var(--ease-premium);
  white-space: nowrap;
}
.chip-pill:hover, .chip-pill.active { background: var(--grad-primary); color: #fff; border-color: transparent; }

/* ---------- Ticker ---------- */
.ticker-wrap {
  overflow: hidden;
  background: #111827;
  padding: 0.85rem 0;
}
.ticker-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  width: max-content;
  animation: ticker-scroll 32s linear infinite;
}
.ticker-track span {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.ticker-track span::before { content: "●"; color: var(--clr-accent); font-size: 0.5rem; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Cards ---------- */
.article-card {
  position: relative;
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.45s var(--ease-premium), box-shadow 0.45s var(--ease-premium), border-color 0.45s var(--ease-premium);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-8px);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(17,24,39,0.05), var(--shadow-lg), inset 0 0 0 1.5px rgba(108,99,255,0.4);
}
.card-media { position: relative; overflow: hidden; aspect-ratio: 16/11; }
.card-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.35) 100%);
  opacity: 0;
  z-index: 0;
  transition: opacity 0.45s var(--ease-premium);
  pointer-events: none;
}
.article-card:hover .card-media::after { opacity: 1; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease-premium); }
.article-card:hover .card-media img { transform: scale(1.08); }
.card-media .badge-cat { position: absolute; top: 0.9rem; left: 0.9rem; z-index: 1; }
.bookmark-btn {
  position: absolute; top: 0.85rem; right: 0.85rem;
  z-index: 1;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-text);
  cursor: pointer;
  transition: transform 0.3s var(--ease-premium), color 0.3s, background 0.3s;
}
.bookmark-btn:hover { transform: scale(1.1); background-color: rgba(255,255,255,0.9); color: var(--clr-primary); }
.bookmark-btn:focus { background-color: rgba(255,255,255,0.9); color: var(--clr-primary); }
.bookmark-btn.active:focus { color: var(--clr-primary); background-color: #fff; }
.bookmark-btn.active { color: var(--clr-primary); background-color: #fff; }
[data-theme="dark"] .bookmark-btn { background: rgba(19, 24, 38, 0.75); color: var(--clr-text); }
[data-theme="dark"] .bookmark-btn.active { background: var(--clr-surface); }
.card-content { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.65rem; flex: 1; }
.card-content h3 { font-size: 1.15rem; line-height: 1.35; margin: 0; }
.card-content h3 a { transition: color 0.25s; }
.card-content h3 a:hover { color: var(--clr-primary); }
.card-content .excerpt { color: var(--clr-gray); font-size: 0.92rem; flex: 1; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.4rem; padding-top: 0.9rem; border-top: 1px solid var(--clr-border);
}
.author-mini { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--clr-text-soft); }
.author-mini img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.meta-inline { display: flex; gap: 0.9rem; font-size: 0.78rem; color: var(--clr-gray); }
.meta-inline span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ---------- Categories ---------- */
.category-card {
  position: relative;
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.4rem;
  text-align: left;
  border: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium);
  height: 100%;
  overflow: hidden;
}
.category-card::after {
  content: "";
  position: absolute;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: var(--grad-primary);
  filter: blur(30px);
  opacity: 0;
  top: -50px; right: -50px;
  transition: opacity 0.4s var(--ease-premium);
  z-index: 0;
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md), inset 0 0 0 1.5px rgba(108,99,255,0.35);
}
.category-card:hover::after { opacity: 0.15; }
.category-card > * { position: relative; z-index: 1; }
.cat-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
  background: rgba(108,99,255,0.08);
  color: var(--clr-primary);
  transition: background 0.4s var(--ease-premium), color 0.4s var(--ease-premium), transform 0.4s var(--ease-premium);
}
.category-card:hover .cat-icon {
  background: var(--grad-primary);
  color: #fff;
  transform: scale(1.08) rotate(-4deg);
}
.category-card h4 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.category-card span { color: var(--clr-gray); font-size: 0.85rem; }

/* ---------- Featured Story ---------- */
.featured-story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--clr-surface);
}
@media (max-width: 991.98px) { .featured-story { grid-template-columns: 1fr; } }
.featured-media { position: relative; overflow: hidden; min-height: 420px; }
.featured-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform 1s var(--ease-premium); }
.featured-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(108,99,255,0.28) 0%, rgba(0,0,0,0) 55%),
              linear-gradient(0deg, rgba(0,0,0,0.25) 0%, transparent 35%);
}
.featured-story:hover .featured-media img { transform: scale(1.05); }
.featured-body { padding: 3rem; display: flex; flex-direction: column; justify-content: center; gap: 1rem; }
.featured-body h3 { font-size: clamp(1.5rem, 2.5vw, 2.1rem); line-height: 1.25; }
.featured-body p { color: var(--clr-gray); }
.featured-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; color: var(--clr-text-soft); flex-wrap: wrap; }
.featured-meta img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* ---------- Masonry ---------- */
.masonry {
  columns: 3 320px;
  column-gap: 1.75rem;
}
.masonry .article-card { margin-bottom: 1.75rem; break-inside: avoid; }
@media (max-width: 767.98px) { .masonry { columns: 1; } }

/* ---------- Authors ---------- */
.author-card {
  position: relative;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 2.1rem 1.75rem 1.75rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium), border-color 0.4s var(--ease-premium);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.author-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: rgba(108,99,255,0.25); }

.author-top { display: flex; align-items: flex-start; gap: 0.9rem; margin-bottom: 1.3rem; }
.author-card img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--clr-surface-2);
  transition: box-shadow 0.4s var(--ease-premium);
}
.author-card:hover img { box-shadow: 0 0 0 4px rgba(108,99,255,0.14); }
.author-id { min-width: 0; padding-top: 0.15rem; }
.author-id h4 {
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.author-card .role {
  display: inline-block;
  color: var(--clr-primary);
  background: rgba(108,99,255,0.08);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  max-width: 100%;
}
.author-card .bio {
  color: var(--clr-text-soft);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.4rem;
  flex: 1;
}
.author-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  margin-bottom: 1.1rem;
  border-top: 1px solid var(--clr-border);
}
.author-count { font-size: 0.78rem; color: var(--clr-gray); }
.author-count strong { color: var(--clr-text); font-family: var(--font-heading); }
.author-social { display: flex; gap: 0.5rem; }
.author-social a {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--clr-surface-2); color: var(--clr-text-soft); font-size: 0.78rem;
  transition: all 0.25s;
}
.author-social a:hover { background: var(--grad-primary); color: #fff; transform: translateY(-2px); }
.follow-btn,
.view-profile-btn {
  display: block;
  width: 100%;
  padding: 0.65rem;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--clr-text);
  color: var(--clr-bg);
  font-weight: 600;
  font-size: 0.85rem;
  font-family: var(--font-heading);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-premium);
}
.follow-btn:hover,
.view-profile-btn:hover { background: var(--grad-primary); color: #fff; transform: translateY(-2px); }
.follow-btn.following { background: var(--clr-surface-2); color: var(--clr-text-soft); }
.follow-btn.following:hover { background: var(--grad-primary); color: #fff; }

/* ---------- Newsletter ---------- */
.newsletter-wrap { position: relative; }
.newsletter-box {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 3rem 3.25rem;
  background: var(--clr-text);
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
[data-theme="dark"] .newsletter-box { background: var(--clr-surface); border: 1px solid var(--clr-border); }
@media (max-width: 767.98px) { .newsletter-box { grid-template-columns: 1fr; text-align: left; padding: 2.25rem 1.75rem; } }

.newsletter-box::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.09) 1px, transparent 0);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 100% at 0% 50%, #000 0%, transparent 75%);
  mask-image: radial-gradient(70% 100% at 0% 50%, #000 0%, transparent 75%);
  z-index: 0;
}
.newsletter-box::after {
  content: "";
  position: absolute; top: -30%; right: -10%;
  width: 55%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(0,194,168,0.28) 0%, transparent 70%);
  z-index: 0;
}
.newsletter-copy { position: relative; z-index: 1; }
.newsletter-box h2 { color: #fff; font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 0.6rem; }
.newsletter-box p { color: rgba(255,255,255,0.68); max-width: 420px; margin: 0; }
.newsletter-box .eyebrow { color: var(--clr-accent); }
.newsletter-box .eyebrow::before { background: var(--clr-accent); }

.newsletter-form {
  position: relative; z-index: 1;
  display: flex;
  gap: 0.6rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 0.35rem;
  border-radius: var(--radius-md);
}
.newsletter-form input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.7rem 0.9rem;
  color: #fff;
  font-size: 0.95rem;
  min-width: 0;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.45); }
.newsletter-form input:focus { outline: none; }
.newsletter-form button {
  border: none;
  background: var(--clr-accent);
  color: #06342E;
  font-weight: 700;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.3s var(--ease-premium), background 0.3s;
  font-family: var(--font-heading);
  white-space: nowrap;
}
.newsletter-form button:hover { transform: translateY(-2px); background: #06D9BB; }
@media (max-width: 480px) { .newsletter-form { flex-direction: column; } .newsletter-form button { width: 100%; } }

/* ---------- Testimonials ---------- */
.testimonial-track { overflow: hidden; }
.testimonial-slides {
  display: flex;
  transition: transform 0.6s var(--ease-premium);
}
.testimonial-slide { flex: 0 0 100%; padding: 0 0.5rem; }
.testimonial-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.testimonial-card .stars { color: #F5A524; margin-bottom: 1rem; letter-spacing: 3px; }
.testimonial-card p.quote { font-size: 1.15rem; color: var(--clr-text-soft); margin-bottom: 1.5rem; font-style: italic; }
.testimonial-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin: 0 auto 0.7rem; }
.testimonial-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; }
.testimonial-dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none;
  background: var(--clr-border); cursor: pointer; transition: all 0.3s;
}
.testimonial-dots button.active { width: 26px; border-radius: 5px; background: var(--grad-primary); }

/* ---------- Stats ---------- */
.stats-band {
  background: var(--clr-text);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}
[data-theme="dark"] .stats-band { background: var(--clr-surface); border: 1px solid var(--clr-border); }
.stat-item { text-align: center; }
.stat-item .num {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-item .label { color: rgba(255,255,255,0.65); font-size: 0.9rem; margin-top: 0.3rem; }

/* ---------- Footer ---------- */
.site-footer { background: #0B0E17; color: rgba(255,255,255,0.7); padding: 3.5rem 0 1.75rem; }
.site-footer .brand { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 3rem; }
@media (max-width: 767.98px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h5 { color: #fff; font-size: 0.95rem; margin-bottom: 1.2rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.site-footer ul a { color: rgba(255,255,255,0.6); font-size: 0.9rem; transition: color 0.25s; }
.site-footer ul a:hover { color: var(--clr-accent); }
.footer-desc { color: rgba(255,255,255,0.55); font-size: 0.9rem; max-width: 320px; margin: 1rem 0 1.5rem; }
.footer-social { display: flex; gap: 0.7rem; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); color: #fff; transition: all 0.3s;
}
.footer-social a:hover { background: var(--grad-primary); transform: translateY(-3px); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 2.5rem; padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: 0.82rem; color: rgba(255,255,255,0.45);
}

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: color-mix(in srgb, var(--clr-bg) 92%, transparent);
  backdrop-filter: blur(20px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s var(--ease-premium), visibility 0.35s;
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-panel { width: min(680px, 90vw); }
.search-panel input {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font-size: 1.6rem;
  font-family: var(--font-heading);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--clr-border);
  padding: 0.8rem 0.2rem;
  color: var(--clr-text);
}
.search-panel input:focus {
  outline: none;
  forced-color-adjust: none;
  border-color: var(--clr-primary);
  box-shadow: 0 2px 0 0 var(--clr-primary);
}
.search-hint { margin-top: 1rem; color: var(--clr-gray); font-size: 0.85rem; display: flex; gap: 1.5rem; }
.search-close {
  position: absolute; top: 2rem; right: 2rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 900;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--grad-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow);
  border: none; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: all 0.4s var(--ease-premium);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); }

/* ---------- Skeleton loaders ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--clr-surface-2) 25%, var(--clr-border) 37%, var(--clr-surface-2) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-premium), transform 0.8s var(--ease-premium);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ---------- Cursor glow (desktop only) ---------- */
.cursor-glow {
  position: fixed;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,0.10) 0%, rgba(108,99,255,0) 70%);
  pointer-events: none;
  /* Ambient background candy — must render behind all real content
     (cards, inputs, overlays), not on top of it. */
  z-index: -1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}
@media (hover: hover) and (pointer: fine) { .cursor-glow.active { opacity: 1; } }

/* ---------- Misc ---------- */
.text-gray { color: var(--clr-gray) !important; }
.bg-surface { background: var(--clr-surface); }
