/* ================================================
   K12 ANALYTICS ENGINEERING — GLOBAL STYLES
   Warm Editorial Design System
   ================================================ */

/* ================================================
   0. GOOGLE FONTS
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,700;0,9..144,900;1,9..144,300;1,9..144,400;1,9..144,700&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ================================================ */

:root {
  /* Breakpoints (reference - used in media queries) */
  /* sm: 667px, md: 800px, lg: 1024px */

  /* Warm editorial palette */
  --ed-cream:         #faf6f0;
  --ed-cream-dark:    #f2ebe0;
  --ed-sand:          #e8d9c4;
  --ed-sand-mid:      #d4bc9a;
  --ed-terracotta:    #c1623f;
  --ed-terracotta-lt: #d4815f;
  --ed-terracotta-dk: #9e4a2d;
  --ed-burgundy:      #6b2737;
  --ed-burgundy-lt:   #8a3347;
  --ed-sage:          #5a7a5e;
  --ed-sage-lt:       #7a9e7e;
  --ed-sage-pale:     #c8d9c4;
  --ed-ink:           #1e1612;
  --ed-ink-mid:       #3d2e24;
  --ed-ink-soft:      #5c4a3a;
  --ed-warm-gray:     #8a7d70;

  /* Editorial type scale */
  --ed-font-serif:    'Fraunces', 'Playfair Display', Georgia, serif;
  --ed-font-sans:     'DM Sans', system-ui, sans-serif;

  /* Grain texture intensity */
  --ed-grain-opacity: 0.035;

  /* Typography */
  --font-primary: var(--ed-font-sans);
  --font-accessible: Arial, Verdana, sans-serif;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(30, 22, 18, 0.05);
  --shadow-md: 0 4px 6px rgba(30, 22, 18, 0.08);
  --shadow-lg: 0 10px 15px rgba(30, 22, 18, 0.08);
  --shadow-xl: 0 20px 25px rgba(30, 22, 18, 0.12);

  /* Layout */
  --max-width-content: 56rem;
  --max-width-container: 80rem;
  /* Animation */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 500ms ease;

  /* Semantic color mapping — Light Theme */
  --background: var(--ed-cream);
  --foreground: var(--ed-ink);
  --primary: var(--ed-terracotta);
  --primary-foreground: var(--ed-cream);
  --secondary: var(--ed-cream-dark);
  --secondary-foreground: var(--ed-ink-soft);
  --muted: var(--ed-cream-dark);
  --muted-foreground: var(--ed-ink-soft);
  --accent: var(--ed-sand);
  --accent-foreground: var(--ed-ink);
  --destructive: #b91c1c;
  --border: var(--ed-sand);
  --input: var(--ed-sand);
  --ring: var(--ed-terracotta);
  --popover: var(--ed-cream);
  --popover-foreground: var(--ed-ink);
  --card: var(--ed-cream);
  --card-foreground: var(--ed-ink);
  --brand-accent: var(--ed-sage);
}

/* Dark Theme */
[data-theme="dark"] {
  --ed-grain-opacity: 0.02;

  --background: var(--ed-ink);
  --foreground: var(--ed-cream);
  --primary: var(--ed-terracotta-lt);
  --primary-foreground: var(--ed-ink);
  --secondary: var(--ed-ink-mid);
  --secondary-foreground: var(--ed-cream-dark);
  --muted: var(--ed-ink-mid);
  --muted-foreground: var(--ed-warm-gray);
  --accent: #4d3a2c;
  --accent-foreground: var(--ed-cream);
  --destructive: #dc2626;
  --border: #4d3a2c;
  --input: #4d3a2c;
  --ring: var(--ed-terracotta-lt);
  --popover: var(--ed-ink-mid);
  --popover-foreground: var(--ed-cream);
  --card: var(--ed-ink-mid);
  --card-foreground: var(--ed-cream);
  --brand-accent: var(--ed-sage-lt);
}

