/* zerodesk.cc: geometric, minimal. Tokens follow a white page, ink not
   pure black, neutral greys and one blue accent. */
@font-face {
  font-family: "Sora Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/fonts/sora-latin.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
:root {
  --page: #ffffff;
  --card: #f5f5f7;
  --ink: #1c1b19;
  --body: #3a3a3c;
  --sub: #6e6e73;
  --hint: #a1a1a6;
  --blue: #3a5bd9;
  --link: #3a5bd9;
  --line: rgba(28, 27, 25, 0.08);
  --field-line: rgba(28, 27, 25, 0.16);
  --glass: rgba(255, 255, 255, 0.95);
  --shadow: 0 14px 40px rgba(28, 27, 25, 0.1), 0 1px 3px rgba(28, 27, 25, 0.06);
  --error: #b3261e;
  --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui;
  --display: "Sora Variable", var(--sys);
  --cjk: "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 48px);
  --max: 1080px;
  --r-lg: 14px;
  --r-md: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-line: cubic-bezier(0.45, 0, 0.15, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #1c1b19;
    --card: #2a2a2c;
    --ink: #f5f5f7;
    --body: #d9d9de;
    --sub: #a1a1a6;
    --hint: #6e6e73;
    --blue: #6b86f0;
    --link: #93a6f5;
    --line: rgba(245, 245, 247, 0.1);
    --field-line: rgba(245, 245, 247, 0.18);
    --glass: rgba(28, 27, 25, 0.86);
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
    --error: #f2b8b5;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--body);
  font-family: var(--sys), var(--cjk);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul, ol { margin: 0; }
h1, h2 { text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

/* Header: sticky glass, hairline below */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 24px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
/* The mark: an ink tile, the Z in the page colour, the zero as a blue ball (the lighter blue on the dark tile). */
.brand-mark { flex: none; width: 24px; height: 24px; }
.brand-mark rect { fill: var(--ink); }
.brand-mark path { fill: var(--page); }
.brand-mark circle { fill: #6b86f0; }
@media (prefers-color-scheme: dark) { .brand-mark circle { fill: #3a5bd9; } }
.nav { display: flex; gap: 24px; margin-left: auto; font-size: 14px; color: var(--sub); }
.nav a { position: relative; white-space: nowrap; padding-block: 8px; transition: color 0.2s ease; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 1px; background: var(--blue); }
.nav .short { display: none; }

/* Screens */
main { flex: 1; display: flex; }
.screen { width: 100%; display: flex; align-items: center; padding-block: clamp(40px, 7vw, 96px); }
.screen > .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; gap: clamp(32px, 6vw, 96px); }
.screen-wide > .wrap { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.5fr); align-items: start; }
.copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; min-width: 0; }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; min-width: 0; }
h1 {
  font-family: var(--display), var(--cjk); font-weight: 600; color: var(--ink);
  font-size: clamp(40px, 6vw, 72px); line-height: 1.02; letter-spacing: -0.04em;
}
html:lang(zh-Hans) h1, html:lang(ja) h1 { font-weight: 700; letter-spacing: 0.01em; line-height: 1.2; }
h2 { font-family: var(--display), var(--cjk); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; color: var(--ink); line-height: 1.3; }
.lead { max-width: 30em; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; color: var(--sub); }
.note { font-size: 14px; color: var(--sub); max-width: 34em; }
.art { display: flex; justify-content: center; min-width: 0; }
.screen-wide .art { padding-top: 24px; }
.motif { width: clamp(160px, 24vw, 300px); height: auto; overflow: visible; }
.screen-wide .motif { width: clamp(120px, 16vw, 200px); }

/* Motif: hairlines in their own box, exactly one blue ball, drawn on reveal.
   Chrome measures dashes in screen space under non-scaling-stroke, so the
   dash is 2 path lengths: enough up to twice the viewBox size. */
.k0 { --k: 0; } .k1 { --k: 1; } .k2 { --k: 2; } .k3 { --k: 3; }
.k4 { --k: 4; } .k5 { --k: 5; } .k6 { --k: 6; } .k7 { --k: 7; }
.motif .mf { fill: none; stroke: var(--hint); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-opacity: 0.55; stroke-dasharray: 2; }
.motif .mf-blue { stroke: var(--blue); stroke-opacity: 0.7; }
.motif .mf-ball { fill: var(--blue); transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .motif .mf { stroke-dashoffset: 2; opacity: 0; }
  .motif .mf-ball { opacity: 0; transform: scale(0.2); }
  .motif.in .mf { animation: draw 0.8s var(--ease-line) calc(var(--k) * 260ms + 120ms) forwards; }
  .motif.in .mf-ball { animation: ball 0.7s var(--ease) calc(var(--k) * 260ms + 120ms) forwards; }
  .screen .copy { transition: opacity 0.2s ease, transform 0.35s var(--ease); }
  .screen.leaving .copy, .screen.entering .copy { opacity: 0; transform: translateY(8px); }
  .panel { animation: rise 0.35s var(--ease); }
}
@keyframes draw { from { stroke-dashoffset: 2; opacity: 0; } 30% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes ball { to { opacity: 1; transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px; border: 0; border-radius: 999px;
  font-size: 16px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.1s ease-out;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-dark { background: var(--ink); color: var(--page); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--field-line); }
.btn-line:hover { box-shadow: inset 0 0 0 1px var(--sub); }
.btn-small { min-height: 36px; padding: 0 16px; font-size: 14px; }
.text-link { background: none; border: 0; padding: 0; color: var(--link); font-size: 15px; cursor: pointer; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link.danger { color: var(--error); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Status lines */
.status { min-height: 1.6em; font-size: 15px; color: var(--sub); transition: opacity 0.14s ease; }
.status.error { color: var(--error); }
.status.hidden { opacity: 0; }

/* Device rows */
.rows { list-style: none; padding: 0; width: 100%; border-top: 1px solid var(--line); }
.rows li { display: flex; align-items: center; gap: 16px; padding-block: 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.row-main { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.row-title { font-family: var(--display), var(--cjk); font-weight: 600; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
.row-sub { font-size: 14px; line-height: 1.3; color: var(--sub); overflow-wrap: anywhere; }
.row-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.tag { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 20px; color: var(--ink); box-shadow: inset 0 0 0 1px var(--field-line); }

/* Add a device */
.title-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; }
.steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; font-size: 15px; color: var(--sub); }
.steps li { display: flex; align-items: center; gap: 10px; transition: color 0.2s ease; }
.steps .num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-family: var(--display); font-size: 13px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--field-line); transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.steps li.on { color: var(--ink); }
.steps li.on .num { background: var(--ink); color: var(--page); box-shadow: none; }
.steps li.done .num { background: var(--blue); color: #fff; box-shadow: none; }
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.type {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0;
  padding: 20px; border: 0; border-radius: var(--r-lg); background: var(--card); color: var(--ink);
  text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.2s ease, transform 0.1s ease-out;
}
.type:hover { box-shadow: inset 0 0 0 1px var(--field-line); }
.type:active { transform: scale(0.98); }
.type[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--blue); }
.type-t { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.25; }
.type-s { font-size: 14px; color: var(--sub); line-height: 1.4; }
.panel { width: 100%; padding: 24px; border-radius: var(--r-lg); background: var(--card); min-width: 0; }
.panel > .stack { gap: 16px; }
.cmd { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 8px 8px 8px 16px; border-radius: var(--r-md); background: var(--page); }
.cmd code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 14px; line-height: 1.5; color: var(--ink); }
.howto { padding-left: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.5; }
.howto li::marker { color: var(--sub); }
.howto li .cmd { margin-top: 12px; }
.opts { width: 100%; }
.opts summary { cursor: pointer; font-size: 15px; color: var(--ink); width: max-content; }
.opts[open] summary { margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 12px; width: 100%; font-size: 14px; color: var(--ink); }
.field input {
  width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-md);
  font: inherit; font-size: 15px; color: var(--ink); background: var(--page);
  box-shadow: inset 0 0 0 1px var(--field-line); transition: box-shadow 0.2s ease;
}
.field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.field small { font-size: 13px; line-height: 1.4; color: var(--sub); }
.wait-row { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.wait-t { font-family: var(--display), var(--cjk); font-weight: 600; font-size: 18px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse 1.6s ease-in-out infinite; }
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
.wait > * + * { margin-top: 12px; }

.agent-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; width: 100%; }
.agent-row .field { flex: 1 1 200px; }
.agent-row .btn { white-space: normal; text-align: center; max-width: 100%; line-height: 1.3; padding-block: 8px; }

/* Code entry */
.code-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.code-input {
  width: 13ch; min-height: 56px; padding: 0 20px;
  font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink);
  background: var(--card); border: 0; border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}
.code-input::placeholder { color: var(--sub); opacity: 0.6; }
.code-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.code-input:disabled { opacity: 0.6; }

/* Account */
.key-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; width: 100%; }
.key-form .field { flex: 1 1 260px; }
.key-form .field input { background: var(--card); box-shadow: inset 0 0 0 1px transparent; font-family: var(--mono); }
.key-form .field input:focus { box-shadow: inset 0 0 0 2px var(--blue); }
.qr { width: 168px; height: 168px; padding: 12px; border-radius: var(--r-md); background: #ffffff; }
.qr svg { display: block; width: 100%; height: 100%; }

/* Dialog */
.dialog {
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-lg);
  background: var(--page); color: var(--body); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(28, 27, 25, 0.32); }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.dialog-body p { font-size: 15px; color: var(--sub); overflow-wrap: anywhere; }
.dialog-body h2 { overflow-wrap: anywhere; }
.dialog .cmd { background: var(--card); }
.dialog .cmd code { font-size: 16px; letter-spacing: 0.04em; }
.choices { display: flex; flex-direction: column; gap: 12px; }
.choices .type { width: 100%; }
.choices .type-s { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .dialog[open] { animation: rise 0.3s var(--ease); }
}

footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-block: 20px; font-size: 14px; color: var(--sub); }
footer .text-link { font-size: 14px; }

/* Guide popover (driver.js), in the same tokens */
.driver-popover.zd-pop {
  background: var(--page); color: var(--body); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 24px; max-width: 320px; font-family: var(--sys), var(--cjk);
}
.driver-popover.zd-pop .driver-popover-title { font-family: var(--display), var(--cjk); font-weight: 600; font-size: 18px; color: var(--ink); line-height: 1.3; }
.driver-popover.zd-pop .driver-popover-description { font-size: 15px; color: var(--sub); line-height: 1.5; margin-top: 8px; }
.driver-popover.zd-pop .driver-popover-progress-text { font-size: 13px; color: var(--sub); }
.driver-popover.zd-pop .driver-popover-footer { margin-top: 20px; gap: 12px; }
.driver-popover.zd-pop .driver-popover-navigation-btns { gap: 8px; }
.driver-popover.zd-pop .driver-popover-footer button {
  min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 500;
  text-shadow: none; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--field-line);
}
.driver-popover.zd-pop .driver-popover-footer .driver-popover-next-btn { background: var(--ink); color: var(--page); box-shadow: none; }
.driver-popover.zd-pop .driver-popover-close-btn { color: var(--sub); width: 36px; height: 36px; }
.driver-popover.zd-pop .driver-popover-arrow { border-color: var(--page); }
.driver-popover.zd-pop .driver-popover-arrow-side-left { border-color: transparent transparent transparent var(--page); }
.driver-popover.zd-pop .driver-popover-arrow-side-right { border-color: transparent var(--page) transparent transparent; }
.driver-popover.zd-pop .driver-popover-arrow-side-top { border-color: var(--page) transparent transparent transparent; }
.driver-popover.zd-pop .driver-popover-arrow-side-bottom { border-color: transparent transparent var(--page) transparent; }

@media (max-width: 760px) {
  .screen { align-items: flex-start; padding-block: 32px 48px; }
  .screen > .wrap, .screen-wide > .wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .art { order: -1; justify-content: flex-start; }
  .screen-wide .art { padding-top: 0; }
  .motif, .screen-wide .motif { width: 104px; }
  .nav { gap: 16px; }
  .nav .wide { display: none; }
  .nav .long { display: none; }
  .nav .short { display: inline; }
  .bar { gap: 16px; }
  .types { grid-template-columns: minmax(0, 1fr); }
  .rows li { flex-wrap: wrap; }
  .row-main { flex-basis: 100%; }
  .panel { padding: 20px; }
}
