/* ==========================================================================
   GREENSTRAT — Design System
   Warm off-white editorial studio aesthetic. Forest green as a signal,
   not a wash. DM Serif Display for editorial weight, Inter for clarity.
   ========================================================================== */

:root {
  /* Palette */
  --bg: #F7F7F2;
  --brand: #123C32;
  --brand-dark: #0B2923;
  --ink: #17201D;
  --muted: #5E6B65;
  --border: #DDE3DE;
  --accent: #1E6B55;
  --white: #FFFFFF;

  /* On dark sections */
  --ink-inverse: #F1F3EF;
  --muted-inverse: #9FB0A8;
  --border-inverse: rgba(241, 243, 239, 0.14);

  /* Type */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Scale */
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.06rem + 0.32vw, 1.3125rem);
  --step-2: clamp(1.375rem, 1.24rem + 0.64vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.1vw, 2.375rem);
  --step-4: clamp(2.25rem, 1.85rem + 1.8vw, 3.25rem);
  --step-5: clamp(2.75rem, 2.1rem + 2.8vw, 4.25rem);

  --content-max: 1120px;
  --measure: 62ch;

  --radius-s: 3px;
  --radius-m: 6px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink); }
p.lede { font-size: var(--step-1); color: var(--muted); max-width: var(--measure); }

.measure { max-width: var(--measure); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 24px;
}

section { padding-block: clamp(56px, 8vw, 112px); }
section.tight { padding-block: clamp(40px, 5vw, 64px); }

.section-dark {
  background: var(--brand-dark);
  color: var(--ink-inverse);
}
.section-dark h2, .section-dark h3, .section-dark h4 { color: var(--ink-inverse); }
.section-dark p { color: var(--muted-inverse); }
.section-dark p.lede { color: var(--muted-inverse); }
.section-dark .hairline { border-color: var(--border-inverse); }

.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.hairline {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

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

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-5 { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-s);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
  white-space: nowrap;
  vertical-align: middle;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--muted);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.section-dark .btn-ghost {
  color: var(--ink-inverse);
  border-color: var(--muted-inverse);
}
.section-dark .btn-ghost:hover { border-color: var(--ink-inverse); }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s var(--ease);
}
.btn-text:hover { border-color: currentColor; }
.section-dark .btn-text { color: var(--ink-inverse); }

.btn-lg { padding: 16px 28px; font-size: 1rem; min-height: 54px; }

.hero-actions .btn,
.hero-actions .btn-ghost {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 247, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 18px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.375rem;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease);
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.nav-cta { display: flex; align-items: center; gap: 20px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-cta .btn-primary { display: none; }
  .nav-toggle { display: inline-flex; }

  .mobile-panel {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0 20px;
    border-top: 1px solid var(--border);
  }
  .mobile-panel.open { display: flex; }
  .mobile-panel a {
    text-decoration: none;
    color: var(--ink);
    padding: 12px 4px;
    font-size: 1.02rem;
    border-bottom: 1px solid var(--border);
  }
  .mobile-panel .btn { margin-top: 12px; align-self: flex-start; }
}

