/* Page structure: nav band and footer slab bookend an aluminium middle. */

.container { width: 100%; max-width: calc(var(--content-width) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* Nav band */
.band { background: var(--band); color: var(--on-band); }
.nav { display: flex; align-items: center; gap: var(--space-6); min-height: 64px; }
.nav-links { display: flex; align-items: center; gap: var(--space-4); margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--on-band); text-decoration: none; padding: var(--space-2) 0; border-bottom: 2px solid transparent;
}
.nav-link:hover, .nav-link[aria-current="page"] { border-bottom-color: var(--on-band); }
.nav-link:focus-visible { outline-color: var(--on-band); }
.band .sp-btn { color: var(--on-band); border-color: var(--on-band); }
.band .sp-btn:hover { background: transparent; text-decoration: underline; }
.nav-meta { font-family: var(--font-mono); font-size: 12px; color: var(--on-band); white-space: nowrap; }
@media (max-width: 720px) {
  .nav { gap: var(--space-3); padding-top: var(--space-2); padding-bottom: var(--space-2); }
  .nav-links { gap: var(--space-3); }
}
/* Below this the lockup and every link no longer fit on one line */
@media (max-width: 960px) { .nav-links .nav-secondary { display: none; } }

/* Lockup: mark then wordmark, 12px apart, mark 1.35x the wordmark's cap height */
.lockup { display: inline-flex; align-items: center; gap: var(--space-3); color: inherit; text-decoration: none; }
.lockup svg { width: 30px; height: 30px; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-stretch: 125%; letter-spacing: 0.02em; font-size: 22px; line-height: 1; text-transform: uppercase; }
/* CLICKWORK is long: on a narrow phone the lockup shrinks and Create account goes (the page has its own sign-up buttons) */
@media (max-width: 420px) {
  .lockup { gap: var(--space-2); }
  .lockup svg { width: 24px; height: 24px; }
  .wordmark { font-size: 17px; }
  .nav-links .nav-wide { display: none; }
}

/* Footer slab */
.slab { margin-top: var(--space-12); padding: var(--space-8) 0; }
.slab-inner { display: flex; flex-wrap: wrap; gap: var(--space-6); justify-content: space-between; align-items: flex-start; }
.slab p, .slab a, .slab-links span { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--on-band); }
.slab-links { display: flex; gap: var(--space-4); flex-wrap: wrap; }

/* Page */
.page { padding-top: var(--space-12); display: flex; flex-direction: column; gap: var(--space-12); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-6); }
.page-head .lede { max-width: 640px; margin-top: var(--space-3); }
.page-head > div { min-width: 0; }
.page-head h1 { overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.section { display: flex; flex-direction: column; gap: var(--space-6); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-4); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.cluster-end { justify-content: flex-end; }

.grid { display: grid; gap: var(--space-4); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-span-2 { grid-column: span 2; }
@media (max-width: 960px) { .grid-span-2 { grid-column: auto; } }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* Home: the headline and pitch above the demo, which spans the page */
.hero-band { display: flex; flex-direction: column; gap: var(--space-8); }
.hero { padding-top: var(--space-8); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8); align-items: end; }
.hero-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); container-type: inline-size; }
.hero-aside { display: grid; gap: var(--space-6); }
/* The headline shrinks to fit its column: "THE CLICKWORK" is about 9.5em wide */
.hero h1 { font-size: min(92px, 10.2cqi); }
.hero .body-l { max-width: 640px; }
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero h1 { font-size: min(72px, 10.2cqi); }
}
.feature { display: flex; gap: var(--space-3); align-items: flex-start; }
.feature h3 { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: var(--space-1); }
.feature p { color: var(--etch); }
.step-text { color: var(--etch); }

/* Tool calls in the home demo's chat: the call, then its result under it */
.session-call { color: var(--etch); }
.session-tool { color: var(--ink); font-weight: 500; }
.session-result { color: var(--etch); padding-left: var(--space-4); }
.session-result::before { content: "└ "; margin-left: calc(-1 * var(--space-4)); }

