/* The site is always light, regardless of system theme — white canvas,
   black accent, quiet gray surfaces. */
:root {
  --font-ui: "Inter", -apple-system, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --radius: 6px;

  --bg: #ffffff;
  --surface: #f7f7f7;
  --surface-raised: #ffffff;
  --border: #dedede;
  --text: #0e0e0e;
  --text-dim: #626262;
  --accent: #111111;
  --accent-dim: rgba(17, 17, 17, 0.11);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 16px; }
a { color: inherit; }
.mono { font-family: var(--font-mono); }

/* Consent banner */
.consent {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; align-items: center; gap: 14px;
  max-width: calc(100vw - 32px); flex-wrap: wrap; justify-content: center;
  padding: 12px 16px; background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim);
  box-shadow: 0 14px 30px rgba(14, 14, 14, 0.12);
}
.consent[hidden] { display: none; }
body.has-consent .hero { padding-bottom: 154px; }
.consent button {
  font-family: var(--font-mono); font-size: 12px; padding: 6px 12px;
  border-radius: var(--radius); border: 1px solid var(--accent);
  background: var(--accent); color: var(--bg); cursor: pointer;
}
.consent button.ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }

/* ---------- hero (the live island demo IS the hero) ---------- */
.hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 70px 24px 84px; }
.hero .mark { height: 38px; width: 28px; color: var(--accent); margin-bottom: 20px; }
.hero .eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 22px; }
.hero .eyebrow .k { color: var(--accent); }
.hero h1 { margin: 0; font-size: clamp(28px, 3.2vw, 40px); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; max-width: 20ch; text-wrap: balance; }
.hero .hero-copy { margin: 14px auto 0; max-width: 52ch; font-size: 15px; line-height: 1.55; color: var(--text-dim); text-wrap: balance; }
.hero .cta { margin-top: 40px; display: inline-flex; align-items: center; height: 44px; padding: 0 26px; border-radius: var(--radius); background: var(--accent); color: var(--bg); text-decoration: none; font-family: var(--font-mono); font-size: 14px; white-space: nowrap; }
.hero .cta:hover { opacity: 0.88; }
.hero .platforms { margin-top: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); opacity: 0.7; white-space: nowrap; }
.hero .platforms a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: color 0.15s, border-color 0.15s; }
.hero .platforms a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- live island demo (large, self-animating, non-interactive) ---------- */
/* [data-theme="private"] overrides the token variables in-scope, so every
   descendant rule below (all written against var(--surface) etc.) shifts
   into the demo's dark monochrome private state. */
.demo-stage {
  position: relative; width: 100%; max-width: 900px; margin: 26px auto 0; height: 460px;
  border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 30px 70px rgba(14,14,14,0.08);
  transition: background 220ms ease, border-color 220ms ease;
}
.demo-stage[data-theme="private"] {
  --bg: #0d0d0d; --surface: #151515; --surface-raised: #1f1f1f; --border: #343434;
  --text: #f5f5f5; --text-dim: #a0a0a0; --accent: #f5f5f5; --accent-dim: rgba(255,255,255,0.13);
  background: var(--bg); border-color: var(--border);
}
.demo-page { position: absolute; inset: 0; padding: 100px 64px 0; }
.demo-page .bar { height: 13px; border-radius: 4px; background: var(--border); margin-bottom: 14px; opacity: 0.7; transition: background 220ms ease; }
.demo-page .bar.w1 { width: 62%; } .demo-page .bar.w2 { width: 88%; } .demo-page .bar.w3 { width: 45%; } .demo-page .bar.w4 { width: 71%; }
.demo-stage.scrolling .demo-page { animation: demo-page-scroll 4200ms cubic-bezier(0.2, 0.7, 0.16, 1) forwards; }

/* real page render behind the island (mShots screenshot service); the
   skeleton bars above stay visible as the loading/fallback state and the
   shot crossfades in over them once its real image has arrived. */
