:root {
  color-scheme: dark;
  --bg: #071321;
  --bg-2: #0a1a2c;
  --bg-3: #10243a;
  --panel: rgba(15, 35, 58, 0.86);
  --panel-strong: rgba(18, 42, 70, 0.94);
  --line: rgba(178, 202, 231, 0.18);
  --line-strong: rgba(178, 202, 231, 0.34);
  --text: #eef6ff;
  --text-soft: #b8c8dc;
  --text-muted: #879bb4;
  --cyan: #59cff7;
  --blue: #2e7ff5;
  --gold: #d8ba72;
  --green: #66d2a1;
  --frame: min(1160px, calc(100% - 40px));
  --header-height: 82px;
  --body-gradient: radial-gradient(circle at 72% 8%, rgba(46, 127, 245, 0.18), transparent 33rem),
    radial-gradient(circle at 16% 0%, rgba(89, 207, 247, 0.10), transparent 30rem),
    linear-gradient(180deg, #081421 0%, #071321 48%, #091728 100%);
  --grid-lines: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px) 0 0 / 42px 42px;
  --grid-mask: linear-gradient(180deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.05));
  --header-bg: rgba(7, 19, 33, 0.88);
  --brand-plate-bg: #f8fafc;
  --soft-band: rgba(255, 255, 255, 0.035);
  --source-brief-bg: linear-gradient(180deg, rgba(18, 41, 68, 0.92), rgba(10, 26, 44, 0.84));
  --model-bg: linear-gradient(180deg, rgba(13, 32, 54, 0.72), rgba(8, 21, 36, 0.74)),
    radial-gradient(circle at 16% 18%, rgba(89, 207, 247, 0.10), transparent 24rem);
  --loop-bg: radial-gradient(circle at 86% 20%, rgba(46, 127, 245, 0.13), transparent 28rem),
    rgba(5, 14, 25, 0.18);
  --trace-bg: linear-gradient(rgba(89, 207, 247, 0.055) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, rgba(89, 207, 247, 0.045) 1px, transparent 1px) 0 0 / 42px 42px,
    rgba(7, 19, 33, 0.72);
  --trace-title-bg: rgba(4, 13, 24, 0.54);
  --loop-step-bg: rgba(6, 17, 31, 0.78);
  --connector-bg: rgba(5, 14, 25, 0.82);
  --trace-footer-bg: rgba(7, 19, 33, 0.92);
  --secondary-button-bg: rgba(255, 255, 255, 0.04);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-2: #ffffff;
  --bg-3: #e9f0f7;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --line: rgba(20, 44, 72, 0.16);
  --line-strong: rgba(20, 44, 72, 0.28);
  --text: #142033;
  --text-soft: #42556f;
  --text-muted: #6b7f99;
  --cyan: #087da5;
  --blue: #1f6fe5;
  --gold: #9c6c12;
  --green: #267854;
  --body-gradient: radial-gradient(circle at 72% 8%, rgba(31, 111, 229, 0.12), transparent 34rem),
    radial-gradient(circle at 12% 0%, rgba(8, 125, 165, 0.10), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, #eef4fa 52%, #f7fafc 100%);
  --grid-lines: linear-gradient(rgba(20, 44, 72, 0.045) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, rgba(20, 44, 72, 0.04) 1px, transparent 1px) 0 0 / 42px 42px;
  --grid-mask: linear-gradient(180deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.06));
  --header-bg: rgba(248, 250, 252, 0.88);
  --brand-plate-bg: #ffffff;
  --soft-band: rgba(20, 44, 72, 0.035);
  --source-brief-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(238, 244, 250, 0.84));
  --model-bg: linear-gradient(180deg, rgba(243, 248, 253, 0.78), rgba(255, 255, 255, 0.76)),
    radial-gradient(circle at 16% 18%, rgba(8, 125, 165, 0.08), transparent 24rem);
  --loop-bg: radial-gradient(circle at 86% 20%, rgba(31, 111, 229, 0.10), transparent 28rem),
    rgba(255, 255, 255, 0.28);
  --trace-bg: linear-gradient(rgba(8, 125, 165, 0.06) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, rgba(8, 125, 165, 0.052) 1px, transparent 1px) 0 0 / 42px 42px,
    rgba(255, 255, 255, 0.72);
  --trace-title-bg: rgba(235, 242, 249, 0.76);
  --loop-step-bg: rgba(255, 255, 255, 0.76);
  --connector-bg: rgba(255, 255, 255, 0.86);
  --trace-footer-bg: rgba(255, 255, 255, 0.92);
  --secondary-button-bg: rgba(255, 255, 255, 0.72);
  --shadow: 0 22px 70px rgba(20, 44, 72, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--body-gradient);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: var(--grid-lines);
  mask-image: var(--grid-mask);
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  letter-spacing: -0.032em;
  line-height: 1.12;
}

