:root {
  color-scheme: dark;
  --_layout---fluid--max: 90;
  --_layout---fluid--min: 20;
  --_layout---grid--gap-main: 40px;
  --_layout---grid--gap-md: 24px;
  --_layout---grid--gap-sm: 8px;
  --_layout---grid--gap-button: 16px;
  --_components---container--gutter: 6vw;
  --_components---container--max-width: calc(var(--_layout---fluid--max) * 1rem);
  --_components---section--padding: clamp(3rem, 8vw, 6rem);
  --_components---button--border-radius: var(--theme-radius-button);
  --_components---card--border-radius: var(--theme-radius-card);

  --droptine-forest: #2e3d28;
  --droptine-forest-dark: #121810;
  --droptine-ink: #101312;
  --droptine-charcoal: #151919;
  --droptine-tan: #d0b78e;
  --droptine-sand: #deccaf;
  --droptine-stone: #e0ddda;
  --droptine-paper: #f2f2f2;
  --droptine-black: #020202;

  --theme-radius-button: .25rem;
  --theme-radius-card: .35rem;
  --theme-texture-opacity: .18;
  --theme-heading-case: none;
  --theme-heading-letter: -.025em;

  --_typography---fonts--primary-font: Inter, Arial, sans-serif;
  --theme-heading-font: "Saira Condensed", Inter, sans-serif;
  --theme-accent-font: "IBM Plex Mono", monospace;

  --_color---neutral--black: var(--droptine-ink);
  --_color---neutral--dark-gray: var(--droptine-charcoal);
  --_color---neutral--mid-gray-2: #534938;
  --_color---neutral--mid-gray-1: #a69271;
  --_color---neutral--light-gray: var(--droptine-paper);
  --_color---neutral--white: #ffffff;
  --_color---primary--orange: var(--droptine-tan);
  --_color---primary--dark-orange: #a69271;
  --_color---secondary--blue: #5d6c7b;
  --_color---secondary--yellow: var(--droptine-sand);
}

html[data-palette="field-ops"] {
  --theme-accent: #d0b78e;
  --theme-accent-2: #5d6c7b;
  --theme-primary: #2e3d28;
  --theme-radius-button: .18rem;
  --theme-radius-card: .35rem;
  --theme-texture-opacity: .18;
}

html[data-palette="backcountry-soc"] {
  --theme-accent: #758696;
  --theme-accent-2: #d0b78e;
  --theme-primary: #2e3d28;
  --theme-radius-button: .5rem;
  --theme-radius-card: .75rem;
  --theme-texture-opacity: .14;
}

html[data-palette="ironwood"] {
  --theme-accent: #d0b78e;
  --theme-accent-2: #534938;
  --theme-primary: #2e3d28;
  --theme-radius-button: .15rem;
  --theme-radius-card: .15rem;
  --theme-texture-opacity: .10;
}

html[data-palette="ranger-tech"] {
  --theme-accent: #d0b78e;
  --theme-accent-2: #b45f36;
  --theme-primary: #2e3d28;
  --theme-radius-button: 0;
  --theme-radius-card: 0;
  --theme-texture-opacity: .24;
}

html[data-type="saira-inter"] {
  --theme-heading-font: "Saira Condensed", Inter, sans-serif;
  --_typography---fonts--primary-font: Inter, Arial, sans-serif;
  --theme-accent-font: "IBM Plex Mono", monospace;
  --theme-heading-letter: -.015em;
}

html[data-type="barlow"] {
  --theme-heading-font: "Barlow Condensed", Barlow, sans-serif;
  --_typography---fonts--primary-font: Barlow, Inter, sans-serif;
  --theme-accent-font: "JetBrains Mono", monospace;
  --theme-heading-letter: -.01em;
}

html[data-type="source-serif"] {
  --theme-heading-font: "Source Serif 4", Georgia, serif;
  --_typography---fonts--primary-font: "Source Sans 3", Inter, sans-serif;
  --theme-accent-font: "IBM Plex Mono", monospace;
  --theme-heading-letter: -.035em;
}

html[data-type="oswald-plex"] {
  --theme-heading-font: Oswald, Inter, sans-serif;
  --_typography---fonts--primary-font: "IBM Plex Sans", Inter, sans-serif;
  --theme-accent-font: "IBM Plex Mono", monospace;
  --theme-heading-letter: -.02em;
}