.demo-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; transition: opacity 360ms ease; pointer-events: none; }
.demo-shot.show { opacity: 1; }
.demo-stage.scrolling .demo-shot.show { animation: demo-shot-scroll 4200ms cubic-bezier(0.2, 0.7, 0.16, 1) forwards; }
@keyframes demo-shot-scroll {
  0%, 12% { object-position: top center; }
  78%, 100% { object-position: center 72%; }
}
@keyframes demo-page-scroll {
  0%, 12% { transform: translateY(0); }
  78%, 100% { transform: translateY(-116px); }
}

.demo-island { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 5; white-space: nowrap; }
.demo-island .pill { display: flex; align-items: center; gap: 12px; padding: 9px 16px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 12px 28px rgba(14,14,14,0.1); transition: opacity 160ms ease, transform 160ms ease, background 220ms ease, border-color 220ms ease; }
.demo-stage[data-theme="private"] .demo-island .pill { border-style: dashed; }
.demo-island.open .pill { opacity: 0; transform: translateY(-6px) scale(0.97); pointer-events: none; }

/* pill clusters: a bordered pinned-shelf capsule, then one dot cluster per
   group, then the loose cluster — mirroring the real Blanc Island pill. */
.demo-island .dots { display: flex; align-items: center; gap: 9px; }
.demo-island .pin-shelf { display: flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; }
.demo-island .pin-shelf > span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.55; }
.demo-island .cluster { display: flex; gap: 6px; }
.demo-island .cluster > span { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: background 160ms ease; }
.demo-island .cluster.on > span { background: var(--accent); opacity: 0.4; }
.demo-island .cluster.on > span.cur { opacity: 1; }
.demo-island .cluster.folded { border: 1px solid var(--border); border-radius: 999px; padding: 3px 7px; }
.demo-island .cluster.folded > span { width: 5px; height: 5px; }
.demo-stage[data-theme="private"] .demo-island .pin-shelf { border-color: var(--text-dim); }
.demo-stage[data-theme="private"] .demo-island .pin-shelf > span,
.demo-stage[data-theme="private"] .demo-island .cluster > span { background: transparent; border: 1px solid var(--text-dim); opacity: 0.8; }

.demo-island .pill-fav { width: 16px; height: 16px; border-radius: 4px; background-color: var(--border); background-size: cover; background-position: center; flex: 0 0 auto; }
.demo-island .group-name { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); display: inline-flex; align-items: center; }
.demo-island .group-name[hidden] { display: none; }
.demo-island .domain { font-family: var(--font-mono); font-size: 15px; }
.demo-island .shield { font-family: var(--font-mono); font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: var(--accent-dim); color: var(--accent); transition: background 220ms ease, color 220ms ease; }
.demo-island .shield[hidden] { display: none; }
.demo-island .priv-chip { display: none; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11.5px; padding: 2px 5px 2px 9px; border-radius: 999px; border: 1px dashed var(--accent); color: var(--accent); }
.demo-island .priv-chip svg { display: block; }
.demo-island.private .priv-chip { display: flex; }
.demo-island.private .domain, .demo-island.private .shield, .demo-island.private .pill-fav, .demo-island.private .group-name { display: none; }

.demo-island .panel {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%) translateY(-6px) scale(0.97);
  width: 640px; max-height: 436px; overflow-y: auto;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 24px 50px rgba(14,14,14,0.14); padding: 13px 16px 8px; text-align: left;
  opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 160ms ease, background 220ms ease, border-color 220ms ease;
}
.demo-stage[data-theme="private"] .demo-island .panel { border-style: dashed; }
.demo-island.open .panel { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); pointer-events: auto; }

.demo-island .field { height: 34px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--surface); display: flex; align-items: center; padding: 0 12px; font-family: var(--font-mono); font-size: 14.5px; gap: 1px; transition: background 220ms ease; }
.demo-island .typed { color: var(--text); }
.demo-island .field .caret { width: 7px; height: 18px; background: var(--accent); opacity: 0.65; margin-left: 1px; animation: demo-blink 1s step-end infinite; }
@keyframes demo-blink { 50% { opacity: 0; } }

.demo-island .list { margin-top: 6px; display: flex; flex-direction: column; }

