/* =========================================================
   Linden — shared stylesheet
   Brand brief: docs/linden-brand-brief.html (visual brand survives the
   2026-05-11 spec lock; spec text in that doc is dead).
   Design system reference: docs/redesign/03-design.md
   ========================================================= */

/* ---------- Self-hosted fonts ----------
   Variable WOFF2 files from Fontsource (latin subset). No Google Fonts
   request. Total weight ~115 KB (Fraunces normal + italic + Outfit
   normal). font-display: swap so text never blocks paint. */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations"),
       url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght-italic.woff2") format("woff2-variations"),
       url("/assets/fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("/assets/fonts/outfit-latin-wght-normal.woff2") format("woff2-variations"),
       url("/assets/fonts/outfit-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Canopy greens — primary brand palette, from linden-brand-brief.html */
  --canopy: #0d3b22;
  --canopy-mid: #15543a;
  --forest: #1a6b42;
  --leaf: #2d9a5e;
  --leaf-bright: #4ecf7d;
  --leaf-pale: #a8e6c3;
  --spring: #d4f5e0;

  /* Sky / neutrals */
  --sky: #f0f9f3;
  --sky-warm: #f5faf7;
  --white: #ffffff;

  /* Ink — text colors */
  --ink: #0a1f12;
  --ink-soft: #1e3a28;
  --ink-muted: #3a5a45;
  --ink-faint: #7a9f88;

  /* Walnut — product material accent (visible cladding) */
  --walnut: #3d2b1f;
  --walnut-mid: #4e3929;
  --walnut-light: #5c4033;

  /* Stone — neutral UI gray (replaces the retired "aluminum" material
     token; shell is now FDM ASA, not aluminum) */
  --stone: #b8b5b0;
  --stone-light: #d4d1cc;
  --stone-pale: #e6e3de;

  /* Borders / surfaces */
  --border: rgba(13, 59, 34, 0.10);
  --border-strong: rgba(13, 59, 34, 0.18);
  --surface: rgba(255, 255, 255, 0.62);

  /* Typography stacks */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Outfit", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Type scale (1.25 ratio, root 17px) */
  --text-xs: 0.8125rem;   /* 13.0px */
  --text-sm: 0.9375rem;   /* 15.0px */
  --text-base: 1.0625rem; /* 17.0px */
  --text-lg: 1.25rem;     /* 20.0px */
  --text-xl: 1.5rem;      /* 24.0px */
  --text-2xl: 1.875rem;   /* 30.0px */
  --text-3xl: 2.5rem;     /* 40.0px */
  --text-4xl: 3.5rem;     /* 56.0px */

  /* Spacing (4px scale) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout widths */
  --content-width: 680px;   /* long-form prose */
  --wide-width: 1080px;     /* hero, spec table, footer */

  /* Radii */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  /* Motion — minimal budget. Only opacity transitions. */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration: 250ms;

  /* Focus ring */
  --focus: 2px solid var(--leaf);
  --focus-offset: 3px;
}

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink);
  background: var(--sky);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease);
}
a:hover { color: var(--canopy); }
a:focus-visible {
  outline: var(--focus);
  outline-offset: var(--focus-offset);
  border-radius: 2px;
}

::selection { background: var(--leaf-pale); color: var(--canopy); }

