/* ═══════════════════════════════════════════════════════════════════
   AnyFarm IOT — shared theme
   Aesthetic: professional agricultural, editorial typography, earth
   palette, illustrated farming visuals. Light + dark themes.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Palette — earth + crop tones */
  --forest:       #1a3a23;
  --forest-2:     #244e30;
  --field:        #3a6b3f;
  --crop:         #5c8a3a;
  --wheat:        #c89653;
  --wheat-soft:   #e3c483;
  --ochre:        #b56b3a;
  --soil:         #6b4d36;
  --cream:        #f4ecd8;
  --bone:         #ebe4d2;
  --parchment:    #faf4e3;
  --ink:          #1a1f17;
  --ink-soft:     #4a4f44;
  --rule:         #d8cfb7;
  --sky:          #d3dfdc;

  /* ── Semantic tokens (LIGHT theme) ──────────────────────────────
     Components reference these so light/dark swap in one place.
     Intentionally-dark bands (activities, CTA, footer) keep raw
     palette tokens — they're dark in both themes. */
  --c-bg:          #faf4e3;
  --c-surface:     #f4ecd8;
  --c-surface-2:   #ebe4d2;
  --c-text:        #1a1f17;
  --c-text-soft:   #4a4f44;
  --c-text-mute:   #6b4d36;
  --c-heading:     #1a1f17;
  --c-brand:       #1a3a23;
  --c-brand-hover: #244e30;
  --c-brand-ink:   #f4ecd8;
  --c-accent:      #b56b3a;
  --c-border:      #d8cfb7;
  --c-header-bg:   rgba(244, 236, 216, 0.93);
  --c-rowline:     rgba(26, 58, 35, 0.025);
  --c-codebg:      #1a1f17;
  --c-ghost-bd:    rgba(26, 31, 23, 0.25);

  /* Aliases used by older selectors so nothing breaks */
  --fg:           var(--c-text);
  --bg:           var(--c-bg);
  --accent:       var(--c-brand);
  --accent-dark:  var(--c-brand);
  --accent-soft:  rgba(26, 58, 35, 0.08);
  --muted:        var(--c-text-soft);

  /* Typography */
  --font-serif:   "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-display: "Fraunces", Georgia, serif;

  /* Layout */
  --max:          60rem;
  --wide:         1240px;
  --shadow-paper: 0 1px 0 rgba(26,31,23,0.04), 0 22px 40px -28px rgba(26,31,23,0.16);
}

/* ── Semantic tokens (DARK theme) ─────────────────────────────────
   Deep olive-ink base, parchment text. Primary action lifts to Crop
   and accents lift to Wheat so they read on dark. */
:root[data-theme="dark"] {
  --c-bg:          #14160f;
  --c-surface:     #1e221a;
  --c-surface-2:   #2a2f22;
  --c-text:        #f0ead8;
  --c-text-soft:   rgba(240, 234, 216, 0.72);
  --c-text-mute:   rgba(240, 234, 216, 0.55);
  --c-heading:     #f0ead8;
  --c-brand:       #5c8a3a;
  --c-brand-hover: #6e9e46;
  --c-brand-ink:   #14160f;
  --c-accent:      #c89653;
  --c-border:      rgba(240, 234, 216, 0.14);
  --c-header-bg:   rgba(20, 22, 15, 0.9);
  --c-rowline:     rgba(240, 234, 216, 0.03);
  --c-codebg:      #2a2f22;
  --c-ghost-bd:    rgba(240, 234, 216, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg:          #14160f;
    --c-surface:     #1e221a;
    --c-surface-2:   #2a2f22;
    --c-text:        #f0ead8;
    --c-text-soft:   rgba(240, 234, 216, 0.72);
    --c-text-mute:   rgba(240, 234, 216, 0.55);
    --c-heading:     #f0ead8;
    --c-brand:       #5c8a3a;
    --c-brand-hover: #6e9e46;
    --c-brand-ink:   #14160f;
    --c-accent:      #c89653;
    --c-border:      rgba(240, 234, 216, 0.14);
    --c-header-bg:   rgba(20, 22, 15, 0.9);
    --c-rowline:     rgba(240, 234, 216, 0.03);
    --c-codebg:      #2a2f22;
    --c-ghost-bd:    rgba(240, 234, 216, 0.3);
  }
}

