/* ============================================================================
   ICONIC Human Design Education, PMA — Centralized Design System
   Source of truth for ALL pages. DO NOT override these values in page-specific CSS.

   Typography: JovianArchive.com (Rubik headings + Barlow body)
   Colors: HumanDesignMastery.com (Purple/Teal on Black)
   ============================================================================ */

/* ── Google Fonts ───────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&display=swap');

/* ── Design Tokens (CSS Custom Properties) ──────────────────────────────────── */
:root {
  /* Primary Colors — HumanDesignMastery.com palette */
  --primary: #633a85;
  --primary-dark: #3d2452;
  --primary-light: #7a4d9e;
  --accent: #34d2e2;
  --accent-dark: #2cbece;

  /* Legacy aliases (backward compat with existing markup) */
  --gold: #633a85;
  --gold-light: #34d2e2;

  /* Backgrounds */
  --bg: #000000;
  --deep: #000000;
  --surface: #0d0d0d;
  --surface-2: #161616;
  --surface-3: #1e1028;

  /* Text */
  --text: #ffffff;
  --text-body: #fcfcfc;
  --text-muted: #A89FA0;
  --text-secondary: #8a7a9a;

  /* Borders */
  --border: rgba(99, 58, 133, 0.15);
  --border-strong: rgba(99, 58, 133, 0.3);
  --border-subtle: rgba(99, 58, 133, 0.08);

  /* Status */
  --error: #fa3246;
  --success: #2ecc71;
  --warning: #fcd34d;
  --info: #93c5fd;

  /* Typography */
  --font-heading: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(99, 58, 133, 0.15);
  --shadow-lg: 0 8px 30px rgba(99, 58, 133, 0.35);
}

/* ── Light Mode Overrides ────────────────────────────────────────────────────── */
[data-theme="light"] {
  /* Backgrounds */
  --bg: #f7f3ef;
  --deep: #f7f3ef;
  --surface: #ffffff;
  --surface-2: #f0ece8;
  --surface-3: #e8dff5;

  /* Text */
  --text: #1a1218;
  --text-body: #2d2535;
  --text-muted: #5a4e6a;
  --text-secondary: #7a6e8a;

  /* Borders */
  --border: rgba(99, 58, 133, 0.18);
  --border-strong: rgba(99, 58, 133, 0.35);
  --border-subtle: rgba(99, 58, 133, 0.10);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(99, 58, 133, 0.10);
  --shadow-lg: 0 8px 30px rgba(99, 58, 133, 0.18);
}

/* ── Theme Transition ────────────────────────────────────────────────────────── */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}
body,
body *:not(script):not(style) {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ── Theme Toggle Button ─────────────────────────────────────────────────────── */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}
.theme-toggle-btn:hover {
  background: rgba(99, 58, 133, 0.10);
  color: var(--primary);
  border-color: var(--primary);
}
.theme-toggle-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
/* Dark mode → show sun (click = go light) */
.theme-toggle-btn .icon-moon { display: none; }
.theme-toggle-btn .icon-sun  { display: block; }
/* Light mode → show moon (click = go dark) */
[data-theme="light"] .theme-toggle-btn .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle-btn .icon-moon { display: block; }

/* ── Floating Theme Toggle Pill (bottom-left, persistent across all pages) ───── */
.theme-toggle-float {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(99, 58, 133, 0.45);
  background: rgba(22, 14, 36, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  color: #c5bfd4;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(99, 58, 133, 0);
  padding: 0;
  line-height: 1;
}
.theme-toggle-float:hover {
  background: rgba(99, 58, 133, 0.28);
  border-color: rgba(99, 58, 133, 0.75);
  color: #e8e3f0;
  transform: scale(1.09);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(99, 58, 133, 0.15);
}
.theme-toggle-float:active {
  transform: scale(0.96);
}
.theme-toggle-float svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
/* Dark mode → show sun (click = go light) */
.theme-toggle-float .icon-moon { display: none; }
.theme-toggle-float .icon-sun  { display: block; }
/* Light mode → show moon (click = go dark) */
[data-theme="light"] .theme-toggle-float .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle-float .icon-moon { display: block; }
/* Light mode pill appearance */
[data-theme="light"] .theme-toggle-float {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(99, 58, 133, 0.28);
  color: #5a4570;
  box-shadow: 0 2px 14px rgba(99, 58, 133, 0.12);
}
[data-theme="light"] .theme-toggle-float:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(99, 58, 133, 0.55);
  color: #633a85;
  box-shadow: 0 4px 18px rgba(99, 58, 133, 0.2), 0 0 0 3px rgba(99, 58, 133, 0.1);
}