/* Skip link — accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--canopy);
  color: var(--white);
  padding: var(--space-3) var(--space-4);
  z-index: 100;
  text-decoration: none;
  font-weight: 500;
}
.skip-link:focus { top: 0; color: var(--white); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--canopy);
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5vw, var(--text-4xl)); }
h2 { font-size: clamp(1.625rem, 3.5vw, var(--text-3xl)); margin-bottom: var(--space-4); }
h3 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
h4 { font-size: var(--text-lg); margin-bottom: var(--space-2); }

p { margin-bottom: var(--space-4); color: var(--ink-soft); }
p:last-child { margin-bottom: 0; }

em { font-family: var(--font-display); font-style: italic; font-weight: 300; }
strong { font-weight: 500; color: var(--ink); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-3);
  display: block;
}

.lede { font-size: var(--text-lg); color: var(--ink-soft); }

.pull {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: var(--text-xl);
  color: var(--canopy);
  padding-left: var(--space-6);
  border-left: 2px solid var(--leaf);
  margin: var(--space-8) 0;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.prose {
  max-width: var(--content-width);
  margin: 0 auto;
}

.prose > * + * { margin-top: var(--space-4); }
.prose > h2 { margin-top: var(--space-12); margin-bottom: var(--space-4); }
.prose > h3 { margin-top: var(--space-8); }
.prose ul, .prose ol { padding-left: var(--space-6); color: var(--ink-soft); }
.prose li { margin-bottom: var(--space-2); }

section { padding: var(--space-16) 0; }
section.tight { padding: var(--space-8) 0; }

hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-12) auto;
  max-width: var(--content-width);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(240, 249, 243, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--space-6);
  max-width: var(--wide-width);
  margin: 0 auto;
}

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  color: var(--canopy);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--canopy); }

.nav {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}
.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 400;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--canopy); }
.nav a[aria-current="page"] { font-weight: 500; }

@media (max-width: 600px) {
  .nav { gap: var(--space-4); }
  .nav a { font-size: var(--text-xs); }
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-24) 0 var(--space-16);
  text-align: left;
}

.hero__eyebrow { color: var(--ink-muted); }

.hero h1 {
  font-size: clamp(2.5rem, 6vw, var(--text-4xl));
  margin-bottom: var(--space-6);
  max-width: 18ch;
}

.hero__sub {
  font-size: var(--text-lg);
  color: var(--ink-soft);
  max-width: 50ch;
  margin-bottom: var(--space-8);
}

.hero__meta {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-top: var(--space-4);
  max-width: 50ch;
}

@media (max-width: 600px) {
  .hero { padding: var(--space-16) 0 var(--space-12); }
}

/* ---------- Manifesto / mission pillars ---------- */
.manifesto {
  background: var(--sky-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-12) 0;
}

.manifesto__grid {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-8);
}

.manifesto__statement {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-xl);
  color: var(--canopy);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ---------- Spec table (dl) ---------- */
.spec-table {
  max-width: var(--content-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) 1fr;
  gap: var(--space-6);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.spec-row dt {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.spec-row dd {
  font-size: var(--text-base);
  color: var(--ink-soft);
}

@media (max-width: 520px) {
  .spec-row { grid-template-columns: 1fr; gap: var(--space-1); }
  .spec-row dt { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; }
}

/* ---------- Email capture ---------- */
.signup {
  max-width: 460px;
}

.signup--inline { margin: var(--space-4) 0 0; }

.signup__form {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}

.signup__input {
  flex: 1;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  min-height: 48px;
  transition: border-color var(--duration-fast) var(--ease);
  width: 100%;
}

.signup__input::placeholder { color: var(--ink-faint); }
.signup__input:focus {
  outline: var(--focus);
  outline-offset: 0;
  border-color: var(--leaf);
}

.signup__button {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--white);
  background: var(--canopy);
  border: 1px solid var(--canopy);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-6);
  min-height: 48px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease);
}
.signup__button:hover { background: var(--canopy-mid); }
.signup__button:focus-visible { outline: var(--focus); outline-offset: var(--focus-offset); }
.signup__button[disabled] { opacity: 0.6; cursor: wait; }

.signup__help {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-top: var(--space-3);
  max-width: 50ch;
}

.signup__error {
  font-size: var(--text-sm);
  color: #b94a3b;
  margin-top: var(--space-2);
}

.signup__success {
  font-size: var(--text-base);
  color: var(--canopy);
  font-weight: 500;
}

@media (max-width: 520px) {
  .signup__form { flex-direction: column; }
  .signup__button { width: 100%; }
}

/* Sticky-mobile email bar (Home/Inside/Journey only, after 30% scroll) */
.signup-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-strong);
  padding: var(--space-3) var(--space-4);
  transform: translateY(100%);
  transition: transform var(--duration) var(--ease);
  display: none;
}
.signup-sticky[data-show="true"] { transform: translateY(0); }

