@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

/* ===== TOKENS ===== */
:root {
  --c-primary: #6514ff;
  --c-accent: #bf00ff;
  --c-dark: #1c1726;
  --c-dark2: #251e34;
  --c-dark3: #312842;
  --c-surface: rgba(255,255,255,0.06);
  --c-surface-hover: rgba(255,255,255,0.11);
  --c-border: rgba(255,255,255,0.12);
  --c-text: #f0eaff;
  --c-text-muted: #b8a8d8;
  --c-text-faint: #7a6a9a;
  --c-neon: #e040fb;
  --radius-card: 10px;
  --radius-pill: 999px;
  --gap-lg: 48px;
  --gap-md: 32px;
  --gap-sm: 16px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 300ms cubic-bezier(.4,0,.2,1);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; line-height: 1.6; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background-color: var(--c-dark);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; border-radius: 4px; }

/* ===== ANIMATED BG PATTERN ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(101,20,255,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(191,0,255,0.14) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.site-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ===== ANNOUNCE BAR ===== */
.announce-bar {
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  animation: gradShift 4s linear infinite alternate;
}

@keyframes gradShift {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* ===== HEADER / NAV ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(28,23,38,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 10px 24px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.pill-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  background: transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.pill-btn:hover,
.pill-btn.active {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}

/* ===== MAIN ===== */
.main-content { flex: 1; }

/* ===== HERO – HOME ===== */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 70vh;
  gap: var(--gap-lg);
  padding: 64px 48px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 20px;
  z-index: 2;
}

.hero-badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.geo-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border: 1.5px solid var(--c-primary);
  color: var(--c-primary);
  background: rgba(101,20,255,0.1);
  animation: badgePop 0.4s ease;
}

.geo-badge.accent {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(191,0,255,0.1);
}

@keyframes badgePop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 30%, var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: 1rem;
  color: var(--c-text-muted);
  max-width: 420px;
  line-height: 1.7;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 36px;
  min-height: 48px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 32px rgba(101,20,255,0.4);
}

.cta-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 40px rgba(191,0,255,0.5);
}

.hero-figure {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 360px;
  background: var(--c-dark2);
  border: 1px solid var(--c-border);
}

.hero-img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.hero-placeholder { background: linear-gradient(135deg, var(--c-dark2), var(--c-dark3)); }

/* ===== PAGE HERO (non-home) ===== */
.page-hero,
.cat-hero,
.tag-hero,
.about-hero,
.privacy-hero,
.entry-hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--gap-lg);
  padding: 64px 48px 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.page-hero-aside,
.entry-meta-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-h1,
.entry-h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, #fff 30%, var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cat-hero-fig,
.tag-hero-fig,
.about-hero-fig,
.privacy-hero-fig,
.default-hero-fig,
.entry-hero-fig {
  border-radius: 16px;
  overflow: hidden;
  min-height: 280px;
  background: var(--c-dark2);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.entry-hero-img { width: 100%; height: 100%; object-fit: cover; }
.entry-hero-placeholder { background: linear-gradient(135deg, var(--c-dark2), var(--c-dark3)); }

.cat-deco-shape,
.tag-deco-shape,
.about-deco-shape,
.privacy-deco-shape {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  opacity: 0.25;
  animation: shapeSpin 10s linear infinite;
}

@keyframes shapeSpin {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  to { transform: rotate(360deg) scale(1); }
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--c-text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.breadcrumb a { color: var(--c-primary); }
.breadcrumb a:hover { color: var(--c-accent); }

/* ===== DATES ===== */
.entry-date {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--c-text-faint);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-border);
  margin-right: 6px;
}

.entry-dates { display: flex; flex-wrap: wrap; gap: 6px; }
.card-date { font-size: 0.72rem; color: var(--c-text-faint); }

