/* ============================================================
   Vervain Landing Page — Hand-Crafted Organic Theme
   Colors sourced from Theme.swift
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand */
  --green: rgb(56, 143, 89);
  --green-glow: rgba(56, 143, 89, 0.4);
  --amber: rgb(199, 140, 46);
  --amber-glow: rgba(199, 140, 46, 0.3);
  --terracotta: rgb(189, 102, 66);
  --terracotta-glow: rgba(189, 102, 66, 0.3);
  --sage: rgb(102, 148, 112);
  --sage-glow: rgba(102, 148, 112, 0.3);

  /* Backgrounds (dark — default) */
  --bg: #1A1712;
  --bg-sidebar: #1F1C14;
  --bg-surface: #24211A;
  --bg-surface-hover: #2A2720;
  --bg-surface-overlay: rgba(255, 255, 255, 0.04);

  /* Text */
  --text: #F5F0E6;
  --text-secondary: rgba(245, 240, 230, 0.6);
  --text-muted: rgba(245, 240, 230, 0.35);
  --text-faint: rgba(245, 240, 230, 0.2);

  /* Divider */
  --divider: rgba(255, 255, 255, 0.07);

  /* Spacing */
  --section-pad: 120px 0;
  --container: 1100px;

  /* Radius */
  --radius: 12px;
  --radius-lg: 20px;
}

/* ── Reset ──────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* Subtle film grain — warmth & texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* Custom selection */
::selection {
  background: var(--green);
  color: white;
}

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ─────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(26, 23, 18, 0.8);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease;
}

.nav.scrolled {
  border-bottom-color: var(--divider);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-brand svg {
  width: 28px;
  height: 28px;
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--green);
  transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-links .btn-sm {
  background: var(--green);
  color: white;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-links .btn-sm::after { display: none; }

.nav-links .btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(56, 143, 89, 0.3);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
}

.nav-toggle svg { width: 24px; height: 24px; }

/* ── Hero ───────────────────────────────────────────────────── */

.hero {
  padding: 180px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Animated gradient glow */
.hero::before {
  content: '';
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(56, 143, 89, 0.12) 0%, rgba(199, 140, 46, 0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0%   { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 1;   transform: translate(-50%, -50%) scale(1.1); }
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(38px, 5.5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--green) 20%, var(--amber) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero > .container > p {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Trust pills */
.hero-trust {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero-trust span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hero-trust span::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 8px;
  vertical-align: middle;
  opacity: 0.7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--green);
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(56, 143, 89, 0.35);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--divider);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Hero screenshot */
.hero-screenshot {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 120px rgba(56, 143, 89, 0.06);
  transform: perspective(2000px) rotateX(2deg);
  transition: transform 0.5s ease;
}

.hero-screenshot:hover {
  transform: perspective(2000px) rotateX(0deg);
}

.hero-screenshot img {
  width: 100%;
  display: block;
}

/* ── Features ───────────────────────────────────────────────── */

.features {
  padding: var(--section-pad);
  position: relative;
}

/* Decorative organic shape behind features */
.features::before {
  content: '';
  position: absolute;
  top: 20%;
  right: -200px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 143, 89, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.section-label {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--green);
  margin-bottom: 12px;
}

.section-title {
  text-align: center;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 64px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: border-color 0.4s ease, transform 0.3s ease, box-shadow 0.4s ease;
}

/* Accent glow on hover per card */
.feature-card:nth-child(1):hover {
  border-color: rgba(56, 143, 89, 0.3);
  box-shadow: 0 8px 32px rgba(56, 143, 89, 0.08);
}
.feature-card:nth-child(2):hover {
  border-color: rgba(199, 140, 46, 0.3);
  box-shadow: 0 8px 32px rgba(199, 140, 46, 0.08);
}
.feature-card:nth-child(3):hover {
  border-color: rgba(189, 102, 66, 0.3);
  box-shadow: 0 8px 32px rgba(189, 102, 66, 0.08);
}
.feature-card:nth-child(4):hover {
  border-color: rgba(102, 148, 112, 0.3);
  box-shadow: 0 8px 32px rgba(102, 148, 112, 0.08);
}

.feature-card:hover {
  transform: translateY(-3px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

/* Feature accent backgrounds */
.feature-icon.green  { background: rgba(56, 143, 89, 0.15); color: var(--green); }
.feature-icon.amber  { background: rgba(199, 140, 46, 0.15); color: var(--amber); }
.feature-icon.terra  { background: rgba(189, 102, 66, 0.15); color: var(--terracotta); }
.feature-icon.sage   { background: rgba(102, 148, 112, 0.15); color: var(--sage); }

/* ── Feature Showcase ───────────────────────────────────────── */

.feature-showcase {
  margin-top: 100px;
  display: flex;
  flex-direction: column;
  gap: 100px;
}

.showcase-item {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  align-items: center;
}

.showcase-item.reverse {
  grid-template-columns: 1.4fr 1fr;
}

.showcase-item.reverse .showcase-text {
  order: 2;
}

.showcase-item.reverse .showcase-screenshots {
  order: 1;
}

.showcase-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.showcase-label.green { background: rgba(56, 143, 89, 0.12); color: var(--green); }
.showcase-label.amber { background: rgba(199, 140, 46, 0.12); color: var(--amber); }
.showcase-label.terra { background: rgba(189, 102, 66, 0.12); color: var(--terracotta); }
.showcase-label.sage  { background: rgba(102, 148, 112, 0.12); color: var(--sage); }

.showcase-text h3 {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.showcase-text p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}

.showcase-screenshots {
  position: relative;
}

.showcase-screenshots img {
  border-radius: var(--radius);
  border: 1px solid var(--divider);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  width: 100%;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.showcase-screenshots img:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.4);
}

/* ── Trust / Promises ───────────────────────────────────────── */

.trust {
  padding: var(--section-pad);
  position: relative;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(31, 28, 20, 0.6) 50%, var(--bg) 100%);
}

/* Decorative shape */
.trust::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -150px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199, 140, 46, 0.03) 0%, transparent 70%);
  pointer-events: none;
  transform: translateY(-50%);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.trust-item {
  text-align: center;
  padding: 40px 24px;
  border-radius: var(--radius-lg);
  transition: background 0.3s ease;
}

.trust-item:hover {
  background: var(--bg-surface-overlay);
}

.trust-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(56, 143, 89, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.trust-item:hover .trust-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 20px rgba(56, 143, 89, 0.15);
}

.trust-item h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.trust-item p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

/* ── Open Source ─────────────────────────────────────────────── */

.opensource {
  padding: var(--section-pad);
  text-align: center;
  position: relative;
}

/* Accent line above */
.opensource::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--amber));
  border-radius: 1px;
}