html[data-mode="dark"] {
  color-scheme: dark;
  --primary--background: #101312;
  --primary--surface: #151919;
  --primary--surface-2: #1d241c;
  --primary--text: #f2f2f2;
  --primary--muted: #c7c3b8;
  --primary--border: rgba(222, 204, 175, .22);
  --primary--accent: var(--theme-accent);
  --primary--accent-dark: #a69271;
  --primary--button-text: #101312;
  --primary--shadow: rgba(0,0,0,.42);
}

html[data-mode="light"] {
  color-scheme: light;
  --primary--background: #f2f2f2;
  --primary--surface: #ffffff;
  --primary--surface-2: #e0ddda;
  --primary--text: #101312;
  --primary--muted: #4d4d4d;
  --primary--border: rgba(16, 19, 18, .18);
  --primary--accent: #2e3d28;
  --primary--accent-dark: #121810;
  --primary--button-text: #f2f2f2;
  --primary--shadow: rgba(16,19,18,.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--_typography---fonts--primary-font);
  background: var(--primary--background);
  color: var(--primary--text);
  line-height: 1.6;
  transition: background .25s ease, color .25s ease;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: var(--theme-texture-opacity);
  mix-blend-mode: overlay;
  background-image: radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0);
  background-size: 18px 18px;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 6vw;
  border-bottom: 1px solid var(--primary--border);
  background: color-mix(in srgb, var(--primary--background) 88%, transparent);
  backdrop-filter: blur(18px);
}
.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .75rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid var(--primary--border);
  background: var(--primary--accent);
  color: var(--primary--button-text);
  font-family: var(--theme-heading-font);
  font-weight: 800;
}
.brand strong, .brand em { display: block; line-height: 1; }
.brand em { color: var(--primary--muted); font-style: normal; font-size: .78rem; font-family: var(--theme-accent-font); text-transform: uppercase; letter-spacing: .08em; margin-top: .2rem; }
.topnav { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.topnav label { display: flex; align-items: center; gap: .5rem; font-family: var(--theme-accent-font); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--primary--muted); }
select, input {
  border: 1px solid var(--primary--border);
  background: var(--primary--surface);
  color: var(--primary--text);
  border-radius: var(--theme-radius-button);
  padding: .72rem .85rem;
  font: inherit;
}
.mode-toggle, .btn, button {
  border: 1px solid var(--primary--accent);
  background: var(--primary--accent);
  color: var(--primary--button-text);
  border-radius: var(--_components---button--border-radius);
  padding: .78rem 1rem;
  font-family: var(--theme-accent-font);
  font-size: .82rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--primary--shadow);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover, .mode-toggle:hover, button:hover { transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--primary--text);
  border-color: var(--primary--border);
}

.section { padding: var(--_components---section--padding) 0; position: relative; }
.container { width: min(calc(100% - 12vw), var(--_components---container--max-width)); margin-inline: auto; }
.row { display: flex; flex-wrap: wrap; margin-inline: calc(var(--_layout---grid--gap-main) / -2); }
.col { padding-inline: calc(var(--_layout---grid--gap-main) / 2); flex: 1 0 0; }
.col-lg-4 { flex-basis: 33.333%; max-width: 33.333%; }
.col-lg-5 { flex-basis: 41.666%; max-width: 41.666%; }
.col-lg-7 { flex-basis: 58.333%; max-width: 58.333%; }
.col-lg-8 { flex-basis: 66.666%; max-width: 66.666%; }
.row-gap-md { row-gap: var(--_layout---grid--gap-md); }
.row-gap-button { gap: var(--_layout---grid--gap-button); margin: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--theme-heading-font);
  letter-spacing: var(--theme-heading-letter);
  text-transform: var(--theme-heading-case);
  line-height: .98;
  margin: 0 0 .25em;
  font-weight: 700;
}
h1 { font-size: clamp(3.25rem, 9vw, 7.25rem); max-width: 11ch; }
h2 { font-size: clamp(2.2rem, 5vw, 4.4rem); }
h3 { font-size: clamp(1.45rem, 2.5vw, 2.4rem); line-height: 1.05; }
p { margin: 0 0 1em; }
.paragraph-xl { font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.45; color: var(--primary--muted); max-width: 42rem; }
.paragraph-lg { font-size: clamp(1.05rem, 1.6vw, 1.28rem); line-height: 1.55; color: var(--primary--muted); }
.eyebrow {
  font-family: var(--theme-accent-font);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  color: var(--primary--accent);
  font-weight: 600;
  margin-bottom: 1.2em;
}

