@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg-color: #F7F4EF;
  --card-bg: #FFFCF7;
  --primary: #8E3B52;
  --primary-hover: #7A3346;
  --text-main: #2D2A26;
  --text-muted: #6B6863;
  --font-heading: 'Fraunces', serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-lg: 24px;
  --radius-md: 16px;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
}

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

header {
  position: sticky;
  top: 0;
  background: rgba(247, 244, 239, 0.9);
  backdrop-filter: blur(8px);
  padding: 1rem 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.nav-cta {
  background-color: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.nav-cta:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 3rem;
}

/* ==========================================
   AlterPath Dynamic Player (Light & Dark)
   ========================================== */

.phone-mockup {
  /* Default Dark Theme Variables */
  --app-bg: #0E090B;
  --app-card-bg: #1A1114;
  --app-card-hover: #24171B;
  --app-border: rgba(255, 255, 255, 0.04);
  --app-text: #FFFFFF;
  --app-text-muted: #8A7E82;
  --app-primary: #D37B93;
  --app-primary-hover: rgba(211, 123, 147, 0.25);
  --app-banner-bg: #381E23;
  --app-banner-text: #F5D6DD;
  --app-progress-bg: #24161C;
  --app-phone-border: #1C1517;

  background: var(--app-bg);
  border: 8px solid var(--app-phone-border);
  border-radius: 40px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: var(--app-text);
  padding: 1.25rem;
  min-height: 700px;
  max-width: 380px;
  margin: 0 auto 4rem;
  display: flex;
  flex-direction: column;
  position: relative;
  text-align: left;
  transition: all 0.5s ease;
}

/* Light Theme Variables */
.phone-mockup.light-theme {
  --app-bg: #FFFFFF;
  --app-card-bg: #FFFFFF;
  --app-card-hover: #FFFFFF;
  --app-border: rgba(0, 0, 0, 0.08);
  --app-text: #2D2A26;
  --app-text-muted: #6B6863;
  --app-primary: #8E3B52;
  --app-primary-hover: rgba(142, 59, 82, 0.3);
  --app-banner-bg: rgba(142, 59, 82, 0.05);
  --app-banner-text: #8E3B52;
  --app-progress-bg: rgba(142, 59, 82, 0.1);
  --app-phone-border: #F7F4EF;
  box-shadow: 0 25px 50px rgba(142,59,82,0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Theme Toggle Button (Side of phone) */
.theme-toggle-btn {
  position: absolute;
  right: -32px;
  top: 100px;
  width: 24px;
  height: 64px;
  background: var(--app-phone-border);
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  box-shadow: 4px 0 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.5s ease;
}

.theme-toggle-btn svg {
  width: 14px;
  height: 14px;
  color: var(--app-text-muted);
  opacity: 0.6;
  transition: opacity 0.3s;
}

.theme-toggle-btn:hover svg {
  opacity: 1;
}

/* Show Sun when in Dark Mode (to switch to light) */
.phone-mockup .moon-icon {
  display: none;
}
.phone-mockup .sun-icon {
  display: block;
}

/* Show Moon when in Light Mode (to switch to dark) */
.phone-mockup.light-theme .sun-icon {
  display: none;
}
.phone-mockup.light-theme .moon-icon {
  display: block;
}

.story-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
}

.close-icon, 
.more-icon,
.speaker-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--app-text);
  font-size: 1.25rem;
  opacity: 0.8;
  cursor: pointer;
  transition: color 0.5s ease, opacity 0.2s;
}

.close-icon:hover,
.more-icon:hover,
.speaker-icon:hover {
  opacity: 1;
}

.story-title {
  color: var(--app-primary);
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-heading);
  text-transform: capitalize;
  transition: color 0.5s ease;
}

.story-progress-bg {
  height: 4px;
  width: 100%;
  background-color: var(--app-progress-bg);
  border-radius: 99px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: background-color 0.5s ease;
}