/* Variable-axes setup */
.fraunces, body, h1, h2, h3, h4, h5, .display, .prose {
  font-variation-settings: "opsz" 14, "SOFT" 30, "WONK" 1;
}
.display, h1, h2 {
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.site-main  { flex: 1 0 auto; padding: 0; max-width: none; margin: 0; width: 100%; }
.site-footer { flex-shrink: 0; }

a { color: inherit; }

/* ───────────────────────── Header ──────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: var(--c-header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
}

.site-header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo { width: 56px; height: auto; display: block; }

/* On dark surfaces the tractor's dark outlines/wheels need a light halo
   to separate from the background (no background fill added). */
.footer-logo-img {
  filter:
    drop-shadow(0 0 1px rgba(244, 236, 216, 0.9))
    drop-shadow(0 0 2px rgba(244, 236, 216, 0.5));
}
:root[data-theme="dark"] .brand-logo {
  filter:
    drop-shadow(0 0 1px rgba(244, 236, 216, 0.9))
    drop-shadow(0 0 2px rgba(244, 236, 216, 0.5));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo {
    filter:
      drop-shadow(0 0 1px rgba(244, 236, 216, 0.9))
      drop-shadow(0 0 2px rgba(244, 236, 216, 0.5));
  }
}

.brand-mark {
  display: flex;
  flex-direction: column;
  line-height: 1;
  position: relative;
  padding-bottom: 0.45rem;
}

.brand-main {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-weight: 600;
  font-size: 1.85rem;
  color: var(--c-brand);
  letter-spacing: -0.025em;
  line-height: 1;
}

.brand-sub {
  font-family: var(--font-mono);
  margin-top: 0.4rem;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--c-text-soft);
  letter-spacing: 0.22em;
  line-height: 1;
}

.brand-accent {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 55%;
  background: linear-gradient(90deg, var(--wheat) 0%, var(--ochre) 100%);
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 0;
}

.header-nav-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.main-nav {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 4px;
  color: var(--c-text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link i { font-size: 0.85rem; color: var(--field); }

.nav-link:hover { background: var(--c-surface-2); color: var(--c-brand); }
.nav-link:hover i { color: var(--c-brand); }

.nav-link.active {
  background: transparent;
  color: var(--c-brand);
  border-radius: 0;
  box-shadow: inset 0 -2px 0 var(--c-accent);
}
.nav-link.active:hover { background: transparent; }
.nav-link.active i { color: var(--c-accent); }

/* Dark-mode toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: transparent;
  color: var(--c-text);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--c-surface-2);
  color: var(--c-accent);
  border-color: var(--c-accent);
}

.header-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--c-text-mute);
}

@media (max-width: 1024px) {
  .nav-link span { display: none; }
  .nav-link { padding: 0.5rem 0.7rem; }
  .nav-link i { font-size: 1rem; }
  .header-tagline { display: none; }
}

@media (max-width: 640px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }
  .header-right { align-items: flex-start; width: 100%; }
  .header-nav-row { width: 100%; }
  .main-nav { width: 100%; justify-content: flex-start; }
  .brand-logo { width: 48px; }
  .brand-main { font-size: 1.55rem; }
}

/* ───────────────────────── Buttons ─────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  line-height: 1;
}

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

.btn-ghost {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-ghost-bd);
}
.btn-ghost:hover { border-color: var(--c-brand); color: var(--c-brand); }

.btn-large { padding: 1rem 1.6rem; font-size: 0.9rem; }

/* ───────────────────────── Typography ──────────────────────────── */

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--c-heading);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

p { margin: 0 0 1.1rem 0; }

.eyebrow, .chapter-mark {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.section-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 5rem 1.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 0.75rem 0;
  color: var(--c-heading);
}

.section-title em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  color: var(--c-brand);
}

.section-lede {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--c-text-soft);
  margin: 0 0 3rem 0;
  max-width: 42rem;
}

/* Decorative horizontal rule used between editorial sections */
.field-rule {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.5rem 0;
  color: var(--c-accent);
}
.field-rule::before, .field-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-border);
}
.field-rule-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ───────────────────────── HOME — HERO ─────────────────────────── */

