/* ==========================================================================
   ReadVeylo — Design System & Editorial Stylesheet
   Independent Publication on AI, Productivity, and AI-Powered Studying
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens & CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette — Refined Editorial & Minimalist */
  --bg-page: #faf9f6;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f1ec;
  --bg-subtle-hover: #ece9e2;
  
  --text-main: #121418;
  --text-secondary: #4b5262;
  --text-muted: #737b8d;
  --text-inverse: #ffffff;
  
  /* Restrained Single Accent Color — Editorial Deep Ink Cobalt */
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;

  /* Editorial Borders & Dividers */
  --border-subtle: #e7e5df;
  --border-strong: #cecbc2;
  --border-focus: #1d4ed8;

  /* Typography Stacks */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Charter", "Bitstream Charter", "Georgia", "Cambria", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Spacing Scale */
  --space-xxs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --space-4xl: 6rem;

  /* Layout Max Widths */
  --container-max: 1160px;
  --article-max: 720px;
  --header-height: 64px;

  /* Subtle Shadows & Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-subtle: 0 1px 3px rgba(18, 20, 24, 0.05);
  --shadow-card: 0 4px 16px -2px rgba(18, 20, 24, 0.06), 0 1px 3px rgba(18, 20, 24, 0.03);
  --shadow-elevated: 0 12px 28px -4px rgba(18, 20, 24, 0.08), 0 2px 6px rgba(18, 20, 24, 0.04);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  background: var(--text-main);
  color: var(--text-inverse);
  padding: var(--space-sm) var(--space-md);
  z-index: 1000;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
}

/* Screen reader utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus States */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

p {
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   Layout Containers & Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

.container-narrow {
  max-width: var(--article-max);
}

.site-main {
  flex: 1 0 auto;
}

.section {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid var(--border-subtle);
}

.section:last-of-type {
  border-bottom: none;
}

/* Eyebrow Label */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.eyebrow-muted {
  color: var(--text-muted);
}

/* Section Header */
.section-header {
  margin-bottom: var(--space-2xl);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.section-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.025em;
}

.section-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform var(--transition-fast);
}

.section-link:hover {
  color: var(--accent-hover);
  transform: translateX(3px);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.badge-featured {
  background: var(--text-main);
  color: var(--text-inverse);
  border-color: var(--text-main);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 550;
  padding: 0.6875rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-primary {
  background-color: var(--text-main);
  color: var(--text-inverse);
  border-color: var(--text-main);
}

.btn-primary:hover {
  background-color: #272c35;
  border-color: #272c35;
  color: var(--text-inverse);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  border-color: var(--text-main);
  transform: translateY(-1px);
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.45rem 0.875rem;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-subtle);
  border-color: var(--border-strong);
}

.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

/* Brand Logo + Wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.brand-icon {
  width: 26px;
  height: 26px;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand-wordmark {
  letter-spacing: -0.04em;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text-main);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background-color: var(--accent);
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Mobile Hamburger Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  padding: var(--space-xs);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.mobile-nav-toggle:focus-visible {
  outline: 2px solid var(--border-focus);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  margin: 4px 0;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Mobile Nav Drawer */
.mobile-nav-overlay {
  display: none;
}

@media (max-width: 820px) {
  .mobile-nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-xl);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    box-shadow: var(--shadow-card);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 99;
  }

  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    font-size: 1.125rem;
    padding: var(--space-xs) 0;
    width: 100%;
  }

  .mobile-nav-overlay {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 98;
  }

  .mobile-nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Hamburger Active Animation */
  .mobile-nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .mobile-nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  .mobile-nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  padding-top: var(--space-4xl);
  padding-bottom: var(--space-4xl);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero-content {
  max-width: 580px;
}

.hero-headline {
  font-size: clamp(2.25rem, 4.5vw, 3.4rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: var(--space-lg);
  color: var(--text-main);
}

.hero-description {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-xl);
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.hero-topics {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hero-topics span {
  display: inline-block;
}

.hero-topics .bullet {
  color: var(--border-strong);
}

/* Hero Abstract Visual (Original CSS/SVG, editorial workflow aesthetic) */
.hero-visual-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin-left: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Subtle background architectural blueprint grid */
.hero-visual-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Floating editorial workflow cards */
.editorial-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-subtle);
  transition: transform var(--transition-normal);
  z-index: 2;
}

