/* ==========================================================================
   Learnify — Landing page (index.html)
   Clean, modern, responsive styling with proper alignment and typography.
   ========================================================================== */

/* ---------- Header ---------- */

.site-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo .logo-mark { color: var(--color-purple); }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--color-purple); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--color-text);
  padding: 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.mobile-nav-toggle:hover {
  background: var(--color-purple-light);
  color: var(--color-purple);
}

/* Mobile Navigation Dropdown/Drawer */
.landing-mobile-menu {
  display: none;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6);
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  box-shadow: var(--shadow-lg);
  z-index: 99;
}

.landing-mobile-menu.open {
  display: block;
}

.landing-mobile-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.landing-mobile-nav .mobile-nav-link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* Theme switch (sun / pill / moon) */
.theme-switch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-subtle);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.theme-switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  transition: background 0.2s ease;
}

.theme-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

:root[data-theme="dark"] .theme-switch-track {
  background: var(--color-purple);
}
:root[data-theme="dark"] .theme-switch-knob {
  transform: translateX(16px);
}

.theme-switch svg {
  flex-shrink: 0;
}

/* ---------- Hero ---------- */

.hero {
  padding: var(--space-12) 0 0;
  overflow: hidden;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-10);
  align-items: center;
  padding-bottom: var(--space-12);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--color-purple-light);
  color: var(--color-purple);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.hero-heading {
  font-size: 2.875rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.text-purple {
  color: var(--color-purple);
}

.hero-subtext {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 480px;
  margin-bottom: var(--space-6);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
}

.hero-social-proof {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.avatar-stack {
  display: flex;
}

.avatar-stack .avatar-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--color-surface);
  background: var(--color-purple-light);
  color: var(--color-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: -8px;
}
.avatar-stack .avatar-chip:first-child { margin-left: 0; }

.hero-social-proof strong {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.2;
}

.hero-social-proof span {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

/* ---------- Hero Visual (Mockup) ---------- */

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-mock {
  position: relative;
  width: 100%;
  max-width: 460px;
}

.device-screen {
  background: var(--color-ink);
  border: 6px solid #06060c;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.device-base {
  height: 12px;
  max-width: 90%;
  margin: 0 auto;
  background: linear-gradient(#06060c, #1a1a24);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.device-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.device-topbar .device-logo {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.device-topbar .device-search {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.4);
}

.device-topbar .device-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-purple);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-body {
  display: grid;
  grid-template-columns: 80px 1fr 100px;
  gap: var(--space-2);
  padding: var(--space-3);
}

.device-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.device-nav-item {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.45);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
}

.device-nav-item.active {
  background: rgba(109, 61, 245, 0.35);
  color: #fff;
  font-weight: 600;
}

.device-video-card {
  background: linear-gradient(135deg, #6D3DF5 0%, #3B82F6 100%);
  border-radius: var(--radius-sm);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.device-play-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
}

.device-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.device-mini-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 5px 2px;
  text-align: center;
  font-size: 0.5625rem;
  color: rgba(255, 255, 255, 0.6);
}

.device-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.device-summary-card,
.device-progress-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.device-summary-card .device-card-label {
  font-size: 0.5625rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-bottom: 5px;
}

.skel-line {
  display: block;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.18);
  margin-bottom: 4px;
}
.skel-line:nth-child(3) { width: 80%; }
.skel-line:nth-child(4) { width: 60%; }

.device-progress-card {
  text-align: center;
}

.mini-ring {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin: 0 auto 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  background: conic-gradient(var(--color-purple) 0% 78%, rgba(255, 255, 255, 0.12) 78% 100%);
}

.device-progress-card span {
  font-size: 0.5625rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Floating chips */
.hero-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  animation: float 4s ease-in-out infinite;
  z-index: 3;
}

.hero-float-streak {
  top: -4%;
  right: -3%;
}

.hero-float-score {
  bottom: -4%;
  left: -4%;
  animation-delay: 1.4s;
}

