/* ============================================
   ForestStar — Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500&display=swap');

:root {
  --cream: #F0EDE8;
  --cream-dark: #E8E3DC;
  --white: #FFFFFF;
  --text: #2C2A26;
  --text-secondary: #6B6560;
  --green: #3D5A3E;
  --green-light: #5A7A5B;
  --green-muted: #E8EDE8;
  --border: #D8D3CC;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --nav-height: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   NAV
   ============================================ */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(240, 237, 232, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.2s;
}

.nav-theme-btn:hover { color: var(--text); }

.nav-download { position: relative; }

.nav-download-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.nav-download-btn:hover {
  background: var(--text);
  color: var(--cream);
}

.nav-download-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: 240px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.nav-download.open .nav-download-dropdown { display: block; }

.store-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--cream);
  margin-bottom: 8px;
  opacity: 0.6;
  cursor: not-allowed;
}

.store-badge:last-child { margin-bottom: 0; }
.store-badge svg { flex-shrink: 0; }
.store-badge-text { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.3; }
.store-badge-name { font-weight: 600; font-size: 0.85rem; color: var(--text); display: block; }
.store-badge-soon { font-size: 0.7rem; color: var(--green); font-weight: 500; }

/* ============================================
   PHONE MOCKUP
   ============================================ */

.phone-mockup {
  position: relative;
  width: 220px;
  height: 450px;
  background: #0E0E0E;
  border-radius: 38px;
  box-shadow:
    0 0 0 1.5px #3a3a3a,
    0 0 0 3px #0E0E0E,
    0 20px 56px rgba(0,0,0,0.20);
  overflow: hidden;
  flex-shrink: 0;
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #0E0E0E;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}

.phone-mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.phone-mockup.large {
  width: 255px;
  height: 522px;
  border-radius: 42px;
}

.phone-mockup.small {
  width: 185px;
  height: 379px;
  border-radius: 34px;
}

.phone-mockup.small::before {
  width: 78px;
  height: 19px;
}

/* ============================================
   SECTIONS — SHARED
   ============================================ */

section {
  padding: 120px 64px;
}

.section-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.75;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.text-link:hover { border-color: var(--green); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--text);
  color: var(--cream);
  border: none;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--green);
  transform: translateY(-1px);
}

/* ============================================
   SECTION 1+2 — OPENING
   ============================================ */

.opening {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-height) + 80px);
  padding-bottom: 80px;
  gap: 96px;
  max-width: 1200px;
  margin: 0 auto;
}

.opening-phone { flex-shrink: 0; }
.opening-text { flex: 1; }
.opening-text .section-sub { margin-bottom: 36px; }

/* ============================================
   SECTION 3 — CATEGORIES (SCROLL-PINNED)
   ============================================ */

/* Outer container creates scroll travel space — height set by JS */
.categories-scroll-outer {
  position: relative;
  height: 500vh; /* fallback; overridden by JS */
}

.categories-section {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  background: var(--white);
}

.categories-header {
  padding: 0 64px;
  margin-bottom: 48px;
}

.categories-header .section-heading { max-width: 480px; margin-bottom: 12px; }
.categories-header .section-sub { margin-top: 0; }

.carousel-wrapper {
  position: relative;
  overflow: visible;
}

.carousel-wrapper::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 120px;
  background: linear-gradient(to right, transparent, var(--white));
  pointer-events: none;
  z-index: 2;
}

.categories-track {
  display: flex;
  gap: 28px;
  overflow: visible;
  padding: 16px 64px 16px;
  scrollbar-width: none;
  will-change: transform;
  cursor: default;
}

.categories-track::-webkit-scrollbar { display: none; }

.category-card {
  flex-shrink: 0;
  width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center bottom;
}

.category-card .phone-mockup {
  margin-bottom: 22px;
  transition: box-shadow 0.3s ease;
}

.category-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.category-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 180px;
}

/* Progress dots */
.categories-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 24px 0 0;
}

.progress-dot {
  height: 3px;
  width: 20px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.3s ease, width 0.3s ease;
}

.progress-dot.active {
  background: var(--green);
  width: 36px;
}

/* Touch carousel arrow buttons (mobile only) */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  z-index: 10;
  transition: background 0.2s, opacity 0.2s, transform 0.2s;
  opacity: 0;
}

.carousel-wrapper:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover { background: var(--text); color: var(--cream); transform: translateY(-60%) scale(1.05); }
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }
.carousel-btn:disabled { opacity: 0 !important; pointer-events: none; }

