:root {
  --bg: #050505;
  --bg-2: #0a0a0a;
  --bg-3: #111111;
  --ink: #eae7de;
  --ink-dim: rgba(234, 231, 222, 0.62);
  --ink-faint: rgba(234, 231, 222, 0.32);
  --line: rgba(234, 231, 222, 0.12);
  --amber: #d8c79d;
  --amber-deep: #b79a62;
  --font: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-logo: "Outfit", "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max: 1240px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font-family: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -40px;
  z-index: 80;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 36px;
  background: transparent;
  transition: background 0.45s var(--ease), border-color 0.45s var(--ease), backdrop-filter 0.45s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: saturate(1.1) blur(12px);
  border-bottom-color: var(--line);
}

.nav-brand {
  font-family: var(--font-logo);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  padding-right: 0.06em;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-active {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}

.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 24px; }

.nav.is-open .nav-toggle span:first-child {
  top: 20px;
  transform: rotate(45deg);
}

.nav.is-open .nav-toggle span:last-child {
  top: 20px;
  transform: rotate(-45deg);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--amber);
  border-color: var(--amber);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--amber);
  color: var(--amber);
}

/* ---------- Shared type ---------- */

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 18px;
}

h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--ink);
}

h1 {
  font-size: clamp(52px, 8.4vw, 112px);
  margin-bottom: 28px;
}

h2 {
  font-size: clamp(36px, 5.4vw, 72px);
  margin-bottom: 22px;
  max-width: 16ch;
}

p {
  color: var(--ink-dim);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  max-width: 42rem;
}

.section {
  position: relative;
  padding: 120px 48px;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-intro {
  margin-bottom: 64px;
}

.section-copy p,
.section-intro p:not(.eyebrow) {
  max-width: 40rem;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--nav-h) + 40px) 48px 64px;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.78) 0%, rgba(5, 5, 5, 0.42) 48%, rgba(5, 5, 5, 0.28) 100%),
    linear-gradient(180deg, rgba(5, 5, 5, 0.35) 0%, transparent 28%, rgba(5, 5, 5, 0.55) 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero .lede {
  font-size: 20px;
  color: var(--ink);
  max-width: 34rem;
  margin-bottom: 16px;
}

.hero .sub {
  margin-bottom: 36px;
}

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

/* ---------- Systems ---------- */

.section-split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 64px;
  align-items: center;
}

.systems-diagram,
.orch-diagram {
  color: var(--amber);
}

.systems-diagram img {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-nodes rect {
  fill: var(--bg);
  stroke: rgba(216, 199, 157, 0.45);
}

.diagram-nodes .node-core {
  stroke: var(--amber);
}

.diagram-nodes text {
  fill: var(--ink);
  font-size: 11px;
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-anchor: middle;
}

.diagram-lines {
  opacity: 0.55;
}

.draw-svg .diagram-lines path {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  transition: stroke-dashoffset 1.4s var(--ease);
}

.in-view .draw-svg .diagram-lines path {
  stroke-dashoffset: 0;
}

/* ---------- Web3 ---------- */

.section-stack {
  background: var(--bg-2);
}

.capability-index {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.capability-index li {
  padding: 28px 22px 16px 24px;
  border-right: 1px solid var(--line);
  min-height: 160px;
}

.capability-index li:last-child {
  border-right: 0;
}

.capability-index span {
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--amber);
  margin-bottom: 12px;
}

.capability-index p {
  font-size: 14px;
  max-width: 16ch;
  color: var(--ink-dim);
}

/* ---------- Shift ---------- */

.section-shift {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 160px 48px 120px;
  justify-content: flex-end;
  overflow: hidden;
}

.shift-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.shift-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.shift-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.55) 0%, rgba(5, 5, 5, 0.42) 38%, rgba(5, 5, 5, 0.78) 100%),
    linear-gradient(90deg, rgba(5, 5, 5, 0.35), transparent 42%);
}

.shift-content {
  position: relative;
  z-index: 1;
  width: min(var(--max), 100%);
}

.shift-content .section-intro {
  margin-bottom: 48px;
}

.shift-content .section-intro p:not(.eyebrow) {
  color: rgba(234, 231, 222, 0.78);
}

.type-transition {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: clamp(14px, 1.6vw, 20px);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink);
  max-width: none;
}

.type-transition .arrow {
  color: var(--amber);
}

/* ---------- Judgment ---------- */

.section-judgment {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: center;
  background: var(--bg-2);
  overflow: hidden;
}

.judgment-word {
  font-size: clamp(72px, 14vw, 220px);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 1px rgba(216, 199, 157, 0.55);
  max-width: none;
  user-select: none;
}

.judgment-points {
  list-style: none;
  margin-top: 40px;
  max-width: 420px;
}

