/* ── ENGLISH MASTERY SHARED DESIGN SYSTEM ── */

:root {
  --bg: #0e1117;
  --surface: #161b27;
  --surface2: #1e2535;
  --border: #2a3347;
  --bg-darker: #090c12;
  --border-hover: rgba(255, 255, 255, 0.15);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.35);
  --accent: #e8a045;     /* Yellow/Orange */
  --accent2: #5b8dd9;    /* Blue */
  --accent3: #72c97e;    /* Green */
  --accent4: #d96b6b;    /* Red/Pink */
  --accent5: #b07fd4;    /* Purple */
  --text: #d8dde8;
  --text-dim: #7a8499;
  --text-bright: #f0f3fa;
  --heading-font: 'Playfair Display', serif;
  --body-font: 'DM Sans', sans-serif;
  --mono-font: 'DM Mono', monospace;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 15px rgba(232, 160, 69, 0.05);
  --card-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 25px rgba(232, 160, 69, 0.15);
}

body.light-mode {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface2: #eaecf1;
  --border: #dce2eb;
  --bg-darker: #f0f2f5;
  --border-hover: rgba(15, 23, 42, 0.15);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.08);
  --accent: #c97d26;     /* Rich gold/orange */
  --accent2: #3460a8;    /* Deep slate blue */
  --accent3: #2d823e;    /* Deep green */
  --accent4: #b83b3b;    /* Deep coral red */
  --accent5: #7c3aed;    /* Violet/Purple */
  --text: #2f343f;
  --text-dim: #64748b;
  --text-bright: #0f172a;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.02), 0 0 15px rgba(120, 79, 29, 0.08);
  --card-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.05), 0 0 25px rgba(120, 79, 29, 0.18);
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── HEADER NAVIGATION BAR ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(14, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  transition: var(--transition);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  font-family: var(--heading-font);
  font-weight: 900;
  font-size: 20px;
  color: var(--text-bright);
}

.nav-brand span {
  color: var(--accent);
  font-style: italic;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 6px 0;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links .nav-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 6px;
  color: var(--text-bright);
  font-weight: 600;
}

.nav-links .nav-btn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

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

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

footer span {
  color: var(--accent);
}

/* Responsive adjustments */
@media (max-width: 700px) {
  .navbar {
    padding: 16px 20px;
  }
  .nav-links {
    gap: 16px;
  }
}

/* ── PRONUNCIATION BUTTONS ── */
.speak-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 6px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  font-size: 0 !important; /* Hide the emoji text */
  position: relative;
  opacity: 0.65;
}

.speak-btn::before {
  content: '';
  width: 13px;
  height: 13px;
  display: block;
  background-color: var(--text-dim);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cpath d='M15.54 8.46a5 5 0 0 1 0 7.07'/%3E%3Cpath d='M19.07 4.93a10 10 0 0 1 0 14.14'/%3E%3C/svg%3E") no-repeat center center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cpath d='M15.54 8.46a5 5 0 0 1 0 7.07'/%3E%3Cpath d='M19.07 4.93a10 10 0 0 1 0 14.14'/%3E%3C/svg%3E") no-repeat center center / contain;
  transition: var(--transition);
}

.speak-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.speak-btn:hover::before {
  background-color: var(--accent);
}

.speak-btn.btn-sm {
  width: 14px;
  height: 14px;
}

.speak-btn.btn-sm::before {
  width: 10px;
  height: 10px;
}

/* ── THEME SWITCHER STYLES ── */
.theme-toggle-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-bright);
  transition: var(--transition);
  outline: none;
}

.theme-toggle-btn:hover {
  background: var(--surface2);
  transform: scale(1.15);
}

body.light-mode .navbar {
  background: rgba(244, 245, 248, 0.85);
  border-bottom: 1px solid var(--border);
}

body.light-mode .nav-links .nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-bright);
}

