/* ==========================================================
   Trainable — Style (PixelOS Inspired)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@8..144,100..1000&display=swap');

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  /* Monolithic Dark Scheme — exact app colors */
  --md-primary: #3A59D1;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #3A59D1;
  --md-on-primary-container: #FFFFFF;
  --md-secondary: #A9A0B9;
  --md-on-secondary: #292336;
  --md-secondary-container: #292336;
  --md-on-secondary-container: #A9A0B9;
  --md-tertiary: #7AC6D2;
  --md-on-tertiary: #00363D;
  --md-tertiary-container: #5AB1BF;
  --md-on-tertiary-container: #00363D;

  --md-surface: #0E0E11;
  --md-on-surface: #E7E1EC;
  --md-surface-variant: #141317;
  --md-on-surface-variant: #ADA9B3;
  --md-surface-container: #1A191E;
  --md-surface-container-high: #201F25;
  --md-surface-container-highest: #26252C;
  --md-surface-container-low: #141317;

  --md-outline: #49474F;
  --md-outline-variant: #49474F;
  --md-error: #FFB4AB;
  --md-on-error: #690005;

  --nav-blur: rgba(14, 14, 17, 0.75);
}

[data-theme="light"] {
  /* Monolithic Light Scheme */
  --md-primary: #3A59D1;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #DDE1FF;
  --md-on-primary-container: #00164F;
  --md-secondary: #5A5D72;
  --md-on-secondary: #FFFFFF;
  --md-secondary-container: #DEE1F9;
  --md-on-secondary-container: #171A2C;
  --md-tertiary: #75546F;
  --md-on-tertiary: #FFFFFF;
  --md-tertiary-container: #FFD7F5;
  --md-on-tertiary-container: #2C1229;

  --md-surface: #FBF8FF;
  --md-on-surface: #1B1B21;
  --md-surface-variant: #E2E0EC;
  --md-on-surface-variant: #45454F;
  --md-surface-container: #EFECF4;
  --md-surface-container-high: #E9E7EE;
  --md-surface-container-highest: #E2E0E8;
  --md-surface-container-low: #F5F2FA;

  --md-outline: #767680;
  --md-outline-variant: #C6C4D0;
  --md-error: #BA1A1A;
  --md-on-error: #FFFFFF;

  --nav-blur: rgba(251, 248, 255, 0.8);
}

body {
  font-family: 'Google Sans Flex', 'Outfit', sans-serif;
  background-color: var(--md-surface);
  color: var(--md-on-surface);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
}

*, *::before, *::after {
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, fill 0.4s ease;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* ================================================================
   ENTRANCE ANIMATIONS
   ================================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    translate: 0 60px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.animate-in {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.nav-inner.animate-in {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section-alt { background-color: var(--md-surface-container); border-radius: 40px; margin: 20px; }

.text-center { text-align: center; }

/* ================================================================
   HERO GRADIENT BACKGROUND
   ================================================================ */
.hero-section::before {
  content: '';
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  background:
    radial-gradient(ellipse 65% 50% at 20% 30%, color-mix(in srgb, var(--md-primary), transparent 80%) 0%, transparent 100%),
    radial-gradient(ellipse 45% 55% at 80% 25%, color-mix(in srgb, var(--md-primary), transparent 88%) 0%, transparent 100%),
    radial-gradient(ellipse 55% 60% at 50% 85%, color-mix(in srgb, var(--md-primary), transparent 85%) 0%, transparent 100%);
  pointer-events: none;
  z-index: -2;
  animation: heroGradientDrift 30s ease-in-out infinite alternate;
}

@keyframes heroGradientDrift {
  0%   { transform: translate(0%, 0%); }
  50%  { transform: translate(-4%, -3%); }
  100% { transform: translate(3%, 4%); }
}

/* ================================================================
   FLOATING MONET VECTORS
   ================================================================ */
.monet-orb {
  position: absolute;
  width: clamp(200px, 35vw, 500px);
  opacity: 0.7;
  z-index: -1;
  pointer-events: none;
  --tx: 0;
  --ty: 0;
  filter: blur(30px);
  animation: spin 30s linear infinite;
}
.monet-y { top: 0; left: 0; --tx: -40%; --ty: -40%; }
.monet-w { top: 0; right: 0; --tx: 55%; --ty: -20%; animation-direction: reverse; animation-duration: 40s; }
.monet-b { bottom: 0; left: 0; --tx: -35%; --ty: 40%; animation-duration: 35s; }
.monet-t { bottom: 0; right: 0; --tx: 30%; --ty: 30%; animation-duration: 45s; animation-direction: reverse; }

@keyframes spin {
  from { transform: translate(var(--tx), var(--ty)) rotate(0deg); }
  to { transform: translate(var(--tx), var(--ty)) rotate(360deg); }
}

[data-theme="light"] .monet-orb { opacity: 0.35; }

/* ================================================================
   NAVIGATION
   ================================================================ */
nav {
  position: fixed;
  top: 20px; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 24px;
}
.nav-inner {
  width: 100%;
  max-width: 1152px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--nav-blur);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 100px;
  position: relative;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.2rem;
}
.nav-logo img { border-radius: 8px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font-weight: 500;
  color: var(--md-on-surface-variant);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--md-on-surface); }

/* Theme Switch */
.theme-switch {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  background: var(--md-surface-container-highest);
  flex-shrink: 0;
  transition: background 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.theme-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--md-on-surface-variant);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sw-icon {
  position: absolute;
  width: 14px;
  height: 14px;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  pointer-events: none;
}
.sw-sun { left: 6px; }
.sw-moon { right: 6px; }
[data-theme="dark"] .sw-sun { opacity: 0.35; color: var(--md-on-surface-variant); }
[data-theme="dark"] .sw-moon { opacity: 1; color: var(--md-on-surface); }
[data-theme="light"] .sw-sun { opacity: 1; color: var(--md-on-surface); }
[data-theme="light"] .sw-moon { opacity: 0.35; color: var(--md-on-surface-variant); }
[data-theme="dark"] .theme-switch::after { transform: translateX(0); }
[data-theme="light"] .theme-switch::after {
  transform: translateX(24px);
  background: var(--md-primary);
  box-shadow: 0 0 8px color-mix(in srgb, var(--md-primary), transparent 50%);
}

.nav-download-btn {
  background: var(--md-primary);
  color: var(--md-on-primary) !important;
  padding: 10px 24px;
  border-radius: 100px;
  font-weight: 600 !important;
  transition: opacity 0.2s;
}
.nav-download-btn:hover { opacity: 0.9; }

.hamburger-btn { display: none; background: none; border: none; color: var(--md-on-surface); cursor: pointer; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ================================================================
   HERO
   ================================================================ */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 100px;
  position: relative;
  overflow: hidden;
}
.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  width: 100%;
  padding: 0 48px;
  gap: 60px;
}
.hero-text-side { flex: 1; }
.hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}
.hero-sub {
  font-size: 1.2rem;
  color: var(--md-on-surface-variant);
  max-width: 500px;
  margin-bottom: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--md-surface-container-high);
  color: var(--md-on-surface-variant);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 100px;
  width: fit-content;
  margin-bottom: 16px;
}

