/* TreeHouse Landing Page - Brand colors from app_color.dart */
:root {
  --brand-600: #6A8C69;
  --brand-500: #81A57F;
  --brand-300: #B1D8AF;
  --brand-50: #F6FAF6;
  --gray-950: #0C111D;
  --gray-900: #101828;
  --gray-800: #1D2939;
  --gray-700: #344054;
  --gray-600: #475467;
  --gray-500: #667085;
  --gray-400: #98A2B3;
  --gray-200: #EAECF0;
  --gray-50: #F9FAFB;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(16, 24, 40, 0.1), 0 4px 6px -4px rgba(16, 24, 40, 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-800);
  background: linear-gradient(180deg, rgba(218, 230, 207, 0.8) 0%, rgba(255, 255, 255, 0) 100%), var(--white);
  overflow-x: hidden;
}

@supports (color: color(display-p3 0 0 0)) {
  body {
    background: linear-gradient(180deg, color(display-p3 0.863 0.902 0.820 / 0.8) 0%, color(display-p3 1 1 1 / 0) 100%), var(--white);
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--gray-900);
  font-weight: 600;
  font-size: 1.25rem;
}

.logo-link:hover {
  color: var(--brand-600);
}

#logo-lottie {
  width: 44px;
  height: 44px;
}

.logo-fallback {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.site-nav a:hover {
  color: var(--brand-600);
}

/* Main content */
main {
  min-height: 60vh;
}

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

.section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 0.5rem;
  text-align: center;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--gray-500);
  margin: 0 auto 3rem;
  max-width: 600px;
  text-align: center;
  white-space: nowrap;
}

/* Hero */
.hero {
  padding: 4rem 0 5rem;
  background: linear-gradient(180deg, var(--brand-50) 0%, var(--white) 100%);
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.hero-lottie-wrap {
  margin-bottom: 1rem;
}

#hero-lottie {
  width: 120px;
  height: 120px;
}

.hero-content {
  animation: fadeSlideUp 0.7s ease-out;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 1rem;
  line-height: 1.2;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin: 0 0 1.5rem;
}

.hero-image-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeSlideUp 0.7s ease-out 0.2s both;
}

.hero-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-image-wrap {
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Features grid */
.features {
  background: var(--white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.feature-card {
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-300);
}

.feature-card.reveal {
  animation: fadeSlideUp 0.5s ease-out forwards;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--brand-50);
  color: var(--brand-600);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.5rem;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--gray-500);
  margin: 0;
}

/* App preview / screenshots - Glide.js carousel (5 visible, center 1.4x, flipped non-active) */
.app-preview {
  background: var(--brand-50);
  overflow: visible;
  padding: 4rem 0 5rem;
}

.app-preview-container {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.screenshots-carousel-outer {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  overflow: visible;
  padding: 2.5rem 0 3rem;
}

.screenshots-glide.glide {
  width: 100%;
  overflow: visible !important;
}

.screenshots-glide .glide__track,
.screenshots-glide .glide__list {
  overflow: visible !important;
}

.screenshots-glide .glide__slides {
  align-items: center;
  perspective: 1000px;
  transform-style: preserve-3d;
  overflow: visible !important;
}

.screenshots-glide .glide__slide {
  overflow: visible !important;
  transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.9s ease;
  display: flex;
  justify-content: center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* Non-active: smaller + flipped (tilt) so they recede like Glide landing */
.screenshots-glide .glide__slide:not(.glide__slide--active) {
  transform: scale(0.92);
}

/* Center: larger, no tilt */
.screenshots-glide .glide__slide--active {
  transform: scale(1.1);
  z-index: 1;
}

.screenshots-glide .glide__slide .screenshot-clip {
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: filter 0.45s ease, box-shadow 0.45s ease;
  max-width: 200px;
  width: 100%;
}

.screenshots-glide .glide__slide--active .screenshot-clip {
  max-width: 240px;
  box-shadow: var(--shadow-lg);
}

.screenshots-glide .glide__slide .screenshot-clip img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}

.screenshots-glide .glide__slide--active .screenshot-clip {
  filter: none;
}

@media (max-width: 1024px) {
  .screenshots-glide .glide__slide .screenshot-clip {
    max-width: 180px;
  }
  .screenshots-glide .glide__slide--active .screenshot-clip {
    max-width: 220px;
  }
}

@media (max-width: 768px) {
  .screenshots-glide .glide__slide:not(.glide__slide--active) {
    transform: scale(0.92);
  }
  .screenshots-glide .glide__slide .screenshot-clip {
    max-width: 160px;
  }
  .screenshots-glide .glide__slide--active .screenshot-clip {
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .screenshots-glide .glide__slide:not(.glide__slide--active) {
    transform: scale(0.92);
  }
  .screenshots-glide .glide__slide .screenshot-clip {
    max-width: 140px;
  }
  .screenshots-glide .glide__slide--active .screenshot-clip {
    max-width: 200px;
  }
}

/* About */
.about {
  background: var(--white);
}

.about-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.about p {
  color: var(--gray-600);
  margin: 0 0 1rem;
}

/* Contact */
.contact {
  background: var(--gray-50);
}

.contact-inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.contact a[href^="mailto"] {
  color: var(--brand-600);
  font-weight: 600;
  text-decoration: none;
}

.contact a[href^="mailto"]:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 2.5rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color var(--transition);
}

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

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 1.25rem;
  transition: color var(--transition);
}

.social-links a:hover {
  color: var(--brand-300);
}

.footer-copy {
  font-size: 0.875rem;
  margin: 0;
}

/* Legal pages */
.legal-page main {
  padding: 2rem 0 4rem;
}

.legal-page h1 {
  font-size: 2rem;
  color: var(--gray-900);
  margin: 0 0 2rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  color: var(--gray-800);
  margin: 2rem 0 0.75rem;
}

.legal-page p,
.legal-page ul {
  color: var(--gray-600);
  margin: 0 0 1rem;
}

.legal-page ul {
  padding-left: 1.5rem;
}

/* Animations */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
