/* ===== LeafTex — design tokens (BRAND-MATCHED v2) ===== */
:root {
  /* Brand palette — clean white + kelly green */
  --bg: #ffffff;
  --bg-2: #f6f7f9;            /* light cool grey panel */
  --bg-3: #eef0f3;            /* slightly deeper panel */
  --ink: #0e1116;             /* near-black */
  --ink-2: #2a2f37;
  --ink-3: #5b6470;           /* secondary */
  --ink-4: #9aa3ad;           /* tertiary / labels */
  --rule: #e3e6ea;
  --rule-2: #d6dae0;

  --green: #18C25A;           /* primary brand green (matches the "f" in the logo) */
  --green-ink: #0EA34A;
  --green-soft: #E5F8EC;
  --green-deep: #0c5c2e;

  --dark: #0e1116;            /* near-black bands */
  --dark-2: #181c22;

  --sans: 'Plus Jakarta Sans', 'Nunito Sans', ui-sans-serif, -apple-system, system-ui, sans-serif;
  --display: 'Plus Jakarta Sans', 'Nunito Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* Layout */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

/* Top accent strip — the green hairline you see at the top of every brand asset */
.brand-strip {
  height: 4px;
  background: var(--green);
  width: 100%;
}

/* Type */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.label-mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

/* Display — heavy geometric sans, matching the bold logo wordmark */
.display-xl {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 3.5vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.display-l {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 42px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.display-m {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(20px, 2.4vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.display-s {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(17px, 1.9vw, 24px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.body-l { font-size: 16px; line-height: 1.55; color: var(--ink-2); font-weight: 400; }
.body { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.body-s { font-size: 14px; line-height: 1.55; color: var(--ink-3); }

.green-word { color: var(--green-ink); }

/* Section scaffolding */
section {
  position: relative;
  padding: 110px 0;
}
section + section { border-top: 1px solid var(--rule); }
@media (max-width: 720px) {
  section { padding: 72px 0; }
}

.section-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: baseline;
  margin-bottom: clamp(24px, 3.5vh, 36px);
}
.section-head .meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 14px;
  border-top: 3px solid var(--green);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.section-head .meta .code { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) {
  .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 36px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
}
.btn:hover { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.btn-green:hover { background: var(--green-ink); border-color: var(--green-ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn .arrow { transition: transform 200ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Image placeholders */
.img-placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      #eef0f3 0,
      #eef0f3 8px,
      #f4f6f8 8px,
      #f4f6f8 16px
    );
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-placeholder.dark {
  background:
    repeating-linear-gradient(
      135deg,
      #1a1f26 0,
      #1a1f26 8px,
      #20262e 8px,
      #20262e 16px
    );
  border-color: #2a3038;
  color: #fff;
}
.img-placeholder .ph-caption {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink-2);
  max-width: 82%;
  line-height: 1.55;
}
.img-placeholder.dark .ph-caption {
  background: #14181d;
  border-color: #2a3038;
  color: #d6dae0;
}
.img-placeholder .ph-corner {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: #fff;
  padding: 5px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-weight: 500;
}
.img-placeholder.dark .ph-corner {
  background: #14181d;
  color: #c9d3dc;
  border-color: #2a3038;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 800ms ease, transform 800ms cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}

/* Side rail */
.side-rail {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.side-rail a {
  color: var(--ink-4);
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  transition: color 160ms ease;
  font-weight: 500;
}
.side-rail a::before {
  content: ""; width: 18px; height: 1px; background: var(--ink-4);
  transition: width 160ms ease, background 160ms ease;
}
.side-rail a:hover { color: var(--ink); }
.side-rail a:hover::before { width: 28px; background: var(--green); }
.side-rail a.active { color: var(--ink); }
.side-rail a.active::before { width: 28px; background: var(--green); }
@media (max-width: 1180px) { .side-rail { display: none; } }

/* Tag chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule-2);
  background: #fff;
  color: var(--ink);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(24,194,90,0.16); }
.chip-green {
  background: var(--green-soft);
  border-color: #c9efd6;
  color: var(--green-deep);
}

/* Number stat */
.stat-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 3.5vw, 48px);
  line-height: 0.96;
  letter-spacing: -0.035em;
}
.stat-num .unit {
  font-weight: 800;
  font-size: 0.5em;
  letter-spacing: -0.02em;
  margin-left: 2px;
}

/* Cards */
.card {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 22px;
}
.card.outline {
  background: #fff;
  border: 1px solid var(--rule);
}
.card.dark {
  background: var(--dark);
  color: #fff;
  border-color: #1f242c;
}

/* Checkmark bullet — like the brand uses */
.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.check-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.5;
}
.check-list li::before {
  content: "";
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--green) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'><path d='M5 10.5L8.5 14L15 7' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/14px no-repeat;
}

/* Selection */
::selection { background: var(--green); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6dae0; border-radius: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }

/* Utility */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; } .gap-48 { gap: 48px; }

/* ============================================================
   COMPRESS-TO-FIT — content shrunk so each block fits a
   typical 1366×768 laptop viewport (~688px usable after nav).
   ============================================================ */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

/* Override the base 110px section padding and Hero's inline paddingTop:132 */
section,
header#top {
  padding-top: 72px !important;
  padding-bottom: 36px !important;
}

footer#contact {
  padding-top: 80px !important;
  padding-bottom: 32px !important;
}

/* HERO ── Constrain the StemCrossSection SVG by explicit height so the
   right column never grows taller than the left column's text content. */
header#top .hero-grid > div:last-child svg {
  height: 230px;   /* ~219px wide at the 400:420 viewBox ratio */
  width: auto;
  display: block;
  margin: 0 auto;
}
header#top .hero-grid { gap: clamp(24px, 3.5vw, 44px) !important; }
header#top .hero-stats { margin-top: 20px !important; }
header#top .hero-stats > div { padding: 14px 18px !important; }

/* PROCESS — diagram cap */
#process svg { max-width: 300px; margin: 0 auto; display: block; }
#process .proc-grid { gap: 28px !important; }

/* PRODUCTS — swatch grid gap */
#products .swatch-grid { gap: 10px !important; }

/* TEAM — card grid gap */
#team .container > div:last-child { gap: 12px !important; }

/* Generic card tightening */
.card { padding: 18px; }
.section-head { margin-bottom: 22px; }

/* Mobile — let content flow naturally, drop the overrides */
@media (max-width: 900px) {
  section, header#top, footer#contact {
    padding-top: 64px !important;
    padding-bottom: 32px !important;
  }
  header#top .hero-grid > div:last-child svg { height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