.story-progress-fill {
  height: 100%;
  background-color: var(--app-primary);
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease;
}

.scene-label {
  color: var(--app-text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  text-align: left;
  transition: color 0.5s ease;
}

.helper-banner {
  background-color: var(--app-banner-bg);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--app-banner-text);
  font-size: 0.9rem;
  line-height: 1.4;
  animation: fadeIn 0.4s ease-out;
  transition: all 0.5s ease;
}

.helper-banner-content {
  display: flex;
  align-items: center;
}

.helper-banner-text {
  font-family: var(--font-body);
  font-weight: 500;
}

.helper-banner-close {
  color: var(--app-primary);
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 1rem;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.5s ease;
}

.phone-mockup:has(.analysis-result) .scene-label,
.phone-mockup:has(.analysis-result) .helper-banner,
.phone-mockup:has(.analysis-result) .story-progress-bg,
.phone-mockup:has(.analysis-result) .story-header {
  display: none !important;
}

.story-scene {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: fadeIn 0.4s ease-out;
  flex-grow: 1;
}

.choices-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.story-text-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.story-text {
  font-family: var(--font-body); 
  font-size: 1.15rem;
  color: var(--app-text);
  line-height: 1.45;
  font-weight: 500;
  transition: color 0.5s ease;
}

.choice-btn {
  background: var(--app-card-bg);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  color: var(--app-text);
  padding: 1.1rem 1.25rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.choice-btn::before {
  content: '';
  display: block;
  width: 4px;
  height: 24px;
  background-color: var(--app-primary);
  border-radius: 4px;
  margin-right: 1rem;
  flex-shrink: 0;
  transition: background-color 0.5s ease;
}

.choice-btn span {
  flex-grow: 1;
}

.choice-btn::after {
  content: '→';
  color: var(--app-primary);
  font-size: 1.25rem;
  opacity: 0.4;
  transition: all 0.2s;
  margin-left: 1rem;
}

.choice-btn:hover {
  background: var(--app-card-hover);
  border-color: var(--app-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.choice-btn:hover::after {
  opacity: 1;
  transform: translateX(2px);
}

.analysis-result {
  text-align: center;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  color: var(--app-text);
  transition: color 0.5s ease;
}

.analysis-result p {
  color: var(--app-text);
}

.analysis-result .archetype {
  color: var(--app-primary);
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: block;
  transition: color 0.5s ease;
}

.analysis-result .analysis-desc {
  color: var(--app-text-muted);
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 2rem;
  transition: color 0.5s ease;
}

.analysis-result-box {
  background-color: var(--app-card-bg);
  border: 1px solid var(--app-border);
  padding: 1.5rem; 
  border-radius: 16px; 
  margin-top: 1rem; 
  text-align: center;
  transition: all 0.5s ease;
}

.analysis-result-box p {
  color: var(--app-text);
}

.analysis-result-box p.muted {
  color: var(--app-text-muted);
  font-size: 0.95rem;
}

.analysis-result .choice-btn {
  border: 1px solid var(--app-border);
  background: transparent;
  justify-content: center;
  margin-top: 2rem;
}

.analysis-result .choice-btn::before,
.analysis-result .choice-btn::after {
  display: none;
}

.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(142, 59, 82, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(142, 59, 82, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary);
  padding: 1rem 2.5rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 1.125rem;
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--primary);
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: rgba(142, 59, 82, 0.05);
}

section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  text-align: left;
  border: 1px solid rgba(0,0,0,0.02);
}

.card h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.card p {
  color: var(--text-muted);
}

.step-number {
  background: var(--bg-color);
  color: var(--primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
}

footer {
  background: var(--card-bg);
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.05);
}

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

.footer-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

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

.copyright {
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

@media (max-width: 600px) {
  .hero { padding: 3rem 0; }
  section { padding: 4rem 0; }
  .theme-toggle-btn { right: -24px; width: 16px; }
  .theme-toggle-btn svg { width: 10px; height: 10px; }
}