body.light-mode .nav-links .nav-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body.light-mode header:not(.hero) {
  background: linear-gradient(135deg, #eaecf1 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}

/* ── NAV COLLAPSIBLE FOR MOBILE (GLOBAL) ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.nav-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--text-bright);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--surface2);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 30px;
    gap: 24px;
    transition: right 0.3s ease;
    z-index: 1000;
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
  }
  .nav-links.open {
    right: 0;
  }
  .nav-links li {
    width: 100%;
  }
  .nav-links a {
    display: block;
    width: 100%;
    font-size: 16px;
    padding: 8px 0;
  }
  .nav-links .nav-btn {
    text-align: center;
    margin-top: 10px;
  }
  .theme-toggle-item {
    margin: 10px 0;
  }
}

/* ── SITE FOOTER ── */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 45px 40px 20px;
  width: 100%;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-brand p {
  color: var(--text-dim);
  font-size: 14px;
  max-width: 300px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  transition: var(--transition);
}

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

.footer-bottom {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.footer-bottom p {
  color: var(--text-dim);
  font-size: 12px;
}

/* ── LEGAL PAGES STYLES ── */
.legal-container {
  max-width: 850px;
  margin: 40px auto;
  padding: 0 20px;
  width: 100%;
  flex: 1;
}

.legal-header {
  margin-bottom: 36px;
  text-align: center;
}

.legal-header h1 {
  font-family: var(--heading-font);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.legal-header p {
  color: var(--text-dim);
  font-size: 14px;
}

.legal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section h2 {
  font-family: var(--heading-font);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.legal-section p, .legal-section ul {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.legal-section ul {
  padding-left: 24px;
}

.legal-section li {
  margin-bottom: 8px;
}

.legal-placeholder {
  font-family: var(--mono-font);
  background: rgba(232, 160, 69, 0.12);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9em;
  border: 1px dashed var(--accent);
}

body.light-mode .legal-placeholder {
  background: rgba(201, 125, 38, 0.15);
  color: #a15c10;
  border-color: #c97d26;
}

@media (max-width: 600px) {
  .legal-content {
    padding: 24px 18px;
  }
}

/* ── ANTI-FOUC & PREMIUM ACCESS SCREEN ── */
html:not(.access-granted) body > *:not(#spikin-access-screen) {
  display: none !important;
}

.spikin-access-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  background: var(--bg);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  overflow-y: auto;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.spikin-access-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.spikin-access-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 460px;
  width: 100%;
  padding: 40px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  text-align: center;
  position: relative;
  transition: var(--transition);
  margin: auto;
}

.spikin-access-brand {
  font-family: var(--heading-font);
  font-size: 28px;
  font-weight: 900;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.spikin-access-brand span {
  color: var(--accent);
  font-style: italic;
}

.spikin-access-title {
  font-family: var(--heading-font);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 10px;
}

.spikin-access-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 24px;
}

.spikin-social-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.spikin-social-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  text-decoration: none;
  transition: var(--transition);
}

.spikin-social-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(232, 160, 69, 0.18);
}

.spikin-access-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.spikin-input-group {
  width: 100%;
}

.spikin-access-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--text-bright);
  font-family: var(--body-font);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  text-align: center;
  box-sizing: border-box;
}

.spikin-access-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 160, 69, 0.2);
}

.spikin-access-error {
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  display: none;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
}

.spikin-access-error.visible {
  display: block;
}

.spikin-access-btn {
  width: 100%;
  background: var(--accent);
  color: #000;
  font-family: var(--body-font);
  font-size: 16px;
  font-weight: 700;
  padding: 14px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
}

.spikin-access-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 160, 69, 0.35);
  background: #f0aa50;
}

.spikin-access-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.spikin-welcome-toast {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--heading-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  padding: 20px 0;
}

.spikin-welcome-toast svg {
  color: var(--accent);
  animation: checkPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.welcome-state .spikin-access-form,
.welcome-state .spikin-social-links,
.welcome-state .spikin-access-subtitle,
.welcome-state .spikin-access-title {
  display: none !important;
}

.welcome-state .spikin-welcome-toast {
  display: flex;
}

.spikin-access-footer-link {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.spikin-legal-link {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  transition: var(--transition);
}

.spikin-legal-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.welcome-state .spikin-access-footer-link {
  display: none !important;
}

@keyframes checkPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
  .spikin-access-card {
    padding: 30px 20px;
  }
  .spikin-social-links {
    flex-direction: column;
  }
  .spikin-social-pill {
    justify-content: center;
  }
}

/* ── 404 PAGE STYLES ── */
.error-404-container {
  max-width: 580px;
  margin: 60px auto;
  padding: 48px 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-hover);
}

.error-404-code {
  font-family: var(--heading-font);
  font-size: 80px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 8px;
  line-height: 1;
}

.error-404-title {
  font-family: var(--heading-font);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.error-404-text {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 28px;
}

.error-404-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  background: var(--accent);
  color: #000;
  font-family: var(--body-font);
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  text-decoration: none;
  transition: var(--transition);
}

.error-404-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 160, 69, 0.35);
  background: #f0aa50;
}