@media (min-width: 861px) {
  .mobile-panel { display: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(64px, 10vw, 120px) clamp(56px, 8vw, 96px);
}
.hero h1 { max-width: 780px; }
.hero .lede { margin-top: 20px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.hero-kicker {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 16px;
  display: block;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: var(--radius-m);
}

.service-card {
  border: 1px solid var(--border);
  background: var(--white);
  padding: clamp(28px, 3vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.service-card .num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--muted);
}
.service-card h3 { margin-bottom: 4px; }
.service-card .tagline { color: var(--brand); font-weight: 600; font-size: 1.05rem; margin: 0; }
.service-card p.desc { color: var(--muted); margin: 0; }

.audience-card {
  border-left: 2px solid var(--border);
  padding-left: 20px;
}
.audience-card h4 { margin-bottom: 6px; }
.audience-card p { color: var(--muted); margin: 0; }

/* Right-aligned link that should collapse to left when stacked on mobile */
.align-end { text-align: right; }
@media (max-width: 760px) {
  .align-end { text-align: left; }
}

/* ---------- Process ---------- */
.process-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
}
.section-dark .process-list { border-color: var(--border-inverse); }

.process-list li {
  list-style: none;
  padding: 28px 20px 28px 0;
  border-right: 1px solid var(--border);
}
.section-dark .process-list li { border-color: var(--border-inverse); }
.process-list li:last-child { border-right: none; }

.process-list .step-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}
.section-dark .process-list .step-num { color: #6FA893; }

.process-list h4 { margin-bottom: 6px; }
.process-list p { color: var(--muted); font-size: 0.94rem; margin: 0; }

@media (max-width: 860px) {
  .process-list { grid-template-columns: 1fr; border-top: none; }
  .process-list li { border-right: none; border-bottom: 1px solid var(--border); padding: 24px 0; }
  .process-list li:last-child { border-bottom: none; }
}

/* ---------- Flow diagram (Idea -> Clarity -> MVP -> Build -> Learn) ---------- */
.flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
}
.flow .flow-node { padding: 10px 6px; color: var(--ink); }
.section-dark .flow .flow-node { color: var(--ink-inverse); }
.flow .flow-arrow { color: var(--accent); padding: 0 14px; font-family: var(--font-body); }

/* ---------- Vertical timeline (Idea -> Learn) ---------- */
.timeline {
  position: relative;
  padding-left: 32px;
  margin: 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.section-dark .timeline::before { background: var(--border-inverse); }

.timeline-step {
  position: relative;
  padding-bottom: 32px;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.section-dark .timeline-step::before { box-shadow: 0 0 0 4px var(--brand-dark); }

.timeline-step .step-label {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--ink);
  display: block;
  line-height: 1.2;
}
.section-dark .timeline-step .step-label { color: var(--ink-inverse); }

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--border);
}
.section-dark .faq-item { border-color: var(--border-inverse); }

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  font-weight: 600;
  font-size: 1.05rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { font-size: 1.4rem; color: var(--accent); transition: transform 0.2s var(--ease); flex-shrink: 0; margin-left: 16px; }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-item .faq-body { padding-bottom: 22px; color: var(--muted); max-width: var(--measure); }
.section-dark .faq-item .faq-body { color: var(--muted-inverse); }

/* ---------- Insight / article cards ---------- */
.insight-card {
  border: 1px solid var(--border);
  padding: 28px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  justify-content: space-between;
}
.insight-card .tag {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 8px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.form-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 14px;
}

/* ---------- Placeholder callouts (for editable content) ---------- */
.placeholder {
  background: #FBF3E7;
  color: #7A5B12;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 0.94em;
  font-weight: 600;
  white-space: nowrap;
}

.placeholder-note {
  border: 1px dashed #C9B489;
  background: #FBF3E7;
  color: #6b5210;
  padding: 14px 18px;
  border-radius: var(--radius-s);
  font-size: 0.9rem;
  margin-block: 16px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-dark);
  color: var(--muted-inverse);
  padding-block: 64px 32px;
}
.site-footer h3 {
  color: var(--ink-inverse);
  font-size: 1.3rem;
  margin-bottom: 6px;
}
.site-footer .tag { color: var(--muted-inverse); margin-bottom: 24px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-inverse);
}
.footer-col h4 {
  color: var(--ink-inverse);
  font-size: 0.85rem;
  text-transform: none;
  margin-bottom: 16px;
  font-weight: 600;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--muted-inverse); text-decoration: none; font-size: 0.94rem; }
.footer-col a:hover { color: var(--ink-inverse); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  font-size: 0.85rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Legal pages ---------- */
.legal-body h2 { font-size: var(--step-2); margin-top: 2.2em; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body ul { color: var(--ink); padding-left: 1.2em; }
.legal-body li { margin-bottom: 0.4em; }
.legal-meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 2.5em; }
.legal-body { max-width: 74ch; }

/* ---------- 404 ---------- */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
}
.error-page .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 8rem);
  color: var(--border);
  line-height: 1;
  margin-bottom: 8px;
}

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.text-muted { color: var(--muted); }
.center { text-align: center; margin-inline: auto; }