.judgment-points li {
  font-size: 16px;
  font-weight: 500;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.judgment-points li:last-child {
  border-bottom: 1px solid var(--line);
}

/* ---------- AX ---------- */

.section-ax {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px 80px;
  align-items: end;
}

.ax-mark {
  font-size: clamp(56px, 8vw, 120px);
  font-weight: 500;
  letter-spacing: -0.05em;
  color: var(--ink);
  line-height: 1;
  margin-top: 12px;
  max-width: none;
}

.ax-mark span {
  color: var(--amber);
}

.ax-body {
  display: grid;
  gap: 18px;
}

.ax-compare {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.ax-compare div {
  padding: 32px 40px 8px 0;
}

.ax-compare div:last-child {
  border-left: 1px solid var(--line);
  padding-left: 40px;
}

.ax-compare h3 {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--amber);
}

.ax-compare p {
  font-size: 22px;
  color: var(--ink);
  max-width: 28rem;
}

/* ---------- Orchestration ---------- */

.section-orch {
  background: var(--bg-2);
}

.orch-diagram {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.orch-diagram img {
  width: 100%;
  height: auto;
  display: block;
}

.workflow {
  margin-top: 48px;
  text-align: center;
  font-size: clamp(12px, 1.3vw, 16px);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink);
  max-width: none;
}

/* ---------- Production ---------- */

.prod-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.prod-grid li {
  padding: 36px 24px 36px 0;
  border-right: 1px solid var(--line);
}

.prod-grid li:last-child {
  border-right: 0;
}

.prod-grid span {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

.prod-grid p {
  font-size: 14px;
  max-width: 22ch;
}

.prod-line {
  margin-top: 40px;
  color: var(--amber);
  letter-spacing: 0.08em;
}

/* ---------- Contact ---------- */

.section-contact {
  min-height: 100vh;
  align-items: center;
}

.contact-inner {
  width: min(720px, 100%);
}

.contact-form {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.field input,
.field textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  padding: 10px 0 12px;
  border-radius: 0;
  outline: none;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--amber);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.form-success {
  margin-top: 48px;
}

.success-title {
  font-size: clamp(32px, 4vw, 48px);
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  max-width: none;
}

.contact-form.is-sent,
.form-success[hidden] {
  display: none;
}

.form-success:not([hidden]) {
  display: block;
}

/* ---------- Footer ---------- */

.footer {
  padding: 40px 48px 32px;
  border-top: 1px solid var(--line);
}

.footer-top,
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer-top {
  margin-bottom: 36px;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer nav a {
  font-size: 13px;
  color: var(--ink-dim);
}

.footer nav a:hover,
.footer nav a:focus-visible {
  color: var(--ink);
}

.footer-bottom p {
  font-size: 13px;
  max-width: none;
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ---------- Focus ---------- */

:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 3px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .capability-index {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .capability-index li:nth-child(4) {
    border-right: 0;
  }

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

@media (max-width: 900px) {
  .nav {
    padding: 0 20px;
  }

  .nav-brand,
  .nav-toggle {
    position: relative;
    z-index: 61;
  }

  .nav-toggle {
    display: block;
  }

  .nav-panel {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.97);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease);
  }

  .nav.is-open .nav-panel {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }

  .nav-links a {
    font-size: 28px;
    font-weight: 500;
  }

  .hero,
  .section-split,
  .section-judgment,
  .section-ax {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 100vh;
    padding: calc(var(--nav-h) + 28px) 20px 48px;
  }

  .section {
    padding: 88px 20px;
    min-height: 0;
  }

  .section-shift {
    min-height: 100vh;
    padding: 120px 20px 72px;
  }

  .ax-compare,
  .contact-form,
  .footer-top,
  .footer-bottom {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .ax-compare div:last-child {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
  }

  .capability-index,
  .prod-grid {
    grid-template-columns: 1fr 1fr;
  }

  .capability-index li,
  .prod-grid li {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: 0;
    padding: 22px 16px 22px 20px;
  }

  .judgment-word {
    order: -1;
  }

  .workflow {
    letter-spacing: 0.08em;
    line-height: 1.8;
  }

  .footer {
    padding: 32px 20px;
  }
}

@media (max-width: 600px) {
  .capability-index,
  .prod-grid {
    grid-template-columns: 1fr;
  }

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

  .type-transition {
    letter-spacing: 0.08em;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .draw-svg .diagram-lines path,
  .nav,
  .btn {
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .draw-svg .diagram-lines path {
    stroke-dashoffset: 0;
  }

  .hero-media video,
  .shift-media video {
    display: none;
  }

  .shift-media {
    background: #050505 url("assets/agent-centric-poster.jpg") center / cover no-repeat;
  }
}