.editorial-card-1 {
  align-self: flex-start;
  width: 82%;
  animation: floatCard1 8s ease-in-out infinite alternate;
}

.editorial-card-2 {
  align-self: flex-end;
  width: 86%;
  animation: floatCard2 9s ease-in-out infinite alternate;
}

.editorial-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.card-tag {
  font-size: 0.6875rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.card-timestamp {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.card-title-mock {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: var(--space-xs);
}

.card-skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.skeleton-line {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
}

.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-90 { width: 90%; }

/* Ambient watermark mark */
.visual-watermark {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 220px;
  height: 220px;
  opacity: 0.035;
  color: var(--text-main);
  pointer-events: none;
}

@keyframes floatCard1 {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}

@keyframes floatCard2 {
  0% { transform: translateY(0px); }
  100% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .editorial-card-1, .editorial-card-2 {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Featured Article Section
   -------------------------------------------------------------------------- */
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.featured-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-elevated);
}

.featured-content {
  padding: clamp(var(--space-xl), 4vw, var(--space-3xl));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.featured-title {
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text-main);
}

.featured-title a:hover {
  color: var(--accent);
}

.featured-description {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

.featured-cta {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform var(--transition-fast);
}

.featured-card:hover .featured-cta {
  transform: translateX(4px);
}

/* Featured Visual Area */
.featured-visual {
  background: var(--bg-subtle);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.featured-art-frame {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 3;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.art-node-graph {
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Latest Articles Section
   -------------------------------------------------------------------------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
  position: relative;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.article-card-meta {
  margin-bottom: var(--space-sm);
}

.article-card-title {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: var(--space-sm);
}

.article-card-title a {
  color: var(--text-main);
}

.article-card-title a:hover {
  color: var(--accent);
}

.article-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.article-card-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-lg);
  flex-grow: 1;
}

.article-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.article-card-cta {
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Coming Soon Card Slot */
.article-card-placeholder {
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  box-shadow: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
}

.article-card-placeholder:hover {
  transform: none;
  border-color: var(--text-muted);
  box-shadow: none;
}

.placeholder-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.placeholder-title {
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--text-main);
  margin-bottom: var(--space-xs);
}

.placeholder-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 240px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Explore By Topic
   -------------------------------------------------------------------------- */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.topic-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  position: relative;
}

.topic-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.topic-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.topic-card:hover .topic-icon {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}

.topic-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
  color: var(--text-main);
}

.topic-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-lg);
  flex-grow: 1;
}

