/* ============================================================
   TERREXO — Design Tokens
   Calm, architectural, warm. Inspired by Luxembourg's
   stone houses, vineyards, and Ardennes forests.
   ============================================================ */

:root {
  /* ---- Color: Neutrals (warm off-white + papers) ---- */
  --paper:        #FAFAF7;     /* page bg */
  --paper-2:      #F2EDE4;     /* section alt bg, warm */
  --paper-3:      #E8E2D5;     /* deeper warm */
  --ink:          #161A18;     /* near-black with green undertone */
  --ink-2:        #2A302D;
  --ink-3:        #4A524E;
  --ink-mute:     #767D78;
  --rule:         #D9D4C8;     /* hairlines */
  --rule-strong:  #B8B2A2;

  /* ---- Color: Brand (forest + sage + sand) ---- */
  --forest:       #1A2E2A;     /* primary deep */
  --forest-2:     #243B36;
  --sage:         #5A6F5C;     /* secondary */
  --sage-2:       #768A78;
  --sand:         #D4C9A8;     /* accent warm */
  --sand-2:       #E5DCC0;
  --clay:         #A8704F;     /* small accent for tags / rare */

  /* ---- Type ---- */
  --font-sans: "Inter Tight", "Inter", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* Scale (1920 base) */
  --t-display:  clamp(56px, 7vw, 124px);
  --t-h1:       clamp(40px, 4.4vw, 76px);
  --t-h2:       clamp(32px, 3.0vw, 52px);
  --t-h3:       clamp(22px, 1.6vw, 30px);
  --t-h4:       18px;
  --t-body-lg:  20px;
  --t-body:     16px;
  --t-small:    13px;
  --t-eyebrow:  12px;

  /* ---- Spacing ---- */
  --gutter: clamp(20px, 3vw, 56px);
  --section-y: clamp(80px, 9vw, 160px);

  /* ---- Radii / Borders / Shadow ---- */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-pill: 999px;
  --shadow-soft: 0 1px 2px rgba(20,28,24,.04), 0 8px 28px rgba(20,28,24,.06);
  --shadow-card: 0 1px 2px rgba(20,28,24,.04), 0 20px 50px rgba(20,28,24,.10);

  /* ---- Motion ---- */
  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02", "cv11";
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Type utilities */
.eyebrow {
  font-size: var(--t-eyebrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.serif { font-family: var(--font-serif); font-weight: 400; }
.italic { font-style: italic; }

.h-display {
  font-family: var(--font-sans);
  font-size: var(--t-display);
  line-height: 0.94;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 0;
}
.h1 { font-size: var(--t-h1); line-height: 1.02; letter-spacing: -0.025em; font-weight: 500; margin: 0; }
.h2 { font-size: var(--t-h2); line-height: 1.06; letter-spacing: -0.02em; font-weight: 500; margin: 0; }
.h3 { font-size: var(--t-h3); line-height: 1.18; letter-spacing: -0.01em; font-weight: 500; margin: 0; }
.h4 { font-size: var(--t-h4); line-height: 1.3; font-weight: 600; margin: 0; }
.body-lg { font-size: var(--t-body-lg); line-height: 1.5; }
.small { font-size: var(--t-small); }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }

/* Layout helpers */
.container {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container-wide {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section-sm { padding-top: clamp(56px, 6vw, 100px); padding-bottom: clamp(56px, 6vw, 100px); }

.bg-paper { background: var(--paper); }
.bg-paper-2 { background: var(--paper-2); }
.bg-forest { background: var(--forest); color: var(--paper); }
.bg-sand { background: var(--sand-2); }
.bg-ink { background: var(--ink); color: var(--paper); }

/* Hairline rules */
.rule { height: 1px; background: var(--rule); border: 0; }
.rule-strong { height: 1px; background: var(--rule-strong); border: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .25s var(--ease);
  white-space: nowrap;
  background: transparent;
  color: inherit;
}
.btn .arrow {
  display: inline-flex;
  width: 16px; height: 16px;
  transition: transform .35s var(--ease-out);
}
.btn:hover .arrow { transform: translateX(4px); }

.btn-primary {
  background: var(--forest);
  color: var(--paper);
  border-color: var(--forest);
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.btn-ghost {
  border-color: var(--rule-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn-link {
  padding: 10px 0;
  border-radius: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  gap: 10px;
}
.btn-on-dark {
  background: var(--paper);
  color: var(--ink);
}
.btn-on-dark:hover { background: var(--sand-2); }

/* Tag / chip */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule-strong);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: transparent;
}
.tag .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--sage);
}

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
}

/* Reveal animation */
@keyframes terrexoFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { animation: terrexoFadeUp .9s var(--ease-out) both; }
.reveal.d1 { animation-delay: .08s; }
.reveal.d2 { animation-delay: .16s; }
.reveal.d3 { animation-delay: .24s; }
.reveal.d4 { animation-delay: .32s; }
.reveal.d5 { animation-delay: .40s; }

/* Scroll reveal hooks (used by IntersectionObserver) */
.sr {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  will-change: opacity, transform;
}
.sr.in { opacity: 1; transform: translateY(0); }

/* Link with underline grow */
.link-grow {
  position: relative;
  display: inline-block;
}
.link-grow::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .4s var(--ease-out);
}
.link-grow:hover::after { transform: scaleX(1); }

/* Image hover frame */
.media {
  position: relative;
  overflow: hidden;
  background: var(--paper-3);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}
.media:hover img { transform: scale(1.04); }

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--forest);
  width: 0%;
  z-index: 100;
  transition: width .1s linear;
}

/* Marquee */
.marquee { overflow: hidden; }
.marquee-track {
  display: flex;
  gap: 64px;
  white-space: nowrap;
  animation: marqueeScroll 40s linear infinite;
}
@keyframes marqueeScroll {
  to { transform: translateX(-50%); }
}

/* Footer */
footer { background: var(--ink); color: var(--paper); }

/* Form */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.field input, .field textarea, .field select {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  padding: 12px 0;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .25s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--forest);
}
.field textarea { resize: vertical; min-height: 120px; }

/* Section header utility */
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 64px;
}
@media (max-width: 900px) {
  .section-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 36px; }
}

/* Number stat */
.stat-num {
  font-family: var(--font-sans);
  font-size: clamp(60px, 6vw, 96px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 500;
}

/* Marker (the wordmark, small versions) */
.wordmark {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 22px;
}
.wordmark .dot { color: var(--sage); }

/* Prevent horizontal scroll on mobile */
@media (max-width: 767px) {
  body { overflow-x: hidden; }
}
