@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("./fonts/bricolage-grotesque-latin.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("./fonts/hanken-grotesk-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/ibm-plex-mono-400-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("./fonts/ibm-plex-mono-500-latin.woff2") format("woff2"); }

:root {
  --paper: #f1eee7;
  --ink: #17140f;
  --accent: #2c4a45;
  --accent-light: #3f6960;
  --petrol: #0f2e2b;
  --muted: #6f6a60;
  --line: #d8d2c7;
  --highlight: #b4664a;
  --white: #fff;
  --surface: rgba(255, 255, 255, 0.48);
  --accent-soft: rgba(63, 105, 96, 0.13);
  --highlight-soft: rgba(180, 102, 74, 0.12);
  --shadow: 0 18px 55px rgba(23, 20, 15, 0.08);
  --radius: 20px;
  --font-heading: "Bricolage Grotesque", Arial, sans-serif;
  --font-body: "Hanken Grotesk", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: radial-gradient(circle at 80% 0%, rgba(44, 74, 69, 0.07), transparent 30rem), var(--paper); color: var(--ink); }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.42; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(44, 74, 69, 0.38); outline-offset: 3px; }
h1, h2, h3, h4 { margin-top: 0; font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
.is-hidden { display: none !important; }
.shell { width: min(1220px, calc(100% - 48px)); margin-inline: auto; }

.skip-link { position: fixed; z-index: 100; top: -100px; left: 16px; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: white; }
.skip-link:focus { top: 16px; }

.topbar { position: sticky; z-index: 30; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 74px; padding: 0 40px; border-bottom: 1px solid rgba(23, 20, 15, 0.14); background: rgba(241, 238, 231, 0.92); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 13px; padding: 8px 0; color: var(--ink); font-size: 14px; letter-spacing: -0.01em; text-decoration: none; }
.brand strong { display: block; font-weight: 650; }
.brand-mark { display: inline-flex; align-items: center; gap: 3px; }
.brand-mark i { display: block; width: 6px; height: 6px; border: 1.5px solid var(--accent); border-radius: 50%; }
.brand-mark i:nth-child(2) { width: 18px; border-radius: 99px; }
.brand-mark i:last-child { background: var(--accent); }
.all-tools-link { display: inline-flex; align-items: center; justify-self: end; gap: 7px; color: var(--accent); font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-decoration: none; }
.all-tools-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.view-switch { display: flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.38); }
.view-switch > span { padding: 0 7px 0 9px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.view-switch button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.view-switch button.is-active { background: var(--accent); color: white; }

.eyebrow, .small-label, .note-number, .field > span, .stage-fieldset legend, .field-help, .primary-context > span, .secondary-context > span, .assumption-banner > span, .signal-preview > span, .moment-number, .moment-card-top, .logic-label, .value-label, .method-list dt, .lifecycle-label, .engine-note { font-family: var(--font-mono); }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 80px; align-items: end; padding: 84px 0 76px; border-bottom: 1px solid var(--line); }
.hero h1 { max-width: 900px; margin: 0; font-size: clamp(50px, 7.4vw, 92px); line-height: 0.96; letter-spacing: -0.052em; }
.hero-copy { max-width: 760px; margin: 28px 0 0; color: var(--muted); font-size: 18px; line-height: 1.62; }
.hero-note { padding: 24px 0 4px 30px; border-top: 3px solid var(--highlight); }
.hero-note p { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.hero-note strong { color: var(--ink); }
.note-number { color: var(--highlight); font-size: 10px; letter-spacing: 0.14em; }

.construct { padding: 68px 0 82px; border-bottom: 1px solid var(--line); }
.construct-heading { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr); gap: 70px; align-items: end; margin-bottom: 34px; }
.construct-heading .eyebrow { grid-column: 1 / -1; margin-bottom: -48px; }
.construct-heading h2 { max-width: 730px; margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: -0.045em; }
.construct-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; list-style: none; }
.construct-flow li { min-height: 216px; padding: 24px; border-right: 1px solid var(--line); background: rgba(255, 255, 255, 0.38); }
.construct-flow li:last-child { border-right: 0; background: var(--accent); color: white; }
.construct-flow span { display: block; margin-bottom: 48px; color: var(--highlight); font-family: var(--font-mono); font-size: 10px; }
.construct-flow li:last-child span { color: rgba(255, 255, 255, 0.66); }
.construct-flow strong { display: block; font-size: 17px; }
.construct-flow p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.52; }
.construct-flow li:last-child p { color: rgba(255, 255, 255, 0.68); }