.signup-sticky__inner {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  max-width: var(--content-width);
  margin: 0 auto;
}

.signup-sticky__label {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  flex: 0 0 auto;
}

.signup-sticky__form { flex: 1; display: flex; gap: var(--space-2); }
.signup-sticky__close {
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  padding: var(--space-2);
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
}

@media (max-width: 720px) { .signup-sticky { display: block; } }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--canopy);
  color: var(--leaf-pale);
  padding: var(--space-16) 0 var(--space-8);
}

.site-footer a { color: var(--leaf-bright); }
.site-footer a:hover { color: var(--white); }

.site-footer__inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
}

.site-footer h3 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--leaf-pale);
  margin-bottom: var(--space-4);
}

.site-footer .signup__input {
  background: rgba(255, 255, 255, 0.92);
  border-color: transparent;
}

.site-footer__bottom {
  max-width: var(--wide-width);
  margin: var(--space-12) auto 0;
  padding: var(--space-6) var(--space-6) 0;
  border-top: 1px solid rgba(168, 230, 195, 0.18);
  font-size: var(--text-sm);
  color: var(--leaf-pale);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.site-footer__credit { font-size: var(--text-xs); }

.site-footer__fineprint {
  max-width: var(--wide-width);
  margin: var(--space-6) auto 0;
  padding: 0 var(--space-6);
  font-size: 0.75rem;
  color: rgba(168, 230, 195, 0.55);
  font-style: italic;
  text-align: center;
}

.site-footer__legal a {
  color: var(--leaf-pale);
  margin-right: var(--space-4);
  text-decoration: none;
}
.site-footer__legal a:hover { color: var(--white); text-decoration: underline; }

@media (max-width: 600px) {
  .site-footer__inner { grid-template-columns: 1fr; gap: var(--space-8); }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Page-specific helpers ---------- */
.founder {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-8);
  align-items: start;
  max-width: var(--content-width);
  margin: 0 auto;
}
.founder__photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--stone-pale);
}
.founder__photo img { width: 100%; height: auto; display: block; }

@media (max-width: 600px) {
  .founder { grid-template-columns: 1fr; max-width: 360px; }
}

/* FAQ accordions — native <details> */
.faq-group { max-width: var(--content-width); margin: 0 auto var(--space-8); }
.faq-group__label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-lg);
  color: var(--canopy);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 300;
  color: var(--leaf);
  transition: transform var(--duration-fast) var(--ease);
}
.faq-item[open] summary::after { content: "−"; }
.faq-item__answer { padding-bottom: var(--space-4); color: var(--ink-soft); }

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }

/* ---------- Fade-up on intersection (opt-in via [data-fade]) ---------- */
[data-fade] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 600ms var(--ease),
    transform 600ms var(--ease);
}
[data-fade].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-fade] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Falling leaves — site-wide ambient ---------- */
.leaf-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.floating-leaf {
  position: absolute;
  top: 0;
  pointer-events: none;
  opacity: 0;
  animation: leafDrift linear infinite;
  will-change: transform, opacity;
}
.floating-leaf img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.5;
  filter: saturate(0.85);
}
@keyframes leafDrift {
  0%   { transform: translate(0, -12vh) rotate(0deg);     opacity: 0; }
  10%  { opacity: 0.55; }
  50%  { opacity: 0.5; }
  90%  { opacity: 0.45; }
  100% { transform: translate(60px, 112vh) rotate(220deg); opacity: 0; }
}
.site-header, main, .site-footer, .signup-sticky { position: relative; z-index: 2; }
@media (prefers-reduced-motion: reduce) {
  .leaf-field { display: none; }
}

/* ---------- Hero headline — word-by-word reveal on load ---------- */
.hero-reveal__word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.3em);
  animation: heroWordIn 700ms var(--ease) forwards;
}
.hero-reveal__word em { font-style: italic; }
.hero-reveal__space { display: inline-block; width: 0.25em; }
@keyframes heroWordIn {
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-reveal__word { opacity: 1; transform: none; animation: none; }
}