.topic-cta {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.topic-cta::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* --------------------------------------------------------------------------
   Newsletter Section
   -------------------------------------------------------------------------- */
.newsletter-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-2xl), 5vw, var(--space-3xl));
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.newsletter-headline {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.newsletter-description {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.newsletter-input-group {
  display: flex;
  gap: var(--space-xs);
}

.newsletter-input {
  flex: 1;
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6875rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.newsletter-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.newsletter-message {
  font-size: 0.875rem;
  font-weight: 550;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  display: none;
}

.newsletter-message.is-success {
  display: block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.newsletter-message.is-error {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* --------------------------------------------------------------------------
   Creator Section
   -------------------------------------------------------------------------- */
.creator-section {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.creator-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}

.creator-text-block {
  max-width: 680px;
}

.creator-heading {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-xs);
}

.creator-bio {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
  flex-wrap: wrap;
}

.footer-brand-col {
  max-width: 320px;
}

.footer-brand-col .brand {
  margin-bottom: var(--space-sm);
}

.footer-tagline {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.footer-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.footer-nav-col {
  display: flex;
  gap: var(--space-3xl);
  flex-wrap: wrap;
}

.footer-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-main);
  margin-bottom: var(--space-md);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-link {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-main);
}

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Article Page Template Styles
   -------------------------------------------------------------------------- */
.article-header {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.article-header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.article-title {
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin-bottom: var(--space-md);
}

.article-lead {
  font-size: clamp(1.125rem, 1.6vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

.article-byline {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.875rem;
}

.byline-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-main);
}

.byline-info {
  display: flex;
  flex-direction: column;
}

.byline-name {
  font-weight: 600;
  color: var(--text-main);
}

.byline-date {
  color: var(--text-muted);
}

/* Article Body Typography & Components */
.article-body {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  font-size: 1.125rem;
  line-height: 1.75;
  color: #272a31;
}

.article-body p {
  margin-bottom: 1.5rem;
  color: #272a31;
}

.article-body h2 {
  font-size: 1.75rem;
  letter-spacing: -0.025em;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
}

.article-body h3 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  margin-bottom: 0.5rem;
  color: #272a31;
}

.article-body blockquote {
  margin: 2.25rem 0;
  padding: var(--space-md) var(--space-xl);
  border-left: 3px solid var(--text-main);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--text-main);
}

.article-body blockquote cite {
  display: block;
  margin-top: var(--space-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-style: normal;
  color: var(--text-muted);
}

.article-body figure {
  margin: 2.5rem 0;
}

.figure-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: var(--space-sm);
  padding: var(--space-lg);
  text-align: center;
}

figcaption {
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* Code Blocks & Inline Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  color: var(--accent);
  padding: 0.15em 0.35em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

pre {
  background: #181a1f;
  color: #abb2bf;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid #282c34;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

/* Article Images */
.article-body img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  margin: 2rem 0;
  display: block;
}

/* Styled Editorial Table */
.table-wrapper {
  margin: 2.5rem 0;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
}

th, td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background: var(--bg-subtle);
  font-weight: 650;
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

/* Inline Placeholder Banner */
.placeholder-callout {
  background: #fdf8e6;
  border: 1px solid #f6e05e;
  border-left: 4px solid #d69e2e;
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-lg);
  margin: 2rem 0;
  font-size: 0.9375rem;
  color: #744210;
}

.placeholder-callout strong {
  display: block;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2.75rem 0;
}

.article-body strong {
  color: var(--text-main);
  font-weight: 650;
}

/* Editorial Prompt Callout Card */
.prompt-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-left: 3.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.4rem;
  margin: 1.75rem 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-main);
  box-shadow: var(--shadow-subtle);
}

.prompt-card .prompt-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* Workflow Stage Loop Box */
.workflow-loop {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.75rem 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  box-shadow: var(--shadow-subtle);
}

/* Custom UI Callout Anchors */
.callout {
  padding: 1.2rem 1.4rem;
  margin: 1.85rem 0;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  line-height: 1.6;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
}

.callout-info {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #1d4ed8;
  color: #1e3a8a;
}
.callout-info .callout-title {
  color: #1d4ed8;
}

.callout-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  color: #78350f;
}
.callout-warning .callout-title {
  color: #b45309;
}

.callout-tip {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  color: #14532d;
}
.callout-tip .callout-title {
  color: #15803d;
}

.callout-receipt {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-left: 4px solid #7c3aed;
  color: #3b0764;
}
.callout-receipt .callout-title {
  color: #6d28d9;
}

/* Quick-Start Cheat Sheet Card */
.quick-start-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-card);
}

.quick-start-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  background: var(--text-main);
  color: #ffffff;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
}

.quick-start-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.quick-start-list {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0.5rem 0 0 0 !important;
}

.quick-start-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #272a31;
}

.quick-start-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
}

/* Metric Receipt Grid */
.receipt-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1rem 0 0.5rem 0;
}

.metric-pill {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  text-align: center;
}

.metric-val {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.metric-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* Article Related Section */
.article-related {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

/* --------------------------------------------------------------------------
   Standard Content Pages (About, Contact, Topics, Legal)
   -------------------------------------------------------------------------- */
.page-header {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border-subtle);
}

.page-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-sm);
}

.page-intro {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 680px;
}

/* About / Creator Profile Layout */
.creator-profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin-top: var(--space-2xl);
  box-shadow: var(--shadow-card);
}

.creator-profile-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-2xl);
  align-items: flex-start;
}

.creator-avatar-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-md);
}

.profile-meta-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.profile-meta-item h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.profile-meta-item p {
  font-size: 0.9375rem;
  color: var(--text-main);
  font-weight: 500;
}

/* Forms (Contact Page) */
.contact-form-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-xl), 4vw, var(--space-3xl));
  box-shadow: var(--shadow-card);
  max-width: 640px;
  margin: var(--space-2xl) auto 0;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6875rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.form-error-feedback {
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.3rem;
  display: none;
}

