/* Content layout, keeping the original font mapping and pixel canvas. */
:root {
  --ink: #141718;
  --paper: #f6faf7;
  --muted: #eef4f0;
  --accent: #8de8cd;
  --line: rgba(255, 255, 255, 0.22);
}
body {
  background: var(--ink);
  font-family: 'HXWX Doto', 'HXWX Mono', monospace;
  font-size: calc(1rem * var(--text-scale));
  font-weight: 400;
  line-height: 1.6;
  color: var(--paper);
}
/* Keep the tint with the fixed canvas during scrolling and edge bounce. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
  z-index: 1;
}
body * { letter-spacing: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary { touch-action: manipulation; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
h1, h2, h3 { font-weight: 400; line-height: 1.15; overflow-wrap: anywhere; }
h1 { font-size: calc(2.4rem * var(--text-scale)); }
h2 { font-size: calc(2rem * var(--text-scale)); }
h3 { font-size: calc(1.25rem * var(--text-scale)); }
p, li, label, summary { overflow-wrap: anywhere; }
main, .site-footer { position: relative; z-index: 2; }
section { scroll-margin-top: 30px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: fixed; top: -100px; left: 65px; z-index: 100; background: var(--ink); padding: 10px 20px; }
.skip-link:focus { top: 20px; }
.lang-toggle { background: rgba(20, 23, 24, 0.9); border-color: var(--line); }
.lang-btn { text-decoration: none; min-height: 36px; display: grid; place-items: center; color: var(--muted); }
.nav-item { color: var(--paper); font-size: calc(1.2vh * var(--text-scale) * 1.15); font-weight: 700; }
.nav-item.active { color: var(--accent); text-shadow: none; }
.vertical-nav { gap: 1.3rem; }
#hero {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 74px 80px 54px; background: transparent;
  text-align: center; isolation: isolate;
}
.brand-stage { position: relative; width: 100%; height: max(230px, 20vw); flex: none; }
#hxwx { font-family: serif; font-weight: 400; line-height: normal; }
#hxwx span { letter-spacing: inherit; }
.tagline {
  position: static; transform: none; width: auto; max-width: 100%;
  font-size: calc(1.5rem * var(--text-scale)); color: var(--paper);
  margin: 8px 0 28px; white-space: normal; text-wrap: balance;
}
.hero-copy { position: relative; max-width: 900px; }
.hero-copy h1 { text-wrap: balance; }
.hero-copy > p { max-width: 780px; margin: 20px auto 0; line-height: 1.6; }
.actions { display: flex; justify-content: center; align-items: center; gap: 28px; flex-wrap: wrap; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 20px; border: 1px solid var(--line);
  border-radius: 4px; font-weight: 700; font-size: calc(0.9rem * var(--text-scale));
  line-height: 1.4; text-align: center; text-decoration: none;
  background: transparent; color: var(--paper); transition: background 0.15s;
}
.button.primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: #b5f4e3; }
.text-link { text-underline-offset: 6px; text-decoration-thickness: 1px; font-weight: 700; }
.text-link:hover { color: var(--accent); }
.section {
  min-height: 0; height: auto; display: block; padding: 88px 80px;
  background: transparent; border-top: 1px solid var(--line);
}
.section-inner { width: 100%; max-width: 1200px; margin: 0 auto; }
.section-heading { max-width: 850px; margin-bottom: 44px; }
.section-heading > p:not(.eyebrow) { color: var(--muted); margin-top: 20px; max-width: 760px; }
.eyebrow { font-size: calc(0.8rem * var(--text-scale)); color: var(--accent); margin-bottom: 20px; font-weight: 700; }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 60px; }
.service { position: relative; border-top: 1px solid var(--line); padding: 26px 0 0; }
.item-number { display: block; color: var(--accent); font-size: calc(0.8rem * var(--text-scale)); margin-bottom: 16px; }
.service:nth-child(2) .item-number { color: #ffb2a5; }
.service:nth-child(3) .item-number { color: #e3df85; }
.service h3 { margin-bottom: 16px; }
.service p { color: var(--muted); max-width: 520px; }
.service .outcome { font-size: calc(0.85rem * var(--text-scale)); color: var(--accent); margin-top: 18px; font-weight: 700; }
.measurement-note { font-size: calc(0.75rem * var(--text-scale)); color: var(--muted); }
.demo-section { padding-top: 32px; padding-bottom: 64px; }
.demo-section .section-heading { max-width: none; margin-bottom: 32px; }
.demo-section .section-heading > p:not(.eyebrow) { max-width: none; }
.demo-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.demo-scenarios { display: flex; align-items: stretch; gap: 20px; border-bottom: 1px solid var(--line); min-width: 0; }
.demo-scenarios button { min-width: 0; min-height: 48px; padding: 12px 0; background: transparent; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--paper); font-size: calc(0.85rem * var(--text-scale)); line-height: 1.4; text-align: left; }
.demo-scenarios button[aria-selected='true'] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.demo-scenarios button:hover { color: var(--accent); }
.demo-controls { flex: none; display: grid; gap: 8px; justify-items: end; }
.demo-playback { display: flex; gap: 12px; align-items: center; }
#demo-run { gap: 12px; min-width: 208px; }
.demo-label { color: var(--muted); font-size: calc(0.75rem * var(--text-scale)); }
.icon-button { width: 44px; height: 44px; flex: none; background: transparent; border: 1px solid var(--line); border-radius: 4px; color: var(--paper); display: grid; place-items: center; }
.icon-button svg { width: 20px; height: 20px; }
.icon-button:hover:not(:disabled) { border-color: var(--accent); background: rgba(255, 255, 255, 0.08); }
.tool-icon { filter: invert(1); }
.demo-flow-stage { position: relative; }
.demo-packet-track { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.demo-packet { position: absolute; top: 0; left: 0; width: 8px; height: 8px; background: var(--accent); pointer-events: none; opacity: 0; will-change: transform; transition: opacity 0.15s; }
.workflow-example[data-phase='running'] .demo-packet, .workflow-example[data-phase='paused'] .demo-packet { opacity: 1; }
.demo-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; margin: 0 0 28px; }
.demo-flow li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; min-width: 0; padding: 0 8px; }
.demo-flow li::before { content: ''; position: absolute; top: 28px; left: calc(50% + 36px); width: calc(100% - 72px); height: 1px; background: rgba(255, 255, 255, 0.5); transition: background-color 0.3s; }
.demo-flow li:last-child::before { display: none; }
.demo-flow li.is-current::before, .demo-flow li.is-done::before { background: var(--accent); }
.demo-node { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 4px; transition: background 0.3s, border-color 0.3s; }
.demo-flow li.is-current .demo-node { border-color: var(--accent); background: rgba(141, 232, 205, 0.12); }
.demo-flow li.is-done .demo-node { border-color: var(--accent); }
.demo-flow li.is-current strong, .demo-flow li.is-done strong { color: var(--accent); }
.demo-flow strong { font-size: calc(0.9rem * var(--text-scale)); line-height: 1.4; font-weight: 700; transition: color 0.3s; }
.demo-flow li > span:last-child { font-size: calc(0.7rem * var(--text-scale)); line-height: 1.5; }
.demo-workspace { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 38px; align-items: start; }
.demo-incoming { min-width: 0; border-top: 1px solid var(--line); padding-top: 20px; }
.demo-incoming h3, .demo-outcomes h3 { font-size: calc(0.95rem * var(--text-scale)); line-height: 1.4; font-weight: 700; }
.demo-message-meta { font-size: calc(0.8rem * var(--text-scale)); margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.demo-message-meta > div, .demo-fields > div { display: grid; grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr); gap: 12px; }
.demo-message-meta dt, .demo-fields dt { color: var(--muted); }
.demo-message-meta dd, .demo-fields dt, .demo-fields dd { overflow-wrap: anywhere; }
.demo-message-meta dd { font-weight: 700; }
.demo-message-body { font-size: calc(0.95rem * var(--text-scale)); line-height: 1.6; margin: 20px 0 0; }
.demo-source { color: var(--muted); font-size: calc(0.75rem * var(--text-scale)); margin-top: 20px; }
.demo-extracted { border-left: 2px solid var(--accent); padding-left: 16px; margin-top: 24px; }
.demo-extraction-slot { min-height: 104px; }
.demo-extracted span { display: block; color: var(--accent); font-size: calc(0.7rem * var(--text-scale)); }
.demo-extracted strong { display: block; font-size: calc(0.85rem * var(--text-scale)); margin-top: 6px; }
.demo-outcomes { min-width: 0; }
.demo-records { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.demo-record { border: 1px solid var(--line); border-radius: 4px; padding: 16px; min-width: 0; transition: border-color 0.3s, background 0.3s; }
.demo-artifact-heading { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.demo-artifact-heading > img { flex: none; }
.demo-fields { font-size: calc(0.8rem * var(--text-scale)); margin-top: 16px; }
.demo-fields > div { padding: 2px 0; }
.demo-fields dd { font-weight: 700; }
.demo-record.is-revealed { border-color: var(--accent); background: rgba(141, 232, 205, 0.045); }
.demo-record.is-revealed .demo-artifact-heading { color: var(--accent); }
.workflow-example[data-phase='running'] .demo-record:not(.is-revealed) .demo-fields,
.workflow-example[data-phase='paused'] .demo-record:not(.is-revealed) .demo-fields,
.workflow-example[data-phase='running'] .demo-result:not(.is-revealed) .demo-reply,
.workflow-example[data-phase='paused'] .demo-result:not(.is-revealed) .demo-reply { opacity: 0.15; }
.workflow-example[data-phase='running'] .is-revealed .demo-fields,
.workflow-example[data-phase='running'] .is-revealed .demo-reply { animation: artifact-reveal 0.5s ease-out both; }
@keyframes artifact-reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.demo-result { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.demo-draft-heading { min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.demo-review-state { color: #e3df85; font-weight: 700; font-size: calc(0.75rem * var(--text-scale)); margin: 12px 0; }
.demo-result.is-revealed { border-top-color: var(--accent); }
.demo-result.approved .demo-review-state { color: var(--accent); }
.demo-reply { height: 126px; }
.demo-reply-text { height: 100%; overflow-y: auto; white-space: pre-wrap; font-size: calc(0.95rem * var(--text-scale)); line-height: 1.6; scrollbar-width: thin; }
.demo-edit-form { height: 100%; display: flex; flex-direction: column; gap: 12px; }
.demo-reply-input { flex: 1; min-height: 0; width: 100%; resize: none; padding: 8px; border: 1px solid var(--accent); border-radius: 4px; background: rgba(255, 255, 255, 0.05); color: var(--paper); font-size: calc(0.95rem * var(--text-scale)); line-height: 1.55; }
.demo-edit-actions { display: flex; gap: 10px; }
#demo-approve { width: 100%; }
.demo-status { min-height: 64px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: calc(0.85rem * var(--text-scale)); color: var(--muted); }
.demo-status.error { color: #ffb2a5; }
.process-grid { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.process-grid li { border-top: 1px solid var(--line); padding-top: 24px; }
.process-grid h3 { margin-bottom: 18px; }
.process-grid p { color: var(--muted); font-size: calc(0.9rem * var(--text-scale)); }
.approach-grid, .faq-grid, .contact-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 64px; }
.approach-grid .section-heading, .faq-grid .section-heading { margin: 0; }
.principles { list-style: none; margin: 28px 0; }
.principles li { border-top: 1px solid var(--line); padding: 18px 0; color: var(--muted); }
.anchor-alias { position: absolute; top: 0; }
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
summary { position: relative; display: block; list-style: none; padding: 22px 24px 22px 36px; font-weight: 700; line-height: 1.4; }
summary::marker { content: ''; }
summary::-webkit-details-marker { display: none; }
summary::before {
  content: ''; position: absolute; left: 0; top: calc(22px + 0.7em - 12px);
  width: 24px; height: 24px; background: currentColor;
  -webkit-mask: url('/assets/pixelarticons/chevron-right.svg') center / 24px 24px no-repeat;
  mask: url('/assets/pixelarticons/chevron-right.svg') center / 24px 24px no-repeat;
  transition: transform 0.16s ease;
}
details[open] > summary::before { transform: rotate(90deg); }
.faq-list details > p { color: var(--muted); padding: 0 0 24px; }
.section-heading .contact-note { font-size: calc(0.8rem * var(--text-scale)); color: var(--muted); margin-top: 28px; }
.contact-form-container { border: 0; background: none; padding: 0; border-radius: 0; backdrop-filter: none; gap: 22px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-group { min-width: 0; }
.form-group label { font-size: calc(0.9rem * var(--text-scale)); }
.form-group input, .form-group textarea { width: 100%; min-width: 0; font-size: calc(0.95rem * var(--text-scale)); background: rgba(255,255,255,0.035); border-radius: 4px; border-color: #66736d; }
.form-group input::placeholder, .form-group textarea::placeholder, .input-row input::placeholder { color: #b6c3bd; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-status { min-height: 30px; font-size: calc(0.85rem * var(--text-scale)); color: var(--accent); }
.form-status.error { color: #ffb2a5; }
.form-disclosure { margin-top: 20px; border-top: 1px solid var(--line); }
.form-disclosure .contact-form-container { padding-bottom: 8px; }
.chat-note { color: var(--muted); font-size: calc(0.85rem * var(--text-scale)); padding-bottom: 20px; }
.chat-container { height: 460px; min-height: 0; padding: 16px; border-radius: 6px; background: none; backdrop-filter: none; }
.chat-bubble { max-width: 90%; border-radius: 6px; }
.chat-bubble a { color: var(--accent); }
.chat-bubble p { margin: 0 0 10px; }
.input-row { align-items: stretch; }
.input-row input[type='text'] { border-radius: 4px; font-size: calc(0.9rem * var(--text-scale)); }
.send-button { font-size: calc(0.9rem * var(--text-scale)); padding: 10px 14px; }
.site-footer { background: transparent; border-top: 1px solid var(--line); padding: 32px 80px; font-size: calc(0.8rem * var(--text-scale)); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 32px; }
.footer-inner span { color: var(--muted); }
@media (max-width: 1100px) {
  .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
  .approach-grid, .faq-grid, .contact-grid { gap: 40px; }
  .demo-top { flex-wrap: wrap; }
  .demo-controls { flex: 1; }
  .demo-workspace { grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr); gap: 28px; }
  .demo-fields > div { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 0; }
  .demo-artifact-heading { min-height: 54px; align-items: flex-start; }
}
@media (min-width: 769px) and (max-height: 860px) {
  #hero { padding-top: 48px; padding-bottom: 36px; }
}
@media (max-width: 768px) {
  h1 { font-size: calc(1.65rem * var(--text-scale)); }
  h2 { font-size: calc(1.5rem * var(--text-scale)); }
  h3 { font-size: calc(1.2rem * var(--text-scale)); }
  #hero { padding: 74px 20px 42px 40px; }
  .brand-stage { height: 120px; }
  .tagline { width: auto; max-width: 100%; transform: none; font-size: calc(1.2rem * var(--text-scale)); margin: 4px 0 24px; letter-spacing: 0; }
  .hero-copy > p { font-size: calc(0.9rem * var(--text-scale)); margin-top: 16px; }
  .actions { flex-direction: column; gap: 20px; margin-top: 24px; }
  .actions .button { width: 100%; }
  .vertical-nav { left: 10px; gap: 16px; }
  .nav-item { font-size: calc(1.2vh * var(--text-scale) * 1.15); }
  .section { padding: 58px 26px 58px 50px; min-height: 0; }
  .section-heading { margin-bottom: 30px; }
  .section-heading > p:not(.eyebrow) { font-size: calc(0.9rem * var(--text-scale)); }
  .eyebrow { font-size: calc(0.7rem * var(--text-scale)); margin-bottom: 16px; }
  .service-grid, .process-grid, .approach-grid, .faq-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .service p, .approach-copy, .faq-list p { font-size: calc(0.9rem * var(--text-scale)); }
  .demo-top { gap: 24px; margin-bottom: 32px; }
  .demo-scenarios { width: 100%; gap: 16px; }
  .demo-scenarios button { flex: 1; font-size: calc(0.75rem * var(--text-scale)); }
  .demo-controls { justify-items: start; min-width: 0; width: 100%; }
  .demo-label { font-size: calc(0.7rem * var(--text-scale)); }
  #demo-run { min-width: 0; }
  .demo-playback { width: 100%; }
  .demo-playback .button { flex: 1; }
  .demo-flow { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .demo-flow li { display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 16px; padding: 0; text-align: left; }
  .demo-node { width: 48px; height: 48px; grid-row: 1 / 3; }
  .demo-node img { width: 24px; height: 24px; }
  .demo-flow li::before { top: 53px; left: 23px; width: 1px; height: 14px; }
  .demo-flow strong { font-size: calc(0.85rem * var(--text-scale)); }
  .demo-flow li > span:last-child { font-size: calc(0.7rem * var(--text-scale)); }
  .demo-workspace { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .demo-records { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .demo-artifact-heading { min-height: 44px; align-items: center; }
  .demo-fields > div { grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr); gap: 12px; }
  .demo-reply { height: 240px; }
  .demo-reply-text, .demo-reply-input, .demo-message-body { font-size: calc(0.9rem * var(--text-scale)); }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .contact-form-container { padding: 0; gap: 22px; }
  .chat-container { height: 480px; max-height: none; min-height: 0; padding: 12px; }
  .input-row { flex-wrap: wrap; }
  .input-row input[type='text'] { flex-basis: 100%; }
  .send-button { width: 100%; }
  .site-footer { padding: 30px 26px 30px 50px; }
}
@media (max-width: 360px) {
  .demo-scenarios { flex-wrap: wrap; gap: 8px 16px; }
  .demo-scenarios button { flex: 1 1 100%; min-height: 44px; }
  .demo-fields > div, .demo-message-meta > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .demo-packet { opacity: 0 !important; }
  .demo-fields, .demo-reply { animation: none !important; }
}