h1 {
  max-width: 780px;
  margin-bottom: 1rem;
  font-size: clamp(2.05rem, 4vw, 3.05rem);
  font-weight: 800;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.45vw, 2.05rem);
  font-weight: 760;
}

h3 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: -0.012em;
}

p {
  color: var(--text-soft);
}

.site-frame {
  width: var(--frame);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand-plate {
  display: inline-flex;
  width: 178px;
  height: 58px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(7, 19, 33, 0.08);
  border-radius: 12px;
  background: var(--brand-plate-bg);
  box-shadow: var(--shadow);
}

.brand-plate img {
  display: block;
  width: 154px;
  height: auto;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem 1.15rem;
  margin-left: auto;
}

.primary-nav a {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  color: var(--cyan);
}

.theme-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 0.44rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.3rem 0.68rem;
  color: var(--text);
  background: var(--secondary-button-bg);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: rgba(89, 207, 247, 0.48);
}

.theme-icon {
  display: none;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
}

[data-theme="light"] .theme-icon-sun,
[data-theme="dark"] .theme-icon-moon {
  display: block;
}

section {
  scroll-margin-top: calc(var(--header-height) + 22px);
}

.hero-section {
  padding: clamp(4.2rem, 8vw, 6.8rem) 0 clamp(3rem, 6vw, 5.2rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-lede {
  max-width: 760px;
  margin-bottom: 1.55rem;
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.64rem 1rem;
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.button.primary {
  border-color: rgba(89, 207, 247, 0.56);
  background: linear-gradient(135deg, rgba(46, 127, 245, 0.96), rgba(20, 94, 188, 0.96));
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(46, 127, 245, 0.22);
}

.button.secondary {
  color: var(--text);
  background: var(--secondary-button-bg);
}

.source-brief {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 1.35rem;
  background: var(--source-brief-bg);
  box-shadow: var(--shadow);
}

.brief-label {
  margin-bottom: 0.7rem;
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brief-statement {
  margin-bottom: 1.1rem;
  font-size: 0.98rem;
}

.brief-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.brief-line span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(89, 207, 247, 0.24);
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  color: var(--text-soft);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.74rem;
}

.brief-line span + span::before {
  margin-right: 0.35rem;
  color: var(--cyan);
  content: "→";
}

.orientation-band {
  border-block: 1px solid var(--line);
  background: var(--soft-band);
}

.orientation-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding-block: 0.9rem;
}

.orientation-line span {
  border-right: 1px solid var(--line);
  padding: 0.45rem 0.95rem;
  color: var(--text-soft);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.76rem;
}

.orientation-line span:first-child {
  border-left: 1px solid var(--line);
}

.content-section,
.model-section,
.loop-section,
.contact-section {
  padding: clamp(3.4rem, 7vw, 5.4rem) 0;
}

.model-section {
  border-block: 1px solid var(--line);
  background: var(--model-bg);
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(280px, 0.64fr);
  gap: clamp(2rem, 5vw, 4.2rem);
  align-items: end;
  margin-bottom: 1.7rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-strong);
}

.section-intro.compact {
  align-items: start;
}

.section-intro.no-rule {
  border-bottom: 0;
  padding-bottom: 0;
}

.section-intro p:last-child {
  margin-bottom: 0;
  font-size: 0.96rem;
}

.service-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(190px, 290px);
  gap: clamp(1rem, 3vw, 2rem);
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.service-code {
  display: inline-flex;
  width: 58px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(89, 207, 247, 0.34);
  border-radius: 999px;
  color: var(--cyan);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.service-row p {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 0.95rem;
}

.service-row ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 0.8rem;
  margin-bottom: 0;
  padding-left: 1rem;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.automation-table,
.standards-table {
  border-top: 1px solid var(--line-strong);
}

.automation-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.automation-row > div {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.automation-row > div:first-child {
  border-left: 1px solid var(--line);
}

.automation-row strong,
.standard-row strong {
  color: var(--text);
}

.automation-head > div {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loop-section {
  background: var(--loop-bg);
}

.loop-list {
  display: grid;
  gap: 0.46rem;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.loop-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.42rem;
}

.loop-step {
  position: relative;
  min-height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.78rem 1rem 0.78rem 1.35rem;
  background: var(--loop-step-bg);
}

.loop-step::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--cyan), rgba(46, 127, 245, 0.38));
  content: "";
}

.loop-step.final::before {
  background: linear-gradient(180deg, var(--gold), rgba(89, 207, 247, 0.42));
}

.loop-list h3,
.loop-list p {
  margin-bottom: 0;
}

.loop-list h3 {
  letter-spacing: -0.01em;
}

.loop-list p {
  max-width: 980px;
  font-size: 0.9rem;
}

.loop-connector {
  justify-self: start;
  border: 1px solid rgba(216, 186, 114, 0.38);
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  color: var(--gold);
  background: var(--connector-bg);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.loop-connector::before {
  margin-right: 0.34rem;
  color: var(--cyan);
  content: "→";
}

.trace-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line-strong);
  background: var(--line);
}