.form-group.has-error .form-error-feedback {
  display: block;
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea {
  border-color: #dc2626;
}

.form-status-alert {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  margin-bottom: var(--space-lg);
  display: none;
}

.form-status-alert.is-success {
  display: block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Legal Pages (Privacy & Terms) */
.legal-content {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-3xl);
  font-size: 1rem;
  line-height: 1.7;
}

.legal-content h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.legal-content p {
  margin-bottom: 1.25rem;
}

.legal-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.legal-content li {
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.notice-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-xl);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .hero-visual-wrapper {
    margin-left: 0;
    max-width: 100%;
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-visual {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-xl);
  }

  .articles-grid,
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .newsletter-box {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .creator-profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .articles-grid,
  .topics-grid {
    grid-template-columns: 1fr;
  }

  .newsletter-input-group {
    flex-direction: column;
  }

  .footer-top {
    flex-direction: column;
    gap: var(--space-xl);
  }

  .footer-nav-col {
    gap: var(--space-2xl);
    width: 100%;
    justify-content: space-between;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-ctas .btn {
    width: 100%;
  }
}


/* ==========================================================================
   ReadVeylo Cosmic Portal Mode & Work Workspace
   Learn vs. Work Dual Portal + Starfield Galaxy Engine
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Mode Switcher (Header Segmented Control)
   -------------------------------------------------------------------------- */
.portal-nav-toggle-wrap {
  display: flex;
  align-items: center;
  margin-left: var(--space-md);
  margin-right: var(--space-md);
}

.portal-nav-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  position: relative;
  transition: all var(--transition-normal);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.portal-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  position: relative;
  line-height: 1;
}

.portal-tab:hover {
  color: var(--text-main);
}

.portal-tab.is-active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.12);
}

.portal-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}

.portal-tab-icon.cosmic-sparkle {
  color: #8b5cf6;
  animation: cosmicPulse 3s ease-in-out infinite;
}

.portal-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  display: inline-block;
  margin-left: 2px;
}

@keyframes cosmicPulse {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.4));
  }
  50% {
    transform: scale(1.15) rotate(12deg);
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.8));
  }
}

/* --------------------------------------------------------------------------
   2. Dark Cosmic Header Transformations when Work Mode is Active
   -------------------------------------------------------------------------- */
body.mode-work-active {
  background-color: #03050c;
  color: #f1f5f9;
}

body.mode-work-active .site-header {
  background: rgba(3, 5, 12, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

body.mode-work-active .brand-wordmark {
  color: #ffffff;
}

body.mode-work-active .brand-icon path:first-child {
  fill: #a78bfa;
}

body.mode-work-active .nav-link {
  color: #94a3b8;
}

body.mode-work-active .nav-link:hover,
body.mode-work-active .nav-link.is-active {
  color: #ffffff;
}

body.mode-work-active .portal-nav-tabs {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}

body.mode-work-active .portal-tab {
  color: #94a3b8;
}

body.mode-work-active .portal-tab:hover {
  color: #f8fafc;
}

body.mode-work-active .portal-tab.is-active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(59, 130, 246, 0.25));
  color: #ffffff;
  border: 1px solid rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

body.mode-work-active .site-footer {
  background: #02040a;
  border-top: 1px solid rgba(139, 92, 246, 0.18);
  color: #94a3b8;
}

body.mode-work-active .site-footer .footer-tagline,
body.mode-work-active .site-footer .footer-group-title {
  color: #e2e8f0;
}

body.mode-work-active .site-footer .footer-link {
  color: #94a3b8;
}

body.mode-work-active .site-footer .footer-link:hover {
  color: #a78bfa;
}

/* --------------------------------------------------------------------------
   3. Portal Views Management
   -------------------------------------------------------------------------- */
.portal-view {
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-view[hidden] {
  display: none !important;
}

.portal-view-learn {
  opacity: 1;
  transform: translateY(0);
}

.portal-view-work {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  padding-bottom: var(--space-4xl);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   4. Galaxy Starfield Canvas
   -------------------------------------------------------------------------- */
.galaxy-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 0;
}

.work-workspace-inner {
  position: relative;
  z-index: 1;
  padding-top: var(--space-2xl);
}

/* --------------------------------------------------------------------------
   5. Work Workspace Hero & Metric Strip
   -------------------------------------------------------------------------- */
.work-hero {
  text-align: center;
  max-width: 820px;
  margin: 0 auto var(--space-3xl) auto;
  padding: 0 var(--space-md);
}

.cosmic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: var(--radius-full);
  color: #c4b5fd;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.15);
}

.cosmic-badge-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulseLight 2s infinite;
}

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