/* ============================================
   SECTION 4 — WHY FORESTSTAR
   ============================================ */

.why-section {
  max-width: 1200px;
  margin: 0 auto;
}

.why-header { margin-bottom: 72px; }

.why-sub {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  color: var(--text-secondary);
  line-height: 1.9;
  margin-top: 28px;
  max-width: 640px;
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px 80px;
}

.why-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 20px;
  color: var(--green);
}

.why-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.why-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   SECTION 5 — MADE BY A FORESTAR
   ============================================ */

.made-section {
  background: var(--cream-dark);
  max-width: 100%;
}

.made-inner {
  display: flex;
  align-items: center;
  gap: 96px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 64px;
  width: 100%;
}

.made-illustration {
  flex-shrink: 0;
  width: 360px;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
}

.made-text .section-sub { margin-bottom: 24px; }

.made-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============================================
   SECTION 5.5 — GET THE APP
   ============================================ */

.appstore-section {
  text-align: center;
  background: var(--white);
  max-width: 100%;
}

.appstore-inner {
  max-width: 560px;
  margin: 0 auto;
}

.appstore-badges {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.store-badge.large {
  opacity: 1;
  cursor: default;
  padding: 16px 24px;
  gap: 14px;
  background: var(--cream);
  border: 1px solid var(--border);
}

.store-badge.large .store-badge-name { font-size: 1rem; }
.store-badge.large .store-badge-text { font-size: 0.85rem; }
.store-badge.large .store-badge-soon { font-size: 0.78rem; }

/* ============================================
   SECTION 6 — CONTACT
   ============================================ */

.contact-section {
  text-align: center;
  background: var(--white);
  max-width: 100%;
}

.contact-inner {
  max-width: 560px;
  margin: 0 auto;
}

.contact-inner .section-sub { margin: 0 auto 36px; }

.contact-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  background: var(--text);
  color: rgba(240,237,232,0.6);
  padding: 40px 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: #F0EDE8;
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.8rem;
  color: rgba(240,237,232,0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: #F0EDE8; }

.footer-copy {
  font-size: 0.75rem;
  color: rgba(240,237,232,0.4);
}

/* ============================================
   ABOUT PAGE
   ============================================ */

.about-hero {
  padding-top: calc(var(--nav-height) + 100px);
  padding-bottom: 100px;
  display: flex;
  align-items: center;
  gap: 96px;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 64px;
  padding-right: 64px;
}

.about-hero-text { flex: 1; }
.about-hero-text .section-label { margin-bottom: 12px; }

.about-watercolor {
  width: 360px;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.about-journey {
  background: var(--white);
  padding: 120px 64px;
}

.about-journey-inner {
  max-width: 720px;
  margin: 0 auto;
}

.journey-block {
  display: flex;
  gap: 40px;
  margin-bottom: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}

.journey-block:last-child { border-bottom: none; margin-bottom: 0; }

.journey-year {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
  min-width: 80px;
  flex-shrink: 0;
  padding-top: 2px;
}

.journey-content h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.journey-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ============================================
   FEEDBACK PAGE
   ============================================ */

.feedback-page {
  padding-top: calc(var(--nav-height) + 96px);
  padding-bottom: 120px;
  max-width: 640px;
  margin: 0 auto;
  padding-left: 48px;
  padding-right: 48px;
}

.feedback-label { margin-bottom: 12px; }
.feedback-page .section-heading { margin-bottom: 16px; }
.feedback-page .section-sub { margin-bottom: 56px; }

.form-group { margin-bottom: 32px; }

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 10px;
}

.form-label span {
  font-weight: 400;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.7rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus { border-color: var(--green); }

.form-input::placeholder,
.form-textarea::placeholder { color: var(--border); }

.form-select-wrap { position: relative; }

.form-select-wrap::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-secondary);
  pointer-events: none;
}

.form-textarea { resize: vertical; min-height: 180px; }

.form-submit {
  width: 100%;
  padding: 16px;
  background: var(--text);
  color: var(--cream);
  border: none;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
  margin-top: 8px;
}

.form-submit:hover { background: var(--green); }
.form-submit:disabled,
.form-submit.is-submitting { opacity: 0.6; cursor: default; }

.form-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 20px;
}
.form-note-error { color: #b3402f; }

/* ============================================
   TERMS / PRIVACY PAGES
   ============================================ */

.legal-hero {
  padding-top: calc(var(--nav-height) + 96px);
  padding-bottom: 64px;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 64px;
  padding-right: 64px;
}

.legal-hero .section-heading { margin-top: 12px; }

.legal-updated {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legal-pullquote {
  background: var(--white);
  border-left: 3px solid var(--green);
  padding: 24px 32px;
  margin: 48px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.legal-pullquote p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
}

.legal-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 64px;
}

.legal-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-of-type { border-bottom: none; }

.legal-section-alt {
  background: var(--white);
  margin: 0 -64px;
  padding: 64px 64px;
}

.leaf-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 24px;
  color: var(--green);
  opacity: 0.4;
}

