/* ==============================================
   HabitGuild Landing Page — Core Styles
   RPG Parchment / Wood Aesthetic
   ============================================== */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --bg-primary: #1A1208;
  --bg-secondary: #2C1810;
  --bg-surface: rgba(44, 24, 16, 0.8);
  --bg-surface-solid: #2C1810;

  --accent-gold: #D4A855;
  --accent-gold-light: #E8C878;
  --accent-fire: #FF6B35;
  --accent-fire-dark: #E63946;

  --parchment: #F5E6C8;
  --wood-frame: #5C3A1E;

  --text-primary: #F5E6C8;
  --text-secondary: #C4A882;
  --text-muted: #8B7355;

  --border-ornament: rgba(212, 168, 85, 0.3);
  --glow-gold: 0 0 20px rgba(212, 168, 85, 0.3);
  --glow-gold-strong: 0 0 40px rgba(212, 168, 85, 0.5);

  /* Typography */
  --font-display: 'Cinzel Decorative', serif;
  --font-body: 'Quicksand', sans-serif;

  /* Spacing */
  --section-padding: 6rem 1.5rem;
  --container-max: 1100px;

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-gold-light);
}

/* --- Utility --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================
   SECTION 1: HERO
   ======================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: radial-gradient(ellipse at 50% 30%, var(--bg-secondary) 0%, var(--bg-primary) 70%);
  text-align: center;
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero__logo {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-fire));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(212, 168, 85, 0.4));
  margin-bottom: 1rem;
}

.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero__counter {
  font-size: 0.95rem;
  color: var(--accent-fire);
  font-weight: 600;
  margin-top: 1rem;
}

.hero__languages {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--accent-gold);
  border-bottom: 2px solid var(--accent-gold);
  transform: rotate(45deg);
  animation: bounce-arrow 2s ease infinite;
  opacity: 0.6;
}

/* --- Waitlist Form --- */
.waitlist-form__group {
  display: flex;
  gap: 0;
  max-width: 480px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--glow-gold), 0 4px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-ornament);
}

.waitlist-form__input {
  flex: 1;
  padding: 1rem 1.25rem;
  background: var(--parchment);
  color: #1A1208;
  border: 2px solid var(--wood-frame);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  min-width: 0;
}

.waitlist-form__input::placeholder {
  color: var(--text-muted);
}

.waitlist-form__input:focus {
  background: #FCF3E1;
  border-color: var(--accent-gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn--primary {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-fire));
  color: var(--bg-primary);
}

.btn--primary:hover {
  filter: brightness(1.15);
  box-shadow: var(--glow-gold-strong);
}

.btn--primary:active {
  transform: scale(0.97);
}

.btn--primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: none;
}

.btn__loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: var(--bg-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn--loading .btn__text {
  display: none;
}

.btn--loading .btn__loader {
  display: block;
}

.form-feedback {
  display: none;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.form-feedback.success {
  color: #4ADE80;
}

.form-feedback.info {
  color: var(--accent-gold-light);
}

.form-feedback.error {
  color: var(--accent-fire-dark);
}

/* ========================
   SECTION 2: DRAGON BATTLE
   ======================== */
.battle-demo {
  padding: 80px 0;
  text-align: center;
  background: var(--bg-secondary);
}

.battle-demo__subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.battle-demo__canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

#battle-canvas {
  display: block;
  width: 100%;
  border-radius: 16px;
  touch-action: none;
}

.battle-placeholder {
  position: absolute;
  inset: 0;
  background: var(--bg-surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 3rem;
  color: var(--text-muted);
  transition: opacity 0.4s ease;
}

.battle-placeholder p {
  font-size: 0.9rem;
}

.battle-placeholder--hidden {
  opacity: 0;
  pointer-events: none;
}

.battle-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 12px;
  transition: opacity 0.5s ease;
}

.battle-hint--hidden {
  opacity: 0;
  pointer-events: none;
}

.battle-demo__desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 1.5rem;
}

.battle-demo__note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

@media (max-width: 768px) {
  .battle-demo__canvas-wrap {
    max-width: 100%;
    padding: 0 1rem;
  }
}

/* ========================
   SECTION 3: COMPANION
   ======================== */
.companion {
  padding: var(--section-padding);
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}

.companion__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .companion__layout {
    grid-template-columns: 1fr 1fr;
  }
}

.companion__mockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Phone Frame */
.phone-frame {
  position: relative;
  width: 260px;
  aspect-ratio: 9 / 19.5;
  background: #1A1208;
  border-radius: 36px;
  border: 3px solid var(--wood-frame);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(212, 168, 85, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-frame__notch {
  width: 100px;
  height: 24px;
  background: #1A1208;
  border-radius: 0 0 16px 16px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.phone-frame__screen {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('../assets/Images/bg.png') center / cover no-repeat;
}

.phone-frame__screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  z-index: 0;
  pointer-events: none;
}

.phone-frame__screen::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20%;
  background: url('../assets/Images/bg_lower.PNG') center bottom / cover no-repeat;
  z-index: 2;
  pointer-events: none;
}

#dragon-canvas {
  position: absolute;
  bottom: -10%;
  left: 0;
  width: 100%;
  height: 85%;
  display: block;
}