.work-headline {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: #ffffff;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, #ffffff 30%, #c4b5fd 75%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.work-subhead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 680px;
  margin: 0 auto var(--space-lg) auto;
}

.work-metrics-strip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.625rem 1.25rem;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #cbd5e1;
  flex-wrap: wrap;
}

.work-metric-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.work-metric-item strong {
  color: #38bdf8;
}

.work-metric-sep {
  color: rgba(148, 163, 184, 0.35);
}

/* --------------------------------------------------------------------------
   6. Cosmic Carousels / Sliders ("AI Skills" and "Tools")
   -------------------------------------------------------------------------- */
.cosmic-carousel-section {
  margin-bottom: var(--space-4xl);
}

.cosmic-carousel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
  flex-wrap: wrap;
}

.carousel-title-group {
  max-width: 640px;
}

.cosmic-section-heading {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cosmic-section-sub {
  font-size: 0.9375rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.carousel-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-arrow:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.35);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

.carousel-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

/* Scroller Container */
.cosmic-scroller {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.75rem 0.25rem 1.75rem 0.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cosmic-scroller::-webkit-scrollbar {
  display: none;
}

/* Individual Cosmic Card */
.cosmic-card {
  flex: 0 0 calc(33.333% - 1rem);
  min-width: 310px;
  max-width: 380px;
  scroll-snap-align: start;
  background: rgba(13, 17, 30, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.cosmic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.8), rgba(56, 189, 248, 0.8), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cosmic-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 24px rgba(139, 92, 246, 0.25);
}

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

/* Card Header */
.cosmic-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.cosmic-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
}

.cosmic-metric-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.cosmic-metric-chip .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Card Body */
.cosmic-card-title {
  font-size: 1.25rem;
  font-weight: 750;
  color: #ffffff;
  margin-bottom: 0.625rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  transition: color var(--transition-fast);
}

.cosmic-card:hover .cosmic-card-title {
  color: #38bdf8;
}

.cosmic-card-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #94a3b8;
  margin-bottom: 1.25rem;
}

/* Tech Badges List */
.cosmic-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1.5rem;
}

.cosmic-tech-pill {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

/* Card Action Footer */
.cosmic-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.cosmic-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #38bdf8;
  transition: gap var(--transition-fast), color var(--transition-fast);
}

.cosmic-card:hover .cosmic-action-btn {
  color: #7dd3fc;
  gap: 0.65rem;
}

.cosmic-action-arrow {
  transition: transform var(--transition-fast);
}

.cosmic-card:hover .cosmic-action-arrow {
  transform: translateX(3px);
}

/* Carousel Scroll Indicator Track */
.carousel-indicator-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.carousel-progress-track {
  width: 160px;
  height: 4px;
  background: rgba(30, 41, 59, 0.7);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.carousel-progress-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, #8b5cf6, #38bdf8);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  transition: left 0.1s linear, width 0.2s ease;
}

/* --------------------------------------------------------------------------
   7. Modern Web Guidance Compliant Carousel Slide Animation
   -------------------------------------------------------------------------- */
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  .cosmic-card {
    animation: cosmicSlideEntry auto linear both;
    animation-timeline: view(inline);
  }
}