.builder-intro { display: grid; grid-template-columns: 0.35fr 1fr; gap: 60px; align-items: start; padding: 74px 0 28px; }
.builder-intro h2 { margin: 0; font-size: clamp(38px, 5vw, 58px); line-height: 1; letter-spacing: -0.045em; }
.builder-intro > div > p { max-width: 620px; margin: 15px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }

.step-nav { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border-bottom: 1px solid var(--line); }
.step-tab { display: flex; align-items: center; gap: 10px; padding: 17px 12px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-family: var(--font-mono); font-size: 11px; text-align: left; }
.step-tab span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 9px; }
.step-tab.is-active { border-color: var(--accent); color: var(--accent); }
.step-tab.is-active span { border-color: var(--accent); background: var(--accent); color: white; }

.workspace { padding: 54px 0 88px; }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr); gap: 70px; align-items: end; margin-bottom: 32px; }
.section-heading h2 { max-width: 760px; margin: 0; font-size: clamp(34px, 5vw, 54px); line-height: 1; letter-spacing: -0.043em; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.builder-form { display: grid; gap: 24px; }
.field { display: grid; gap: 10px; }
.field > span, .stage-fieldset legend { color: var(--ink); font-size: 11px; font-weight: 500; }
.field b { color: var(--highlight); }
.field small { color: var(--muted); font-size: 11px; line-height: 1.45; }
textarea { width: 100%; min-height: 118px; padding: 18px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.5); color: var(--ink); font-size: 16px; line-height: 1.55; }
textarea:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.8); }

.stage-fieldset { min-width: 0; margin: 8px 0 0; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.34); }
.stage-fieldset legend { padding: 0 8px; }
.field-help { margin: -4px 0 22px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.stage-rail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.stage-rail label { min-width: 0; }
.stage-rail input, .all-stage-option input { position: absolute; opacity: 0; pointer-events: none; }
.stage-rail label > span { display: grid; min-height: 126px; padding: 16px 14px; border-right: 1px solid var(--line); background: rgba(255, 255, 255, 0.45); cursor: pointer; }
.stage-rail label:last-child > span { border-right: 0; }
.stage-rail b { color: var(--muted); font-family: var(--font-mono); font-size: 9px; font-weight: 400; }
.stage-rail strong { align-self: end; font-size: 14px; }
.stage-rail small { color: var(--muted); font-size: 10px; }
.stage-rail input:checked + span { background: var(--accent); color: white; }
.stage-rail input:checked + span b, .stage-rail input:checked + span small { color: rgba(255, 255, 255, 0.64); }
.stage-rail input:focus-visible + span, .all-stage-option input:focus-visible + span { outline: 3px solid rgba(44, 74, 69, 0.38); outline-offset: -3px; }
.all-stage-option { display: block; margin-top: 12px; }
.all-stage-option > span { display: flex; align-items: center; gap: 14px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, 0.36); cursor: pointer; }
.all-stage-option strong { font-size: 12px; }
.all-stage-option small { color: var(--muted); font-size: 11px; }
.all-stage-option input:checked + span { border-color: var(--accent); box-shadow: inset 4px 0 var(--accent); }