.hero {
  min-height: calc(100vh - 70px);
  display: grid;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--primary--background), transparent 6%) 0%, color-mix(in srgb, var(--primary--background), transparent 14%) 55%, transparent 100%),
    linear-gradient(0deg, color-mix(in srgb, var(--theme-primary), transparent 15%), transparent 55%),
    url("https://images.unsplash.com/photo-1473448912268-2022ce9509d8?auto=format&fit=crop&w=1800&q=82") center/cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--primary--border) 1px, transparent 1px), linear-gradient(90deg, var(--primary--border) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, transparent, black 40%, transparent 85%);
  opacity: .55;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: clamp(2rem, 6vw, 6rem); align-items: end; position: relative; z-index: 2; }
.hero-copy { padding: 3rem 0; }
.card {
  border: 1px solid var(--primary--border);
  background: color-mix(in srgb, var(--primary--surface) 92%, transparent);
  border-radius: var(--_components---card--border-radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 24px 70px var(--primary--shadow);
}
.mission-card { backdrop-filter: blur(10px); }
.signal-bars { display: flex; gap: .4rem; align-items: end; height: 3rem; margin-top: 2rem; }
.signal-bars span { flex: 1; background: var(--primary--accent); opacity: .9; }
.signal-bars span:nth-child(1) { height: 30%; } .signal-bars span:nth-child(2) { height: 55%; } .signal-bars span:nth-child(3) { height: 78%; } .signal-bars span:nth-child(4) { height: 100%; background: var(--theme-accent-2); }

.section-heading { max-width: 760px; margin-bottom: 2rem; }
.font-specs { display: flex; flex-wrap: wrap; gap: .7rem; }
.font-specs span { border: 1px solid var(--primary--border); border-radius: 99rem; padding: .45rem .65rem; color: var(--primary--muted); font-family: var(--theme-accent-font); font-size: .78rem; }
.swatch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.swatch { min-height: 180px; display: flex; flex-direction: column; justify-content: flex-end; padding: 1rem; border: 1px solid var(--primary--border); border-radius: var(--theme-radius-card); box-shadow: 0 16px 40px var(--primary--shadow); }
.swatch strong, .swatch span { display: block; }
.swatch strong { font-family: var(--theme-heading-font); font-size: 1.55rem; }
.swatch span { font-family: var(--theme-accent-font); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; opacity: .82; }
.type-stack h1 { font-size: clamp(3rem, 6vw, 5.5rem); }
.component-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.icon { width: 3rem; height: 3rem; display: grid; place-items: center; background: var(--primary--accent); color: var(--primary--button-text); margin-bottom: 1.25rem; font-size: 1.5rem; }
.text-link { color: var(--primary--accent); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: .25em; }
.accent-card { background: color-mix(in srgb, var(--theme-primary) 28%, var(--primary--surface)); }
.demo-panel { margin-top: 1rem; display: flex; justify-content: space-between; gap: 2rem; align-items: center; }
.split-demo { margin-top: 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-card label { display: grid; gap: .45rem; margin-bottom: 1rem; color: var(--primary--muted); font-family: var(--theme-accent-font); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.form-card input, .form-card select { width: 100%; margin-top: .2rem; font-family: var(--_typography---fonts--primary-font); text-transform: none; letter-spacing: 0; color: var(--primary--text); }
details { border-top: 1px solid var(--primary--border); padding: 1rem 0; }
summary { cursor: pointer; font-weight: 700; font-family: var(--theme-heading-font); font-size: 1.35rem; }
details p { color: var(--primary--muted); margin: .75rem 0 0; }
pre { margin: 0; overflow: auto; border: 1px solid var(--primary--border); background: var(--primary--surface); border-radius: var(--theme-radius-card); padding: 1.25rem; color: var(--primary--muted); }
code { font-family: var(--theme-accent-font); font-size: .84rem; }
.footer { border-top: 1px solid var(--primary--border); background: var(--primary--surface); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero-grid, .component-grid, .split-demo, .footer-grid { grid-template-columns: 1fr; }
  .swatch-grid { grid-template-columns: repeat(2, 1fr); }
  .col-lg-4, .col-lg-5, .col-lg-7, .col-lg-8 { flex-basis: 100%; max-width: 100%; }
  .demo-panel { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 540px) {
  .swatch-grid { grid-template-columns: 1fr; }
  .topnav { width: 100%; }
  .topnav label, .topnav select, .mode-toggle { width: 100%; }
}
