/* NaturLoop — Cocoboard® · design tokens + base
   Theming contract: all colors/type via :root custom properties.
   Second skin for the exec pitch = duplicate this block under [data-theme]. */

:root {
  color-scheme: light;
  --bg: #F5F0ED;
  --bg-deep: #141814;
  --ink: #1A1D1A;
  --ink-muted: #5C665C;
  --brand: #445D41;
  --accent: #C4A27A;
  --pending: #B08A3E; /* reserved: placeholder/pending chrome only */

  --font-display: "Space Grotesk", sans-serif;
  --font-expanded: "Archivo", sans-serif;
  --font-body: "Frutiger", "Frutiger Neue", "Source Sans 3", sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --section-pad: clamp(4rem, 12vh, 8rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }

/* --- section grammar --- */
section { padding: var(--section-pad) var(--gutter); }

.eyebrow {
  font-family: var(--font-expanded);
  font-stretch: 125%;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 1.25rem;
}
.headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}
.prose {
  max-width: 34rem;
  color: var(--ink-muted);
}
.prose strong { color: var(--ink); }

.band--dark {
  --bg: var(--bg-deep);
  --ink: #EDEFEA;
  --ink-muted: #9AA69A;
  background: var(--bg);
  color: var(--ink);
}
.band--dark .eyebrow { color: var(--accent); }

.pending {
  color: var(--pending);
  text-decoration: underline dashed;
  text-underline-offset: 0.3em;
}

/* --- header / footer --- */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem var(--gutter);
}
.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-nav { display: flex; gap: 0.75rem; }
.cta {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.55em 1.2em;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}
.cta--ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}
.cta:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.site-footer {
  padding: 3rem var(--gutter);
  font-size: 0.85rem;
  color: var(--ink-muted);
  border-top: 1px solid rgba(26, 29, 26, 0.08);
}
.site-footer p { margin: 0.25rem 0; }

/* --- media slots + stand-in system --- */
.media-slot {
  position: relative;
  margin: 0;
  overflow: hidden;
  background:
    repeating-linear-gradient(115deg,
      rgba(196, 162, 122, 0.22) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(25deg,
      rgba(196, 162, 122, 0.16) 0 2px, transparent 2px 11px),
    linear-gradient(var(--accent), var(--accent));
  background-blend-mode: normal, normal, multiply;
  background-color: color-mix(in srgb, var(--accent) 30%, var(--bg));
}
.media-slot > img,
.media-slot > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent; /* hide broken-image alt artifacts; frame shows through */
}
.media-slot[data-ratio="16/9"] { aspect-ratio: 16 / 9; }
.media-slot[data-ratio="4/3"]  { aspect-ratio: 4 / 3; }
.media-slot[data-ratio="1/1"]  { aspect-ratio: 1 / 1; }
.slot-tag {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.3em 0.75em;
  border-radius: 999px;
  color: #2B2109;
  background: var(--pending);
}