/* Light mode: flip static colors that aren't via CSS variables */
[data-theme="light"] .site-nav {
  background: rgba(247, 243, 239, 0.92);
  border-bottom-color: rgba(99, 58, 133, 0.15);
}
[data-theme="light"] .alert-success { background: #e6f9f0; border-color: #6ee7b7; color: #065f46; }
[data-theme="light"] .alert-error   { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
[data-theme="light"] .alert-info    { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
[data-theme="light"] .alert-warning { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
[data-theme="light"] .badge-published, [data-theme="light"] .badge-completed, [data-theme="light"] .badge-active { background: #d1fae5; color: #065f46; }
[data-theme="light"] .badge-draft, [data-theme="light"] .badge-refunded, [data-theme="light"] .badge-trialing    { background: #ede9fe; color: #5b21b6; }
[data-theme="light"] .badge-pending, [data-theme="light"] .badge-past_due { background: #fef3c7; color: #92400e; }
[data-theme="light"] .badge-failed, [data-theme="light"] .badge-canceled  { background: #fee2e2; color: #991b1b; }

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Base Typography ────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

p {
  color: var(--text-body);
  line-height: 1.8;
  font-weight: 300;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--primary);
}

strong {
  color: var(--text);
  font-weight: 500;
}

/* Rubik utility class */
.syne, .rubik { font-family: var(--font-heading); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1.4;
}
.btn:hover { opacity: 0.88; text-decoration: none; }

.btn-primary,
.btn-purple {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover,
.btn-purple:hover {
  background: var(--primary-light);
}

.btn-accent,
.btn-teal {
  background: var(--accent);
  color: #000;
}
.btn-accent:hover,
.btn-teal:hover {
  background: var(--accent-dark);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
  text-decoration: none;
}
.btn-gold:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* Belt-and-suspenders: prevent link color inheritance from overriding button text */
a.btn-gold, a.btn-gold:visited { color: #ffffff; }
a.btn-primary, a.btn-purple, a.btn-primary:visited { color: #ffffff; }
a.btn-accent, a.btn-teal, a.btn-accent:visited { color: #000000; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  background: transparent;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: rgba(99, 58, 133, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.btn-outline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  background: transparent;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}
.btn-outline-pill:hover {
  background: rgba(99, 58, 133, 0.1);
  border-color: var(--primary);
}

.btn-danger {
  background: #7f1d1d;
  color: #fca5a5;
  border: none;
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  border: 1px solid transparent;
  border-radius: 4px;
}
.btn-ghost:hover {
  background: rgba(99, 58, 133, 0.08);
  color: var(--text);
  border-color: var(--border);
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.card:hover {
  border-color: var(--border-strong);
}
.card-sm { padding: 1rem; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label,
.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.form-input,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-body);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}
.form-input::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}
.form-group select option {
  background: var(--surface-2);
  color: var(--text-body);
}
textarea.form-input { min-height: 130px; resize: vertical; }

.form-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}
.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: #0d2e1a; border: 1px solid #15532a; color: #6ee7b7; }
.alert-error   { background: #2d0a0a; border: 1px solid #5a1a1a; color: #fca5a5; }
.alert-info    { background: #0d1a2e; border: 1px solid #1a3a5a; color: #93c5fd; }
.alert-warning { background: #1a1200; border: 1px solid #5a4000; color: #c9a84c; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-published, .badge-completed, .badge-active { background: #14532d; color: #86efac; }
.badge-draft, .badge-refunded, .badge-trialing    { background: #1e0e2e; color: #a5b4fc; }
.badge-pending, .badge-past_due                     { background: #78350f; color: #fde68a; }
.badge-failed, .badge-canceled                      { background: #7f1d1d; color: #fecaca; }

/* ── Section Labels / Overlines ─────────────────────────────────────────────── */
.section-label,
.hero-overline {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* ── Dividers ───────────────────────────────────────────────────────────────── */
.divider-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* ── Ambient Glow Backgrounds ───────────────────────────────────────────────── */
.bg-glow {
  position: fixed;
  top: -30%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(99, 58, 133, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.bg-glow-2 {
  position: fixed;
  bottom: -20%;
  right: -15%;
  width: 50%;
  height: 50%;
  background: radial-gradient(ellipse, rgba(52, 210, 226, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */
.site-nav {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.site-nav .logo {
  font-family: var(--font-heading);
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
}
.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
}
.site-nav .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav .nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}
.nav-btn {
  background: var(--primary);
  color: #fff !important;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.nav-btn:hover { opacity: 0.88; text-decoration: none; }
.nav-btn-teal {
  background: var(--accent) !important;
  color: #000 !important;
}
.nav-btn-teal:hover { background: var(--accent-dark) !important; }

.nav-cta {
  font-size: 0.8rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase;
  color: var(--primary) !important;
  border: 1px solid var(--border-strong);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-pill);
  transition: all 0.3s !important;
}
.nav-cta:hover {
  background: rgba(99, 58, 133, 0.1);
  border-color: var(--primary);
}

/* ── Page Headers ───────────────────────────────────────────────────────────── */
.page-hdr { margin-bottom: 1.5rem; }
.page-hdr h1 {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.3rem;
}
.page-hdr .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ── Breadcrumbs ────────────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--accent);
}

/* ── Feature Lists ──────────────────────────────────────────────────────────── */
.feature-list {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}
.feature-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before {
  content: '✦';
  color: var(--primary);
  font-size: 0.7rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

/* ── Testimonials ───────────────────────────────────────────────────────────── */
.testimonial {
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 1.5rem 2rem;
  margin: 1rem 0;
}
.testimonial .quote {
  font-size: 1rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.testimonial .attribution {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}
footer a {
  color: var(--primary);
  text-decoration: none;
}
footer a:hover {
  color: var(--accent);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .site-nav { height: auto; padding: 0.75rem 1rem; gap: 0.5rem; flex-wrap: wrap; }
  .site-nav .nav-links { gap: 0.75rem; font-size: 0.82rem; }
}

@media (max-width: 640px) {
  .site-nav .nav-links { gap: 0.5rem; }
}

/* ── HD Animated Background Canvas ─────────────────────────────────────────── */
#hd-bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