/* Home demo: an agent's chat beside the Mac it is driving. The screen is an SVG in the machine's own pixels. */
.demo { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-4); align-items: stretch; }
.demo-chat .sp-plate-title, .demo-screen .sp-plate-title { font-size: 18px; }
.demo-log-wrap { position: relative; flex: 1; min-height: 240px; }
.demo-log {
  position: absolute; inset: 0; overflow-y: auto; margin: 0; padding: var(--space-4); list-style: none;
  display: flex; flex-direction: column; gap: var(--space-3); scrollbar-width: thin;
}
.demo-log > li { animation: demo-in 240ms ease-out; }
.demo-log > li.is-pending { display: none; }
.demo-user {
  align-self: flex-end; max-width: 88%; padding: var(--space-3); background: var(--band); color: var(--on-band);
  font-size: 15px; line-height: 1.45;
}
.demo-say { font-size: 15px; line-height: 1.45; }
.demo-tool { display: flex; gap: var(--space-2); align-items: flex-start; font-family: var(--font-mono); font-size: 12px; line-height: 1.55; }
.demo-tool .sp-icon { margin-top: 2px; }
.demo-tool-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.demo-tool.is-running .sp-icon { color: var(--on-signal); background: var(--signal); outline: 3px solid var(--signal); }
.demo-tool.is-running .session-result { visibility: hidden; }
.demo-composer {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  margin: 0 var(--space-4) var(--space-4); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border: var(--stroke-hair) solid var(--rule); color: var(--etch); font-size: 15px;
}
.demo-send { display: grid; place-items: center; width: 28px; height: 28px; background: var(--ink); color: var(--plate); font-family: var(--font-mono); }
.demo-toggle { cursor: pointer; }
.demo-toggle:hover { background: var(--ink); color: var(--plate); }
.demo-display { padding: var(--space-3); background: var(--band); }
.demo-svg { width: 100%; height: auto; aspect-ratio: 16 / 10; }
@media (max-width: 960px) {
  .demo { grid-template-columns: minmax(0, 1fr); }
  .demo-screen { order: -1; }
  .demo-log-wrap { flex: none; height: 320px; }
}
@media (max-width: 640px) { .demo-display { padding: var(--space-2); } }
@media (max-width: 480px) { .demo .demo-os { display: none; } }

.demo-svg .is-hidden { opacity: 0; }
.demo-win, .demo-pane, .demo-overlay, .demo-caret, .demo-ghost { transition: opacity 260ms ease, transform 260ms ease; }
.demo-win { transform-box: fill-box; transform-origin: center; }
.demo-win.is-hidden { transform: scale(0.94); pointer-events: none; }
.demo-overlay { transition-duration: 500ms; }
.demo-cursor, .demo-ghost { transition: transform 700ms cubic-bezier(0.45, 0, 0.2, 1), opacity 200ms ease; }
.demo-cursor.is-slow, .demo-ghost.is-slow { transition-duration: 1100ms; }
.demo-cursor.is-instant { transition: none; }
.demo-ripple circle { opacity: 0; transform-box: fill-box; transform-origin: center; }
.demo-ripple.is-clicking circle { animation: demo-ripple 500ms ease-out; }
.demo-flash { opacity: 0; pointer-events: none; }
.demo-flash.is-flashing { animation: demo-flash 450ms ease-out; }
.demo-folder { transform-box: fill-box; transform-origin: center; transition: transform 200ms ease, filter 200ms ease; }
.demo-folder.is-target { transform: scale(1.08); filter: brightness(1.12); }
.demo-dock-icon { transform-box: fill-box; transform-origin: center bottom; transition: opacity 300ms ease, transform 300ms ease; }
.demo-dock-icon.is-hidden { transform: scale(0.2); }
.demo-dock-icon.is-bouncing { animation: demo-bounce 700ms ease-in-out; }
.demo-field { transition: stroke 150ms ease, stroke-width 150ms ease; }
.demo-field.is-focused { stroke: #0A84FF; stroke-width: 3.5; }
.demo-caret:not(.is-hidden) { animation: demo-blink 1s steps(1) infinite; }
.demo-button.is-pressed { animation: demo-press 250ms ease-out; }
@keyframes demo-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes demo-ripple { from { opacity: 1; transform: scale(0.3); } to { opacity: 0; transform: scale(1.5); } }
@keyframes demo-flash { from { opacity: 0.7; } to { opacity: 0; } }
@keyframes demo-bounce { 0%, 100% { transform: none; } 30% { transform: translateY(-26px); } 55% { transform: none; } 75% { transform: translateY(-10px); } }
@keyframes demo-blink { 50% { opacity: 0; } }
@keyframes demo-press { 50% { filter: brightness(0.8); } }
@media (prefers-reduced-motion: reduce) {
  .demo-log > li, .demo-caret:not(.is-hidden) { animation: none; }
}

/* Questions */
.faq { border-bottom: var(--stroke-hair) dashed var(--rule); }
.faq:last-child { border-bottom: 0; }
.faq summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4);
  padding: var(--space-4); cursor: pointer; list-style: none;
  font-weight: 700; font-size: 18px; line-height: 1.2; font-stretch: 115%; text-transform: uppercase;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); font-weight: 500; flex: none; }
