:root {
  --paper: oklch(0.97 0.012 247);
  --ink: oklch(0.19 0.05 263);
  --cobalt: oklch(0.47 0.22 264);
  --cobalt-deep: oklch(0.31 0.17 264);
  --citrine: oklch(0.9 0.16 101);
  --coral: oklch(0.68 0.18 31);
  --mint: oklch(0.84 0.12 161);
  --line: oklch(0.36 0.06 263 / 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Chivo", system-ui, sans-serif; line-height: 1.55; }
a { color: inherit; text-underline-offset: 0.22em; }
a:focus-visible, button:focus-visible, textarea:focus-visible { outline: 3px solid var(--citrine); outline-offset: 4px; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 30; padding: 0.8rem 1rem; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 1rem; }

header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1.2rem, 4vw, 4.5rem); border-bottom: 1px solid var(--line); }
.brand { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.06em; text-decoration: none; }
.brand span { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; margin-right: 0.12rem; border-radius: 50%; background: var(--cobalt); color: var(--paper); letter-spacing: -0.08em; }
nav { display: flex; gap: clamp(0.8rem, 2vw, 2rem); font-size: 0.9rem; font-weight: 700; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }

.hero { min-height: calc(100svh - 76px); display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(30rem, 1.05fr); align-items: center; gap: clamp(2rem, 5vw, 7rem); padding: clamp(4rem, 7vw, 7rem) clamp(1.2rem, 6vw, 7rem); background: var(--cobalt); color: var(--paper); overflow: hidden; }
.hero-copy { position: relative; z-index: 2; }
.kicker { margin: 0 0 1.1rem; font-size: 0.78rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2 { margin: 0; font-weight: 900; letter-spacing: -0.065em; line-height: 0.95; }
h1 { max-width: 10ch; font-size: clamp(3.8rem, 8vw, 8.2rem); }
h2 { font-size: clamp(2.5rem, 5.2vw, 5.2rem); }
.hero-copy > p:not(.kicker) { max-width: 37ch; margin: 1.6rem 0 2.2rem; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.button { display: inline-flex; justify-content: space-between; align-items: center; gap: 2rem; min-height: 50px; padding: 0.85rem 1.1rem; background: var(--citrine); color: var(--ink); font-weight: 900; text-decoration: none; box-shadow: 6px 6px 0 var(--ink); transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1); }
.button:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.button.light { background: var(--paper); color: var(--ink); box-shadow: 6px 6px 0 var(--citrine); }

.loop { position: relative; width: min(40rem, 84vw); aspect-ratio: 1.2; margin: 0 auto; }
.loop svg { width: 100%; height: 100%; overflow: visible; }
.loop-path { fill: none; stroke: var(--citrine); stroke-width: 28; stroke-linecap: round; stroke-dasharray: 11 13; }
.loop-arrow { fill: none; stroke: var(--citrine); stroke-width: 24; stroke-linecap: round; stroke-linejoin: round; }
.node { position: absolute; display: grid; place-items: center; min-width: 7.5rem; min-height: 4.4rem; padding: 0.7rem 1rem; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); font-weight: 900; box-shadow: 6px 6px 0 var(--ink); transform: rotate(-2deg); }
.node b { position: absolute; top: -0.85rem; left: -0.75rem; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--coral); color: var(--paper); font-size: 0.7rem; }
.node-human { left: 1%; top: 28%; }
.node-brief { left: 29%; top: 2%; transform: rotate(2deg); }
.node-agent { right: 2%; top: 25%; }
.node-proof { right: 13%; bottom: 4%; transform: rotate(2deg); }
.node-approve { left: 13%; bottom: 2%; }
.loop figcaption { position: absolute; left: 23%; right: 23%; top: 42%; text-align: center; font-size: 0.9rem; font-weight: 700; color: var(--paper); }

.pattern { display: grid; grid-template-columns: minmax(18rem, 0.75fr) minmax(28rem, 1.25fr); gap: clamp(3rem, 8vw, 9rem); padding: clamp(5rem, 10vw, 10rem) clamp(1.2rem, 6vw, 7rem); }
.pattern-title { align-self: start; position: sticky; top: 2rem; }
.pattern ol { margin: 0; padding: 0; list-style: none; }
.pattern li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.25rem; align-items: start; padding: 1.6rem 0; border-top: 1px solid var(--line); }
.pattern li:last-child { border-bottom: 1px solid var(--line); }
.pattern li > span { font-size: 0.8rem; font-weight: 900; color: var(--cobalt); }
.pattern strong { font-size: clamp(1.5rem, 3vw, 2.4rem); letter-spacing: -0.04em; }
.pattern li p { max-width: 48ch; margin: 0.3rem 0 0; }