/* --- hero --- */
#hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 0;
  overflow: hidden;
  color: #fff;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media > img, .hero-media > video {
  will-change: transform;
}
#hero::after { /* legibility scrim */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20,24,20,0.35) 0%, rgba(20,24,20,0.05) 40%, rgba(20,24,20,0.65) 100%);
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 2;
  padding: var(--section-pad) var(--gutter);
}
.hero-sub { color: rgba(255,255,255,0.85); }
.hero-tagline, .hero-sub {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.hero-sub { transition-delay: 0.15s; }
html.hero-in .hero-tagline, html.hero-in .hero-sub,
html.js-failed .hero-tagline, html.js-failed .hero-sub,
html:not(.js) .hero-tagline, html:not(.js) .hero-sub {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .hero-tagline, .hero-sub { opacity: 1; transform: none; transition: none; }
}
.hero-tagline { margin-bottom: 1rem; }
.scroll-cue {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  bottom: 1.5rem;
  color: #fff;
  text-decoration: none;
  font-size: 1.4rem;
}
.site-header { color: #fff; } /* overlays dark hero */
.site-header .cta--ghost { border-color: rgba(255,255,255,0.6); }

/* --- loop (pinned cosmology section) --- */
#loop { padding: 0; }
.loop-track { height: 300vh; }
html:not(.js) .loop-track, html.reduced .loop-track, html.js-failed .loop-track { height: auto; }
.loop-stage {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 4rem);
  align-items: center;
  padding: var(--section-pad) var(--gutter);
}
html:not(.js) .loop-stage, html.reduced .loop-stage, html.js-failed .loop-stage { position: static; min-height: 0; }
.loop-headline { font-size: clamp(2rem, 4vw, 3.5rem); }
.loop-step h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}
/* js: steps swap; no-js / reduced: all stacked */
html.js:not(.reduced):not(.js-failed) .loop-step {
  position: absolute;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
html.js:not(.reduced):not(.js-failed) .loop-text { position: relative; padding-bottom: 11rem; }
html.js:not(.reduced):not(.js-failed) .loop-step.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
html:not(.js) .loop-step, html.reduced .loop-step, html.js-failed .loop-step { margin-bottom: 1.5rem; }

.loop-svg {
  width: min(100%, 520px);
  margin-inline: auto;
  color: var(--brand);
  font-family: var(--font-body);
  font-size: 13px;
}
.loop-node { fill: var(--bg); stroke: currentColor; stroke-width: 1.5; }
.loop-svg text { fill: var(--ink); }
.loop-sub { fill: var(--ink-muted); }
.loop-arc { fill: none; stroke: currentColor; stroke-width: 2; }
.loop-arc--return { stroke-dasharray: 6 6; }
html.js:not(.reduced):not(.js-failed) .loop-seg {
  opacity: 0.22;
  transition: opacity 0.45s ease;
}
html.js:not(.reduced) .loop-seg.is-active { opacity: 1; }

@media (max-width: 760px) {
  .loop-stage { grid-template-columns: 1fr; align-content: center; gap: 1.5rem; }
  .loop-svg { max-width: 320px; }
}
@media (max-height: 860px) and (max-width: 760px), (max-height: 560px) {
  /* viewports too small to fit the pinned stage: never pin (no clipped SVG, no scroll trap) */
  .loop-track { height: auto; }
  .loop-stage { position: static; min-height: 0; }
  html.js:not(.reduced):not(.js-failed) .loop-step { position: static; opacity: 1; transform: none; pointer-events: auto; margin-bottom: 1.5rem; }
  html.js:not(.reduced):not(.js-failed) .loop-text { padding-bottom: 0; }
  html.js:not(.reduced):not(.js-failed) .loop-seg { opacity: 1; }
}

/* --- material --- */
#material { padding: 0 0 var(--section-pad); }
#material .media-slot { max-height: 70vh; }
#material .media-slot[data-ratio="16/9"] { aspect-ratio: auto; height: 60vh; }
.material-copy { padding: var(--section-pad) var(--gutter) 0; }
.spec-list {
  margin: 2.5rem 0 0;
  max-width: 40rem;
  display: grid;
  gap: 1.25rem;
}
.spec-list > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(237, 239, 234, 0.15);
}
.spec-list dt {
  font-family: var(--font-expanded);
  font-stretch: 125%;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 0.2rem;
}
.spec-list dd { margin: 0; color: var(--ink-muted); }
.spec-list dd::first-line { color: var(--ink); }

/* --- proof --- */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
  margin: 3rem 0 0;
}
.proof-card { margin: 0; }
.proof-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 1.25rem 0 0.4rem;
}
.proof-card .prose { font-size: 0.95rem; }
.case-study {
  margin-top: var(--section-pad);
  padding-top: 2.5rem;
  border-top: 1px solid rgba(26, 29, 26, 0.1);
}
.case-headline {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin: 0 0 1rem;
}
@media (max-width: 760px) {
  .proof-grid { grid-template-columns: 1fr; }
  .spec-list > div { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* --- numbers --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: 2.5rem;
}
.stat-item { display: grid; gap: 0.6rem; align-content: start; }
.stat {
  font-family: var(--font-expanded);
  font-stretch: 125%;
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
.stat.pending { font-size: clamp(1.3rem, 2.6vw, 2rem); }
.stat-label { font-size: 0.9rem; color: var(--ink-muted); max-width: 22rem; }
@media (max-width: 760px) { .stat-grid { grid-template-columns: 1fr; } }

/* --- faq --- */
.faq-list { max-width: 44rem; margin-top: 2.5rem; }
.faq-list details { border-top: 1px solid rgba(26, 29, 26, 0.12); }
.faq-list details:last-child { border-bottom: 1px solid rgba(26, 29, 26, 0.12); }
.faq-list summary {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  padding: 1.1rem 2.5rem 1.1rem 0;
  cursor: pointer;
  list-style: none;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  font-size: 1.3rem;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list details > p { margin: 0 0 1.25rem; }

/* --- closing --- */
#closing { min-height: 70vh; display: grid; align-content: center; }
.closing-ctas { display: flex; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
.cta--big { font-size: 1rem; padding: 0.9em 1.9em; }
#closing .cta--ghost { border-color: rgba(237,239,234,0.5); color: var(--ink); }

/* --- shared reveal system (JS adds .reveal; no-JS never hides) --- */
html.js:not(.reduced):not(.js-failed) .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0s);
}
html.js:not(.reduced):not(.js-failed) .reveal.is-in { opacity: 1; transform: none; }