.faq[open] summary::after { content: "−"; }
.faq summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.faq summary:focus-visible { outline-offset: -4px; }
.faq p { padding: 0 var(--space-4) var(--space-4); max-width: 760px; color: var(--etch); }

/* Closing call to action: a nav-band slab inside the page */
.cta { padding: var(--space-12) var(--space-8); display: grid; gap: var(--space-6); justify-items: start; }
.cta .body-l { max-width: 640px; }
@media (max-width: 720px) { .cta { padding: var(--space-8) var(--space-4); } }

/* Auth */
.auth { max-width: 440px; margin: var(--space-12) auto 0; width: 100%; }
.form-grid { display: grid; gap: var(--space-4); }
.auth-note { margin-top: var(--space-4); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* Machine screen */
.screen {
  position: relative; background: var(--band); border: var(--stroke-frame) solid var(--ink);
  aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden;
}
.screen > img, .screen > div { width: 100%; height: 100%; }
.screen > img { object-fit: contain; }
.screen-status { position: absolute; inset: auto var(--space-3) var(--space-3) auto; }
.screen-status .sp-tag { color: var(--on-band); border-color: var(--on-band); background: var(--band); }
.screen-empty { color: var(--on-band); font-family: var(--font-mono); font-size: 12px; text-align: center; padding: var(--space-4); }

.secret { font-family: var(--font-mono); font-size: 13px; padding: var(--space-3); background: var(--alu); border: var(--stroke-hair) dashed var(--rule); overflow-wrap: anywhere; }

/* API keys: one tbody per key, its setup in a row under it */
.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
@media (max-width: 720px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.cell-stack { display: flex; flex-direction: column; }
.key-os { font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.api-keys tbody td { border-bottom: 0; }
.api-keys .cluster { flex-wrap: nowrap; }
.api-keys tbody + tbody { border-top: var(--stroke-hair) dashed var(--rule); }
.key-connect-row > td { padding-top: 0; padding-bottom: var(--space-4); }
.key-connect {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-4); align-items: start;
  padding: var(--space-4); border: var(--stroke-frame) solid var(--ink); background: var(--alu);
}
.key-connect > .stack > p:not(.sp-field-hint, .spec, .secret) { font-family: var(--font-display); font-size: 15px; }
.key-connect .secret { background: var(--plate); }
@media (max-width: 960px) { .key-connect { grid-template-columns: minmax(0, 1fr); } }
.key-mismatch { color: var(--fault); }
.key-slot { background: var(--signal); color: var(--on-signal); padding: 0 2px; }

/* Machine grid: operating systems by size, each box a machine an API key may start */
.machine-grid { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.machine-grid-title {
  padding: 0; margin-bottom: var(--space-1);
  font-weight: 700; font-size: 18px; line-height: 1.15; font-stretch: 115%; text-transform: uppercase;
}
.machine-grid-scroll { overflow-x: auto; }
.machine-grid-table { display: flex; flex-direction: column; gap: var(--space-2); }
.machine-grid-row {
  display: grid; grid-template-columns: minmax(180px, 1.2fr); grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr);
  gap: var(--space-2); align-items: stretch;
}
.machine-grid-size { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--etch); padding-top: var(--space-2); }
.machine-grid-os { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) 0; border-top: var(--stroke-hair) dashed var(--rule); }
.machine-grid-os .cluster { gap: 0; margin-left: calc(-1 * var(--space-2)); }
.machine-grid-os-name { font-weight: 700; font-size: 18px; line-height: 1.15; font-stretch: 115%; text-transform: uppercase; }
.machine-box {
  position: relative; /* keeps its visually hidden label inside the grid's scroll box */
  display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-3);
  border: var(--stroke-frame) solid var(--rule); background: var(--plate); cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
}
.machine-box:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.machine-box input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.machine-box input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.machine-box-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.machine-box-price { font-size: 13px; font-weight: 500; }
.machine-box-minimum { font-size: 11px; color: var(--etch); }
.machine-box-none { justify-content: center; align-items: center; border: var(--stroke-hair) dashed var(--rule); background: transparent; color: var(--etch); cursor: default; }
