/* ============================================================
   THE COMPANION — SHARED STYLES
   For all who seek what is true, good, and beautiful.
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Raleway:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --cosmic-blue:     #0d1b4b;
  --cosmic-blue-mid: #112266;
  --nebula-purple:   #5c1fa8;
  --nebula-rose:     #9b1fa8;
  --void-black:      #04060f;
  --deep-space:      #070d1e;
  --star-white:      #e8e8ff;
  --aurora-teal:     #00c9b1;
  --aurora-glow:     rgba(0, 201, 177, 0.3);
  --indigo-mist:     #3d2b8a;
  --gold-stardust:   #c8a96e;
  --warm-amber:      #d4a055;
  --pink-nebula:     #ff6bcb;
  --font-heading:    'Cinzel', serif;
  --font-body:       'Raleway', sans-serif;
  --font-serif:      'EB Garamond', Georgia, serif;
  --nav-height:      72px;
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  background-color: var(--void-black);
  color: var(--star-white);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
}

h1 { font-size: clamp(2rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }

p { margin-bottom: 1rem; }

a {
  color: var(--aurora-teal);
  text-decoration: none;
  transition: color var(--transition-smooth);
}

a:hover { color: var(--star-white); }

/* ---------- Selection Color ---------- */
::selection {
  background: var(--nebula-purple);
  color: var(--star-white);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--void-black); }
::-webkit-scrollbar-thumb {
  background: var(--indigo-mist);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--nebula-purple); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.cosmic-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: linear-gradient(
    180deg,
    rgba(4, 6, 15, 0.95) 0%,
    rgba(4, 6, 15, 0.7) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(92, 31, 168, 0.2);
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--star-white);
  text-transform: uppercase;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition-smooth);
}

.nav-logo .logo-glyph {
  font-size: 1.4rem;
  color: var(--aurora-teal);
  animation: logoSpin 20s linear infinite;
}

.nav-logo:hover { color: var(--aurora-teal); }

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(232, 232, 255, 0.65);
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  position: relative;
  transition: color var(--transition-smooth);
}

.nav-links a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: var(--aurora-teal);
  transition: width var(--transition-smooth);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--star-white);
}

.nav-links a:hover::before,
.nav-links a.active::before {
  width: 60%;
}

.nav-links li::after {
  content: '·';
  color: rgba(92, 31, 168, 0.5);
  margin-left: 0.25rem;
  font-size: 1rem;
}
.nav-links li:last-child::after { display: none; }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--star-white);
  border-radius: 2px;
  transition: all var(--transition-smooth);
}

/* ============================================================
   PAGE SHELL
   ============================================================ */
.page-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page-content {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ============================================================
   COSMIC SECTION HEADERS
   ============================================================ */
.section-header {
  text-align: center;
  padding: 4rem 1rem 2.5rem;
}

.section-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--aurora-teal);
  display: block;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  color: var(--star-white);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1rem;
  color: rgba(232, 232, 255, 0.55);
  max-width: 540px;
  margin: 0 auto;
  font-weight: 300;
  font-style: italic;
}

.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.section-divider::before,
.section-divider::after {
  content: '';
  height: 1px;
  width: 80px;
  background: linear-gradient(90deg, transparent, var(--nebula-purple));
}

.section-divider::after {
  background: linear-gradient(90deg, var(--nebula-purple), transparent);
}

.section-divider-glyph {
  color: var(--nebula-purple);
  font-size: 1rem;
}

/* ============================================================
   GLOW UTILITIES
   ============================================================ */
.glow-teal {
  box-shadow: 0 0 20px rgba(0, 201, 177, 0.25),
              0 0 60px rgba(0, 201, 177, 0.1);
}

.glow-purple {
  box-shadow: 0 0 20px rgba(92, 31, 168, 0.4),
              0 0 60px rgba(92, 31, 168, 0.15);
}

.glow-gold {
  box-shadow: 0 0 20px rgba(200, 169, 110, 0.3),
              0 0 60px rgba(200, 169, 110, 0.1);
}

.text-glow {
  text-shadow: 0 0 20px rgba(0, 201, 177, 0.5),
               0 0 40px rgba(0, 201, 177, 0.2);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--nebula-purple), var(--cosmic-blue-mid));
  color: var(--star-white);
  border: 1px solid rgba(92, 31, 168, 0.5);
}