@keyframes cosmicSlideEntry {
  0% {
    opacity: 0.7;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

/* --------------------------------------------------------------------------
   8. Actual Tool Pages Dark Galaxy Styling (Zero Placeholders)
   -------------------------------------------------------------------------- */
.tool-galaxy-body {
  background-color: #03050c;
  color: #f1f5f9;
  min-height: 100vh;
  position: relative;
}

.tool-galaxy-body .site-header {
  background: rgba(3, 5, 12, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.25);
}

.tool-galaxy-body .brand-wordmark {
  color: #ffffff;
}

.tool-galaxy-body .brand-icon path:first-child {
  fill: #a78bfa;
}

.tool-galaxy-body .nav-link {
  color: #94a3b8;
}

.tool-galaxy-body .nav-link:hover {
  color: #ffffff;
}

.tool-canvas-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.tool-page-main {
  position: relative;
  z-index: 1;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-4xl);
}

.tool-header-card {
  background: rgba(13, 17, 30, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: var(--space-xl);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.15);
}

.tool-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tool-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #a78bfa;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.tool-back-link:hover {
  color: #38bdf8;
  transform: translateX(-3px);
}

/* Pure Galaxy Destination View (Zero Placeholders) */
.pure-galaxy-main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: flex-start;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.pure-galaxy-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.pure-galaxy-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 650;
  color: #c4b5fd;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-full);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 16px rgba(139, 92, 246, 0.2);
  transition: all var(--transition-fast);
}

.pure-galaxy-back-btn:hover {
  color: #ffffff;
  background: rgba(139, 92, 246, 0.35);
  border-color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.45);
  transform: translateX(-3px);
}

.tool-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.tool-desc {
  font-size: 1rem;
  color: #94a3b8;
  line-height: 1.6;
  max-width: 720px;
}

/* Tool Interactive Stage Card */
.tool-stage-card {
  background: rgba(13, 17, 30, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.12);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   9. Responsive Rules & Prefers-Reduced-Motion
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .cosmic-card {
    flex: 0 0 calc(50% - 0.75rem);
    min-width: 290px;
  }
}

@media (max-width: 768px) {
  .portal-nav-toggle-wrap {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  .portal-tab {
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
  }

  .cosmic-card {
    flex: 0 0 85%;
    min-width: 270px;
  }

  .work-headline {
    font-size: 2.1rem;
  }

  .work-metrics-strip {
    font-size: 0.75rem;
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cosmic-card {
    animation: none !important;
  }
  .portal-tab-icon.cosmic-sparkle,
  .cosmic-badge-pulse {
    animation: none !important;
  }
  .galaxy-canvas,
  .tool-canvas-bg {
    display: none !important;
  }
  body.mode-work-active,
  .tool-galaxy-body {
    background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #03050c 80%) !important;
  }
}


/* --------------------------------------------------------------------------
   10. Work Sub-Navigation (AI Skills vs. Tools Separation) & Rich Micro-Visuals
   -------------------------------------------------------------------------- */
.work-mode-switcher-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-2xl);
  padding: 0 var(--space-md);
}

.work-mode-tabs {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 16px rgba(139, 92, 246, 0.2);
  max-width: 100%;
  overflow-x: auto;
}

.work-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 650;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.work-mode-tab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.work-mode-tab.is-active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(56, 189, 248, 0.25));
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
}

.work-tab-sparkle {
  color: #38bdf8;
  font-size: 0.95rem;
}

.work-tab-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.work-subview {
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-subview[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   11. Highly Explainable Card Micro-Diagrams & Structure
   -------------------------------------------------------------------------- */
.cosmic-card {
  min-height: 490px;
}

.cosmic-card-preview {
  background: rgba(8, 12, 22, 0.92);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  margin-bottom: 1.15rem;
  position: relative;
  overflow: hidden;
}

.cosmic-card-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.7), transparent);
}

.micro-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: #cbd5e1;
}

.micro-node {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.22rem 0.45rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.micro-node.accent {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(167, 139, 250, 0.45);
  color: #c4b5fd;
}

.micro-node.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.micro-arrow {
  color: rgba(148, 163, 184, 0.45);
  font-size: 0.75rem;
}

.cosmic-steps-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: #94a3b8;
  flex-wrap: wrap;
}

.cosmic-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.cosmic-step-num {
  color: #a78bfa;
  font-weight: 700;
}

