/* =========================================================================
   ELEMENTAL NORTH AMERICA — design system
   Editorial B2B / industrial undertone
   ========================================================================= */

/* ----- TOKENS ----- */
:root {
  /* Palette: "Subtle" (default) — warm cream + ink + muted teal accent */
  --bg:           #F4F1E9;
  --bg-elev:     #FAF8F2;
  --bg-card:     #FFFFFF;
  --ink:         #14181D;
  --ink-soft:    #383F48;
  --ink-mute:    #6B7280;
  --rule:        #E4DFD2;
  --rule-strong: #C7C0AE;

  --dark-bg:     #14181D;
  --dark-bg-2:   #1B2027;
  --dark-fg:     #EFEBDF;
  --dark-fg-mute:#9AA2AE;
  --dark-rule:   #2A313B;

  --accent:      #2C7D72;  /* muted brand teal */
  --accent-deep: #1F5F57;
  --accent-soft: #D9E7E3;

  --copper:      #C2784A;  /* industrial accent */
  --copper-deep: #9A5C36;

  /* Type */
  --font-display: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  --container: 1320px;
  --container-narrow: 980px;

  /* Density (tweakable) */
  --density: 1;
  --section-pad-y: calc(120px * var(--density));

  /* Border-radius — minimal, slightly architectural */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
}

/* Palette variant: Industrial (more navy, less teal) */
[data-palette="industrial"] {
  --bg:           #ECE8DD;
  --bg-elev:     #F4F1E7;
  --ink:         #0E1116;
  --accent:      #3F5567;
  --accent-deep: #2A3949;
  --accent-soft: #DCE2E8;
  --copper:      #B8703F;
}

/* Palette variant: Brand-bold (closer to elemental.biz teal) */
[data-palette="bold"] {
  --bg:           #F8F6F0;
  --accent:      #20917F;
  --accent-deep: #156E5F;
  --accent-soft: #CFE6E0;
  --copper:      #C2784A;
}

/* Typography variant: "Editorial" — serif display */
[data-type="editorial"] {
  --font-display: 'Fraunces', 'Inter Tight', serif;
}

/* Density variant: airy */
[data-density="airy"] {
  --density: 1.25;
}
[data-density="compact"] {
  --density: 0.78;
}

/* ----- BASE ----- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* ----- TYPE ----- */
.t-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.t-eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.t-eyebrow.no-dash::before { display: none; }

.t-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--ink);
  margin: 0;
  font-size: clamp(40px, 6vw, 92px);
  text-wrap: balance;
}
.t-h1 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  font-size: clamp(36px, 4.5vw, 64px);
  text-wrap: balance;
}
.t-h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  font-size: clamp(28px, 3.2vw, 44px);
  text-wrap: balance;
}
.t-h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
  font-size: clamp(20px, 1.6vw, 24px);
}

.t-lead {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0;
  max-width: 60ch;
}
.t-body { font-size: 16px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.t-mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; }

