:root {
  color-scheme: light;
  --ink: #17130f;
  --muted: #6c6258;
  --paper: #fffaf0;
  --surface: #ffffff;
  --line: #ded5c7;
  --red: #b43a28;
  --green: #18765a;
  --blue: #265caa;
  --gold: #d79a24;
  --shadow: 0 24px 60px rgba(57, 42, 26, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(255, 255, 255, 0.98)),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header,
.site-footer,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.nav,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.nav {
  gap: 8px;
}

.nav a,
.button,
.copy-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.nav a {
  padding: 0 12px;
  color: var(--muted);
}

.nav a:hover {
  color: var(--ink);
  background: rgba(23, 19, 15, 0.06);
}

.hero {
  min-height: calc(100svh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(320px, 0.97fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  padding: 28px 0 64px;
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(3.25rem, 8vw, 7.25rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.lede {
  max-width: 58ch;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.button.primary {
  background: var(--green);
  color: #fff;
}

.button.secondary {
  background: #fff;
}

.appliance-map {
  position: relative;
  min-height: 520px;
  padding: 28px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23, 19, 15, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 19, 15, 0.06) 1px, transparent 1px),
    #fffdf7;
  background-size: 36px 36px;
  box-shadow: var(--shadow);
}

.map-node,
.map-base {
  position: absolute;
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 170px;
  min-height: 96px;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--ink);
}

.map-node span,
.map-base span {
  color: rgba(23, 19, 15, 0.68);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.map-node strong,
.map-base strong {
  font-size: 1.15rem;
}

.map-node.protocol {
  top: 36px;
  right: 34px;
  border-color: var(--blue);
}

.map-node.factory {
  top: 176px;
  left: 44px;
  border-color: var(--green);
}

.map-node.engine {
  top: 262px;
  right: 48px;
  border-color: var(--red);
}

.map-base {
  left: 28px;
  right: 28px;
  bottom: 28px;
  min-height: 86px;
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.map-base span {
  color: rgba(255, 255, 255, 0.7);
}

.map-line {
  position: absolute;
  height: 2px;
  background: var(--ink);
  transform-origin: left center;
}

.line-a {
  width: 210px;
  top: 170px;
  left: 214px;
  transform: rotate(-18deg);
}

.line-b {
  width: 190px;
  top: 284px;
  left: 214px;
  transform: rotate(12deg);
}

.model-section,
.generator-section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 24px;
}

h2 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.principles article {
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.principles p,
.note {
  color: var(--muted);
}

.generator {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.install-form,
.command-panel {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.install-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
}

label span,
legend {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus {
  outline: 3px solid rgba(38, 92, 170, 0.2);
  border-color: var(--blue);
}

.mode-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.mode-control label {
  min-width: 0;
  display: grid;
}

.mode-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-control span {
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.mode-control label:last-child span {
  border-right: 0;
}

.mode-control input:checked + span {
  background: var(--blue);
  color: #fff;
}

.command-panel {
  overflow: hidden;
}

.command-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 2px solid var(--ink);
  background: #f7efe1;
  font-weight: 800;
}

.copy-button {
  min-width: 76px;
  border: 2px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  cursor: pointer;
}

pre {
  margin: 0;
  min-height: 238px;
  padding: 18px;
  overflow-x: auto;
  background: #141414;
  color: #f7f1e8;
  font-size: 0.92rem;
  line-height: 1.6;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.note {
  min-height: 48px;
  margin: 0;
  padding: 14px 16px 16px;
}

.site-footer {
  min-height: 88px;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .generator,
  .principles {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    max-width: 9ch;
  }

  .appliance-map {
    min-height: 470px;
  }
}

@media (max-width: 560px) {
  .site-header,
  .site-footer,
  main {
    width: min(100% - 24px, 1120px);
  }

  .hero-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .mode-control {
    grid-template-columns: 1fr;
  }

  .mode-control span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mode-control label:last-child span {
    border-bottom: 0;
  }

  .map-node,
  .map-base {
    left: 18px;
    right: 18px;
    min-width: 0;
  }

  .map-node.protocol {
    top: 24px;
  }

  .map-node.factory {
    top: 142px;
  }

  .map-node.engine {
    top: 260px;
  }

  .line-a,
  .line-b {
    display: none;
  }
}
