/* =========================================================
   Komuna Landing — styles.css
   Design: inspired by DESIGN.md (Tesla-minimal aesthetic)
   Brand colors adapted to Komuna green palette
   ========================================================= */

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --green-900: #1B4332;   /* Primary brand — deep forest green */
  --green-800: #2D6A4F;   /* Accent green */
  --green-700: #40916C;   /* Lighter accent */
  --green-100: #D8F3DC;   /* Light green tint */
  --cream:     #F5F0E8;   /* Background warm cream */
  --white:     #FFFFFF;
  --ink-900:   #171A20;   /* Carbon dark — headings */
  --ink-700:   #393C41;   /* Graphite — body */
  --ink-500:   #5C5E62;   /* Pewter — tertiary */
  --ink-300:   #8E8E8E;   /* Silver fog — placeholder */
  --border:    #E2E0DB;   /* Subtle border */
  --surface:   #F9F7F3;   /* Alternate section bg */

  --radius-btn: 4px;
  --radius-card: 12px;
  --transition: 0.33s cubic-bezier(0.5, 0, 0, 0.75);
  --font: 'Inter', -apple-system, Arial, sans-serif;
}

/* ─── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--ink-700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green-900);
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  padding: 0 20px;
  height: 42px;
  border: 3px solid transparent;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary:hover {
  background: var(--green-800);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  padding: 0 20px;
  height: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: background-color var(--transition), border-color var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.8);
}

.btn-large {
  height: 50px;
  font-size: 15px;
  padding: 0 28px;
}

/* ─── NAV ─────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background-color var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}

.nav--scrolled {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  transition: color var(--transition);
}

.nav--scrolled .nav-logo {
  color: var(--ink-900);
}

.nav-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.nav-logo-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-btn);
  transition: color var(--transition), background-color var(--transition);
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.nav--scrolled .nav-link {
  color: var(--ink-500);
}

.nav--scrolled .nav-link:hover {
  color: var(--ink-900);
  background: var(--surface);
}

.nav-cta {
  font-size: 13px;
  height: 36px;
  padding: 0 16px;
}

/* ─── HERO ────────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('./hero.jpg');
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.03);
  transition: transform 8s ease-out;
}

.hero:hover .hero-bg {
  transform: scale(1.0);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 30, 20, 0.45) 0%,
    rgba(10, 30, 20, 0.6) 60%,
    rgba(10, 30, 20, 0.75) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 720px;
  animation: heroFadeIn 1s ease-out 0.2s both;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--green-100);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 17px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

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

.hero-platforms {
  margin-top: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(8px); }
}

/* ─── SECTIONS ────────────────────────────────────────────── */
.section {
  padding: 96px 0;
}

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

.section--dark {
  background: var(--green-900);
}

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

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 64px;
}

.section-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-800);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-eyebrow--light {
  color: var(--green-100);
}

.section-title {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-title--light {
  color: var(--white);
}

.section-subtitle {
  font-size: 16px;
  color: var(--ink-500);
  line-height: 1.6;
}

.section-subtitle--light {
  color: rgba(255, 255, 255, 0.7);
}

/* ─── FEATURES GRID ───────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.feature-card {
  background: var(--white);
  padding: 40px 36px;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, background-color var(--transition);
}

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

.feature-card:hover {
  background: var(--surface);
}

.feature-card--highlight {
  background: var(--green-900);
}

.feature-card--highlight:hover {
  background: var(--green-800);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-100);
  border-radius: 10px;
  color: var(--green-900);
  margin-bottom: 20px;
}

.feature-icon--light {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.feature-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 10px;
  line-height: 1.3;
}

.feature-card--highlight .feature-title {
  color: var(--white);
}

.feature-desc {
  font-size: 14px;
  color: var(--ink-500);
  line-height: 1.65;
}

.feature-card--highlight .feature-desc {
  color: rgba(255, 255, 255, 0.75);
}

.feature-badge {
  display: inline-block;
  margin-top: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-100);
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ─── STEPS ───────────────────────────────────────────────── */
.steps-grid {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  flex: 1;
  text-align: center;
  padding: 40px 32px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.step.visible {
  opacity: 1;
  transform: translateY(0);
}

.step-divider {
  width: 1px;
  height: 80px;
  background: var(--border);
  flex-shrink: 0;
}

.step-number {
  font-size: 48px;
  font-weight: 600;
  color: var(--green-100);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.step-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 10px;
}

.step-desc {
  font-size: 14px;
  color: var(--ink-500);
  line-height: 1.65;
}

/* ─── CHANGELOG ───────────────────────────────────────────── */
.changelog {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.changelog-entry {
  background: var(--surface);
  padding: 40px 44px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.changelog-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.changelog-entry--current {
  border-left: 4px solid var(--green-900);
}

.changelog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.changelog-version {
  font-size: 14px;
  font-weight: 600;
  color: var(--green-900);
  font-variant-numeric: tabular-nums;
}

.changelog-date {
  font-size: 13px;
  color: var(--ink-300);
}

.changelog-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}

.changelog-badge--stable {
  background: var(--green-100);
  color: var(--green-900);
}

.changelog-badge--beta {
  background: #FFF3CD;
  color: #856404;
}

.changelog-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.changelog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.changelog-list li {
  font-size: 14px;
  color: var(--ink-700);
  padding-left: 20px;
  position: relative;
  line-height: 1.55;
}

.changelog-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-700);
}

.changelog-downloads {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.changelog-download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--green-900);
  text-decoration: none;
  border-bottom: 1px solid var(--green-100);
  padding-bottom: 1px;
  transition: border-color var(--transition), color var(--transition);
}

.changelog-download-link:hover {
  color: var(--green-800);
  border-color: var(--green-700);
}

.changelog-note {
  text-align: center;
  font-size: 14px;
  color: var(--ink-300);
  margin-top: 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.changelog-downloads-fallback {
  font-size: 13px;
  color: var(--ink-300);
  margin: 0;
}

/* ─── DOWNLOAD ────────────────────────────────────────────── */
.download-block {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.download-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 52px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.download-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-card);
  padding: 36px 28px;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, background-color var(--transition);
}

.download-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.download-card:hover {
  background: rgba(255, 255, 255, 0.11);
}

.download-card-icon {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.download-card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}

.download-card-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 24px;
}

.download-btn {
  width: 100%;
  height: 46px;
}

.download-card-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 12px;
}

.download-footer-note {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 40px;
}

.download-footer-link {
  color: var(--primary);
  text-decoration: underline;
}

.download-card--unavailable .download-btn {
  display: none;
}

.download-card--unavailable .download-card-note {
  display: none;
}

.download-card-placeholder {
  padding: 12px 0;
  text-align: center;
}

.download-card-placeholder-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.download-card-placeholder-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  margin: 0;
}

/* ─── FOOTER ──────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.footer-brand-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
}

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

.footer-link {
  font-size: 14px;
  color: var(--ink-500);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--ink-900);
}

.footer-copy {
  font-size: 13px;
  color: var(--ink-300);
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps-grid {
    flex-direction: column;
    gap: 0;
  }

  .step-divider {
    width: 48px;
    height: 1px;
    background: var(--border);
  }
}

@media (max-width: 640px) {
  .section {
    padding: 64px 0;
  }

  .nav-inner {
    padding: 0 20px;
  }

  .container {
    padding: 0 20px;
  }

  .nav-links {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    padding: 32px 24px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
    max-width: 280px;
  }

  .download-cards {
    grid-template-columns: 1fr;
    max-width: 360px;
  }

  .changelog-entry {
    padding: 32px 24px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-nav {
    gap: 16px;
  }
}