.legal-section h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.legal-section h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 12px;
}

.legal-section p, .legal-section li {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 14px;
}

.legal-section ul { padding-left: 20px; }
.legal-section li { margin-bottom: 8px; }

.legal-callout {
  background: var(--green-muted);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 0.9rem;
  color: var(--green);
  font-weight: 500;
}

/* ============================================
   DARK MODE — warm, not pure black
   ============================================ */

body.dark {
  --cream: #1A1916;
  --cream-dark: #141210;
  --white: #221F1B;
  --text: #EDE8E2;
  --text-secondary: #8A8580;
  --border: #38342E;
  --green-muted: #1C251C;
}

body.dark nav {
  background: rgba(26, 25, 22, 0.92);
}

body.dark .phone-mockup {
  box-shadow:
    0 0 0 1.5px #555,
    0 0 0 3px #222,
    0 20px 56px rgba(0,0,0,0.45);
}

body.dark footer {
  background: #0E0C0A;
}

body.dark .nav-download-dropdown {
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ============================================
   FADE-IN ANIMATION
   ============================================ */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .opening { gap: 64px; }
  .made-inner { gap: 64px; padding: 100px 48px; }
  .about-hero { gap: 64px; padding-left: 48px; padding-right: 48px; }
}

@media (max-width: 900px) {
  nav { padding: 0 24px; }
  section { padding: 88px 32px; }

  .opening {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: calc(var(--nav-height) + 56px) 32px 88px;
    min-height: auto;
    gap: 56px;
  }

  .opening-text .section-sub { margin-left: auto; margin-right: auto; }

  .why-grid { grid-template-columns: 1fr; gap: 48px; }

  .made-inner {
    flex-direction: column;
    padding: 88px 32px;
    gap: 48px;
  }

  .made-illustration { width: 100%; max-width: 400px; height: 260px; margin: 0 auto; }

  .about-hero {
    flex-direction: column;
    padding: calc(var(--nav-height) + 64px) 32px 64px;
    gap: 48px;
    text-align: center;
  }

  .about-watercolor { width: 100%; max-width: 400px; height: 280px; }

  /* Categories — restore touch carousel on tablet/mobile */
  .categories-scroll-outer { height: auto; }
  .categories-section {
    position: static;
    height: auto;
    overflow: visible;
    padding: 120px 0;
    display: block;
  }
  .carousel-wrapper { overflow: hidden; }
  .categories-track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    will-change: auto;
  }
  .categories-track:active { cursor: grabbing; }
  .category-card { transform: none !important; opacity: 1 !important; }
  .categories-progress { display: none; }
  .categories-header { padding: 0 32px; }
  .categories-track { padding: 16px 32px 40px; }

  .legal-hero { padding-left: 32px; padding-right: 32px; }
  .legal-body { padding-left: 32px; padding-right: 32px; }
  .legal-section-alt { margin: 0 -32px; padding: 64px 32px; }

  footer { padding: 32px 32px; }
  .feedback-page { padding-left: 32px; padding-right: 32px; }
  .about-journey { padding: 88px 32px; }
}

@media (max-width: 600px) {
  .nav-links a { display: none; }

  .phone-mockup { width: 200px; height: 409px; border-radius: 34px; }
  .phone-mockup.large { width: 230px; height: 471px; border-radius: 38px; }
  .phone-mockup.small { width: 168px; height: 344px; border-radius: 30px; }
  .phone-mockup.small::before { width: 70px; height: 17px; }

  .why-section { padding: 88px 24px; }
  .contact-section { padding: 88px 24px; }
  footer { flex-direction: column; align-items: flex-start; gap: 12px; padding: 32px 24px; }

  .carousel-wrapper::after { width: 60px; }
  .categories-track { padding: 16px 24px 40px; }
  .categories-header { padding: 0 24px; }
}
