:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #0f1b33;
  --muted: #56607a;
  --line: #e1e6ef;
  --accent: #1662e8;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fe;
  --ok: #1f7a4d;
  --warn: #9a6200;
  --bad: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 18, 14, 0.05), 0 6px 24px rgba(20, 18, 14, 0.06);
  --max: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121316;
    --surface: #1a1c20;
    --surface-2: #22252b;
    --text: #ecebe7;
    --muted: #a3a29c;
    --line: #2f323a;
    --accent: #8c9bff;
    --accent-ink: #0f1020;
    --accent-soft: #252a4a;
    --ok: #5cc98f;
    --warn: #e2b04a;
    --bad: #f08a80;
    color-scheme: dark;
  }
}
/* Explicit dark choice (data-theme="dark") — same values as the media query above */
:root[data-theme="dark"] {
  --bg: #121316; --surface: #1a1c20; --surface-2: #22252b; --text: #ecebe7; --muted: #a3a29c; --line: #2f323a;
  --accent: #8c9bff; --accent-ink: #0f1020; --accent-soft: #252a4a; --ok: #5cc98f; --warn: #e2b04a; --bad: #f08a80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.section { padding: 64px 0; }
.section.tint { background: var(--surface-2); }
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 0.85rem; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav .btn { margin-left: 8px; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--text); font: inherit; }
@media (max-width: 1100px) {
  .menu-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: 600 0.95rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: transform 0.05s, background 0.15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.hero { padding: 80px 0 56px; }
.hero h1 { max-width: 15ch; }
.search { display: flex; gap: 8px; margin: 28px 0 12px; max-width: 640px; }
.search input { flex: 1; min-width: 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; box-shadow: var(--shadow); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 560px) { .search { flex-direction: column; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 6px 12px; border-radius: 999px; font: 500 0.875rem var(--font); cursor: pointer; text-decoration: none; }
.chip:hover, .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

/* Cards & grids */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--muted); }
.card .card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.875rem; }
a.card { text-decoration: none; color: inherit; transition: border-color 0.15s; }
a.card:hover { border-color: var(--accent); }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.warn { color: var(--warn); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps .card::before { counter-increment: step; content: counter(step); width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; margin-bottom: 12px; }

.split { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.15fr; } }

/* Placeholder screenshot frame */
.shot { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); position: relative; }
.shot img { width: 100%; height: auto; }
.shot figcaption { padding: 10px 14px; font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--line); }
.shot .badge { position: absolute; top: 10px; right: 10px; background: var(--warn); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: 0.04em; }

/* CTA band */
.cta { background: var(--accent); color: var(--accent-ink); border-radius: 18px; padding: 40px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.cta h2 { margin: 0 0 0.3em; }
.cta p { margin: 0; opacity: 0.9; max-width: 40rem; }
.cta .btn { background: var(--accent-ink); color: var(--accent); }
@media (max-width: 560px) { .cta { padding: 28px 20px; } }

/* Template page */
.tpl-head { padding: 48px 0 24px; }
.tpl-layout { display: grid; gap: 32px; grid-template-columns: 1fr; padding-bottom: 64px; }
@media (min-width: 960px) { .tpl-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.tpl-layout aside .card { position: sticky; top: 84px; }
.block { margin-bottom: 36px; }
.prompt { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; overflow-x: auto; }
.prompt pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 0.85rem; line-height: 1.55; }
.copy-btn { position: absolute; top: 10px; right: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.925rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--surface-2); font-weight: 600; font-size: 0.85rem; }
table.data tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
ul.clean { padding-left: 1.1em; margin: 0 0 1em; }
ul.clean li { margin-bottom: 0.35em; }
.notice { border-left: 3px solid var(--warn); background: var(--surface); padding: 12px 16px; border-radius: 0 10px 10px 0; font-size: 0.9rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Forms */
form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
form label { font-weight: 600; font-size: 0.9rem; }
form input, form select, form textarea { padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
form textarea { min-height: 110px; resize: vertical; }
.form-msg { font-size: 0.9rem; margin-top: 8px; }
.form-msg.error { color: var(--bad); }
.form-msg.ok { color: var(--ok); }

/* Team */
.person { text-align: left; }
.avatar { width: 88px; height: 88px; border-radius: 50%; background: var(--surface-2); border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 1.5rem; margin-bottom: 14px; object-fit: cover; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; font-size: 0.9rem; color: var(--muted); }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 24px 40px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 0.9rem; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }

/* Brand logo, header search, footer row (wireframe v2) */
.logo { width: 28px; height: 28px; flex: none; }
.nav-search { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--muted); }
.nav-search:hover { background: var(--surface-2); color: var(--text); }
.site-header .wrap { max-width: 1240px; }
.site-footer .cols { align-items: center; }
.foot-brand { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.socials { display: flex; gap: 16px; }
@media (max-width: 1100px) { .nav-search { display: none; } }
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--accent-ink); background: var(--accent); }