/* ===== CONTENT SECTION (split layout) ===== */
.content-section {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-areas: "deco aside" "deco prose";
  gap: var(--gap-md);
  padding: 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.content-deco {
  grid-area: deco;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
}

.deco-ring {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid var(--c-primary);
  box-shadow: 0 0 32px rgba(101,20,255,0.3), inset 0 0 32px rgba(191,0,255,0.1);
  animation: ringPulse 3s ease-in-out infinite alternate;
}

.deco-ring.sm {
  width: 80px;
  height: 80px;
}

@keyframes ringPulse {
  from { box-shadow: 0 0 16px rgba(101,20,255,0.3); transform: scale(1); }
  to { box-shadow: 0 0 48px rgba(191,0,255,0.5); transform: scale(1.04); }
}

.content-aside {
  grid-area: aside;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prose-wrap {
  grid-area: prose;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
  max-width: 720px;
}

/* ===== CONTENT SECTION ALTERNATE (aside right) ===== */
.entry-body-section,
.entry-main .content-section {
  display: grid;
  grid-template-columns: 1fr 240px;
  grid-template-areas: "deco aside" "prose aside";
  gap: var(--gap-md);
  padding: 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.entry-body-section .content-deco,
.entry-main .content-section .content-deco { grid-area: deco; }
.entry-body-section .content-aside,
.entry-main .content-section .content-aside { grid-area: aside; }
.entry-body-section .prose-wrap,
.entry-main .content-section .prose-wrap { grid-area: prose; max-width: 100%; }

/* ===== PROSE STYLES ===== */
.prose-wrap h2 { font-size: 1.4rem; font-weight: 700; color: var(--c-text); margin: 1.5em 0 0.5em; }
.prose-wrap h3 { font-size: 1.15rem; font-weight: 600; color: var(--c-text); margin: 1.2em 0 0.4em; }
.prose-wrap p { margin-bottom: 1em; }
.prose-wrap ul, .prose-wrap ol { padding-left: 1.5em; margin-bottom: 1em; }
.prose-wrap li { margin-bottom: 0.4em; }
.prose-wrap a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 3px; }
.prose-wrap a:hover { color: var(--c-neon); }
.prose-wrap strong { color: #fff; font-weight: 700; }
.prose-wrap blockquote {
  border-left: 3px solid var(--c-primary);
  padding-left: 1em;
  color: var(--c-text-muted);
  font-style: italic;
  margin: 1.2em 0;
}

/* ===== ASIDE NAV ===== */
.content-aside h2 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--c-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 8px;
}

.content-aside h2:first-child { margin-top: 0; }

.aside-section-h2 {
  margin-top: 32px !important;
}

.content-aside .subtitle {
  font-size: 0.78rem;
  color: var(--c-text-faint);
  margin-bottom: 8px;
}

.aside-nav,
.content-aside nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aside-link {
  display: block;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  line-height: 1.5;
  display: flex;
  align-items: center;
}

.aside-link:hover {
  background: var(--c-surface-hover);
  color: var(--c-accent);
  border-color: var(--c-accent);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  min-height: 32px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  border: 1.5px solid var(--c-accent);
  color: var(--c-accent);
  background: rgba(191,0,255,0.08);
  margin: 3px 3px 0 0;
  transition: background var(--transition), color var(--transition);
}

.tag-chip:hover {
  background: var(--c-accent);
  color: #fff;
}

.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.related-link {
  display: block;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  transition: background var(--transition), color var(--transition);
  line-height: 1.5;
  display: flex;
  align-items: center;
}

.related-link:hover { background: var(--c-surface-hover); color: var(--c-accent); }

/* ===== SUBTITLE ===== */
.subtitle,
p.subtitle,
p.subhead,
p.desc,
p.lead {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  margin-top: 4px;
  margin-bottom: 20px;
  line-height: 1.65;
}

/* ===== CATEGORY SECTION ===== */
.category-section {
  padding: 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.category-section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.cat-card {
  display: inline-flex;
  flex-direction: column;
  overflow: hidden;
}

.cat-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 12px;
  text-align: center;
}

.cat-fig { width: 100%; aspect-ratio: 3/2; overflow: hidden; border-radius: 8px; }
.cat-thumb { width: 100%; height: 100%; object-fit: cover; }
.cat-label { font-size: 0.9rem; font-weight: 700; color: var(--c-text); }

/* ===== CARDS SECTION ===== */
.cards-section {
  padding: 0 48px 64px;
  max-width: 1400px;
  margin: 0 auto;
}

.cards-section h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 6px;
}

/* ===== GLASS CARD ===== */
.glass-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
  opacity: 0;
  transform: translateY(24px);
  animation: revealCard 0.5s ease forwards;
}

.glass-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 48px rgba(101,20,255,0.3);
  border-color: var(--c-primary);
}