.home-hero {
  position: relative;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 38px,
      var(--c-rowline) 38px,
      var(--c-rowline) 40px
    );
  pointer-events: none;
}

.home-hero-inner {
  position: relative;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 4.5rem 1.75rem 5rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
}

.home-hero-text { max-width: 36rem; }

.home-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.home-hero-eyebrow::before {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: var(--c-accent);
}

.home-hero-slogan {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  margin: 0 0 1.5rem 0;
  font-size: clamp(2.5rem, 5.5vw, 4.4rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--c-heading);
}

.home-hero-slogan em {
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  color: var(--c-brand);
}

.home-hero-slogan .accent { color: var(--c-accent); }

.home-hero-subtitle {
  margin: 0 0 2rem 0;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--c-text-soft);
  max-width: 32rem;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.home-hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-hero-visual svg {
  width: 100%;
  max-width: 560px;
  height: auto;
}

.home-hero-creds {
  position: absolute;
  bottom: 1.5rem;
  left: 1.75rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-text-mute);
}
.home-hero-creds span { display: inline-flex; align-items: center; gap: 0.45rem; }
.home-hero-creds i { color: var(--c-accent); }

@media (max-width: 900px) {
  .home-hero-inner {
    grid-template-columns: 1fr;
    padding: 3rem 1.25rem 3.5rem;
    gap: 2rem;
  }
  .home-hero-visual { order: -1; }
  .home-hero-creds { display: none; }
}

/* ───────────────────────── HOME — CAPABILITIES ─────────────────── */

.home-capabilities {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.cap-index-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--c-border);
}

.cap-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 5rem;
  align-items: start;
  gap: 1.25rem;
  padding: 2rem 1.5rem 2rem 0;
  border-bottom: 1px solid var(--c-border);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.2s ease;
}

.cap-row:nth-child(odd) {
  border-right: 1px solid var(--c-border);
  padding-right: 2.5rem;
}
.cap-row:nth-child(even) { padding-left: 2.5rem; }

.cap-row:hover { background: var(--c-bg); }

.cap-num {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  font-weight: 300;
  font-size: 3rem;
  line-height: 1;
  color: var(--c-accent);
  letter-spacing: -0.03em;
}

.cap-row h3 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 50, "WONK" 1;
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0.25rem 0 0.5rem 0;
  color: var(--c-heading);
  letter-spacing: -0.015em;
}

.cap-row p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--c-text-soft);
}

.cap-icon {
  width: 78px;
  height: 78px;
  flex-shrink: 0;
  color: var(--c-brand);
  align-self: center;
}
.cap-icon svg { width: 100%; height: 100%; display: block; }

.cap-row:hover .cap-num { color: var(--c-brand); }

@media (max-width: 800px) {
  .cap-index-list { grid-template-columns: 1fr; }
  .cap-row { padding: 1.75rem 0; }
  .cap-row:nth-child(odd),
  .cap-row:nth-child(even) {
    border-right: none;
    padding-left: 0;
    padding-right: 0;
  }
  .cap-row { grid-template-columns: 3.5rem 1fr 56px; gap: 1rem; }
  .cap-num { font-size: 2.25rem; }
  .cap-icon { width: 56px; height: 56px; }
}

/* ───────────────────────── HOME — ACTIVITIES STRIP (dark band) ─── */

.home-activities {
  background: var(--forest);
  color: var(--cream);
}
:root[data-theme="dark"] .home-activities { background: #16331f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home-activities { background: #16331f; }
}

.home-activities .section-title { color: var(--cream); }
.home-activities .section-lede  { color: rgba(244, 236, 216, 0.7); }
.home-activities .eyebrow      { color: var(--wheat); }

.activities-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  border-top: 1px solid rgba(244, 236, 216, 0.18);
}

.activity-cell {
  padding: 2rem 1.25rem 1.75rem;
  border-right: 1px solid rgba(244, 236, 216, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.activity-cell:last-child { border-right: none; }

.activity-cell svg {
  width: 80px;
  height: 64px;
  color: var(--wheat);
  margin-bottom: 1rem;
}

.activity-cell h4 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 50, "WONK" 1;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--cream);
}

