@import url("tokens.css");

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  transform: translateY(-160%);
}

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

.hook-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(241, 242, 237, 0.92);
  backdrop-filter: blur(16px);
}

.hook-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
}

.hook-brand svg {
  width: 30px;
}

.hook-brand span {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hook-brand b {
  font-size: 1.12rem;
  letter-spacing: 0.14em;
}

.hook-brand small,
.hook-header nav a,
.header-console-link {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
}

.hook-brand small {
  color: var(--muted);
}

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

.hook-header nav a {
  padding: 10px 0;
  color: #485653;
}

.hook-header nav a:hover {
  color: var(--ink);
}

.header-console-link {
  justify-self: end;
  padding: 12px 16px;
  color: white;
  background: var(--ink);
}

.header-console-link span {
  margin-left: 12px;
  color: var(--acid);
}

.entry-hero {
  min-height: calc(100vh - 76px);
  padding: 28px 4vw 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(7, 20, 18, 0.055) 1px),
    linear-gradient(transparent calc(100% - 1px), rgba(7, 20, 18, 0.055) 1px),
    var(--paper);
  background-size: 72px 72px;
}

.entry-meta {
  display: flex;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
}

.entry-meta span:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-meta i,
.entry-cta .eyebrow span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(35, 216, 137, 0.12);
}

.entry-intro {
  width: min(1080px, 92vw);
  margin: 12vh auto 11vh;
  text-align: center;
}

.eyebrow {
  margin: 0 0 28px;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.15em;
}

.eyebrow.light {
  color: var(--acid);
}

.entry-intro h1,
.section-copy h2,
.domain-heading h2,
.entry-cta h2 {
  margin: 0;
  font-size: clamp(3.6rem, 7.5vw, 8.2rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.entry-intro h1 em {
  color: var(--green-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.entry-lede {
  width: min(720px, 90%);
  margin: 40px auto 0;
  color: #42514e;
  font-size: 1.08rem;
  line-height: 1.7;
}

.entry-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

.primary-link,
.secondary-link,
.run-hook,
.cta-side a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 230px;
  padding: 16px 18px;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.primary-link {
  color: white;
  background: var(--ink);
}

.primary-link span,
.cta-side a span {
  color: var(--acid);
}

.secondary-link {
  background: rgba(255, 255, 255, 0.25);
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 -4vw;
  border-top: 1px solid var(--line);
  background: rgba(241, 242, 237, 0.88);
}

.definition-grid article {
  min-height: 230px;
  padding: 34px 4vw;
  border-right: 1px solid var(--line);
}

.definition-grid article:last-child {
  border-right: 0;
}

.definition-grid article > span,
.domain-top span {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
}

.definition-grid h2 {
  margin: 50px 0 12px;
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.definition-grid p {
  max-width: 410px;
  margin: 0;
  color: #53605d;
  font-size: 0.9rem;
  line-height: 1.65;
}

.decision-lab {
  padding: 120px 4vw;
  color: white;
  background: var(--ink);
}

.section-copy {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.7fr;
  gap: 5vw;
  align-items: end;
  margin-bottom: 64px;
}

.section-copy .eyebrow {
  align-self: start;
}

.section-copy h2 {
  font-size: clamp(2.7rem, 5vw, 6rem);
}

.section-copy > p:last-child {
  margin: 0;
  color: #aebbb7;
  font-size: 0.9rem;
  line-height: 1.7;
}

.lab-shell {
  border: 1px solid var(--line-light);
  background: #0a1a17;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.28);
}

.lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-light);
  background: #0d201c;
}

.lab-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lab-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: var(--acid);
  font-weight: 900;
}

.lab-header > div:first-child > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: var(--mono);
}

.lab-header b {
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
}

.lab-header small {
  color: #6f837e;
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
}

.scenario-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line-light);
}

.scenario-switch button {
  padding: 8px 15px;
  border: 0;
  color: #80918d;
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
}

.scenario-switch button.active {
  color: var(--ink);
  background: var(--acid);
}

.lab-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.lab-code {
  min-width: 0;
  padding: 24px;
}

.code-card {
  border: 1px solid var(--line-light);
  background: #071512;
}

.code-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-light);
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.07em;
}

.code-label span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--ink);
  background: var(--acid);
}

.code-label small {
  margin-left: auto;
  color: var(--green);
  font-size: var(--fs-micro);
}

.code-card pre {
  min-height: 168px;
  margin: 0;
  padding: 20px;
  overflow: auto;
  color: #c8f6e4;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.75;
}

.hook-route {
  display: grid;
  grid-template-columns: repeat(4, 1fr auto) 1fr;
  align-items: center;
  padding: 20px 0;
}

.hook-stage {
  display: flex;
  align-items: center;
  gap: 9px;
  opacity: 0.38;
  transition: opacity 180ms ease, transform 180ms ease;
}

