/* GreenFlags landing — vanilla CSS, no framework.
   Brand: emerald accents on slate, Space Grotesk + IBM Plex Mono. */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #64748b;
  --line: #e2e8f0;
  --brand: #10b981;      /* emerald-500 */
  --brand-deep: #047857; /* emerald-700 */
  --brand-dark: #065f46; /* emerald-800 */
  --brand-tint: #ecfdf5; /* emerald-50 */
  --brand-tint-2: #d1fae5; /* emerald-100 */
  --navy: #0f172a;
  --navy-2: #1e293b;
  --radius: 16px;
  --font-sans: "Space Grotesk", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 72rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--brand-deep); }

code, pre { font-family: var(--font-mono); }

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  background: var(--navy);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand svg { flex: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lang-switch:hover { color: var(--brand-deep); border-color: var(--brand); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand-deep);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(4, 120, 87, 0.5);
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }

.btn-invert {
  background: #fff;
  color: var(--navy);
}
.btn-invert:hover { background: var(--brand-tint-2); }

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

.hero {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 0 4.5rem;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 130%;
  background:
    radial-gradient(42rem 26rem at 18% 20%, rgba(16, 185, 129, 0.14), transparent 60%),
    radial-gradient(36rem 24rem at 85% 10%, rgba(6, 95, 70, 0.10), transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 3.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-tint);
  color: var(--brand-dark);
  border: 1px solid var(--brand-tint-2);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}
.eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1.2rem;
  font-weight: 700;
}
.accent {
  color: var(--brand-deep);
  background: linear-gradient(120deg, var(--brand-deep), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 0 2rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  color: var(--ink-faint);
  font-size: 0.88rem;
}
.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
}
.hero-meta { padding: 0; margin: 0; }
.check {
  color: var(--brand-deep);
  font-weight: 700;
}

/* ---------- Code window ---------- */

.code-window {
  background: var(--navy);
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.45);
  overflow: hidden;
  font-size: 0.85rem;
}
.code-window .bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--navy-2);
}
.code-window .bar span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #334155;
}
.code-window .bar span:first-child { background: #f87171; }
.code-window .bar span:nth-child(2) { background: #fbbf24; }
.code-window .bar span:nth-child(3) { background: #34d399; }
.code-window .bar .filename {
  width: auto; height: auto;
  background: none;
  margin-left: 0.5rem;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.code-window pre {
  margin: 0;
  padding: 1.25rem 1.4rem 1.5rem;
  overflow-x: auto;
  color: #e2e8f0;
  line-height: 1.7;
}
.code-window .tok-kw { color: #7dd3fc; }
.code-window .tok-str { color: #6ee7b7; }
.code-window .tok-fn { color: #fbbf24; }
.code-window .tok-cm { color: #64748b; }

/* ---------- Sections ---------- */

section { padding: 4.5rem 0; }

.section-head {
  max-width: 42rem;
  margin-bottom: 3rem;
}
.section-head.centered {
  margin-inline: auto;
  text-align: center;
}

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.9rem;
}
.section-head p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0;
}

.kicker {
  display: block;
  color: var(--brand-deep);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.7rem;
}

/* ---------- Trust bar ---------- */

.trust {
  padding: 1.6rem 0;
  border-block: 1px solid var(--line);
  background: var(--surface);
}
.trust .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 2.5rem;
  color: var(--ink-faint);
  font-size: 0.9rem;
  font-weight: 500;
}
.trust strong { color: var(--ink); font-weight: 600; }

/* ---------- Features grid ---------- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-tint-2);
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.18);
}
.feature-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem; height: 2.8rem;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand-deep);
  margin-bottom: 1.1rem;
}
.feature-card h3 {
  font-size: 1.12rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.feature-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.6rem 1.8rem;
}
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-deep);
  background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2);
  width: fit-content;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.step h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.step p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.step code {
  background: var(--brand-tint);
  color: var(--brand-dark);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.85em;
}

/* ---------- SDK / dark section ---------- */

.dark-section {
  background: var(--navy);
  color: #e2e8f0;
  border-radius: 0;
}
.dark-section h2 { color: #fff; }
.dark-section .section-head p { color: #94a3b8; }
.dark-section .kicker { color: var(--brand); }

.sdk-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 3rem;
  align-items: center;
}
.sdk-list {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.sdk-list li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  color: #cbd5e1;
  font-size: 0.97rem;
}
.sdk-list .check { color: var(--brand); flex: none; margin-top: 0.1rem; }
.sdk-list strong { color: #fff; }

.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.75rem;
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: none;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.copy-btn:hover { background: rgba(148, 163, 184, 0.3); }
.code-holder { position: relative; }

/* ---------- Use cases ---------- */

.usecases {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.4rem;
}
.usecase {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  background: linear-gradient(160deg, var(--surface), var(--brand-tint) 140%);
}
.usecase h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.usecase p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- FAQ ---------- */

.faq-list {
  max-width: 46rem;
  margin-inline: auto;
  display: grid;
  gap: 0.9rem;
}
.faq-list details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
}
.faq-list details[open] { border-color: var(--brand-tint-2); }
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--brand-deep);
  transition: transform 0.2s;
  flex: none;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p {
  margin: 0.8rem 0 0.2rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* ---------- Final CTA ---------- */

.cta-final {
  padding: 5rem 0;
}
.cta-box {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-deep) 55%, var(--brand));
  border-radius: 24px;
  padding: 3.5rem 2rem;
  text-align: center;
  color: #fff;
  box-shadow: 0 30px 60px -25px rgba(4, 120, 87, 0.55);
}
.cta-box h2 { color: #fff; margin-bottom: 0.8rem; }
.cta-box p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 34rem;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}
.cta-box .btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.cta-box .btn-ghost:hover { border-color: #fff; }
.cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 3rem 0 2rem;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-grid p { color: var(--ink-faint); max-width: 20rem; margin: 0.8rem 0 0; }
.site-footer h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0 0 0.9rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--brand-deep); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .eyebrow .dot { animation: none; }
}

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

@media (max-width: 60rem) {
  .hero-grid, .sdk-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .features-grid, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usecases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 40rem) {
  section { padding: 3.2rem 0; }
  .hero { padding: 3.5rem 0 3rem; }

  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.4rem;
    display: none;
  }
  .nav-menu.is-open { display: block; }
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
  }
  .nav-menu .btn { width: 100%; }

  .features-grid, .steps, .usecases { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-ctas .btn { width: 100%; }
  .cta-box { padding: 2.5rem 1.4rem; }
}

@media (min-width: 40.01rem) {
  .nav-menu {
    display: flex;
    align-items: center;
    gap: 1.75rem;
  }
}
