:root {
  --paper: #f7f6f2;
  --ink: #181c28;
  --accent: #3a5fe0;
  --text-2: #3b3f4c;
  --text-3: #5a5f6e;
  --serif: 'Instrument Serif', serif;
  --sans: 'Instrument Sans', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --gutter: clamp(20px, 5vw, 64px);
}

html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
* { box-sizing: border-box; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
ul, ol { list-style: none; margin: 0; padding: 0; }

.page { font-family: var(--sans); background: var(--paper); color: var(--ink); overflow-x: clip; }

/* Buttons and logo */

.btn { display: flex; align-items: center; border-radius: 999px; font-family: var(--sans); font-weight: 500; }
.btn--dark, .btn--dark:hover { background: var(--ink); color: var(--paper); }
.btn--accent, .btn--accent:hover { background: var(--accent); color: #fff; }
.btn--nav { height: 44px; padding: 0 18px; font-size: 14px; }
.btn--hero { margin-top: clamp(28px, 3vw, 34px); height: 52px; padding: 0 28px; font-size: 16px; }
.btn--audit { margin-top: clamp(30px, 3vw, 36px); width: min(100%, 320px); height: 56px; justify-content: center; font-size: 17px; }

.logo { display: flex; align-items: flex-start; font-family: var(--serif); font-style: italic; line-height: 1; letter-spacing: -0.02em; }
.logo span { color: var(--accent); margin-left: 1px; margin-top: -2px; }
.logo--nav { font-size: clamp(27px, 2.2vw, 30px); }
.logo--nav span { font-size: clamp(14px, 1.1vw, 16px); }
.logo--footer { font-size: 26px; }
.logo--footer span { font-size: 13px; }

/* Nav (fades in partway through the hero) */

.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; opacity: 0; pointer-events: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(18px, 4vw, 56px); background: rgba(247, 246, 242, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(24, 28, 40, 0.08); }
.nav-right { display: flex; align-items: center; gap: 28px; font-family: var(--mono); font-size: 13px; }
.nav-links { display: flex; gap: 28px; }

/* Hero */

.hero { position: relative; height: 680vh; }
.hero-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--paper); }
.hero-canvas { position: absolute; inset: 0; display: block; }

.hero-copy { position: absolute; left: 0; right: 0; z-index: 3; opacity: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-copy--continuum { top: clamp(90px, 13vh, 140px); top: clamp(90px, 13svh, 140px); padding: 0 24px; }
.hero-copy--deploy { top: clamp(90px, 14vh, 150px); top: clamp(90px, 14svh, 150px); padding: 0 20px; }

.wordmark { display: flex; align-items: flex-start; margin: 0; font-family: var(--serif); font-size: inherit; font-style: italic; font-weight: 400; line-height: 0.85; letter-spacing: -0.02em; }
.wordmark-word { font-size: clamp(78px, 15vw, 230px); color: var(--ink); }
.wordmark-x { font-size: clamp(40px, 7vw, 108px); color: var(--accent); margin-left: 0.04em; margin-top: -0.08em; }
.hero-line { margin: clamp(22px, 2.2vw, 28px) 0 0; font-size: clamp(20px, 2vw, 28px); font-weight: 500; color: var(--ink); }
.hero-sub { margin: 10px 0 0; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.5; color: var(--text-2); max-width: 520px; text-wrap: pretty; }

.deploy-lead { font-family: var(--serif); font-style: italic; font-size: clamp(34px, 4vw, 58px); line-height: 1; }
.deploy-word { font-family: var(--serif); font-style: italic; font-size: clamp(62px, 12vw, 190px); line-height: 1.08; letter-spacing: -0.02em; color: var(--accent); transition: opacity .3s ease, filter .3s ease; }
.deploy-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px clamp(18px, 2vw, 26px); margin-top: 10px; font-family: var(--mono); font-size: clamp(11px, 1vw, 13px); letter-spacing: 0.04em; text-transform: uppercase; }
.deploy-list span { transition: opacity .3s; }

/* Hero: retro desktop. Every [data-px] box is sampled into the canvas, so its
   geometry is what the pixels dissolve from. */