/* ================================================
   2. CSS RESET & BASE STYLES
   ================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--foreground);
  background: var(--background);
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: var(--ed-grain-opacity);
  mix-blend-mode: multiply;
}

/* Push all real content above the grain layer */
.app-container,
#footer-container {
  position: relative;
  z-index: 1;
}

/* App container for accessibility font sizing */
.app-container {
  font-size: 1rem;
  flex: 1;
}

/* Accessibility font style */
.accessible-font {
  --ed-font-serif: var(--font-accessible);
  --ed-font-sans: var(--font-accessible);
}

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

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

/* ================================================
   3. TYPOGRAPHY
   ================================================ */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1rem 0;
}

p:last-child {
  margin-bottom: 0;
}

/* ================================================
   4. LAYOUT UTILITIES
   ================================================ */

.container {
  max-width: var(--max-width-container);
  margin: 0 auto;
  padding: 0 2rem;
}

.content-width {
  max-width: var(--max-width-content);
  margin: 0 auto;
}

.section {
  padding: var(--spacing-3xl) 0;
}

.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;
}

/* ================================================
   5. FOOTER
   ================================================ */

.footer {
  margin-top: auto;
  padding: var(--spacing-xl) 0;
  border-top: 1px solid var(--ed-sand);
  background: var(--ed-cream);
}

[data-theme="dark"] .footer {
  background: var(--ed-ink);
  border-top-color: #3d2e24;
}

.footer__container {
  max-width: var(--max-width-container);
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
  margin-bottom: 1rem;
}

.footer__link {
  font-size: 0.875rem;
  color: var(--ed-warm-gray);
  transition: color var(--transition-base);
}

.footer__link:hover {
  color: var(--ed-ink);
}

[data-theme="dark"] .footer__link:hover {
  color: var(--ed-cream);
}

.footer__copyright {
  font-size: 0.875rem;
  color: var(--ed-warm-gray);
}

/* ================================================
   8. BUTTONS — Legacy .btn system
   ================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn--primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn--secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--accent);
}

.btn--outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}

.btn--outline:hover:not(:disabled) {
  background: var(--accent);
}

.btn--ghost {
  background: transparent;
  color: var(--foreground);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--accent);
}

.btn--icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
}

.btn--lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* ================================================
   8b. EDITORIAL BUTTONS
   ================================================ */

.ed-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.875rem;
  font-family: var(--ed-font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  background: var(--ed-ink);
  color: var(--ed-cream);
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.22s ease, transform 0.18s ease;
  border: none;
  cursor: pointer;
}

.ed-btn-primary:hover {
  background: var(--ed-terracotta-dk);
  transform: translateY(-1px);
}

.ed-btn-primary svg {
  transition: transform 0.18s ease;
}

.ed-btn-primary:hover svg {
  transform: translateX(3px);
}

[data-theme="dark"] .ed-btn-primary {
  background: var(--ed-cream);
  color: var(--ed-ink);
}

[data-theme="dark"] .ed-btn-primary:hover {
  background: var(--ed-terracotta-lt);
  color: var(--ed-cream);
}

.ed-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-family: var(--ed-font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ed-ink-soft);
  text-decoration: none;
  border-bottom: 1.5px solid var(--ed-sand-mid);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.ed-btn-ghost:hover {
  color: var(--ed-terracotta);
  border-color: var(--ed-terracotta);
}

[data-theme="dark"] .ed-btn-ghost {
  color: var(--ed-warm-gray);
  border-color: var(--ed-ink-soft);
}

[data-theme="dark"] .ed-btn-ghost:hover {
  color: var(--ed-terracotta-lt);
  border-color: var(--ed-terracotta-lt);
}