.cosmic-card-outcome {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 1rem;
  background: rgba(139, 92, 246, 0.08);
  border-left: 2px solid #8b5cf6;
  padding: 0.45rem 0.65rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.cosmic-card-outcome strong {
  color: #ffffff;
}

.cosmic-action-btn-styled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cosmic-action-btn-styled:hover {
  background: linear-gradient(135deg, #7c3aed, #0284c7);
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
  color: #ffffff;
}


/* ==========================================================================
   Light & Dark Theme Engine (Clean & High UX Fidelity)
   ========================================================================== */

/* Dark Theme Variables */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #0b0f17;
  --bg-surface: #111827;
  --bg-subtle: #1a2234;
  --bg-subtle-hover: #222d42;
  
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0b0f17;
  
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --accent-border: rgba(59, 130, 246, 0.35);

  --border-subtle: #1e293b;
  --border-strong: #334155;
  --border-focus: #60a5fa;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 12px 28px -4px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-page: #0b0f17;
    --bg-surface: #111827;
    --bg-subtle: #1a2234;
    --bg-subtle-hover: #222d42;
    
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0b0f17;
    
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-soft: rgba(59, 130, 246, 0.15);
    --accent-border: rgba(59, 130, 246, 0.35);

    --border-subtle: #1e293b;
    --border-strong: #334155;
    --border-focus: #60a5fa;

    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-elevated: 0 12px 28px -4px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  }
}

/* Header Background in Dark Theme */
:root[data-theme="dark"] .site-header,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header {
    background-color: rgba(11, 15, 23, 0.92);
  }
}

/* Theme Toggle Button */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
  transform: scale(1.05);
}

.theme-icon-sun,
.theme-icon-moon {
  width: 17px;
  height: 17px;
}

/* Light theme shows moon (click to go dark) */
:root[data-theme="light"] .theme-icon-sun,
:root:not([data-theme="dark"]) .theme-icon-sun {
  display: none;
}
:root[data-theme="light"] .theme-icon-moon,
:root:not([data-theme="dark"]) .theme-icon-moon {
  display: block;
}

/* Dark theme shows sun (click to go light) */
:root[data-theme="dark"] .theme-icon-sun {
  display: block !important;
}
:root[data-theme="dark"] .theme-icon-moon {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-icon-moon {
    display: none;
  }
}

/* Mobile Nav Drawer in Dark Theme */
@media (max-width: 820px) {
  :root[data-theme="dark"] .nav-menu {
    background-color: var(--bg-surface);
    border-bottom-color: var(--border-subtle);
  }
}

/* ==========================================================================
   Skills Section (Curated AI Skills & Autonomous Workflows)
   ========================================================================== */
.skills-page-container {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-4xl);
}

.skills-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto var(--space-3xl);
}

.skills-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.skills-title {
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: var(--space-md);
}

.skills-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

.skills-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-subtle);
}

.skills-sep {
  color: var(--border-strong);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: var(--space-xl);
}

.skill-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-card);
}

.skill-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-elevated);
}

.skill-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.skill-metric-badge {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.skill-preview-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: var(--space-md);
}

.skill-flow-step {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.skill-flow-step.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 700;
}

.skill-flow-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: bold;
}

.skill-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: var(--space-xs);
}

.skill-card-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-lg);
  flex-grow: 1;
}

.skill-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: var(--space-lg);
}

.tag-pill {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.skill-card-footer {
  margin-top: auto;
}

.skill-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  text-decoration: none;
}


/* ==============================================================================
   Interactive Micro-Widget (Prompt Customizer)
   ============================================================================== */
.interactive-prompt-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
  box-shadow: var(--shadow-card);
}

.interactive-prompt-widget header {
  margin-bottom: var(--space-md);
}

.interactive-prompt-widget .widget-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.interactive-prompt-widget .widget-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--text-main);
}

.interactive-prompt-widget .widget-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.interactive-prompt-widget .widget-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.interactive-prompt-widget label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.interactive-prompt-widget select,
.interactive-prompt-widget input[type="text"],
.interactive-prompt-widget textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}

.interactive-prompt-widget select:focus,
.interactive-prompt-widget input[type="text"]:focus,
.interactive-prompt-widget textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.interactive-prompt-widget .widget-preview-box {
  margin-top: var(--space-sm);
}

.interactive-prompt-widget .widget-preview {
  position: relative;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--text-main);
  max-height: 220px;
  overflow-y: auto;
}

.interactive-prompt-widget .widget-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.interactive-prompt-widget .btn-copied {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.byline-author-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.byline-author-link:hover {
  color: var(--accent);
}
.byline-title {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.875em;
  margin-left: 0.25rem;
}
