:root {
  color-scheme: dark;
  --bg: #151714;
  --bg-strong: #20251f;
  --surface: #1b1f1b;
  --surface-soft: #242a24;
  --surface-glass: rgba(27, 31, 27, 0.78);
  --surface-card: rgba(33, 38, 33, 0.72);
  --surface-quiet: rgba(33, 38, 33, 0.44);
  --ink: #f4eadc;
  --muted: #b9b1a3;
  --line: rgba(244, 234, 220, 0.16);
  --line-strong: rgba(244, 234, 220, 0.28);
  --accent: #adc7b5;
  --accent-dark: #d4c59f;
  --rust: #d19a78;
  --dark: #111310;
  --dark-soft: #202620;
  --dark-line: rgba(244, 234, 220, 0.18);
  --light: #fbf7ef;
  --grid: rgba(244, 234, 220, 0.045);
  --grid-dark: rgba(244, 234, 220, 0.045);
  --header-bg: rgba(21, 23, 20, 0.86);
  --logo-filter: invert(1);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-strong: #eee8de;
  --surface: #fffdf8;
  --surface-soft: #f4eee6;
  --surface-glass: rgba(247, 244, 239, 0.9);
  --surface-card: rgba(255, 253, 248, 0.74);
  --surface-quiet: rgba(255, 253, 248, 0.44);
  --ink: #20211f;
  --muted: #5e625d;
  --line: rgba(32, 33, 31, 0.12);
  --line-strong: rgba(32, 33, 31, 0.24);
  --accent: #526b61;
  --accent-dark: #33463f;
  --rust: #9a6c55;
  --dark: #1f2522;
  --dark-soft: #2c3430;
  --dark-line: #49524c;
  --light: #fbf7ef;
  --grid: rgba(32, 33, 31, 0.035);
  --grid-dark: rgba(251, 247, 239, 0.035);
  --header-bg: rgba(247, 244, 239, 0.9);
  --logo-filter: none;
  --shadow: 0 24px 60px rgba(40, 35, 28, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--bg);
  background-size: 40px 40px, 40px 40px, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(82, 107, 97, 0.35);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-160%);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.65rem 0.9rem;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: 1rem max(1.25rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.brand img,
.footer-brand img {
  flex: 0 0 auto;
}

.logo-mark {
  aspect-ratio: 1;
  height: auto;
  object-fit: contain;
  filter: var(--logo-filter);
}

.nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
}

.nav a,
.footer-links a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover,
.footer-links a:hover,
.text-link:hover {
  color: var(--ink);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle__icon {
  grid-area: 1 / 1;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-toggle__icon--moon {
  display: none;
}

html[data-theme="light"] .theme-toggle__icon--moon {
  display: block;
}

html[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

.section {
  scroll-margin-top: 104px;
  width: 100%;
  max-width: 100vw;
  padding: 6rem max(1.25rem, calc((100vw - 1180px) / 2));
}

.section--rule {
  border-top: 1px solid var(--line);
}

.section--tint {
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-strong) 78%, transparent);
}

.section--dark {
  background:
    linear-gradient(var(--grid-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-dark) 1px, transparent 1px),
    var(--dark);
  background-size: 38px 38px, 38px 38px, auto;
  color: var(--light);
}

.hero {
  min-height: auto;
  padding-top: 5.5rem;
  padding-bottom: 4.25rem;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(300px, 0.72fr);
  align-items: center;
  gap: 4.5rem;
  min-width: 0;
}

.hero__copy {
  max-width: 720px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.3;
  text-transform: uppercase;
}

.section--dark .eyebrow {
  color: #b5c8be;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.04;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 {
  max-width: 780px;
  margin-bottom: 1.35rem;
  font-size: 4.25rem;
}

h1 span {
  display: block;
}

h2 {
  margin-bottom: 1.25rem;
  font-size: 2.6rem;
}

h3 {
  margin-bottom: 0.65rem;
  font-size: 1.38rem;
}

.hero__summary {
  max-width: 690px;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.55;
}

.section--dark .hero__summary,
.section--dark p,
.section--dark li,
.section--dark .note {
  color: rgba(251, 247, 239, 0.82);
}

.hero__actions,
.constitution-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.78rem 1rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: var(--accent-dark);
  color: #151714;
}

.button--primary:hover {
  background: #e3d3ad;
}

html[data-theme="light"] .button--primary {
  color: #fffaf2;
}

html[data-theme="light"] .button--primary:hover {
  background: #253730;
}

.button--secondary {
  border-color: var(--line-strong);
  background: var(--surface-card);
  color: var(--ink);
}