.ed-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.875rem;
  font-family: var(--ed-font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  background: transparent;
  color: var(--ed-ink);
  border: 1.5px solid var(--ed-sand-mid);
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.ed-btn-outline:hover {
  border-color: var(--ed-terracotta);
  color: var(--ed-terracotta-dk);
  background: rgba(193, 98, 63, 0.05);
}

[data-theme="dark"] .ed-btn-outline {
  color: var(--ed-cream);
  border-color: var(--ed-ink-soft);
}

[data-theme="dark"] .ed-btn-outline:hover {
  border-color: var(--ed-terracotta-lt);
  color: var(--ed-terracotta-lt);
}

/* ================================================
   9. CARDS
   ================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: var(--spacing-lg);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card--offering {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
}

.card__description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  transition: gap var(--transition-base);
}

.card__link:hover {
  gap: 0.75rem;
}

/* ================================================
   9b. EDITORIAL BENTO CARDS
   ================================================ */

.ed-bento-card {
  border-radius: 20px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.ed-bento-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(30, 22, 18, 0.12);
}

.ed-bento-card--cream {
  background: var(--ed-cream-dark);
  border: 1px solid var(--ed-sand);
}

.ed-bento-card--sand {
  background: var(--ed-sand);
  border: 1px solid var(--ed-sand-mid);
}

.ed-bento-card--ink {
  background: var(--ed-ink);
  border: 1px solid var(--ed-ink-mid);
  color: var(--ed-cream);
}

.ed-bento-card--terracotta {
  background: var(--ed-terracotta);
  border: 1px solid var(--ed-terracotta-dk);
  color: var(--ed-cream);
}

.ed-bento-card--sage {
  background: var(--ed-sage-pale);
  border: 1px solid #b0c8ab;
}

.ed-bento-card--burgundy {
  background: var(--ed-burgundy);
  border: 1px solid var(--ed-burgundy-lt);
  color: var(--ed-cream);
}

.ed-bento-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ed-bento-card--cream .ed-bento-card__icon,
.ed-bento-card--sand .ed-bento-card__icon,
.ed-bento-card--sage .ed-bento-card__icon {
  background: rgba(30, 22, 18, 0.08);
  color: var(--ed-ink);
}

.ed-bento-card--ink .ed-bento-card__icon {
  background: rgba(193, 98, 63, 0.25);
  color: var(--ed-terracotta-lt);
}

.ed-bento-card--terracotta .ed-bento-card__icon {
  background: rgba(250, 246, 240, 0.2);
  color: var(--ed-cream);
}

.ed-bento-card--burgundy .ed-bento-card__icon {
  background: rgba(250, 246, 240, 0.15);
  color: var(--ed-cream);
}

.ed-bento-card__tag {
  font-family: var(--ed-font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

.ed-bento-card__title {
  font-family: var(--ed-font-serif);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
}

.ed-bento-card--ink .ed-bento-card__title,
.ed-bento-card--terracotta .ed-bento-card__title,
.ed-bento-card--burgundy .ed-bento-card__title {
  color: inherit;
}

.ed-bento-card__body {
  font-family: var(--ed-font-sans);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ed-ink-soft);
  flex: 1;
}

.ed-bento-card--ink .ed-bento-card__body {
  color: rgba(250, 246, 240, 0.65);
}

.ed-bento-card--terracotta .ed-bento-card__body {
  color: rgba(250, 246, 240, 0.8);
}

.ed-bento-card--burgundy .ed-bento-card__body {
  color: rgba(250, 246, 240, 0.75);
}

.ed-bento-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--ed-font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: gap 0.18s ease, opacity 0.18s ease;
  margin-top: auto;
  width: fit-content;
}

.ed-bento-card--cream .ed-bento-card__link,
.ed-bento-card--sand .ed-bento-card__link,
.ed-bento-card--sage .ed-bento-card__link {
  color: var(--ed-terracotta-dk);
}

.ed-bento-card--ink .ed-bento-card__link,
.ed-bento-card--terracotta .ed-bento-card__link,
.ed-bento-card--burgundy .ed-bento-card__link {
  color: var(--ed-cream);
  opacity: 0.85;
}

.ed-bento-card__link:hover {
  gap: 0.65rem;
  opacity: 1;
}

.ed-bento-card__big-number {
  font-family: var(--ed-font-serif);
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ed-terracotta-lt);
  opacity: 0.9;
  margin-top: auto;
}

