/* Claudock's own tokens (src/renderer/styles/tokens.css). Clay is for small indicators only. */
:root {
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', Times, serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Courier New', monospace;

  color-scheme: light dark;
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-sunken: #f0eee6;
  --text: #141413;
  --text-2: #5e5d59;
  --text-3: #73726c;
  --border: rgba(31, 30, 29, 0.15);
  --border-strong: rgba(31, 30, 29, 0.3);
  --hover: rgba(115, 114, 108, 0.1);
  --accent: #d97757;
  --primary-bg: #141413;
  --primary-fg: #faf9f5;
  --focus: #2a78d6;
  --shadow: 0 24px 60px -12px rgba(20, 20, 19, 0.28), 0 2px 6px rgba(20, 20, 19, 0.08);
  /* the terminal the hero opens on: dark in both themes */
  --term: #1a1918;
  --term-text: #e8e6dc;
  --term-dir: #9fbbe0;

  --gutter: 24px;
  --max: 1440px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262624;
    --surface: #30302e;
    --surface-sunken: #1a1918;
    --text: #faf9f5;
    --text-2: #c2c0b6;
    --text-3: #9c9a92;
    --border: rgba(222, 220, 209, 0.15);
    --border-strong: rgba(222, 220, 209, 0.3);
    --hover: rgba(222, 220, 209, 0.08);
    --primary-bg: #faf9f5;
    --primary-fg: #141413;
    --focus: #6a9bcc;
    --shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    --term: #121211;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
code, pre { font-family: var(--font-mono); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2 { font-family: var(--font-serif); font-weight: 400; margin: 0; letter-spacing: -0.015em; }

.bar, main, .foot { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 22px/1 var(--font-serif); letter-spacing: -0.01em; }
.brand .mark { flex: none; }
.bar-link { font-size: 15px; color: var(--text-2); text-decoration: none; padding: 8px 0; }
.bar-link:hover { color: var(--text); }

/* Hero: copy on the left, the app window on the right. With .motion it opens as a terminal (motion.js). */
.hero { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 48px; align-items: center; min-height: calc(100vh - 64px - 24px); min-height: calc(100svh - 64px - 24px); padding: 0 0 24px; }
h1 { font-size: clamp(36px, 3.8vw, 56px); line-height: 1.08; letter-spacing: -0.02em; }
.ln { display: block; white-space: nowrap; }
.path { color: var(--text-2); }
.hero-copy { position: relative; }
.caps { position: absolute; inset: 0; pointer-events: none; display: none; }
.cap { position: absolute; left: 0; top: 50%; margin: 0; transform: translateY(-50%); font: clamp(44px, 5vw, 76px)/1 var(--font-serif); letter-spacing: -0.025em; visibility: hidden; }

.get { margin-top: 36px; }
/* npx claudock is the main install, in the place and size of a button; links to the other two ways sit under it */
.npx {
  display: inline-flex; align-items: center; gap: 16px; max-width: 100%;
  height: 52px; padding: 0 8px 0 20px;
  background: var(--term); color: var(--term-text); border-radius: 10px;
}
.npx code { background: none; padding: 0; font-size: 17px; white-space: nowrap; user-select: all; -webkit-user-select: all; }
.npx code b { color: var(--accent); font-weight: 400; user-select: none; -webkit-user-select: none; }
.npx-copy {
  flex: none; height: 36px; padding: 0 12px; font: 13px var(--font-sans); cursor: pointer;
  color: var(--term-text); background: transparent; border: 1px solid rgba(232, 230, 220, 0.3); border-radius: 7px;
}
.npx-copy:hover { background: rgba(232, 230, 220, 0.1); }
.npx-copy:focus-visible { outline-color: #6a9bcc; }
.npx-copy[hidden] { display: none; }
/* the other two ways in, as links to the Install section */
.inst { margin: 16px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; font-size: 15px; }
.inst a { padding: 4px 0; }

.win { position: relative; aspect-ratio: 1600 / 900; border-radius: 12px; overflow: hidden; background: var(--bg); box-shadow: var(--shadow); outline: 1px solid var(--border); outline-offset: -1px; }
.cam { position: absolute; inset: 0; transform-origin: 0 0; }
.screen { position: absolute; inset: 0; }
.screen > picture { display: block; height: 100%; }
.screen img { width: 100%; height: 100%; }
/* The Today screenshot's limits come from the fixture: this label sits under the weekly meter, and the next screen
   wipes over it */
.demo-data { position: absolute; top: 70.3%; right: 9.7%; transform: translateY(-50%); padding: 1px 6px; font: 11px/1.5 var(--font-mono); color: var(--text-2); background: var(--bg); border: 1px solid var(--border); border-radius: 5px; }
.screen + .screen { visibility: hidden; }
.term, .lines { display: none; }

.motion:not(.motion-ready) .hero-intro, .motion:not(.motion-ready) .win, .motion:not(.motion-ready) .mark-wave { visibility: hidden; }
.motion .caps { display: block; }
.motion .screen + .screen { visibility: visible; }
.motion .term { display: block; position: absolute; inset: 0; background: var(--term); color: var(--term-text); }
.motion .lines { display: block; position: absolute; inset: 0; }
.term .dots { position: absolute; left: 3%; top: 4%; display: flex; gap: 7px; }
.term .dots i { width: 11px; height: 11px; border-radius: 50%; background: #3d3d3a; }
.prompt { position: absolute; left: 6%; top: 12%; font-family: var(--font-mono); white-space: nowrap; transform: translateY(-50%); }
.prompt b { color: var(--accent); font-weight: 400; }
.caret { display: inline-block; width: 0.55em; height: 1.1em; margin-left: 4px; vertical-align: -0.18em; background: var(--accent); }
.line { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.line span { position: absolute; left: 0; top: 0; transform: translateY(-50%); white-space: nowrap; }
.line .fn { font-family: var(--font-mono); color: var(--term-text); }
.line .fn.dir { color: var(--term-dir); }
.line .lb { color: var(--text); opacity: 0; }

/* File names drifting under the hero; motion.js ties their speed to scrolling */
.marquee { margin-top: 64px; overflow: hidden; display: grid; gap: 4px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.track { display: flex; gap: 44px; width: max-content; font: clamp(26px, 3.6vw, 52px)/1.25 var(--font-mono); color: var(--text-3); white-space: nowrap; will-change: transform; }
.track span:nth-child(3n+1) { color: var(--text); }

/* Launch film: sound and pause buttons in the bottom right */
.film { position: relative; max-width: 1180px; margin: 96px auto 0; border-radius: 12px; overflow: hidden; background: #1a1918; box-shadow: var(--shadow); outline: 1px solid var(--border); outline-offset: -1px; aspect-ratio: 16 / 9; }
.film video { width: 100%; height: 100%; object-fit: cover; }
.film-controls { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 8px; }
.toggle {
  width: 36px; height: 36px;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  color: #faf9f5; background: rgba(20, 20, 19, 0.6); border: 1px solid rgba(250, 249, 245, 0.25); border-radius: 50%;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.15s ease;
}
.film:hover .toggle, .toggle:focus-visible { opacity: 1; }
.toggle[data-playing='false'], .toggle[aria-pressed='true'] { opacity: 1; }
.toggle[hidden] { display: none; }
.toggle .i-play, .toggle .i-sound { display: none; }
.toggle[data-playing='false'] .i-pause, .toggle[aria-pressed='true'] .i-muted { display: none; }
.toggle[data-playing='false'] .i-play, .toggle[aria-pressed='true'] .i-sound { display: block; }
.toggle:focus-visible { outline-color: #6a9bcc; }
@media (hover: none) { .toggle { opacity: 1; } }

/* Install: npx, the install script, the installers, in that order */
.install { margin-top: 120px; }
.ways { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--border); }
.ways > li { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 12px 32px; padding: 28px 0; border-bottom: 1px solid var(--border); align-items: baseline; scroll-margin-top: 24px; }
.ways h3 { margin: 0; font: 22px/1.25 var(--font-serif); letter-spacing: -0.01em; font-weight: 400; display: flex; gap: 12px; align-items: baseline; }
.ways h3::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.way { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.way .cmd {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 100%;
  min-height: 52px; padding: 8px 8px 8px 20px;
  background: var(--term); color: var(--term-text); border-radius: 10px;
}
.way .cmd code { min-width: 0; background: none; padding: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.way .cmd code b { color: var(--accent); font-weight: 400; user-select: none; -webkit-user-select: none; }
.way .os { margin: 6px 0 -4px; font-size: 14px; color: var(--text-3); }
.way .os:first-child { margin-top: 0; }
.dl { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.dl a { padding: 4px 0; }
.steps { margin: 6px 0 0; display: grid; gap: 8px; color: var(--text-2); max-width: 68ch; }
.steps div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 12px; }
.steps dt { color: var(--text); font-weight: 600; }
.steps dd { margin: 0; }
.steps strong { color: var(--text); font-weight: 600; }
.steps code { overflow-wrap: anywhere; }

/* Safe by design */
.safe { margin-top: 120px; }
h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.15; }
.safe-body { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 28px; }
.safe-icon { display: none; }
.motion .safe-body { grid-template-columns: 200px minmax(0, 1fr); gap: 32px; }
.motion .safe-icon { display: grid; place-items: center; position: sticky; top: calc(50vh - 80px); height: 160px; }
.safe-icon svg { width: 120px; height: 120px; overflow: visible; }
.safe-icon .glyph { fill: var(--text); }
.safe-icon .spark { fill: var(--accent); }
.safe ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.motion .safe li { padding: 44px 0; }
.safe li { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 8px 32px; padding: 20px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.safe li strong { font: 22px/1.25 var(--font-serif); letter-spacing: -0.01em; font-weight: 400; display: flex; gap: 12px; align-items: baseline; }
.safe li strong::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.safe li span { color: var(--text-2); }
code { font-size: 0.9em; background: var(--surface-sunken); padding: 1px 6px; border-radius: 5px; }

/* Try it */
.try { margin-top: 120px; }
.try-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.req { margin: 0; font: 13px/1 var(--font-mono); color: var(--text-3); }
.code { position: relative; margin-top: 24px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 12px; }
.code pre { margin: 0; padding: 22px 24px; overflow-x: auto; font-size: 15px; line-height: 1.8; -webkit-overflow-scrolling: touch; }
.code pre code { background: none; padding: 0; font-size: inherit; }
.code .cl { display: inline-block; }
.copy { position: absolute; top: 12px; right: 12px; height: 32px; padding: 0 12px; font: 13px var(--font-sans); color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; }
.copy:hover { background: var(--hover); }
.copy[hidden] { display: none; }

/* Footer */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 120px; padding-block: 28px 40px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-3); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot a { color: var(--text-2); }
.foot p { margin: 0; }

/* Narrow screens */
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 8px; min-height: 0; }
  .motion .hero { height: calc(100svh - 64px); gap: 20px; align-content: center; padding: 0; }
  .motion .hero-copy { min-height: 210px; }
  .film { margin-top: 72px; }
  h1 { font-size: clamp(34px, 8.6vw, 60px); }
  .get { margin-top: 28px; }
  .install, .safe, .try, .foot { margin-top: 88px; }
  .motion .safe-body { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; }
  .motion .safe-icon { height: 72px; top: calc(50vh - 36px); }
  .safe-icon svg { width: 56px; height: 56px; }
  .foot { margin-top: 88px; }
}
@media (max-width: 700px) {
  :root { --gutter: 16px; }
  .safe li { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 18px 0; }
  .ways > li { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 22px 0; }
  .way .cmd { width: 100%; padding-left: 16px; }
  .way .cmd code { font-size: 13.5px; }
  .npx { display: flex; width: 100%; justify-content: space-between; }
  .demo-data { padding: 0 4px; font-size: 9px; }
  .code pre { padding: 18px 16px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .copy { position: static; margin: 0 16px 16px; }
  .code { display: flex; flex-direction: column; }
  .code pre { order: 0; }
  .install, .safe, .try { margin-top: 72px; }
  .motion .safe li { padding: 28px 0; }
  .marquee { margin-top: 40px; }
  .foot { margin-top: 72px; }
}

/* Text pages: comparisons, privacy, terms. One reading column; tables may run wider. */
.doc { max-width: 1040px; margin-inline: auto; padding-block: 48px 0; }
.doc > * { max-width: 68ch; }
.doc > .tbl, .doc > .get { max-width: none; }
.doc h1 { font-size: clamp(36px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.doc h2 { margin-top: 64px; text-wrap: balance; }
.doc h3 { margin: 36px 0 0; font: 22px/1.25 var(--font-serif); letter-spacing: -0.01em; font-weight: 400; }
.doc p, .doc ul, .doc ol { margin: 16px 0 0; }
.doc h1 + p { margin-top: 24px; font-size: 19px; line-height: 1.5; color: var(--text-2); }
.doc ul, .doc ol { padding-left: 22px; display: grid; gap: 6px; }
.doc li::marker { color: var(--text-3); }
.doc .get { margin-top: 64px; }
.doc .fine { margin-top: 48px; font-size: 14px; color: var(--text-3); }
.doc .fine a { color: var(--text-2); }

.tbl { margin-top: 24px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tbl caption { caption-side: top; text-align: left; padding: 12px 16px; font-size: 13px; color: var(--text-3); border-bottom: 1px solid var(--border); }
.tbl th, .tbl td { padding: 11px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.tbl tr:last-child > * { border-bottom: 0; }
.tbl thead th { background: var(--surface-sunken); font-weight: 600; white-space: nowrap; }
.tbl tbody th { min-width: 11em; font-weight: 500; color: var(--text-2); }
.tbl .ns { color: var(--text-3); }
.tbl.wide table { min-width: 880px; font-size: 14px; }

@media (max-width: 1000px) {
  .doc { padding-top: 32px; }
  .doc h2 { margin-top: 56px; }
}
@media (max-width: 700px) {
  .doc h1 + p { font-size: 17px; }
  /* Two-column comparison tables become one block per row; each cell is labelled with its column */
  .tbl.stack { border: 0; border-radius: 0; overflow: visible; }
  .tbl.stack table { min-width: 0; }
  .tbl.stack table, .tbl.stack tbody, .tbl.stack tr, .tbl.stack th, .tbl.stack td { display: block; }
  .tbl.stack caption { display: block; padding: 0 0 8px; }
  .tbl.stack thead { display: none; }
  .tbl.stack tr { padding: 14px 0; border-top: 1px solid var(--border); }
  .tbl.stack tr:last-child { border-bottom: 1px solid var(--border); }
  .tbl.stack th, .tbl.stack td { padding: 0; border: 0; }
  .tbl.stack tbody th { margin-bottom: 6px; color: var(--text); font-weight: 600; }
  .tbl.stack td { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 3px 0; }
  .tbl.stack td::before { content: attr(data-col); color: var(--text-3); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