.activity-cell p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 236, 216, 0.65);
}

@media (max-width: 1024px) {
  .activities-grid { grid-template-columns: repeat(3, 1fr); }
  .activity-cell:nth-child(3n) { border-right: none; }
  .activity-cell:nth-child(n+4) { border-top: 1px solid rgba(244, 236, 216, 0.12); }
}
@media (max-width: 540px) {
  .activities-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-cell:nth-child(3n) { border-right: 1px solid rgba(244, 236, 216, 0.12); }
  .activity-cell:nth-child(2n) { border-right: none; }
  .activity-cell:nth-child(n+3) { border-top: 1px solid rgba(244, 236, 216, 0.12); }
}

/* ───────────────────────── HOME — FLOW ─────────────────────────── */

.home-flow {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.flow-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--c-border);
}

.flow-step {
  position: relative;
  padding: 2.5rem 1.5rem 2rem;
  border-right: 1px solid var(--c-border);
}
.flow-step:last-child { border-right: none; }

.flow-step-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 1rem;
}

.flow-step-illustration {
  width: 110px;
  height: 80px;
  margin-bottom: 1.25rem;
  color: var(--c-brand);
}
.flow-step-illustration svg { width: 100%; height: 100%; }

.flow-step h4 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 50, "WONK" 1;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-heading);
  margin: 0 0 0.4rem 0;
}

.flow-step p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--c-text-soft);
}

.flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--c-bg);
  padding: 0.2rem 0.3rem;
  color: var(--c-accent);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  z-index: 2;
}

@media (max-width: 880px) {
  .flow-steps { grid-template-columns: 1fr 1fr; }
  .flow-step:nth-child(2n) { border-right: none; }
  .flow-step:nth-child(n+3) { border-top: 1px solid var(--c-border); }
  .flow-step:not(:last-child)::after { display: none; }
}
@media (max-width: 540px) {
  .flow-steps { grid-template-columns: 1fr; }
  .flow-step { border-right: none; border-bottom: 1px solid var(--c-border); }
  .flow-step:last-child { border-bottom: none; }
}

/* ───────────────────────── HOME — CTA (dark band) ──────────────── */

.home-cta {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-2) 100%);
  color: var(--cream);
  position: relative;
  overflow: hidden;
}

.home-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      88deg,
      transparent 0,
      transparent 22px,
      rgba(244, 236, 216, 0.04) 22px,
      rgba(244, 236, 216, 0.04) 23px
    );
  pointer-events: none;
}

.home-cta-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.home-cta .eyebrow { color: var(--wheat); margin-bottom: 1rem; display: block; }

.home-cta h2 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  margin: 0 0 0.75rem 0;
  font-size: clamp(1.85rem, 3.5vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--cream);
}
.home-cta h2 em { font-style: italic; color: var(--wheat); }

.home-cta p {
  margin: 0;
  color: rgba(244, 236, 216, 0.78);
  font-size: 1.1rem;
  line-height: 1.55;
  max-width: 34rem;
}

.home-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.home-cta .btn-primary {
  background: var(--wheat);
  color: var(--forest);
  border-color: var(--wheat);
}
.home-cta .btn-primary:hover {
  background: var(--cream);
  border-color: var(--cream);
}

.home-cta .btn-ghost {
  color: var(--cream);
  border-color: rgba(244, 236, 216, 0.4);
}
.home-cta .btn-ghost:hover {
  background: rgba(244, 236, 216, 0.1);
  border-color: var(--cream);
  color: var(--cream);
}

@media (max-width: 720px) {
  .home-cta-inner { grid-template-columns: 1fr; }
  .home-cta-actions { justify-content: flex-start; }
}

/* ───────────────────────── PAGE HERO (sub-pages) ───────────────── */

.page-hero {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: relative;
}

.page-hero-inner {
  padding: 4rem 1.75rem 3.5rem;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-mute);
  text-decoration: none;
  transition: color 0.15s ease, gap 0.15s ease;
}
.page-back:hover { color: var(--c-accent); gap: 0.7rem; }
.page-back i { font-size: 0.78rem; }

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.page-eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--c-accent);
}

.page-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  margin: 0 0 1.1rem 0;
  font-size: clamp(1.85rem, 3.8vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--c-heading);
}