.opensource h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.opensource p {
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  font-size: 15px;
  line-height: 1.8;
}

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.github-btn:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.github-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.github-btn:hover svg {
  transform: rotate(-8deg) scale(1.1);
}

/* ── Download CTA ───────────────────────────────────────────── */

.download {
  padding: var(--section-pad);
  text-align: center;
  position: relative;
}

/* Warm amber glow behind download */
.download::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(199, 140, 46, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.download h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.download > .container > p {
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-size: 15px;
}

.download-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

.download-card {
  background: var(--bg-surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.download-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.download-card .card-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-card .card-icon svg {
  width: 32px;
  height: 32px;
}

.download-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.download-card p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.download-card .btn {
  width: 100%;
  justify-content: center;
  font-size: 14px;
  padding: 12px 20px;
}

.brew-cmd {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--green);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.brew-cmd:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--green);
}

.brew-cmd .copy-hint {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-amber {
  background: var(--amber);
  color: white;
}

.btn-amber:hover {
  box-shadow: 0 8px 24px rgba(199, 140, 46, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--divider);
  color: var(--text);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-surface-overlay);
}

/* ── Footer ─────────────────────────────────────────────────── */

.footer {
  padding: 56px 0 48px;
  border-top: 1px solid var(--divider);
  background: var(--bg-sidebar);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}

.footer-brand svg { width: 20px; height: 20px; }

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

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

.footer-copy {
  width: 100%;
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.footer-craft {
  width: 100%;
  text-align: center;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* ── Scroll Reveal Animations ──────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger delays for grid children */
.feature-card.reveal:nth-child(1) { transition-delay: 0s; }
.feature-card.reveal:nth-child(2) { transition-delay: 0.08s; }
.feature-card.reveal:nth-child(3) { transition-delay: 0.16s; }
.feature-card.reveal:nth-child(4) { transition-delay: 0.24s; }

.trust-item.reveal:nth-child(1) { transition-delay: 0s; }
.trust-item.reveal:nth-child(2) { transition-delay: 0.1s; }
.trust-item.reveal:nth-child(3) { transition-delay: 0.2s; }

.download-card.reveal:nth-child(1) { transition-delay: 0s; }
.download-card.reveal:nth-child(2) { transition-delay: 0.1s; }
.download-card.reveal:nth-child(3) { transition-delay: 0.2s; }

.showcase-item.reveal:nth-child(odd) { transition-delay: 0s; }
.showcase-item.reveal:nth-child(even) { transition-delay: 0.05s; }

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  :root { --section-pad: 80px 0; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(26, 23, 18, 0.97);
    backdrop-filter: blur(24px);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--divider);
  }
  .nav-links.open a::after { display: none; }
  .nav-toggle { display: block; }

  .hero { padding: 130px 0 60px; }
  .hero-screenshot { transform: none; }
  .hero-screenshot:hover { transform: none; }

  .features-grid { grid-template-columns: 1fr; }
  .showcase-item,
  .showcase-item.reverse {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .showcase-item.reverse .showcase-text { order: 0; }
  .showcase-item.reverse .showcase-screenshots { order: 0; }
  .feature-showcase { gap: 64px; }
  .trust-grid { grid-template-columns: 1fr; }
  .download-options { grid-template-columns: 1fr; max-width: 360px; }

  .footer-inner { justify-content: center; text-align: center; }
  .footer-links { justify-content: center; }

  .hero-trust { gap: 16px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 32px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .hero-trust { flex-direction: column; align-items: center; gap: 8px; }
}