/* ----- LAYOUT ----- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 48px);
}
.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 48px);
}
.section { padding-block: var(--section-pad-y); }
.section--tight { padding-block: calc(var(--section-pad-y) * 0.6); }
.section--dark { background: var(--dark-bg); color: var(--dark-fg); }
.section--dark .t-display,
.section--dark .t-h1,
.section--dark .t-h2,
.section--dark .t-h3 { color: var(--dark-fg); }
.section--dark .t-lead,
.section--dark .t-body { color: var(--dark-fg-mute); }
.section--dark .t-eyebrow { color: var(--dark-fg-mute); }
.section--ink {
  background: var(--ink);
  color: var(--dark-fg);
}
.section--ink .t-display,
.section--ink .t-h2 { color: var(--dark-fg); }
.section--ink .t-lead { color: var(--dark-fg-mute); }

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }
.rule--dark { background: var(--dark-rule); }

/* ----- HEADER ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, padding .25s;
}
.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: var(--sp-6);
  transition: height .25s;
}
.site-header.is-scrolled .site-header__inner { height: 64px; }
.site-header__logo {
  display: flex;
  align-items: center;
  height: 32px;
}
.site-header__logo img { height: 100%; width: auto; }
.site-nav {
  display: none;
  gap: var(--sp-6);
  align-items: center;
}
@media (min-width: 980px) {
  .site-nav { display: flex; }
}
.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  padding: 8px 0;
  position: relative;
  transition: color .2s;
}
.site-nav a:hover { color: var(--accent-deep); }
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
}
.site-header__cta { display: none; }
@media (min-width: 980px) { .site-header__cta { display: inline-flex; } }
.site-header__mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
}
@media (min-width: 980px) { .site-header__mobile-toggle { display: none; } }

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 60;
  padding: 24px;
  display: none;
  flex-direction: column;
}
.mobile-menu.is-open { display: flex; animation: slide-down .35s ease; }
@keyframes slide-down {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.mobile-menu__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-menu__nav { display: flex; flex-direction: column; gap: 8px; margin-top: 48px; }
.mobile-menu__nav a {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

/* ----- BUTTONS ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform .15s, background .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
  line-height: 1;
}
.btn--primary {
  background: var(--ink);
  color: var(--bg-elev);
}
.btn--primary:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn--accent {
  background: var(--accent);
  color: #fff;
}
.btn--accent:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}
.btn--ghost:hover { border-color: var(--ink); }
.btn--ghost-light {
  background: transparent;
  color: var(--dark-fg);
  border: 1px solid var(--dark-rule);
}
.btn--ghost-light:hover { border-color: var(--dark-fg); }
.btn--lg { padding: 18px 28px; font-size: 16px; }
.btn--sm { padding: 10px 16px; font-size: 13px; }

.btn .arrow {
  width: 14px;
  height: 14px;
  display: inline-block;
  transition: transform .2s;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ----- CARDS ----- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { border-color: var(--rule-strong); }
.card--linked:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 12px 30px -16px rgba(20,24,29,0.18);
}
.card--dark {
  background: var(--dark-bg-2);
  border-color: var(--dark-rule);
}
.card--ghost {
  background: transparent;
  border-color: var(--rule);
}

/* ----- GRID UTILITIES ----- */
.grid { display: grid; gap: var(--sp-6); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: 1fr 1fr 1fr; }
  .grid--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
@media (min-width: 980px) {
  .grid--2 { gap: var(--sp-8); }
}

/* ----- FOOTER ----- */
.site-footer {
  background: var(--ink);
  color: var(--dark-fg);
  padding-block: 80px 32px;
}
.site-footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
}
@media (min-width: 880px) {
  .site-footer__top { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.site-footer__brand img { height: 36px; }
.site-footer__col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dark-fg-mute);
  font-weight: 500;
  margin: 0 0 16px;
}
.site-footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer__col a { color: var(--dark-fg); font-size: 15px; transition: color .2s; }
.site-footer__col a:hover { color: var(--accent); }
.site-footer__bottom {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--dark-rule);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 13px;
  color: var(--dark-fg-mute);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
@media (min-width: 720px) {
  .site-footer__bottom { flex-direction: row; align-items: center; }
}

/* ----- FADE-IN ON SCROLL ----- */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s cubic-bezier(.16,.84,.44,1), transform .8s cubic-bezier(.16,.84,.44,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.js-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ----- TWEAKS PANEL CUSTOM POSITIONING ----- */
.tweaks-mount { position: fixed; right: 20px; bottom: 20px; z-index: 999; }

/* ----- FLOATING QUOTE BUTTON (sticky CTA on all pages) ----- */
.floating-cta {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: none;
}
.floating-cta.is-visible { display: inline-flex; }
@media (max-width: 720px) {
  .floating-cta { right: 16px; bottom: 16px; }
}

/* ----- UTIL ----- */
.flow > * + * { margin-top: var(--sp-4); }
.flow-lg > * + * { margin-top: var(--sp-6); }
.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mt-8 { margin-top: var(--sp-8); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.cluster--lg { gap: var(--sp-5); }
.split { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap; }
.center { text-align: center; }
.text-accent { color: var(--accent-deep); }
.section--dark .text-accent { color: color-mix(in oklab, var(--accent) 70%, white); }