@keyframes revealCard {
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger children */
.glass-card:nth-child(1) { animation-delay: 0.05s; }
.glass-card:nth-child(2) { animation-delay: 0.10s; }
.glass-card:nth-child(3) { animation-delay: 0.15s; }
.glass-card:nth-child(4) { animation-delay: 0.20s; }
.glass-card:nth-child(5) { animation-delay: 0.25s; }
.glass-card:nth-child(6) { animation-delay: 0.30s; }
.glass-card:nth-child(7) { animation-delay: 0.35s; }
.glass-card:nth-child(8) { animation-delay: 0.40s; }

.card-link { display: flex; flex-direction: column; height: 100%; }

.card-fig {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--c-dark2);
}

.card-thumb { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.glass-card:hover .card-thumb { transform: scale(1.05); }

.card-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.06em;
}

.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--c-text); line-height: 1.4; }
.card-desc { font-size: 0.82rem; color: var(--c-text-muted); line-height: 1.55; flex: 1; }

/* GRID for cards */
.category-section,
.cards-section {
  display: block;
}

.category-section > .cat-card,
.cards-section > .glass-card.entry-card {
  display: inline-block;
}

/* Override: use grid for the inner articles */
.category-section {
  display: flex;
  flex-direction: column;
}

.category-section > h2,
.category-section > p.subtitle { display: block; }

/* Grid layout for cat-cards and entry-cards */
.cards-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.cards-section > h2,
.cards-section > p.subtitle { grid-column: 1 / -1; }

.category-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.category-section > h2,
.category-section > p.subtitle { grid-column: 1 / -1; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--c-dark2);
  border-top: 1px solid var(--c-border);
  padding: 24px 48px;
  text-align: center;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}

.footer-copy a {
  color: var(--c-primary);
  transition: color var(--transition);
}

.footer-copy a:hover { color: var(--c-accent); }

.footer-note {
  display: block;
  font-size: 0.72rem;
  color: var(--c-text-faint);
  margin-bottom: 12px;
}

/* Footer nav dl */
.footer-dl {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin-top: 8px;
}

.footer-dl dt { display: inline; }

.footer-dl dt a {
  font-size: 0.75rem;
  color: var(--c-text-faint);
  padding: 4px 6px;
  border-radius: 4px;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.footer-dl dt a:hover { color: var(--c-accent); }

/* ===== SECTION H2 HEADINGS ===== */
.category-section h2,
.cards-section h2,
.content-section h2,
.entry-body-section h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1.25;
}

/* ===== SCROLL REVEAL via IntersectionObserver (JS-based, CSS class) ===== */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  body::before { animation: none; }
  .deco-ring { animation: none; }
  .glass-card { animation: none; opacity: 1; transform: none; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-section,
  .page-hero,
  .cat-hero,
  .tag-hero,
  .about-hero,
  .privacy-hero,
  .entry-hero-section {
    grid-template-columns: 1fr;
    padding: 48px 32px;
    min-height: auto;
  }

  .hero-aside { align-items: flex-start; text-align: left; }
  .hero-badge-row { justify-content: flex-start; }
  .hero-figure { min-height: 240px; }
  .cat-hero-fig, .tag-hero-fig, .about-hero-fig, .privacy-hero-fig, .default-hero-fig, .entry-hero-fig { display: none; }

  .content-section,
  .entry-body-section,
  .entry-main .content-section {
    grid-template-columns: 1fr;
    grid-template-areas: "aside" "deco" "prose";
    padding: 32px;
  }

  .content-deco { display: none; }
}

@media (max-width: 768px) {
  .top-nav { padding: 8px 16px; gap: 8px; }
  .pill-nav { gap: 6px; }
  .pill-btn { padding: 7px 12px; font-size: 0.75rem; }

  .hero-section,
  .page-hero,
  .cat-hero,
  .tag-hero,
  .about-hero,
  .privacy-hero,
  .entry-hero-section {
    padding: 32px 20px;
  }

  .content-section,
  .entry-body-section,
  .entry-main .content-section {
    padding: 24px 20px;
  }

  .category-section,
  .cards-section { padding: 24px 20px; }

  .cards-section { grid-template-columns: 1fr 1fr; gap: 16px; }
  .category-section { grid-template-columns: 1fr 1fr; gap: 14px; }

  .site-footer { padding: 20px; }
}

@media (max-width: 480px) {
  .cards-section { grid-template-columns: 1fr; }
  .category-section { grid-template-columns: 1fr 1fr; }
  .pill-nav { display: none; }

  .hero-h1 { font-size: 1.75rem; }
  .page-h1, .entry-h1 { font-size: 1.5rem; }
  .hero-lead { font-size: 0.9rem; }
}