.hero-cta {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 16px;
  justify-content: start;
  align-items: center;
}
.btn-kofi { grid-column: 1 / -1; justify-self: center; gap: 8px; }
.btn-icon { width: 20px; height: 20px; }
.btn-kofi .kofi-icon { width: 20px; height: 20px; }
[data-theme="dark"] .btn-icon-github { filter: brightness(0) invert(1); }

.btn {
  padding: 16px 32px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { transform: scale(1.05); }
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--md-primary); color: var(--md-on-primary); }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--md-surface-container-high); color: var(--md-on-surface); }
.btn-secondary:hover { background: var(--md-surface-container-highest); }

.hero-visual-side {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-phone-stack {
  position: relative;
  width: 300px;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone-card {
  position: absolute;
  max-width: 300px;
  border-radius: 32px;
  border: 4px solid var(--md-outline-variant);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  width: 100%;
  transition: transform 0.3s ease;
}
.phone-card-front {
  position: relative;
  z-index: 3;
}
.phone-card-back {
  z-index: 1;
  opacity: 0.7;
}
.phone-card-left {
  transform: rotate(-8deg) translateX(-40px) translateY(3px);
}
.phone-card-right {
  transform: rotate(8deg) translateX(40px) translateY(5px);
}

/* ================================================================
   FEATURES
   ================================================================ */
.section-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.02em; }
.section-desc { font-size: 1.1rem; color: var(--md-on-surface-variant); margin-bottom: 60px; max-width: 600px; margin-left: auto; margin-right: auto; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--md-surface-container);
  padding: 32px;
  border-radius: 24px;
  transition: transform 0.3s ease;
}
.feature-card:hover { transform: translateY(-8px); }
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--md-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature-icon .material-symbols-outlined {
  font-size: 24px;
  color: var(--md-on-primary-container);
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.feature-card h3 { font-size: 1.3rem; margin-bottom: 12px; font-weight: 600; }
.feature-card p { color: var(--md-on-surface-variant); font-size: 0.95rem; line-height: 1.6; }

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--md-outline-variant);
}
.footer-inner {
  display: flex; flex-direction: column; gap: 16px; align-items: center;
}
.footer-copy { color: var(--md-on-surface-variant); font-size: 0.9rem; }
.footer-made { color: var(--md-on-surface-variant); font-size: 0.85rem; }
.footer-heart { color: #FF5A16; }
.footer-links { display: flex; gap: 24px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--md-surface-container);
  transition: background 0.2s;
}
.footer-links a:hover { background: var(--md-surface-container-high); }
.footer-icon { width: 24px; height: 24px; display: block; }
.footer-icon-github { transition: filter 0.2s; }
[data-theme="dark"] .footer-icon-github { filter: brightness(0) invert(1); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  .hero-content { flex-direction: column; text-align: center; padding-top: 40px; }
  .hero-cta {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .btn-kofi { justify-self: center; }
  .hero-visual-side { margin-top: 40px; }
  .hero-phone-stack { width: 260px; height: 520px; }
  .phone-card { max-width: 260px; }
  .monet-orb { width: 40vw; }
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--nav-blur);
    flex-direction: column;
    padding: 0 24px;
    border-radius: 24px;
    margin-top: 10px;
    backdrop-filter: blur(16px);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease, padding 0.3s ease;
    pointer-events: none;
  }
  .nav-links.mobile-open {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    padding: 24px;
  }
  .nav-links.mobile-open a { display: block; }
  .hamburger-btn { display: block; }
  .nav-download-btn { width: 100%; text-align: center; }
}