.desk { position: absolute; inset: 0; z-index: 2; background: #008080; font-family: Tahoma, 'MS Sans Serif', Verdana, sans-serif; color: #000; overflow: hidden; }
.desk--mobile { display: none; }

.desk-icons { position: absolute; top: 18px; left: 14px; display: flex; flex-direction: column; gap: 22px; }
.desk-icon { width: 90px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.desk-icon-label { color: #fff; font-size: 12px; text-align: center; }
.desk-icon-label--break { word-break: break-all; }
.icon-biz { width: 38px; height: 30px; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; padding: 3px; }
.icon-biz > div { width: 100%; height: 100%; background: #000080; }
.icon-inbox { width: 38px; height: 26px; background: #fff; border: 1px solid #000; }
.icon-sheet { width: 30px; height: 36px; background: #fff; border: 1px solid #000; padding-top: 6px; }
.icon-sheet > div { height: 8px; background: #008000; }
.icon-folder { width: 38px; height: 28px; background: #e8c547; border: 1px solid #806000; }
.icon-bin { width: 28px; height: 34px; background: #c0c0c0; border: 1px solid #404040; }

.win { position: absolute; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; padding: 3px; }
.win--main { left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(620px, calc(100vw - 140px)); box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf; }
.win-title { height: 26px; background: linear-gradient(90deg, #000080, #1084d0); display: flex; align-items: center; justify-content: space-between; padding: 0 3px 0 6px; color: #fff; font-weight: bold; font-size: 13px; }
.win-title-name { display: flex; align-items: center; gap: 6px; }
.app-icon { width: 14px; height: 14px; background: #fff; border: 3px solid var(--accent); }
.win-ctls { display: flex; gap: 2px; }
.win-ctl { width: 18px; height: 16px; background: #c0c0c0; border: 1px solid; border-color: #fff #404040 #404040 #fff; color: #000; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.win-ctl--close { margin-left: 2px; }
.win-menu { display: flex; gap: 16px; padding: 5px 8px; font-size: 13px; }
.win-body { margin: 0 2px; background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 24px 26px; }
.win-prompt { font-size: 12px; color: #808080; font-family: 'Courier New', monospace; }
.win-heading { font-size: 36px; font-weight: bold; color: #000080; margin-top: 10px; letter-spacing: -0.5px; }
.win-tagline { font-size: 15px; margin-top: 6px; }
.win-desc { font-size: 13px; margin-top: 14px; line-height: 1.5; color: #222; }
.win-progress-label { display: flex; justify-content: space-between; font-size: 12px; margin-top: 20px; margin-bottom: 5px; }
.win-progress { height: 22px; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 2px; background: #fff; }
.win-progress-fill { height: 100%; width: 12%; background: repeating-linear-gradient(90deg, #000080 0 10px, transparent 10px 12px); }
.win-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 6px 6px; }
.w95-btn { min-width: 86px; height: 26px; padding: 0 10px; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.w95-btn--disabled { color: #808080; }
.w95-btn--default { outline: 1px solid #000; font-weight: bold; }
/* A click anywhere on the hero plays it forward (main.js); the buttons say so. */
.desk .w95-btn, .desk .alert-ok { cursor: pointer; }

.win--alert { right: 5%; top: 9%; width: 300px; box-shadow: inset -1px -1px #808080; }
.alert-title { height: 22px; background: linear-gradient(90deg, #808080, #b5b5b5); color: #d8d8d8; font-weight: bold; font-size: 12px; display: flex; align-items: center; padding: 0 6px; }
.alert-body { display: flex; gap: 12px; padding: 14px 12px 8px; font-size: 12px; line-height: 1.45; }
.alert-icon { flex: 0 0 30px; height: 30px; border-radius: 50%; background: #d40000; color: #fff; font-weight: bold; display: flex; align-items: center; justify-content: center; }
.alert-actions { display: flex; justify-content: center; padding: 4px 0 8px; }
.alert-ok { width: 76px; height: 24px; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }

.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: #c0c0c0; border-top: 2px solid #fff; display: flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 13px; }
.task-start { height: 30px; padding: 0 10px; display: flex; align-items: center; gap: 6px; font-weight: bold; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; }
.task-start > div { width: 14px; height: 14px; background: #000080; }
.task-sep { width: 2px; height: 28px; border-left: 1px solid #808080; border-right: 1px solid #fff; }
.task { height: 30px; width: 180px; padding: 0 8px; display: flex; align-items: center; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; overflow: hidden; white-space: nowrap; }
.task--active { font-weight: bold; background: #dcdcdc; border-color: #404040 #fff #fff #404040; }
.task-clock { margin-left: auto; height: 30px; padding: 0 12px; display: flex; align-items: center; border: 1px solid; border-color: #808080 #fff #fff #808080; }

/* Sections */

.section { padding: clamp(56px, 8vw, 110px) var(--gutter); }
.section--agents { padding: clamp(96px, 12vw, 170px) var(--gutter) clamp(56px, 8vw, 110px); }
.section--work { padding: clamp(56px, 8vw, 110px) 0 clamp(64px, 8vw, 110px); }
.section--audit { padding: clamp(88px, 12vw, 180px) var(--gutter) clamp(96px, 12vw, 180px); text-align: center; }
.wrap { max-width: 1240px; margin: 0 auto; }
.wrap--wide { max-width: 1368px; }

.eyebrow { font-family: var(--mono); font-size: clamp(12px, 1vw, 13px); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.h2 { font-family: var(--sans); font-weight: 500; font-size: clamp(38px, 5.5vw, 80px); line-height: 1.02; letter-spacing: -0.035em; margin: clamp(16px, 2vw, 22px) 0 0; }
.h2--agents { max-width: 900px; text-wrap: pretty; }
.h2--serif { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(40px, 5vw, 72px); line-height: 0.98; letter-spacing: -0.02em; }
.h2--audit { font-size: clamp(64px, 10vw, 160px); line-height: 0.9; letter-spacing: -0.03em; margin: clamp(18px, 2vw, 24px) 0 0; }

/* 01 Agents */

.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px 32px; margin-top: clamp(44px, 7vw, 90px); }
.agent { border-top: 1px solid var(--ink); padding-top: clamp(18px, 2vw, 22px); }
.agent-tag { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.agent-name { font-family: var(--sans); font-weight: 500; font-size: clamp(28px, 2.4vw, 32px); letter-spacing: -0.02em; margin: 12px 0 10px; }
.agent-summary { margin: 0 0 16px; font-size: 16px; line-height: 1.5; color: var(--text-2); }
.agent-tasks { display: flex; flex-direction: column; font-size: 15px; }
.agent-tasks li { padding: 11px 0; border-top: 1px solid rgba(24, 28, 40, 0.12); }

/* 02 Process */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: rgba(24, 28, 40, 0.14); border: 1px solid rgba(24, 28, 40, 0.14); margin-top: clamp(36px, 7vw, 90px); }
.step { background: var(--paper); padding: clamp(22px, 2.4vw, 30px) clamp(20px, 2vw, 26px) clamp(26px, 3vw, 40px); }
.step-num { font-family: var(--serif); font-size: clamp(46px, 5vw, 72px); line-height: 1; color: var(--accent); }
.step-name { font-size: clamp(20px, 1.7vw, 22px); font-weight: 500; margin-top: clamp(16px, 2.4vw, 30px); }
.step-desc { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--text-2); }

/* 03 Work */

.work-head { padding: 0 var(--gutter); display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.case-count { font-family: var(--mono); font-size: 13px; color: var(--text-3); padding-bottom: 6px; white-space: nowrap; }
.case-count, .case-controls { visibility: hidden; }
.is-scrollable .case-count, .is-scrollable .case-controls { visibility: visible; }

/* Bottom padding leaves room for the card shadow, which the scroller clips. */
.cases { position: relative; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; padding: clamp(20px, 4vw, 48px) var(--gutter) 18px; scrollbar-width: none; }
.cases::-webkit-scrollbar { display: none; }
.cases-end { flex: 0 0 1px; }

/* On phones a card fills the row minus a ~30px peek of the next one. */
.case { position: relative; flex: 0 0 max(calc((100% - 24px) / 3), min(calc(100% - 28px), 380px)); scroll-snap-align: start; scroll-snap-stop: always; background: #fff; border: 1px solid rgba(24, 28, 40, 0.1); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(24, 28, 40, 0.04), 0 12px 24px -16px rgba(24, 28, 40, 0.22); transition: transform .25s ease, box-shadow .25s ease; }
.case-media { background: #efeee9; border-bottom: 1px solid rgba(24, 28, 40, 0.08); }
.case-bar { height: 26px; padding: 0 11px; display: flex; align-items: center; gap: 5px; }
.case-bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(24, 28, 40, 0.16); }
.case-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.case-media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.case-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.case-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.case-fn { color: var(--accent); }
.case-headline { margin: 0; font-size: clamp(20px, 1.8vw, 24px); font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; text-wrap: pretty; }
.case-built { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; margin-top: auto; }
.case-built-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 10px; border: 1px solid rgba(24, 28, 40, 0.14); border-radius: 999px; background: var(--paper); font-size: 12.5px; }

/* The client name is the card's link; ::after stretches it over the whole card. */
.case-link { text-align: right; color: var(--text-2); }
.case-link span { margin-left: 6px; color: var(--accent); }
.case-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.case-link:focus-visible { outline: none; }
.case-link:focus-visible::after { box-shadow: inset 0 0 0 2px var(--accent); }

@media (hover: hover) {
  .case:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(24, 28, 40, 0.05), 0 16px 28px -16px rgba(24, 28, 40, 0.3); }
}

.case-controls { padding: 6px var(--gutter) 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.case-dots { display: flex; align-items: center; gap: 2px; margin-left: -4px; }
/* The visible pill is ::before; the padding gives a bigger tap target. */
.case-dot { padding: 8px 4px; border: 0; background: none; cursor: pointer; }
.case-dot::before { content: ''; display: block; width: 8px; height: 8px; border-radius: 999px; background: rgba(24, 28, 40, 0.2); transition: width .3s ease, background .3s ease; }
.case-dot.is-active::before { width: 28px; background: var(--accent); }
.case-arrows { display: flex; gap: 8px; }
.case-arrow { width: 44px; height: 44px; border-radius: 50%; font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.case-arrow--prev { border: 1px solid rgba(24, 28, 40, 0.2); background: transparent; color: var(--ink); }
.case-arrow--next { border: 0; background: var(--ink); color: var(--paper); }
.case-arrow.is-dim { opacity: 0.35; }

/* Touch screens swipe, so drop the arrows and centre the dots. */
@media (pointer: coarse) {
  .case-arrows { display: none; }
  .case-controls { justify-content: center; }
  .case-dots { margin-left: 0; }
}

/* 04 Integrations */

.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: clamp(28px, 3vw, 40px); align-items: end; }
.stack-chips { display: flex; flex-wrap: wrap; gap: clamp(8px, 0.8vw, 10px); font-family: var(--mono); font-size: clamp(13px, 1vw, 14px); }
.stack-chips span { padding: 9px 15px; border: 1px solid rgba(24, 28, 40, 0.2); border-radius: 999px; }

/* 05 Audit */

.audit { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.audit-sub { font-size: clamp(17px, 1.4vw, 18px); line-height: 1.55; color: var(--text-2); max-width: 520px; margin: clamp(22px, 2.4vw, 28px) 0 0; text-wrap: pretty; }

/* Footer */

.footer { border-top: 1px solid rgba(24, 28, 40, 0.12); padding: 28px var(--gutter) 36px; display: flex; flex-wrap: wrap; gap: 18px 24px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.footer-links a { padding: 8px 0; }

/* Mobile: swap in the portrait desktop scene. Keep this breakpoint in step
   with MOBILE_QUERY in main.js. */

@media (max-width: 767.98px) {
  .nav-links { display: none; }

  .section--work { padding-top: 44px; padding-bottom: 28px; }

  .desk--desktop { display: none; }
  .desk--mobile { display: block; }

  .desk--mobile .desk-icons { top: 16px; left: 8px; right: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .desk--mobile .desk-icon { width: auto; gap: 5px; }
  .desk--mobile .desk-icon-label { font-size: 11px; }
  .desk--mobile .icon-biz { width: 34px; height: 27px; }
  .desk--mobile .icon-inbox { width: 34px; height: 24px; margin-top: 3px; }
  .desk--mobile .icon-sheet { width: 26px; height: 30px; padding-top: 5px; }
  .desk--mobile .icon-sheet > div { height: 7px; }
  .desk--mobile .icon-folder { width: 34px; height: 26px; margin-top: 2px; }

  .desk--mobile .win--alert { right: 10px; top: 118px; width: 236px; z-index: 1; }
  .desk--mobile .alert-title { height: 20px; color: #e0e0e0; font-size: 11px; }
  .desk--mobile .alert-body { gap: 10px; padding: 10px 10px 6px; font-size: 11px; line-height: 1.4; }
  .desk--mobile .alert-icon { flex-basis: 26px; height: 26px; }
  .desk--mobile .alert-actions { padding: 2px 0 6px; }
  .desk--mobile .alert-ok { width: 66px; height: 22px; font-size: 11px; }

  .desk--mobile .win--main { left: 12px; right: 12px; top: calc(50% + 40px); transform: translateY(-50%); width: auto; z-index: 2; }
  .desk--mobile .win-menu { gap: 14px; font-size: 12px; }
  .desk--mobile .win-body { padding: 18px 16px; }
  .desk--mobile .win-prompt { font-size: 11px; }
  .desk--mobile .win-heading { font-size: 30px; margin-top: 8px; }
  .desk--mobile .win-tagline { font-size: 14px; margin-top: 4px; }
  .desk--mobile .win-desc { margin-top: 12px; }
  .desk--mobile .win-progress-label { margin-top: 16px; }
  .desk--mobile .win-progress { height: 20px; }
  .desk--mobile .win-progress-fill { background: repeating-linear-gradient(90deg, #000080 0 8px, transparent 8px 10px); }
  .desk--mobile .win-actions { justify-content: flex-start; gap: 6px; padding: 8px 4px 4px; }
  .desk--mobile .w95-btn { min-width: 0; width: 80px; height: 44px; padding: 0; }
  .desk--mobile .w95-btn--default { flex: 1; width: auto; }

  .desk--mobile .taskbar { font-size: 12px; }
  .desk--mobile .task-start > div { width: 13px; height: 13px; }
  .desk--mobile .task--active { flex: 1; min-width: 0; width: auto; }
  .desk--mobile .task-clock { margin-left: 0; padding: 0 10px; }
}

/* Audit form. A full-viewport dialog: its own background is the dim layer,
   so fading the dialog fades the backdrop and panel together. */

.audit-lock { overflow: hidden; }
.audit-dialog { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 16px; border: 0; background: rgba(24, 28, 40, 0.42); color: var(--ink); font-family: var(--sans); opacity: 0; transition: opacity .3s ease; }
.audit-dialog[open] { display: flex; }
.audit-dialog::backdrop { background: transparent; }
.audit-dialog.is-open { opacity: 1; }
.audit-panel { position: relative; margin: auto; width: min(100%, 560px); max-height: min(100%, 780px); display: flex; flex-direction: column; background: var(--paper); border-radius: 20px; box-shadow: 0 30px 80px -30px rgba(24, 28, 40, 0.5); overflow: hidden; transform: translateY(14px) scale(0.985); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.audit-dialog.is-open .audit-panel { transform: none; }

.audit-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px; }
.audit-icon { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-family: var(--sans); font-size: 22px; line-height: 1; cursor: pointer; }
.audit-close { font-size: 30px; font-weight: 300; }
@media (hover: hover) { .audit-icon:hover { background: rgba(24, 28, 40, 0.06); } }
.audit-count { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--text-3); }
.audit-progress { height: 3px; margin: 0 24px; background: rgba(24, 28, 40, 0.1); border-radius: 999px; overflow: hidden; }
.audit-progress > div { width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .35s ease; }

.audit-form { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 0; }
.audit-intro { margin-bottom: 24px; }
.audit-title { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(32px, 6vw, 40px); line-height: 1; letter-spacing: -0.02em; text-wrap: balance; }
.audit-title:focus { outline: none; }
.audit-lede { margin: 10px 0 0; font-size: 16px; line-height: 1.5; color: var(--text-2); text-wrap: pretty; }

.audit-step { display: none; min-width: 0; margin: 0; padding: 0; border: 0; }
.audit-step.is-active, .audit-done:not([hidden]) { display: block; animation: audit-in .32s ease both; }
.audit-step > :last-child:not(.audit-actions), .audit-done > :last-child:not(.audit-actions) { margin-bottom: 24px; }
@keyframes audit-in { from { opacity: 0; transform: translateY(8px); } }
/* Floated so the legend lays out like a normal block. */
.audit-q { float: left; width: 100%; margin: 0 0 16px; padding: 0; font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; text-wrap: pretty; }
.audit-q:focus { outline: none; }
.audit-q + * { clear: both; }
.audit-qn { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.audit-hint { margin: -6px 0 12px; font-size: 14px; color: var(--text-3); }

.audit-opts { display: grid; gap: 8px; }
.audit-opts--grid { grid-template-columns: 1fr 1fr; }
.audit-opt { position: relative; display: block; }
.audit-opt input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.audit-opt span { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%; min-height: 54px; padding: 12px 16px; background: #fff; border: 1px solid rgba(24, 28, 40, 0.14); border-radius: 12px; font-size: 16px; line-height: 1.3; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.audit-opt span::after { content: ''; flex: 0 0 18px; height: 18px; border: 1.5px solid rgba(24, 28, 40, 0.25); border-radius: 50%; transition: inherit; }
.audit-opt input[type="checkbox"] + span::after { border-radius: 5px; }
.audit-opt input:checked + span { background: #f1f4fe; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.audit-opt input:checked + span::after { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.audit-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .audit-opt span:hover { border-color: rgba(24, 28, 40, 0.32); } }

.audit-fields { display: grid; gap: 14px; }
.audit-field > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.audit-field em { display: block; margin-top: 2px; font-size: 13px; font-style: normal; font-weight: 400; color: var(--text-3); }
.audit-field input { width: 100%; height: 52px; padding: 0 14px; background: #fff; border: 1px solid rgba(24, 28, 40, 0.18); border-radius: 12px; font: inherit; font-size: 16px; color: var(--ink); }
.audit-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(58, 95, 224, 0.15); }
.audit-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.audit-error { margin: 14px 0 0; font-size: 14px; color: #b42318; }

/* Pinned to the bottom of the scrolling form so it stays reachable. */
.audit-actions { position: sticky; bottom: 0; margin-top: 10px; padding: 14px 0 24px; background: linear-gradient(rgba(247, 246, 242, 0), var(--paper) 14px); }
.audit-btn { width: 100%; height: 54px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; transition: opacity .2s ease; }
.audit-btn[type="submit"] { background: var(--accent); color: #fff; }
.audit-btn:disabled { opacity: 0.35; cursor: default; }
.audit-btn--ghost { background: transparent; color: var(--ink); border: 1px solid rgba(24, 28, 40, 0.2); }

.audit-done { padding-top: 6px; }
.audit-cal:not(:empty) { margin-top: 18px; background: #fff; border: 1px solid rgba(24, 28, 40, 0.12); border-radius: 14px; overflow: hidden; }
.audit-cal iframe { display: block; width: 100%; height: 640px; border: 0; }

/* Phones get the whole screen, which suits one question at a time. */
@media (max-width: 767.98px) {
  .audit-dialog { padding: 0; }
  .audit-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; box-shadow: none; transform: translateY(20px); }
  .audit-top { padding: 6px 6px 6px; }
  .audit-progress { margin: 0 20px; }
  .audit-form { padding: 22px 20px 0; }
  .audit-q { font-size: 21px; }
  .audit-opts--grid .audit-opt span { padding: 12px 14px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .audit-dialog, .audit-panel, .audit-progress > div { transition: none; }
  .audit-step.is-active, .audit-done:not([hidden]) { animation: none; }
}