.page-lede {
  margin: 0;
  max-width: 42rem;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--c-text-soft);
}

.page-body { background: var(--c-bg); }

/* ───────────────────────── PROSE ────────────────────────────────── */

.prose {
  max-width: 48rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--c-text);
}

.prose h2 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 50, "WONK" 1;
  margin: 2.75rem 0 0.9rem 0;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--c-heading);
}

.prose h3 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 32, "SOFT" 50, "WONK" 1;
  margin: 2rem 0 0.55rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-heading);
}

.prose h4 {
  font-family: var(--font-mono);
  margin: 1.5rem 0 0.4rem 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.prose p { margin: 0 0 1.15rem 0; }

.prose ul, .prose ol { margin: 0 0 1.25rem 0; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4rem; }

.prose a {
  color: var(--c-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover { color: var(--c-accent); }

.prose hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 2.5rem 0;
}

.prose code {
  background: var(--c-surface-2);
  padding: 0.1em 0.45em;
  border-radius: 3px;
  font-size: 0.92em;
  font-family: var(--font-mono);
  color: var(--c-text-mute);
}

.prose pre {
  background: var(--c-codebg);
  color: var(--cream);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.88em;
  line-height: 1.55;
  margin: 0 0 1.25rem 0;
  font-family: var(--font-mono);
}
.prose pre code { background: transparent; color: inherit; padding: 0; }

.prose blockquote {
  margin: 1.5rem 0 1.5rem -0.5rem;
  padding: 0.5rem 1.1rem;
  border-left: 3px solid var(--wheat);
  background: var(--c-surface);
  color: var(--c-text);
  font-style: italic;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 32, "SOFT" 100, "WONK" 1;
  border-radius: 0;
}
.prose blockquote p { margin-bottom: 0; }
.prose blockquote strong { font-style: normal; color: var(--c-accent); }

/* Tables */

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.75rem 0;
  font-size: 0.95rem;
  background: var(--c-bg);
  border-top: 1.5px solid var(--c-text);
  border-bottom: 1.5px solid var(--c-text);
  font-family: var(--font-serif);
}

.prose thead { border-bottom: 1px solid var(--c-border); }

.prose th, .prose td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  vertical-align: top;
}

.prose th {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-heading);
}

.prose tbody tr {
  border-bottom: 1px dotted var(--c-border);
}
.prose tbody tr:last-child { border-bottom: none; }

/* ───────────────────────── SOFTWARE GRID ───────────────────────── */

.software-grid-section {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}

.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border-top: 1px solid var(--c-border);
  border-left: 1px solid var(--c-border);
}

.software-card {
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  border-right: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  padding: 2rem 1.75rem 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
  position: relative;
}

.software-card:hover { background: var(--c-surface); }

.software-card-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--c-brand);
  font-size: 1.7rem;
}

.software-card h3 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 50, "WONK" 1;
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 0.55rem 0;
  letter-spacing: -0.015em;
  color: var(--c-heading);
}

.software-card p {
  margin: 0 0 1.1rem 0;
  flex: 1 0 auto;
  color: var(--c-text-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

.software-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--c-accent);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.software-card:hover .software-card-cta { color: var(--c-brand); }

/* ───────────────────────── LAUNCH CHIP ─────────────────────────── */

.launch-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--c-accent);
  border-radius: 999px;
  color: var(--c-accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.launch-chip i { font-size: 0.78rem; }

@media (max-width: 520px) {
  .launch-chip { display: none; }
}

/* ───────────────────────── EXPLORE CATEGORIES (launch) ─────────── */

.explore-cat {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin: 2.5rem 0 1rem 0;
}
.explore-cat:first-of-type { margin-top: 0.5rem; }

/* ───────────────────────── SURFACES GRID (launch) ──────────────── */

.surfaces-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.surface-tile {
  /* Up to 4 per row; wraps to 3 / 2 as space tightens. Partial last
     rows centre, so there are never lone left-aligned orphans. */
  flex: 0 1 calc(25% - 0.6rem);
  min-width: 150px;
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-bg);
}

.surface-tile i {
  font-size: 1.6rem;
  color: var(--c-brand);
  margin-bottom: 0.75rem;
}