.trace-footer span {
  min-height: 60px;
  padding: 0.92rem 1rem;
  color: var(--text-soft);
  background: var(--trace-footer-bg);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
}

.standard-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.standard-row > div {
  padding: 1rem 0;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.standard-row > div:first-child {
  padding-right: 1.5rem;
}

.standard-row > div + div {
  border-left: 1px solid var(--line);
  padding-left: 1.5rem;
}

.discipline-band {
  border-block: 1px solid var(--line);
  background: var(--soft-band);
}

.discipline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding-block: 0.9rem;
}

.discipline-list span {
  padding: 0.55rem 1rem;
  border-right: 1px solid var(--line);
  color: var(--text-soft);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
}

.discipline-list span:first-child {
  border-left: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(300px, 0.62fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.contact-grid p:last-child {
  max-width: 580px;
  margin-top: 1rem;
}

.contact-panel {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 1.35rem;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.contact-panel span {
  display: block;
  margin-bottom: 0.9rem;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-panel img {
  display: block;
  width: min(100%, 440px);
  height: auto;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.footer-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.reveal {
  opacity: 1;
}

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 620ms ease, transform 620ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  :root {
    --header-height: 96px;
    --frame: min(100% - 32px, 1160px);
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    padding-block: 0.75rem;
  }

  .primary-nav {
    justify-content: flex-start;
  }

  .hero-grid,
  .section-intro,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .service-row {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .service-row ul {
    grid-column: 2;
  }

  .automation-row {
    grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1fr);
  }

  .automation-head {
    display: none;
  }

  .automation-row > div {
    border-left: 1px solid var(--line);
  }

  .automation-row > div:nth-child(1) {
    color: var(--cyan);
  }

  .automation-row > div:nth-child(2)::before {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    content: "Agentic automation";
  }

  .automation-row > div:nth-child(3)::before {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    content: "Deterministic automation";
  }

  .automation-row > div:nth-child(4)::before {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    content: "Control boundary";
  }

  .automation-row > div:nth-child(n + 3) {
    grid-column: 2;
  }
}

@media (max-width: 700px) {
  :root {
    --header-height: 126px;
    --frame: min(100% - 24px, 1160px);
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.55rem);
  }

  h2 {
    font-size: clamp(1.38rem, 6.4vw, 1.82rem);
  }

  .brand-plate {
    width: 154px;
    height: 50px;
  }

  .brand-plate img {
    width: 134px;
  }

  .primary-nav {
    gap: 0.45rem 0.9rem;
  }

  .primary-nav a {
    font-size: 0.72rem;
  }

  .hero-section {
    padding-top: 3rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .orientation-line span,
  .orientation-line span:first-child,
  .discipline-list span,
  .discipline-list span:first-child {
    width: 100%;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .orientation-line span:last-child,
  .discipline-list span:last-child {
    border-bottom: 0;
  }

  .service-row {
    grid-template-columns: 1fr;
  }

  .service-row ul {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .automation-row {
    grid-template-columns: 1fr;
  }

  .automation-row > div:nth-child(n + 3) {
    grid-column: auto;
  }

  .loop-list {
    padding: 0.85rem;
  }

  .loop-step {
    padding: 0.72rem 0.85rem 0.72rem 1rem;
  }

  .trace-footer {
    grid-template-columns: 1fr;
  }

  .standard-row {
    grid-template-columns: 1fr;
  }

  .standard-row > div:first-child {
    padding-bottom: 0.2rem;
  }

  .standard-row > div + div {
    border-left: 0;
    padding-top: 0;
    padding-left: 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-block: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