.ed-bento-card__circle {
  position: absolute;
  bottom: -2.5rem;
  right: -2.5rem;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  border: 20px solid currentColor;
  opacity: 0.08;
  pointer-events: none;
}

/* Dark theme bento cards */
[data-theme="dark"] .ed-bento-card--cream {
  background: var(--ed-ink-mid);
  border-color: #4d3a2c;
}

[data-theme="dark"] .ed-bento-card--sand {
  background: #3d2e24;
  border-color: #5c4a3a;
}

[data-theme="dark"] .ed-bento-card--sage {
  background: #2e3d30;
  border-color: #3d5240;
}

[data-theme="dark"] .ed-bento-card--cream .ed-bento-card__title,
[data-theme="dark"] .ed-bento-card--sand .ed-bento-card__title,
[data-theme="dark"] .ed-bento-card--sage .ed-bento-card__title {
  color: var(--ed-cream);
}

[data-theme="dark"] .ed-bento-card--cream .ed-bento-card__body,
[data-theme="dark"] .ed-bento-card--sand .ed-bento-card__body,
[data-theme="dark"] .ed-bento-card--sage .ed-bento-card__body {
  color: var(--ed-warm-gray);
}

/* ================================================
   10. ACCESSIBILITY MENU
   ================================================ */

.access-menu-trigger {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--secondary);
  color: var(--secondary-foreground);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.access-menu-trigger:hover {
  background: var(--accent);
  box-shadow: var(--shadow-xl);
}

@media (min-width: 1024px) {
  .access-menu-trigger {
    right: 1.5rem;
    top: 1.5rem;
  }
}

.access-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.3s, opacity 0.3s;
}

.access-menu--open {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 0.3s;
}

.access-menu__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.access-menu__panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 350px;
  max-width: 90vw;
  background: var(--background);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.access-menu--open .access-menu__panel {
  transform: translateX(0);
}

@media (min-width: 667px) {
  .access-menu__panel {
    width: 400px;
  }
}

.access-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.access-menu__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.access-menu__description {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.access-menu__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: color var(--transition-base), background-color var(--transition-base);
}

.access-menu__close:hover {
  color: var(--foreground);
  background-color: var(--accent);
}

.access-menu__content {
  padding: 1.5rem;
}

.access-menu__section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.access-menu__section + .access-menu__section {
  border-top: 1px solid var(--border);
}

.access-menu__label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.access-menu__label-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted-foreground);
}

.access-menu__label-text h4 {
  font-size: 0.875rem;
  font-weight: 500;
}

.access-menu__label-text p {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin: 0;
}

/* Switch/Toggle */
.switch {
  position: relative;
  display: inline-flex;
  width: 2.75rem;
  height: 1.5rem;
  cursor: pointer;
}

.switch__input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.switch__track {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--input);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-base);
}

.switch__input:checked + .switch__track {
  background: var(--primary);
}

.switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: white;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base);
  pointer-events: none;
}

.switch__input:checked ~ .switch__thumb {
  transform: translateX(1.25rem);
}

/* Font Size Controls */
.access-menu__font-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.access-menu__font-dots {
  display: flex;
  gap: 0.5rem;
}

.access-menu__font-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: var(--radius-full);
  background: var(--muted);
  transition: background-color var(--transition-base);
}

.access-menu__font-dot--active {
  background: var(--foreground);
}

.access-menu__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ================================================
   BACK NAVIGATION FAB
   ================================================ */

