/* HolonStation — layout concept: a single-line diagram drawn on a cool drafting sheet.
   Sections hang off a vertical "busbar" rule; copper marks energized / actionable things. */
:root {
  --paper: #f3f6fa;
  --surface: #ffffff;
  --ink: #0f1e33;
  --ink-2: #4a5a72;
  --line: #cbd5e2;
  --blue: #1f4fa3;
  --blue-soft: #e3ebf8;
  --copper: #b4541a;
  --copper-soft: #f6e6db;
  --ok: #1d7a4f;

  --font-display: "IBM Plex Sans Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: 2.125rem;
  --step-4: clamp(2.5rem, 5.5vw, 4rem);

  --wrap: 72rem;
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1320;
    --surface: #111c2e;
    --ink: #e6ecf5;
    --ink-2: #9aa9c0;
    --line: #26364f;
    --blue: #86a9f0;
    --blue-soft: #16264a;
    --copper: #f08c4e;
    --copper-soft: #3a2214;
    --ok: #5cc994;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b1320;
  --surface: #111c2e;
  --ink: #e6ecf5;
  --ink-2: #9aa9c0;
  --line: #26364f;
  --blue: #86a9f0;
  --blue-soft: #16264a;
  --copper: #f08c4e;
  --copper-soft: #3a2214;
  --ok: #5cc994;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--copper);
}

/* Header */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--paper);
}
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 9;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-1);
  letter-spacing: 0.01em;
}
.brand b { color: var(--copper); font-weight: 600; }
.nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
}
.nav a:hover { color: var(--ink); }
.nav .lang {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  border: 1px solid var(--line);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
}
@media (max-width: 720px) {
  .nav a:not(.lang):not(.btn) { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 600 0.9375rem/1 var(--font-body);
  padding: 0.8rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
:root[data-theme="dark"] .btn-primary { color: #1a0d05; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #1a0d05; } }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--blue); }
.nav .btn { padding: 0.55rem 0.9rem; color: #fff; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}
@media (max-width: 880px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero h1 { font-size: var(--step-4); margin-top: 0.75rem; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero .lede { font-size: var(--step-1); color: var(--ink-2); margin-top: 1.25rem; max-width: 34rem; }
.hero .cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.protocols {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.75rem;
  padding: 0;
  list-style: none;
}
.protocols li {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.15rem 0.5rem;
  background: var(--surface);
}
.sld {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  min-width: 0;
}
.sld svg { display: block; width: 100%; height: auto; }
.sld figcaption {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-2);
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.sld .wire { stroke: var(--ink); stroke-width: 2; fill: none; }
.sld .bus { stroke: var(--ink); stroke-width: 5; }
.sld .cb { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.sld .cb.closed { fill: var(--ink); }
.sld .ied { fill: var(--blue-soft); stroke: var(--blue); stroke-width: 1.5; }
.sld .holon { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 4; }
.sld .lan { stroke: var(--blue); stroke-width: 2; stroke-dasharray: 2 4; fill: none; }
.sld text { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-2); }
.sld text.strong { fill: var(--ink); font-weight: 500; }
.sld text.blue { fill: var(--blue); }
.sld .packet { fill: var(--copper); }
.sld .scada { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
@media (prefers-reduced-motion: reduce) { .sld .packet { display: none; } }

/* Sections */
section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-head { display: grid; gap: 0.75rem; max-width: 44rem; margin-bottom: 2.25rem; }
.section-head h2 { font-size: var(--step-3); }
.section-head p { color: var(--ink-2); font-size: var(--step-1); }
.band { background: var(--surface); border-block: 1px solid var(--line); }

/* Modules */
.modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 960px) { .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .modules { grid-template-columns: 1fr; } }
.module {
  background: var(--surface);
  padding: 1.5rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.75rem;
  min-width: 0;
}
.module-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.module h3 { font-size: var(--step-2); }
.module h3 span { color: var(--ink-2); font-weight: 400; }
.module p { color: var(--ink-2); }
.chip {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-early { background: var(--copper-soft); color: var(--copper); }
.chip-road { border: 1px solid var(--line); color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; list-style: none; }
.tags li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

/* Holon */
.holon-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 880px) { .holon-grid { grid-template-columns: 1fr; } }
.holon-copy { display: grid; gap: 1rem; max-width: 36rem; }
.holon-copy h2 { font-size: var(--step-3); }
.holon-copy p { color: var(--ink-2); }
.holon-copy .etym {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--ink);
  border-left: 3px solid var(--copper);
  padding-left: 0.9rem;
}
.nest { display: grid; }
.nest > div {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem 0.8rem;
  display: grid;
  gap: 0.6rem;
}
.nest .lvl {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-2);
}
.nest .lvl b { color: var(--ink); font-weight: 500; }
.nest .core {
  border-style: solid;
  border-color: var(--blue);
  background: var(--blue-soft);
}
.nest .core .lvl b { color: var(--blue); }

/* Field features */
.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }
.features li { display: grid; gap: 0.4rem; border-top: 2px solid var(--ink); padding-top: 0.9rem; min-width: 0; }
.features h3 { font-size: var(--step-1); }
.features p { color: var(--ink-2); font-size: 0.9375rem; }

/* Licensing */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 880px) { .plans { grid-template-columns: 1fr; } }
.plan {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.75rem;
  background: var(--paper);
  min-width: 0;
}
.plan.featured { border-color: var(--copper); }
.plan h3 { font-size: var(--step-2); }
.plan .for { font-family: var(--font-mono); font-size: var(--step--1); color: var(--copper); }
.plan ul { margin: 0; padding-left: 1.1rem; color: var(--ink-2); display: grid; gap: 0.3rem; }
.plan .price { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--ink); border-top: 1px solid var(--line); padding-top: 0.9rem; }

/* Security */
.security {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
@media (max-width: 880px) { .security { grid-template-columns: 1fr; } }
.security-copy { display: grid; gap: 1rem; max-width: 38rem; }
.security-copy h2 { font-size: var(--step-3); }
.security-copy p { color: var(--ink-2); }
.disclosure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.disclosure dt { color: var(--ink-2); }
.disclosure dd { margin: 0 0 0.5rem; color: var(--ink); }

/* Contact */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 880px) { .contact { grid-template-columns: 1fr; } }
.contact-copy { display: grid; gap: 1rem; align-content: start; }
.contact-copy h2 { font-size: var(--step-3); }
.contact-copy p { color: var(--ink-2); }
.addr { font-family: var(--font-mono); color: var(--ink); user-select: all; }
form { display: grid; gap: 1rem; min-width: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
label { display: grid; gap: 0.35rem; font-size: 0.875rem; font-weight: 500; }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  width: 100%;
}
textarea { min-height: 7rem; resize: vertical; }
.form-note { font-size: 0.875rem; color: var(--ink-2); }
.form-note[data-state="info"] { color: var(--copper); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; font-size: 0.875rem; color: var(--ink-2); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); }