.hook-stage.active,
.hook-stage.complete,
.hook-stage.ready {
  opacity: 1;
}

.hook-stage.active {
  transform: translateY(-3px);
}

.hook-stage i {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border: 1px solid #5f7770;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-style: normal;
}

.hook-stage.complete i,
.hook-stage.ready i,
.hook-stage.active i {
  color: var(--ink);
  border-color: var(--acid);
  background: var(--acid);
}

.hook-stage.deterministic i {
  border-radius: 3px;
}

.hook-stage span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hook-stage b,
.hook-stage small {
  font-family: var(--mono);
}

.hook-stage b {
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
}

.hook-stage small {
  color: #758a84;
  font-size: var(--fs-micro);
}

.hook-route > em {
  width: clamp(12px, 2vw, 34px);
  height: 1px;
  margin: 0 7px;
  background: #29433c;
}

.lab-result {
  padding: 24px;
  border-left: 1px solid var(--line-light);
  background: #0d201c;
}

.lab-result > p {
  margin: 0 0 24px;
  color: #779089;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
}

.result-state {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}

.result-state i {
  width: 12px;
  height: 12px;
  border: 2px solid var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(35, 216, 137, 0.1);
}

.result-state span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-state small,
.result-state b {
  font-family: var(--mono);
}

.result-state small {
  color: #6f837e;
  font-size: var(--fs-micro);
}

.result-state b {
  color: var(--acid);
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.result-state.running i {
  animation: pulse 800ms infinite;
}

.result-state.held i {
  border-color: #f0b866;
  box-shadow: 0 0 0 7px rgba(240, 184, 102, 0.1);
}

.result-state.held b {
  color: #f0c47f;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 11px rgba(35, 216, 137, 0.02); }
}

.lab-result dl {
  margin: 22px 0;
}

.lab-result dl div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--mono);
  font-size: var(--fs-micro);
}

.lab-result dt {
  color: #7d8f8b;
}

.lab-result dd {
  margin: 0;
}

.run-hook {
  width: 100%;
  min-width: 0;
  border-color: var(--acid);
  color: var(--ink);
  background: var(--acid);
  cursor: pointer;
}

.run-hook:disabled {
  cursor: wait;
  opacity: 0.7;
}

.lab-result > a {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: #9fb0ac;
  font-family: var(--mono);
  font-size: var(--fs-micro);
}

.lab-result > a:hover {
  color: white;
}

.boundaries {
  padding: 120px 4vw;
  background: var(--paper-warm);
}

.dark-copy {
  grid-template-columns: 0.55fr 1.45fr;
  align-items: start;
}

.dark-copy h2 {
  color: var(--ink);
}

.boundary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
}

.boundary-grid article {
  padding: 36px;
}

.boundary-grid article:first-child {
  border-right: 1px solid var(--line);
  background: rgba(140, 255, 204, 0.14);
}

.is-not-card {
  background: rgba(255, 255, 255, 0.26);
}

.boundary-title {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.boundary-title span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--ink);
  background: var(--acid);
  font-family: var(--mono);
}

.is-not-card .boundary-title span {
  color: white;
  background: var(--ink);
}

.boundary-title h3 {
  margin: 0;
  font-size: 1.45rem;
}

.boundary-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.boundary-grid li {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) 1.2fr;
  gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.boundary-grid li b {
  font-size: 0.88rem;
}

.boundary-grid li span {
  color: #5e6a67;
  font-size: 0.82rem;
  line-height: 1.55;
}

.operating-domains {
  padding: 120px 4vw;
  background: var(--paper);
}

.domain-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 60px;
}

.domain-heading h2 {
  max-width: 790px;
  font-size: clamp(3rem, 5.5vw, 6.4rem);
}

.domain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.domain-grid article {
  min-height: 420px;
  padding: 36px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.domain-grid article:last-child {
  background: var(--ink);
  color: white;
}

.domain-top {
  display: flex;
  justify-content: space-between;
}

.domain-top i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
}

.domain-grid h3 {
  margin: 120px 0 18px;
  font-size: clamp(2rem, 3.3vw, 4rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
}

.domain-grid p {
  max-width: 570px;
  color: #5d6a66;
  line-height: 1.7;
}

.domain-grid article:last-child p {
  color: #aebbb7;
}

.domain-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.domain-tags span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--fs-micro);
}

.domain-grid article:last-child .domain-tags span {
  border-color: var(--line-light);
}

.deployment-motion {
  padding: 120px 4vw;
  border-top: 1px solid var(--line);
  background: var(--paper-warm);
}

.motion-heading {
  display: grid;
  grid-template-columns: 0.55fr 1.45fr 0.75fr;
  gap: 5vw;
  align-items: start;
  margin-bottom: 64px;
}