.hero-float .hero-float-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-float-streak .hero-float-icon {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.hero-float-score .hero-float-icon {
  background: var(--color-success-bg);
  color: var(--color-success);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-float { animation: none; }
}

/* ---------- Stats bar ---------- */

.hero-stats-container {
  position: relative;
  z-index: 4;
}

.hero-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(50%);
}

.hero-stat-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5);
  border-right: 1px solid var(--color-border);
}
.hero-stat-item:last-child { border-right: none; }

.hero-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-stat-icon.icon-purple { background: var(--color-purple-light); color: var(--color-purple); }
.hero-stat-icon.icon-blue { background: var(--color-blue-light); color: var(--color-blue); }
.hero-stat-icon.icon-warning { background: #FEF3C7; color: var(--color-warning); }
.hero-stat-icon.icon-success { background: var(--color-success-bg); color: var(--color-success); }

.hero-stat-copy {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.hero-stat-copy h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--color-text);
}

.hero-stat-copy p {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.hero-stats-spacer {
  height: 64px;
}

/* ---------- General Section Headers & Grids ---------- */

.feature-strip {
  border-top: 1px solid var(--color-border);
  padding: var(--space-16) 0;
}

.feature-strip.section-alt {
  background: var(--color-surface);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-12);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-eyebrow {
  display: inline-block;
  color: var(--color-purple);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.section-heading {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.25;
}

.section-subheading {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* 4-column Features Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.feature-strip.section-alt .feature-item {
  background: var(--color-bg);
}

.feature-item:hover {
  transform: translateY(-2px);
  border-color: var(--color-purple);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-purple-light);
  color: var(--color-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}

.feature-item h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.feature-item p {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* 3-column How It Works Grid */
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.step-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  position: relative;
}

.step-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-purple);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.step-card h4 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.step-card p {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* Info Cards (About / Terms) */
.info-card-wrap {
  display: flex;
  justify-content: center;
}

.info-card {
  max-width: 720px;
  width: 100%;
  text-align: center;
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.feature-strip.section-alt .info-card {
  background: var(--color-bg);
}

.info-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.info-card p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-8);
  padding: var(--space-12) 0 var(--space-8);
}

.footer-brand .site-logo {
  margin-bottom: var(--space-3);
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 320px;
}

.footer-col h5 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-4);
  font-weight: 700;
}

.footer-col a {
  display: block;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: var(--space-3);
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--color-purple); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-5);
}

.footer-bottom-links a { 
  color: var(--color-text-subtle); 
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-bottom-links a:hover { color: var(--color-text); }

/* ---------- Responsive Breakpoints ---------- */

@media (max-width: 1024px) {
  .hero-heading { font-size: 2.375rem; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .device-body { grid-template-columns: 70px 1fr 90px; }
}

@media (max-width: 900px) {
  .site-nav { display: none; }
  .mobile-nav-toggle { display: inline-flex; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .hero-visual {
    order: -1;
    max-width: 420px;
    margin: 0 auto var(--space-6);
  }

  .hero-stats-bar {
    grid-template-columns: repeat(2, 1fr);
    transform: none;
    margin-top: var(--space-6);
  }
  .hero-stat-item:nth-child(2) { border-right: none; }
  .hero-stat-item:nth-child(1),
  .hero-stat-item:nth-child(2) { border-bottom: 1px solid var(--color-border); }
  .hero-stats-spacer { display: none; }

  .how-it-works-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .hero-heading { font-size: 1.875rem; word-break: break-word; }
  .hero-subtext { font-size: 1rem; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-float { display: none !important; }
  
  .hero-visual {
    display: none !important;
  }

  .hero-stats-bar { grid-template-columns: 1fr; width: 100%; }
  .hero-stat-item { border-right: none !important; border-bottom: 1px solid var(--color-border); }
  .hero-stat-item:last-child { border-bottom: none; }

  .feature-grid { grid-template-columns: 1fr; }
  .header-actions .btn-secondary { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; gap: var(--space-3); }
  .footer-bottom-links { justify-content: center; flex-wrap: wrap; }
}