.nesting-explainer { display: grid; grid-template-columns: 0.9fr 40px 1.1fr; align-items: stretch; padding: 24px; border-radius: 14px; background: var(--petrol); color: white; }
.primary-context, .secondary-context { padding: 7px 10px; }
.primary-context > span, .secondary-context > span { display: block; margin-bottom: 10px; color: rgba(255, 255, 255, 0.56); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.primary-context strong, .secondary-context strong { display: block; font-family: var(--font-heading); font-size: 21px; font-weight: 550; }
.primary-context p, .secondary-context p { margin: 8px 0 0; color: rgba(255, 255, 255, 0.62); font-size: 11px; line-height: 1.5; }
.nesting-arrow { display: grid; place-items: center; color: var(--highlight); font-size: 27px; }
.secondary-context { border-left: 1px solid rgba(255, 255, 255, 0.16); }

.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 8px; }
.form-actions > p { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-dot.is-ready { background: var(--accent-light); }
.status-dot.is-demo { background: var(--highlight); }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 10px; padding: 10px 17px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 680; transition: transform 150ms ease, background 150ms ease, border-color 150ms ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: var(--accent); background: var(--accent); color: white; box-shadow: 0 8px 18px rgba(26, 78, 61, 0.12); }
.button-primary:hover { background: var(--petrol); }
.button-secondary, .button-quiet { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button-secondary:hover, .button-quiet:hover { border-color: var(--muted); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 11px; font-weight: 650; }
.form-actions-split { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 22px; }

.moments-heading { margin-bottom: 22px; }
.assumption-banner { display: grid; grid-template-columns: 160px 1fr; gap: 24px; margin-bottom: 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--highlight-soft); }
.assumption-banner > span { color: var(--highlight); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.assumption-banner p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.moment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.moment-card { display: grid; gap: 18px; min-height: 440px; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.44); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); }
.moment-card:hover { border-color: var(--muted); box-shadow: var(--shadow); }
.moment-card-top { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 9px; }
.primary-stage-badge { color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; }
.nested-badge { width: fit-content; margin-top: -5px; padding: 6px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 650; }
.moment-card h3 { margin: 0; font-size: 31px; font-weight: 500; line-height: 1.07; letter-spacing: -0.035em; }
.moment-tension { margin: -5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.signal-preview { align-self: end; padding: 16px 18px; border: 1px solid rgba(111, 106, 96, 0.2); border-radius: 9px; background: rgba(255, 255, 255, 0.3); }
.signal-preview > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.signal-preview p { margin: 0; font-size: 11px; line-height: 1.5; }
.build-button { justify-self: start; align-self: end; }

.build-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.built-header { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 60px; align-items: end; padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.built-header h2 { max-width: 800px; margin: 12px 0 0; font-size: clamp(44px, 6vw, 72px); line-height: 0.96; letter-spacing: -0.05em; }
.built-header .moment-tension { margin-top: 22px; max-width: 720px; font-size: 16px; }
.stage-context-card { padding-left: 24px; border-left: 1px solid var(--line); }
.lifecycle-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.stage-context-card strong { display: block; font-family: var(--font-heading); font-size: 24px; font-weight: 550; }
.stage-context-card p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.nested-stage-card { margin-top: 16px; padding: 15px; border-radius: 9px; background: var(--accent-soft); }
.nested-stage-card .lifecycle-label { color: var(--accent); }

.moment-story { display: grid; grid-template-columns: 0.55fr 1.45fr; gap: 60px; padding: 50px 0; }
.moment-story h3, .logic-section h3, .value-section h3, .method-section h3 { margin: 0; font-size: 31px; line-height: 1.08; }
.moment-story > p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.68; }
.logic-section { padding: 46px; border-radius: 14px; background: var(--petrol); color: white; }
.logic-section > .eyebrow { color: rgba(255, 255, 255, 0.62); }
.logic-chain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 28px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.16); }
.logic-step { min-height: 238px; padding: 24px; background: #183936; }
.logic-step:nth-child(2) { background: #21423e; }
.logic-step:nth-child(3) { background: #294a45; }
.logic-label { display: block; margin-bottom: 38px; color: rgba(255, 255, 255, 0.55); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.logic-step strong { display: block; font-size: 16px; }
.logic-step p { margin: 10px 0 0; color: rgba(255, 255, 255, 0.66); font-size: 12px; line-height: 1.58; }
.logic-step small { display: block; margin-top: 14px; color: #d5b09f; font-size: 10px; line-height: 1.45; }

.response-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 20px 0 0; }
.control-card { padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.control-card > span { display: block; margin-bottom: 11px; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.segment { display: flex; gap: 4px; }
.segment button { flex: 1; min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; }
.segment button.is-active { border-color: var(--accent); background: var(--accent); color: white; }
.response-note { margin: 18px 0 0; padding: 16px 18px; border-left: 3px solid var(--highlight); background: var(--highlight-soft); color: var(--muted); font-size: 12px; line-height: 1.55; }

.value-section, .method-section { padding: 58px 0 0; }
.value-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.value-card { min-height: 190px; padding: 22px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.value-label { display: block; margin-bottom: 24px; color: var(--accent); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.value-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.58; }
.method-section { display: none; }
body[data-view="method"] .experience-only { display: none; }
body[data-view="method"] .method-section { display: block; }
.method-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 24px 0 0; }
.method-list > div { padding: 22px 0; border-top: 1px solid var(--line); }
.method-list dt { color: var(--accent); font-size: 9px; letter-spacing: 0.09em; text-transform: uppercase; }
.method-list dd { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.58; }

footer { margin-top: 20px; padding: 34px 24px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
footer p { max-width: 760px; margin: 0 auto; font-size: 11px; line-height: 1.5; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 38px; }
  .hero-note { max-width: 430px; padding-left: 0; }
  .construct-flow { grid-template-columns: repeat(2, 1fr); }
  .construct-flow li { border-bottom: 1px solid var(--line); }
  .construct-flow li:nth-child(2) { border-right: 0; }
  .stage-rail { grid-template-columns: repeat(3, 1fr); }
  .stage-rail label:nth-child(3) > span, .stage-rail label:nth-child(6) > span { border-right: 0; }
  .stage-rail label:nth-child(-n+3) > span { border-bottom: 1px solid var(--line); }
  .built-header { grid-template-columns: 1fr; gap: 30px; }
  .stage-context-card { padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .logic-chain { grid-template-columns: 1fr; }
  .logic-step { min-height: 0; }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 30px, 1220px); }
  .topbar { grid-template-columns: 1fr auto; padding: 0 18px; }
  .view-switch { display: none; }
  .hero { padding: 54px 0 58px; }
  .hero h1 { font-size: clamp(44px, 14vw, 68px); }
  .construct-heading, .builder-intro, .section-heading, .moment-story { grid-template-columns: 1fr; gap: 24px; }
  .construct-heading .eyebrow { grid-column: auto; margin-bottom: -12px; }
  .construct-flow { grid-template-columns: 1fr; }
  .construct-flow li { min-height: 180px; border-right: 0; }
  .builder-intro { padding-top: 56px; }
  .stage-fieldset { padding: 18px; }
  .stage-rail { grid-template-columns: repeat(2, 1fr); }
  .stage-rail label:nth-child(odd) > span { border-right: 1px solid var(--line); }
  .stage-rail label:nth-child(even) > span { border-right: 0; }
  .stage-rail label:nth-child(-n+4) > span { border-bottom: 1px solid var(--line); }
  .all-stage-option > span { align-items: flex-start; flex-direction: column; }
  .nesting-explainer { grid-template-columns: 1fr; gap: 12px; }
  .nesting-arrow { justify-content: start; padding-left: 10px; }
  .secondary-context { padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.16); border-left: 0; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button { width: 100%; }
  .moment-grid, .response-controls, .value-grid, .method-list { grid-template-columns: 1fr; }
  .moment-card { min-height: 0; }
  .assumption-banner { grid-template-columns: 1fr; gap: 7px; }
  .logic-section { padding: 28px 20px; }
}