.back-fab {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid var(--ed-sand);
  border-radius: var(--radius-full);
  background: var(--ed-cream-dark);
  color: var(--ed-terracotta);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: background var(--transition-base), color var(--transition-base),
              box-shadow var(--transition-base), transform var(--transition-base);
  animation: back-fab-breathe 3s ease-in-out infinite;
}

@media (min-width: 1024px) {
  .back-fab { left: 1.5rem; top: 1.5rem; }
}

/* Idle animation - gentle beckoning */
@keyframes back-fab-breathe {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-2px); }
}

.back-fab svg {
  animation: back-fab-arrow-sway 2s ease-in-out infinite 0.5s;
}

@keyframes back-fab-arrow-sway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-1px); }
}

/* Hover - eager arrow */
.back-fab:hover {
  background: var(--ed-sand);
  color: var(--ed-terracotta-dk);
  box-shadow: var(--shadow-xl);
  animation: none;
  transform: translateX(-4px) scale(1.05);
}

.back-fab:hover svg {
  animation: back-fab-arrow-eager 0.35s ease-in-out infinite;
}

@keyframes back-fab-arrow-eager {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-4px); }
}

/* Active/pressed */
.back-fab:active {
  transform: scale(0.92) translateX(-2px);
  box-shadow: var(--shadow-md);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.back-fab:active svg { animation: none; transform: translateX(-2px); }

/* Focus */
.back-fab:focus-visible {
  outline: 2px solid var(--ed-terracotta);
  outline-offset: 2px;
}

/* Dark theme */
[data-theme="dark"] .back-fab {
  background: var(--ed-ink-mid);
  border-color: #4d3a2c;
  color: var(--ed-terracotta-lt);
}

[data-theme="dark"] .back-fab:hover {
  background: var(--ed-ink-soft);
  color: var(--ed-cream);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .back-fab, .back-fab svg, .back-fab:hover svg { animation: none; }
  .back-fab:hover { transform: none; }
  .back-fab:active { transform: scale(0.95); }
}

/* ================================================
   11. ACCORDION
   ================================================ */

.accordion {
  display: flex;
  flex-direction: column;
}

.accordion__item {
  border-bottom: 1px solid var(--ed-sand);
}

[data-theme="dark"] .accordion__item {
  border-bottom-color: #4d3a2c;
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  transition: color var(--transition-base);
}

.accordion__trigger:hover {
  color: var(--ed-terracotta);
}

.accordion__icon {
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.accordion__icon--open {
  transform: rotate(180deg);
}

.accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.accordion__content--open {
  max-height: 500px;
}

.accordion__content-inner {
  padding-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.7;
}

/* ================================================
   12. SHARED EDITORIAL PAGE HERO
   ================================================ */

.ed-page-hero {
  padding: 4rem 2rem 4rem;
  text-align: center;
  background: var(--ed-cream);
  position: relative;
}

[data-theme="dark"] .ed-page-hero {
  background: var(--ed-ink);
}

@media (min-width: 800px) {
  .ed-page-hero {
    padding: 5rem 3rem 5rem;
  }
}

.ed-page-hero__inner {
  max-width: var(--max-width-content);
  margin: 0 auto;
}

.ed-page-hero__badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  font-family: var(--ed-font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ed-terracotta);
  color: var(--ed-cream);
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.ed-page-hero__headline {
  font-family: var(--ed-font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ed-ink);
  margin: 0 0 1rem;
}

[data-theme="dark"] .ed-page-hero__headline {
  color: var(--ed-cream);
}

.ed-page-hero__headline em {
  font-style: italic;
  font-weight: 300;
  color: var(--ed-terracotta);
}

[data-theme="dark"] .ed-page-hero__headline em {
  color: var(--ed-terracotta-lt);
}

.ed-page-hero__subtitle {
  font-family: var(--ed-font-serif);
  font-size: 1.125rem;
  font-weight: 300;
  font-style: italic;
  color: var(--ed-terracotta);
  margin: 0 0 1rem;
}

.ed-page-hero__description {
  font-family: var(--ed-font-sans);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--ed-ink-soft);
  max-width: 60ch;
  margin: 0 auto;
}

[data-theme="dark"] .ed-page-hero__description {
  color: var(--ed-warm-gray);
}

/* ================================================
   12b. EDITORIAL CTA BAND (shared component)
   ================================================ */

.ed-cta-band {
  background: var(--ed-cream-dark);
  border-top: 1px solid var(--ed-sand);
  padding: 6rem 2rem;
}

@media (min-width: 800px) {
  .ed-cta-band {
    padding: 8rem 3rem;
  }
}

.ed-cta-band__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 800px) {
  .ed-cta-band__inner {
    grid-template-columns: 1fr auto;
    gap: 4rem;
  }
}