/* section header (pinned / group name / no group) */
.demo-island .sec-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 2px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.demo-island .sec-head .ico { width: 11px; height: 11px; flex: 0 0 auto; color: var(--text-dim); }
.demo-island .sec-head .caret { width: 9px; height: 9px; flex: 0 0 auto; transform: rotate(90deg); transition: transform 160ms ease; }
.demo-island .sec-head.collapsed .caret { transform: rotate(0deg); }
.demo-island .sec-head .rule { flex: 1 1 auto; height: 1px; background: var(--border); }
.demo-island .sec-head .count { flex: 0 0 auto; }
.demo-island .sec-head.just { animation: rowpulse 1000ms ease; border-radius: var(--radius); }

.demo-island .trow { display: flex; align-items: center; gap: 11px; padding: 4px 12px; border-radius: var(--radius); font-size: 13.5px; transition: background 140ms ease; }
.demo-island .trow.hl { background: var(--accent-dim); }
.demo-island .trow.just { animation: rowpulse 1000ms ease; }
@keyframes rowpulse { 0%, 55% { background: var(--accent-dim); } 100% { background: transparent; } }
.demo-island .trow .fav { width: 17px; height: 17px; border-radius: 4px; flex: 0 0 auto; background-color: var(--border); background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(14,14,14,0.05); }
.demo-island .trow .title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-ui); }
.demo-island .trow .dom { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.demo-island .trow .tag,
.demo-island .trow .kbd,
.demo-island .trow .enter { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); opacity: 0.7; flex: 0 0 auto; }
.demo-island .trow .kbd { margin-left: auto; }
.demo-island .trow .private-tag { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; flex: 0 0 auto; }
.demo-island .trow.command .cmd { flex: 0 0 auto; font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); white-space: nowrap; }
.demo-island .trow.command .hint { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.demo-island .trow.folded { color: var(--text-dim); font-family: var(--font-mono); }
.demo-island .plus { width: 17px; height: 17px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim); }
.demo-island .plus svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.demo-island .row-dots { display: flex; gap: 4px; flex: 0 0 auto; }
.demo-island .row-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--border); }
.demo-island .row-dots.accent span { background: var(--accent); opacity: 0.5; }
.demo-island .trow .empty { color: var(--text-dim); font-family: var(--font-mono); font-size: 13px; }

.demo-island .foot { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); opacity: 0.7; padding: 8px 12px 2px; white-space: nowrap; }

/* synced caption under the demo — tells the viewer what each beat shows */
.demo-caption {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  max-width: min(56ch, calc(100vw - 48px));
  margin: 20px auto 0;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 14px 32px rgba(14,14,14,0.09);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  text-wrap: balance;
  opacity: 1;
}
.demo-caption::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: inherit;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.demo-caption.show { animation: capfade 500ms ease forwards; }
@keyframes capfade { from { opacity: 0; transform: translateY(5px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .demo-stage { height: 420px; }
  .demo-island .panel { width: 86vw; }
  .demo-island .trow .dom { display: none; }
}

/* Short viewports: shrink the demo so mark + line + demo + caption + CTA
   still fit one screen, keeping the CTA clear of the fixed consent banner. */
@media (max-height: 860px) {
  .demo-stage { height: 344px; margin-top: 20px; }
  .demo-island .panel { max-height: 292px; }
  .hero { padding: 52px 24px 66px; }
  body.has-consent .hero { padding-bottom: 146px; }
  .hero .mark { margin-bottom: 14px; }
  .hero .hero-copy { margin-top: 10px; font-size: 14px; line-height: 1.45; }
  .demo-caption { margin-top: 14px; }
  .hero .cta { margin-top: 30px; }
}

footer { border-top: 1px solid var(--border); padding: 24px 40px; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); opacity: 0.75; }
footer .line { white-space: nowrap; }
footer .line b { color: var(--accent); font-weight: 400; }
footer .line a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: color 0.15s, border-color 0.15s; }
footer .line a:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 480px) {
  footer { padding: 20px 16px; }
  footer .line { white-space: normal; }
  .consent {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
  }
  body.has-consent .hero { padding-bottom: 218px; }
  .consent button {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
  }
}