.surface-tile h4 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40, "SOFT" 50, "WONK" 1;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.2rem 0;
  color: var(--c-heading);
}

.surface-tile p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-mute);
}

@media (max-width: 560px) {
  .surface-tile { flex-basis: calc(50% - 0.4rem); }
}

/* ───────────────────────── FOOTER (dark band) ──────────────────── */

.site-footer {
  background: var(--ink);
  color: var(--cream);
  margin-top: 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  padding: 3.5rem 1.75rem 2.5rem;
  max-width: var(--wide);
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .footer-content { grid-template-columns: repeat(2, 1fr); }
  .footer-content .footer-section:first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .footer-content { grid-template-columns: 1fr; }
  .footer-content .footer-section:first-child { grid-column: auto; }
}

.footer-section { display: flex; flex-direction: column; }

.footer-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.footer-logo-img { width: 72px; height: auto; }

.footer-brand { position: relative; padding-bottom: 0.5rem; }

.footer-brand-main {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: 2rem;
  font-weight: 600;
  color: var(--wheat);
  line-height: 1;
  letter-spacing: -0.025em;
}

.footer-brand-sub {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(244, 236, 216, 0.6);
  margin-top: 0.4rem;
}

.footer-brand-accent {
  width: 50%;
  height: 2px;
  margin-top: 0.65rem;
  background: linear-gradient(90deg, var(--wheat) 0%, var(--ochre) 100%);
}

.footer-tagline {
  margin: 0.4rem 0 0 0;
  color: rgba(244, 236, 216, 0.7);
  line-height: 1.55;
  font-size: 0.95rem;
  font-style: italic;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 32, "SOFT" 100, "WONK" 1;
}

.footer-title {
  font-family: var(--font-mono);
  color: var(--wheat);
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0 0 1.25rem 0;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-title i { font-size: 0.85rem; }

.contact-details-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(244, 236, 216, 0.04);
  border-left: 2px solid var(--wheat);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
.contact-details-block:last-child { margin-bottom: 0; }

.site-footer .contact-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: rgba(244, 236, 216, 0.85);
  font-size: 0.9rem;
  line-height: 1.3;
  font-family: var(--font-serif);
}
.site-footer .contact-item i {
  color: var(--wheat);
  width: 16px;
  text-align: center;
  font-size: 0.85rem;
}

.expertise-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(244, 236, 216, 0.04);
  border-left: 2px solid var(--wheat);
  padding: 0.85rem 1rem;
}
.expertise-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(244, 236, 216, 0.85);
  font-size: 0.92rem;
  font-family: var(--font-serif);
}
.expertise-item i {
  color: var(--wheat);
  font-size: 0.7rem;
  width: 16px;
  text-align: center;
}

.footer-bottom {
  border-top: 1px solid rgba(244, 236, 216, 0.12);
  padding: 1.25rem 1.75rem;
}
.footer-bottom-content {
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
}

@media (max-width: 1280px) {
  .footer-bottom-content { flex-wrap: wrap; justify-content: center; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 1rem 2rem; }
  .footer-link-group { flex-wrap: wrap; justify-content: center; }
  .footer-link-group + .footer-link-group { padding-left: 0; border-left: none; }
}
@media (max-width: 900px) {
  .footer-links { flex-direction: column !important; gap: 0.75rem !important; width: 100%; }
  .footer-link-group { gap: 0.75rem 1.25rem !important; width: 100%; }
}

.footer-bottom p {
  margin: 0;
  color: rgba(244, 236, 216, 0.6);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 1280px) {
  .footer-bottom p { white-space: normal; }
}
.footer-version-stamp {
  margin: 0.6rem 0 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: rgba(244, 236, 216, 0.45);
}

.footer-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}
.footer-link-group {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.footer-link-group + .footer-link-group {
  padding-left: 2.5rem;
  border-left: 1px solid rgba(244, 236, 216, 0.15);
}
@media (max-width: 768px) {
  .footer-link-group + .footer-link-group { padding-left: 0; border-left: none; }
}

.footer-link {
  color: rgba(244, 236, 216, 0.78);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}
.footer-link:hover { color: var(--wheat); }
.footer-link i { font-size: 0.75rem; color: var(--wheat); }