/* Contact form: access qualification question */
fieldset.access-q { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 8px; margin: 0 0 16px; }
fieldset.access-q legend { font-weight: 600; font-size: 0.9rem; padding: 0 6px; }
.access-q .radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.9rem; padding: 6px 0; cursor: pointer; }
.access-q .radio input { margin-top: 3px; accent-color: var(--accent); }
.access-hint { margin: 4px 0 6px; font-size: 0.85rem; }
.access-hint.ok { color: var(--ok); }
.access-hint.warn { color: var(--warn); }
fieldset.access-q[hidden] { display: none; }
fieldset.access-q { min-width: 0; }
form select, form input, form textarea { max-width: 100%; min-width: 0; }
.split > * { min-width: 0; }

/* The hidden attribute always wins over component display rules */
[hidden] { display: none !important; }
/* FAQ items opened from a link land below the sticky header */
details[id] { scroll-margin-top: 80px; }

/* Department picker (site.js DX_DEPT.pills): used by the hero, the worker checks and anywhere examples follow the visitor’s department */
.dx-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dx-pills-l { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.dx-pills button { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 0.82rem var(--font); cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.dx-pills button:hover { border-color: var(--accent); }
.dx-pills button.now { border-color: var(--accent); color: var(--accent); }
.dx-pills button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.dx-pills button.dx-all { border-style: dashed; color: var(--muted); }
.dx-pills button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* On the dark hero */
.hero2 .dx-pills-l { color: #9fbaff; }
.hero2 .dx-pills button { background: rgba(255,255,255,0.06); border-color: rgba(160,180,255,0.35); color: #e3ecff; }
.hero2 .dx-pills button.now { border-color: #ffd25e; color: #ffd25e; }
.hero2 .dx-pills button[aria-pressed="true"] { background: #ffd25e; border-color: #ffd25e; color: #0a1733; }
.hero2 .dx-pills button.dx-all { color: #c9d4ec; }

/* Undecided wording: shown as a flagged placeholder, never as a final claim */
.tbc { font-weight: 600; font-size: 0.92em; color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--warn) 70%, transparent); border-radius: 5px; padding: 0 5px; overflow-wrap: anywhere; }

/* Cloud / Prompt AI Worker version toggle (site.js DX_VERSION), used by the homepage and How It Works demos */
.vt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.vt-l { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.vt button { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 0.86rem var(--font); cursor: pointer; }
.vt button:hover { border-color: var(--accent); }
.vt button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.vt button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vt-d { flex: 1 1 260px; min-width: 0; font-size: 0.84rem; color: var(--muted); }

/* Department pickers as icon buttons: the pressed (or shown) department also shows its name */
.dx-pills button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; min-width: 34px; justify-content: center; padding: 5px 9px; }
.dx-pills button span { white-space: nowrap; }
.dx-pills .dx-ico { width: 17px; height: 17px; flex: none; }
.dx-pills > .dx-ico { opacity: 0.7; margin-right: 2px; }

/* A secondary call to action as a plain link (one primary button per section) */
.cta .pr-cta-link { color: inherit; font-weight: 600; text-decoration: underline; align-self: center; }

/* Version toggle tooltips (homepage demo): the description shows on hover or keyboard focus, not always */
.vt button.vt-has-tip { position: relative; }
.vt-tip { position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(260px, calc(100vw - 48px)); padding: 8px 10px; border-radius: 8px; background: var(--text); color: var(--bg); font: 400 0.8rem/1.45 var(--font); text-align: left; white-space: normal; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s; pointer-events: none; }
.vt-tip::before { content: ""; position: absolute; left: 16px; top: -5px; width: 10px; height: 10px; background: inherit; transform: rotate(45deg); }
.vt button.vt-has-tip:hover .vt-tip, .vt button.vt-has-tip:focus-visible .vt-tip { opacity: 1; visibility: visible; transform: none; }
@media (prefers-reduced-motion: reduce) { .vt-tip { transition: none; } }

/* Site-wide specification banner (replaces per-item draft labels) */
.spec-banner { background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--line); font-size: 0.82rem; line-height: 1.4; }
.spec-banner .wrap { padding-block: 7px; text-align: center; }

/* About: founder profiles */
.founders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.founder { display: grid; gap: 12px; min-width: 0; }
.founder p { margin: 0; line-height: 1.6; }
.fd-head { display: flex; align-items: center; gap: 16px; }
.fd-head .avatar { margin: 0; flex: none; width: 72px; height: 72px; font-size: 1.25rem; border-style: solid; color: var(--accent); }
.fd-head h3 { margin: 0; }
.fd-role { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.fd-tags { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fd-tags li { font-size: 0.8rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.fd-more summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.92rem; }
.fd-more[open] summary { margin-bottom: 10px; }
.fd-more p + p { margin-top: 10px; }
.fd-head img.avatar { border: 0; background: var(--surface-2); }
/* v3: the second toggle button's tooltip opens leftwards so it never pushes past the screen edge */
.vt button.vt-has-tip:last-of-type .vt-tip { left: auto; right: 0; }
.vt button.vt-has-tip:last-of-type .vt-tip::before { left: auto; right: 16px; }