.phone-frame__hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--accent-gold-light);
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
  animation: pulse-hint 2s ease infinite;
}

/* Dialogue Bubble — positioned ABOVE the receptionist */
.dialogue-bubble {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  max-width: 85%;
  padding: 8px 14px;
  background: var(--parchment);
  color: #1A1208;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 12px;
  border: 2px solid var(--wood-frame);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 5;
  text-align: center;
}

/* Triangle pointing DOWN (toward the receptionist) */
.dialogue-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--parchment);
}

.dialogue-bubble--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.phone-frame__home {
  width: 80px;
  height: 4px;
  background: var(--wood-frame);
  border-radius: 2px;
  margin: 8px auto 12px;
}

.badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge--interactive {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-fire));
  color: var(--bg-primary);
}

.companion__info {
  text-align: center;
}

@media (min-width: 768px) {
  .companion__info {
    text-align: left;
  }
}

.companion__desc {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.companion__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.companion__features li {
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
}

.companion__features li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--accent-gold);
}

/* ========================
   SECTION 3: FEATURES
   ======================== */
.features {
  padding: var(--section-padding);
  background: var(--bg-primary);
}

.features__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-ornament);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--glow-gold);
}

.feature-card__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.feature-card__desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.feature-card__preview {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  max-width: 280px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 12px rgba(212, 168, 85, 0.3);
  border: 2px solid var(--border-ornament);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.feature-card__preview.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================
   SECTION 4: GAMEPLAY TIMELINE
   ======================== */
.gameplay {
  padding: var(--section-padding);
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.timeline {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.timeline__step {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  width: 100%;
  padding: 1.5rem;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-ornament);
  border-radius: var(--radius-lg);
}

.timeline__icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.timeline__content h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 0.3rem;
}

.timeline__content p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.timeline__connector {
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg, var(--accent-gold), transparent);
  transform-origin: top;
}

/* ========================
   SECTION 5: SOCIAL PROOF
   ======================== */
.social-proof {
  padding: var(--section-padding);
  background: var(--bg-primary);
}

/* Categories Preview */
.categories-preview {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-ornament);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--accent-gold-light);
  font-weight: 600;
}

.categories-preview__subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.grow-paths-img {
  display: block;
  max-width: 100%;
  width: 420px;
  margin: 0 auto 3rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  border: 2px solid var(--border-ornament);
}

/* Founder Quote */
.founder-quote {
  max-width: 600px;
  margin: 3rem auto 0;
  text-align: center;
}

.founder-quote blockquote {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.founder-quote cite {
  font-style: normal;
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 0.9rem;
}

.social-proof__stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat__number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--accent-gold);
  font-weight: 700;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================
   SECTION 6: CTA FINAL
   ======================== */
.cta-final {
  position: relative;
  padding: var(--section-padding);
  background: radial-gradient(ellipse at 50% 50%, rgba(212, 168, 85, 0.08) 0%, var(--bg-primary) 70%);
  text-align: center;
  overflow: hidden;
}

.cta-final__content {
  position: relative;
  z-index: 2;
}

.cta-final__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.cta-final__benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto 2.5rem;
  text-align: left;
}

.cta-final__benefits li {
  font-size: 1rem;
  color: var(--text-secondary);
}

.cta-final__benefits strong {
  color: var(--accent-gold);
}

.cta-final__platforms {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.platform-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-ornament);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================
   SECTION 7: FOOTER
   ======================== */
.footer {
  padding: 2rem 1.5rem;
  background: #120C04;
  border-top: 1px solid rgba(212, 168, 85, 0.1);
}

.footer__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer__content {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer__logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent-gold);
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer__contact {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: 1.25rem;
}

.footer__link {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--accent-gold);
}

.footer__privacy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================
   CELEBRATION CANVAS
   ======================== */
#celebration-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ========================
   PARTICLES CONTAINER
   ======================== */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* ========================
   LANGUAGE SELECTOR
   ======================== */
.lang-selector {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  gap: 4px;
  background: rgba(26, 18, 8, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-ornament);
  border-radius: 999px;
  padding: 4px;
}

.lang-selector__btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.5px;
}

.lang-selector__btn:hover {
  color: var(--accent-gold-light);
  background: rgba(212, 168, 85, 0.1);
}

.lang-selector__btn--active {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

.lang-selector__btn--active:hover {
  background: var(--accent-gold-light);
  color: var(--bg-primary);
}

/* ========================
   RESPONSIVE TWEAKS
   ======================== */
@media (max-width: 480px) {
  .waitlist-form__group {
    flex-direction: column;
    border-radius: var(--radius-md);
  }

  .waitlist-form__input {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .btn--primary {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 0.9rem;
  }

  .social-proof__stats {
    flex-direction: column;
    gap: 1.5rem;
  }
}