.button--secondary:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.button--light {
  background: var(--light);
  color: var(--dark);
}

.button--ghost {
  border-color: var(--dark-line);
  color: var(--light);
}

.button--ghost:hover {
  border-color: rgba(251, 247, 239, 0.72);
}

.quiet-line {
  margin-top: 1.35rem;
  color: var(--rust);
  font-size: 0.95rem;
  font-weight: 650;
}

.hero__mark {
  position: relative;
  justify-self: center;
  width: min(100%, 390px);
  aspect-ratio: 1;
}

.logo-mark--hero {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.section__heading {
  max-width: 720px;
  margin-bottom: 2.2rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: 4rem;
  align-items: start;
}

.prose {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
}

.prose p:last-child,
.pillar p:last-child,
.machine-card p:last-child,
.support-panel p:last-child,
.contact-band p:last-child {
  margin-bottom: 0;
}

.pillar-grid,
.machine-grid {
  display: grid;
  gap: 1rem;
}

.pillar-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pillar,
.machine-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-card);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.pillar p,
.machine-card p {
  color: var(--muted);
}

.machine-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.machine-card {
  display: flex;
  flex-direction: column;
  min-height: 270px;
}

.machine-card--quiet {
  background: var(--surface-quiet);
  box-shadow: none;
}

.card-topline {
  min-height: 1.65rem;
  margin-bottom: 1rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1;
}

.status--muted {
  border-color: var(--line);
  color: var(--muted);
}

.text-link,
.text-note {
  margin-top: auto;
  color: var(--accent-dark);
  font-size: 0.93rem;
  font-weight: 750;
}

.text-link {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24rem;
}

.constitution-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
  gap: 3rem;
  align-items: start;
}

.constitution-intro {
  max-width: 650px;
}

.law-list {
  display: grid;
  gap: 0.8rem;
  margin: 1.5rem 0;
  padding-left: 1.35rem;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

.copy-status {
  min-height: 1.5rem;
  margin-top: 0.8rem;
  color: #c8d6cf;
  font-size: 0.9rem;
}

.constitution-code {
  overflow: hidden;
  border: 1px solid var(--dark-line);
  border-radius: 8px;
  background: var(--dark-soft);
}

pre {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: 1.15rem;
  color: rgba(251, 247, 239, 0.88);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.support-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 2rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-card);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.support-panel p {
  max-width: 760px;
  color: var(--muted);
}

.support-action {
  display: grid;
  justify-items: start;
  gap: 0.8rem;
}

.support-action p {
  margin: 0;
  font-size: 0.86rem;
}

.contact-band {
  max-width: 800px;
}

.contact-band .button {
  margin: 0.6rem 0 1rem;
}

.site-footer {
  padding: 2.2rem max(1.25rem, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand {
  color: var(--ink);
}

.copyright {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

  .nav,
  .footer-links {
    justify-content: flex-start;
  }

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

  .section {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }

  .hero {
    padding-top: 4rem;
  }

  .hero__inner,
  .split,
  .constitution-layout,
  .support-panel {
    grid-template-columns: 1fr;
  }

  .hero__mark {
    justify-self: start;
    width: min(100%, 280px);
  }

  h1 {
    font-size: 3.1rem;
  }

  h2 {
    font-size: 2.15rem;
  }

  .pillar-grid,
  .machine-grid {
    grid-template-columns: 1fr;
  }

  .machine-card {
    min-height: auto;
  }

  .footer-main {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  body {
    background-size: 32px 32px, 32px 32px, auto;
  }

  .site-header,
  .section,
  .site-footer {
    width: 100%;
    max-width: 100vw;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero__inner,
  .hero__copy,
  .section__heading,
  .split,
  .prose,
  .support-panel,
  .contact-band {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .brand span {
    max-width: 220px;
  }

  .nav {
    gap: 0.35rem 0.78rem;
  }

  .header-controls {
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 34px;
    height: 34px;
  }

  h1 {
    width: 100%;
    max-width: 330px;
    font-size: 1.82rem;
    overflow-wrap: break-word;
  }

  h2 {
    width: 100%;
    max-width: 330px;
    font-size: 1.45rem;
    overflow-wrap: break-word;
  }

  .hero__summary,
  .prose {
    width: 100%;
    max-width: 330px;
    font-size: 0.95rem;
    overflow-wrap: break-word;
  }

  .eyebrow {
    max-width: 320px;
    font-size: 0.72rem;
    overflow-wrap: break-word;
  }

  .hero {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .hero__mark {
    display: none;
  }

  .hero__actions,
  .constitution-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .pillar,
  .machine-card,
  .support-panel {
    padding: 1rem;
  }
}