.builder { display: grid; grid-template-columns: minmax(18rem, 0.7fr) minmax(25rem, 1fr) minmax(22rem, 0.8fr); gap: clamp(2rem, 4vw, 4rem); padding: clamp(5rem, 9vw, 9rem) clamp(1.2rem, 4vw, 4.5rem); background: var(--citrine); }
.builder-copy p:not(.kicker) { max-width: 40ch; }
form { display: grid; gap: 1rem; }
form label { display: grid; gap: 0.45rem; }
form label > span { font-weight: 900; }
textarea { width: 100%; min-height: 5rem; resize: vertical; padding: 0.9rem; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font: inherit; }
textarea::placeholder { color: oklch(0.48 0.04 263); }
button { min-height: 48px; border: 0; border-radius: 0; background: var(--cobalt); color: var(--paper); font: inherit; font-weight: 900; cursor: pointer; }
button:hover { background: var(--cobalt-deep); }
.brief-output { align-self: start; min-height: 100%; padding: 1.25rem; background: var(--ink); color: var(--paper); box-shadow: 8px 8px 0 var(--coral); }
.brief-output > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid oklch(0.8 0.03 247 / 0.4); font-weight: 900; }
.brief-output button { min-height: 38px; padding: 0.35rem 0.8rem; background: var(--paper); color: var(--ink); }
.brief-output pre { min-height: 20rem; margin: 1rem 0 0; white-space: pre-wrap; word-break: break-word; font: 500 0.92rem/1.65 "Chivo", system-ui, sans-serif; }
.brief-output #copyStatus { min-height: 1.5rem; margin: 0.8rem 0 0; color: var(--mint); font-size: 0.85rem; }

.proof { display: grid; grid-template-columns: minmax(20rem, 0.75fr) minmax(28rem, 1.25fr); gap: clamp(3rem, 7vw, 8rem); padding: clamp(5rem, 10vw, 10rem) clamp(1.2rem, 6vw, 7rem); background: var(--cobalt-deep); color: var(--paper); }
.proof > div:first-child > p:not(.kicker) { max-width: 50ch; font-size: 1.08rem; }
.proof .button { margin-top: 1.5rem; }
.proof-flow { display: grid; grid-template-columns: 1fr auto 1fr; align-content: center; gap: 1rem; }
.proof-flow a { min-height: 9rem; display: flex; flex-direction: column; justify-content: space-between; padding: 1.1rem; border: 2px solid var(--paper); color: var(--paper); text-decoration: none; transition: background 180ms ease, color 180ms ease; }
.proof-flow a:hover { background: var(--paper); color: var(--ink); }
.proof-flow b { font-size: 1.35rem; }
.proof-flow span { max-width: 21ch; font-size: 0.9rem; }
.proof-flow i { align-self: center; font-style: normal; font-size: 1.5rem; }

footer { display: flex; justify-content: space-between; gap: 1.5rem; padding: 1.6rem clamp(1.2rem, 4vw, 4.5rem); background: var(--ink); color: var(--paper); font-size: 0.88rem; }

@media (max-width: 1050px) {
  .builder { grid-template-columns: 1fr 1fr; }
  .builder-copy { grid-column: 1 / -1; }
}

@media (max-width: 850px) {
  nav a:not(:last-child) { display: none; }
  .hero, .pattern, .builder, .proof { grid-template-columns: 1fr; }
  .hero { padding-top: 4rem; }
  .pattern-title { position: static; }
  .builder-copy { grid-column: auto; }
  .brief-output pre { min-height: 12rem; }
}

@media (max-width: 560px) {
  h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
  .loop { width: 108%; margin-left: -4%; transform: scale(0.92); }
  .node { min-width: 6.2rem; min-height: 3.8rem; padding: 0.5rem; font-size: 0.82rem; }
  .loop figcaption { left: 25%; right: 25%; font-size: 0.75rem; }
  .proof-flow { grid-template-columns: 1fr; }
  .proof-flow i { transform: rotate(90deg); justify-self: center; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