.motion-heading h2 {
  margin: 0;
  font-size: clamp(3rem, 5.5vw, 6.4rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.motion-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.motion-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  list-style: none;
}

.motion-grid li {
  min-height: 380px;
  padding: 28px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.motion-grid span {
  font-family: var(--mono);
  font-size: var(--fs-micro);
}

.motion-grid h3 {
  margin: 105px 0 22px;
  font-size: clamp(1.7rem, 2.4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.motion-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.entry-cta {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: end;
  gap: 9vw;
  min-height: 620px;
  padding: 100px 4vw;
  color: white;
  background:
    radial-gradient(circle at 78% 30%, rgba(35, 216, 137, 0.18), transparent 26%),
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(255, 255, 255, 0.04) 1px),
    linear-gradient(transparent calc(100% - 1px), rgba(255, 255, 255, 0.04) 1px),
    var(--ink);
  background-size: auto, 72px 72px, 72px 72px, auto;
}

.entry-cta .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entry-cta h2 {
  font-size: clamp(3.2rem, 6.5vw, 7.5rem);
}

.cta-side p {
  margin: 0 0 28px;
  color: #aebbb7;
  line-height: 1.7;
}

.cta-side a {
  width: 100%;
  color: var(--ink);
  border-color: var(--acid);
  background: var(--acid);
}

.cta-actions {
  display: grid;
  gap: 10px;
}

.cta-side .secondary-link {
  color: var(--white);
  border-color: rgba(255,255,255,.45);
  background: transparent;
}

.hook-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 4vw;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.05em;
}

@media (max-width: 1050px) {
  .hook-header {
    grid-template-columns: 1fr auto;
  }

  .hook-header nav {
    display: none;
  }

  .section-copy {
    grid-template-columns: 1fr 2fr;
  }

  .motion-heading {
    grid-template-columns: 1fr 2fr;
  }

  .motion-heading > p:last-child {
    grid-column: 2;
  }

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

  .section-copy > p:last-child {
    grid-column: 2;
  }

  .lab-workspace {
    grid-template-columns: 1fr;
  }

  .lab-result {
    border-top: 1px solid var(--line-light);
    border-left: 0;
  }

  .lab-result dl {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 24px;
  }

  .lab-result > a {
    justify-content: flex-start;
    gap: 20px;
  }

  .hook-stage span {
    display: none;
  }

  .hook-route {
    grid-template-columns: repeat(4, 1fr auto) 1fr;
  }
}

@media (max-width: 760px) {
  .hook-header {
    min-height: 66px;
  }

  .hook-brand small {
    display: none;
  }

  .header-console-link {
    display: none;
  }

  .entry-hero {
    min-height: 0;
    padding-top: 20px;
  }

  .entry-intro {
    width: 100%;
    margin: 10vh 0 12vh;
    text-align: left;
  }

  .entry-intro h1 {
    max-width: 100%;
    font-size: clamp(2.9rem, 13vw, 4.5rem);
    overflow-wrap: anywhere;
  }

  .entry-intro h1 em {
    display: block;
    font-size: 0.9em;
    line-height: 0.95;
  }

  .entry-lede {
    width: 100%;
    margin-left: 0;
    font-size: 0.96rem;
  }

  .entry-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .definition-grid,
  .boundary-grid,
  .domain-grid,
  .entry-cta {
    grid-template-columns: 1fr;
  }

  .definition-grid article {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .definition-grid h2 {
    margin-top: 28px;
  }

  .decision-lab,
  .boundaries,
  .operating-domains,
  .deployment-motion {
    padding-top: 84px;
    padding-bottom: 84px;
  }

  .section-copy,
  .dark-copy,
  .motion-heading {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .section-copy > p:last-child {
    grid-column: auto;
  }

  .motion-heading > p:last-child {
    grid-column: auto;
  }

  .motion-grid {
    grid-template-columns: 1fr;
  }

  .motion-grid li {
    min-height: 290px;
  }

  .motion-grid h3 {
    margin-top: 75px;
  }

  .lab-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .scenario-switch {
    width: 100%;
  }

  .scenario-switch button {
    flex: 1;
  }

  .lab-code {
    padding: 12px;
  }

  .code-card pre {
    min-height: 210px;
    padding: 14px;
    font-size: var(--fs-micro);
  }

  .hook-route {
    padding: 18px 4px;
  }

  .hook-stage i {
    width: 24px;
    height: 24px;
  }

  .lab-result dl {
    grid-template-columns: 1fr;
  }

  .boundary-grid article {
    padding: 24px;
  }

  .boundary-grid article:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .boundary-grid li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .domain-heading {
    display: block;
  }

  .domain-heading h2 {
    font-size: 3.1rem;
  }

  .domain-grid article {
    min-height: 360px;
    padding: 25px;
  }

  .domain-grid h3 {
    margin-top: 95px;
  }

  .entry-cta {
    min-height: 620px;
    align-content: center;
    gap: 70px;
  }

  .hook-footer {
    flex-direction: column;
    gap: 14px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