.btn-primary:hover {
  color: var(--star-white);
  box-shadow: 0 0 30px rgba(92, 31, 168, 0.5), 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

/* Gold — primary action (begin, continue, complete) */
.btn-gold {
  background: linear-gradient(135deg, #c8a96e, #b8904e);
  color: #04060f;
  border: 1px solid rgba(200, 169, 110, 0.6);
  font-weight: 600;
}

.btn-gold:hover {
  color: #04060f;
  box-shadow: 0 0 30px rgba(200, 169, 110, 0.4), 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

/* Teal — secondary action (examen, listen) */
.btn-teal {
  background: linear-gradient(135deg, #00c9b1, #009f8e);
  color: #04060f;
  border: 1px solid rgba(0, 201, 177, 0.6);
  font-weight: 600;
}

.btn-teal:hover {
  color: #04060f;
  box-shadow: 0 0 30px rgba(0, 201, 177, 0.4), 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--aurora-teal);
  border: 1px solid rgba(0, 201, 177, 0.4);
}

.btn-outline:hover {
  color: var(--star-white);
  background: rgba(0, 201, 177, 0.1);
  border-color: var(--aurora-teal);
  box-shadow: 0 0 20px var(--aurora-glow);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: rgba(232, 232, 255, 0.7);
  border: 1px solid rgba(232, 232, 255, 0.1);
}

.btn-ghost:hover {
  color: var(--star-white);
  border-color: rgba(232, 232, 255, 0.3);
  background: rgba(255,255,255,0.08);
}

/* ============================================================
   TAGS / BADGES
   ============================================================ */
.tag {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  border: 1px solid rgba(200, 169, 110, 0.3);
  color: rgba(232, 232, 255, 0.65);
  background: rgba(200, 169, 110, 0.08);
  font-family: var(--font-body);
  font-weight: 500;
}

/* ============================================================
   FORMS
   ============================================================ */
.cosmic-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--aurora-teal);
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: rgba(13, 27, 75, 0.5);
  border: 1px solid rgba(92, 31, 168, 0.3);
  border-radius: 6px;
  color: var(--star-white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color var(--transition-smooth),
              box-shadow var(--transition-smooth);
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(232, 232, 255, 0.25);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--aurora-teal);
  box-shadow: 0 0 0 3px rgba(0, 201, 177, 0.12),
              0 0 20px rgba(0, 201, 177, 0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
}

.form-select option {
  background: var(--deep-space);
  color: var(--star-white);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: linear-gradient(
    135deg,
    rgba(13, 27, 75, 0.6) 0%,
    rgba(7, 13, 30, 0.8) 100%
  );
  border: 1px solid rgba(92, 31, 168, 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: all var(--transition-smooth);
  position: relative;
}

.card:hover {
  border-color: rgba(92, 31, 168, 0.5);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4),
              0 0 30px rgba(92, 31, 168, 0.15);
  transform: translateY(-4px);
}

/* ============================================================
   NEBULA PANEL
   ============================================================ */
.nebula-panel {
  background: linear-gradient(
    135deg,
    rgba(200, 169, 110, 0.05) 0%,
    rgba(13, 27, 75, 0.15) 50%,
    rgba(0, 201, 177, 0.03) 100%
  );
  border: 1px solid rgba(200, 169, 110, 0.12);
  border-radius: 16px;
  padding: 2.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.cosmic-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(92, 31, 168, 0.2);
  background: linear-gradient(
    0deg,
    rgba(4, 6, 15, 0.98) 0%,
    rgba(4, 6, 15, 0.7) 100%
  );
  backdrop-filter: blur(10px);
  padding: 3rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--warm-amber);
  opacity: 0.9;
}

.footer-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: rgba(232, 232, 255, 0.45);
  margin-top: 0.35rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(232, 232, 255, 0.25);
  margin-top: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(232, 232, 255, 0.35);
  transition: color var(--transition-smooth);
  text-transform: uppercase;
}

.footer-links a:hover { color: var(--aurora-teal); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-pad {
  padding: 5rem 0;
}

/* ============================================================
   WIP BADGE
   ============================================================ */
.badge-wip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  background: rgba(200, 169, 110, 0.12);
  border: 1px solid rgba(200, 169, 110, 0.35);
  color: var(--warm-amber);
  font-family: var(--font-heading);
}

.badge-wip::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warm-amber);
  animation: badgePulse 2s ease-in-out infinite;
}

/* ============================================================
   RESPONSIVE — MOBILE NAVIGATION
   ============================================================ */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(4, 6, 15, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    transform: translateY(-120%);
    transition: transform var(--transition-smooth);
    border-bottom: 1px solid rgba(92, 31, 168, 0.2);
  }

  .nav-links.open { transform: translateY(0); }

  .nav-links li::after { display: none; }

  .nav-links a {
    display: block;
    padding: 1rem 2rem;
    font-size: 0.85rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  :root { --nav-height: 60px; }
  .cosmic-nav { padding: 0 1rem; }
  .section-pad { padding: 3rem 0; }
}