.ed-cta-band__headline {
  font-family: var(--ed-font-serif);
  font-size: clamp(1.875rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
  margin: 0 0 1rem;
}

.ed-cta-band__headline em {
  font-style: italic;
  font-weight: 300;
  color: var(--ed-terracotta);
}

.ed-cta-band__sub {
  font-family: var(--ed-font-sans);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ed-ink-soft);
  max-width: 52ch;
  margin: 0;
}

.ed-cta-band__actions {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .ed-cta-band__actions {
    flex-direction: row;
  }
}

@media (min-width: 800px) {
  .ed-cta-band__actions {
    flex-direction: column;
  }
}

/* Dark theme CTA band */
[data-theme="dark"] .ed-cta-band {
  background: var(--ed-ink-mid);
  border-top-color: #4d3a2c;
}

[data-theme="dark"] .ed-cta-band__headline {
  color: var(--ed-cream);
}

[data-theme="dark"] .ed-cta-band__headline em {
  color: var(--ed-terracotta-lt);
}

[data-theme="dark"] .ed-cta-band__sub {
  color: var(--ed-warm-gray);
}

/* ================================================
   13. TABLES
   ================================================ */

.table-container {
  overflow-x: auto;
  margin: 2rem 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  color: var(--foreground);
  background: var(--muted);
}

.table td {
  color: var(--muted-foreground);
}

.table tr:hover td {
  background: var(--accent);
}

/* ================================================
   14. ANIMATIONS
   ================================================ */

/* Fade-in for scroll-triggered sections */
.fade-section {
  opacity: 0;
  transform: translateY(24px);
}

.fade-section--visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease-out, transform 0.6s ease-out;
}

/* Editorial fade with stagger delays */
.ed-fade {
  opacity: 0;
  transform: translateY(28px);
}

.ed-fade--visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease-out, transform 0.65s ease-out;
}

.ed-fade--delay-1 { transition-delay: 0.1s; }
.ed-fade--delay-2 { transition-delay: 0.2s; }
.ed-fade--delay-3 { transition-delay: 0.3s; }
.ed-fade--delay-4 { transition-delay: 0.45s; }
.ed-fade--delay-5 { transition-delay: 0.6s; }

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* ================================================
   15. REDUCED MOTION
   ================================================ */

@media (prefers-reduced-motion: reduce) {
  .ed-bento-card:hover,
  .ed-btn-primary:hover {
    transform: none;
  }
  .ed-fade {
    opacity: 1;
    transform: none;
  }
  .fade-section {
    opacity: 1;
    transform: none;
  }
}

/* ================================================
   16. UTILITY CLASSES
   ================================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.text-muted { color: var(--muted-foreground); }
.text-primary { color: var(--primary); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.grid { display: grid; }

.hidden { display: none; }

@media (min-width: 667px) {
  .sm\:block { display: block; }
  .sm\:flex { display: flex; }
}

@media (min-width: 800px) {
  .md\:block { display: block; }
  .md\:flex { display: flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:block { display: block; }
  .lg\:flex { display: flex; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
