/* ============================================================
   Microsoft — The Copilot Company (concept tribute)
   Dark IDE-native design system
   ============================================================ */

/* ---------- Fonts (local only) ---------- */
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --canvas: #0a0c10;
  --canvas-2: #0d1117;
  --panel: #11151c;
  --panel-2: #161b22;
  --hairline: rgba(240, 246, 252, 0.09);
  --text: #e6edf3;
  --text-2: #8b949e;
  --text-3: #9198a1;
  --ghost: rgba(110, 118, 129, 0.55);
  --kw: #ff7b72;
  --str: #a5d6ff;
  --fn: #d2a8ff;
  --var: #79c0ff;
  --num: #79c0ff;
  --type: #ffa657;
  --comment: #8b949e;
  --copilot-a: #a371f7;
  --copilot-b: #79c0ff;
  --grad: linear-gradient(90deg, var(--copilot-a), var(--copilot-b));
  --add-bg: rgba(63, 185, 80, 0.12);
  --add-fg: #3fb950;
  --del-bg: rgba(248, 81, 73, 0.12);
  --del-fg: #f85149;
  --ms-r: #f25022; --ms-g: #7fba00; --ms-b: #00a4ef; --ms-y: #ffb900;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
  --chrome-h: 44px;
  --status-h: 30px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  padding-top: var(--chrome-h);
  padding-bottom: var(--status-h);
  overflow-x: hidden;
}

::selection { background: rgba(163, 113, 247, 0.35); }

:focus-visible {
  outline: 2px solid var(--copilot-b);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; }

/* ---------- Utility text ---------- */
.grad, .grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dim { color: var(--text-2); }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--comment);
  letter-spacing: 0.02em;
  margin-bottom: 0.9rem;
}
.kbd {
  font-family: var(--mono);
  font-size: 0.78em;
  background: var(--panel-2);
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1em 0.45em;
}

/* ============================================================
   IDE CHROME — top strip
   ============================================================ */
.topstrip {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--chrome-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0 14px;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 0.78rem;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.topstrip-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ms-logo { height: 15px; width: auto; display: block; }
.ws-title { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb { color: var(--text-2); white-space: nowrap; }
.crumb-active { color: var(--str); }
.crumb-sep { margin: 0 0.45em; opacity: 0.5; }
.topstrip-right { display: flex; gap: 14px; color: var(--text-2); }
.win-close:hover { color: var(--del-fg); }

/* ============================================================
   STATUS BAR
   ============================================================ */
.statusbar {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  height: var(--status-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px;
  background: #0d1117;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-2);
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.sb-group { display: flex; align-items: center; gap: 2px; min-width: 0; }
.sb-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border: 0; background: none; border-radius: 4px;
  color: inherit; font: inherit; cursor: default; white-space: nowrap;
}
button.sb-item { cursor: pointer; }
button.sb-item:hover { background: var(--panel-2); color: var(--text); }
.sb-branch { color: var(--str); }
.sb-section { color: var(--fn); overflow: hidden; text-overflow: ellipsis; }
.sb-copilot { color: var(--copilot-a); }
.sb-quad { gap: 3px; }
.sb-quad i { width: 5px; height: 5px; display: inline-block; border-radius: 1px; opacity: 0.85; }
.sb-palette { color: var(--text-3); }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--copilot-a);
  box-shadow: 0 0 8px var(--copilot-a);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Zen mode hides chrome */
body.zen .topstrip { transform: translateY(-100%); opacity: 0; pointer-events: none; }
body.zen .statusbar { transform: translateY(100%); opacity: 0; pointer-events: none; }
body.zen { padding-top: 0; padding-bottom: 0; }

/* ============================================================
   SECTIONS — shared
   ============================================================ */
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7.5rem) clamp(1.1rem, 4vw, 2.5rem);
  position: relative;
}
.section h2 {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1.2; margin-bottom: 1rem; letter-spacing: -0.01em;
}
.lede { color: var(--text-3); max-width: 56ch; margin-bottom: 1.4rem; }
.fine { color: var(--text-2); font-size: 0.9rem; }

/* section flash after palette jump */
@keyframes sectionFlash {
  0% { box-shadow: 0 0 0 2px var(--copilot-a); }
  100% { box-shadow: 0 0 0 2px transparent; }
}
.section.flash { animation: sectionFlash 1.1s ease-out; border-radius: var(--radius); }

/* diff-style scroll reveal */
.reveal, .reveal-line { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in, .reveal-line.in { opacity: 1; transform: none; }
.reveal-line { position: relative; }
.reveal-line.in { animation: greenFlash 1.2s ease-out; }
@keyframes greenFlash {
  0% { background: var(--add-bg); }
  100% { background: transparent; }
}

/* code blocks: per-line stagger on first entry */
.codeblock { display: block; }
.codeblock .cline { display: block; min-height: 1.45em; opacity: 0; transform: translateX(8px); }
.codeblock.typed .cline { opacity: 1; transform: none; transition: opacity 0.3s ease, transform 0.3s ease; }

/* ============================================================
   HERO
   ============================================================ */
.hero { min-height: calc(100vh - var(--chrome-h) - var(--status-h)); display: flex; flex-direction: column; justify-content: center; max-width: 1280px; }
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.hero-title {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.15; letter-spacing: -0.02em; margin: 0.4rem 0 1rem;
}
.hero-title .prompt { color: var(--add-fg); }
.caret {
  display: inline-block; width: 0.55em; height: 1.05em;
  background: var(--copilot-b); margin-left: 0.12em;
  vertical-align: -0.15em;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { color: var(--text-3); max-width: 44ch; margin-bottom: 1.6rem; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.8rem; }
.btn {
  font-family: var(--mono); font-size: 0.86rem;
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.65em 1.1em; border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--panel); color: var(--text);
  cursor: pointer; text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.btn:hover { border-color: var(--copilot-a); transform: translateY(-1px); }
.btn:hover::before { content: "▌"; color: var(--copilot-a); margin-right: 0.1em; margin-left: -0.35em; }
.btn-primary { background: linear-gradient(90deg, rgba(163,113,247,0.18), rgba(121,192,255,0.14)); border-color: rgba(163, 113, 247, 0.45); box-shadow: 0 0 22px rgba(163, 113, 247, 0.18); }
.btn-ghost { color: var(--text-2); }
.octicon { color: var(--fn); }

/* floating autocomplete widget demo */
.autocomplete-demo {
  font-family: var(--mono); font-size: 0.78rem;
  background: var(--panel-2); border: 1px solid var(--hairline);
  border-radius: 8px; overflow: hidden; max-width: 340px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  animation: floaty 5s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.ac-row { display: flex; align-items: center; gap: 9px; padding: 6px 10px; color: var(--text-2); }
.ac-row b { color: var(--text); font-weight: 600; }
.ac-active { background: rgba(121, 192, 255, 0.1); color: var(--text); border-left: 2px solid var(--var); }
.ac-kind {
  width: 16px; height: 16px; border-radius: 4px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 700;
}
.kind-f { background: rgba(210, 168, 255, 0.18); color: var(--fn); }
.kind-m { background: rgba(163, 113, 247, 0.18); color: var(--copilot-a); }
.kind-v { background: rgba(121, 192, 255, 0.18); color: var(--var); }

/* editor window */
.editor-window {
  background: var(--canvas-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(163, 113, 247, 0.06);
  position: relative;
}
.editor-titlebar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; background: var(--panel);
  border-bottom: 1px solid var(--hairline);
}
.tl { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.tl-r { background: #ff5f57; } .tl-y { background: #febc2e; } .tl-g { background: #28c840; }
.tabs { display: flex; gap: 2px; margin-left: 10px; overflow-x: auto; }
.tab {
  font-family: var(--mono); font-size: 0.74rem;
  padding: 4px 12px; border: 0; border-radius: 6px 6px 0 0;
  background: transparent; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab-active { background: var(--canvas-2); color: var(--text); border-bottom-color: var(--copilot-a); }
.dirty { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); }
.replay-btn {
  margin-left: auto; font-family: var(--mono); font-size: 0.72rem;
  background: none; border: 1px solid var(--hairline); border-radius: 6px;
  color: var(--text-2); padding: 3px 9px; cursor: pointer;
}
.replay-btn:hover { color: var(--text); border-color: var(--copilot-a); }
.editor-body {
  display: grid; grid-template-columns: auto 1fr;
  font-family: var(--mono); font-size: 0.84rem; line-height: 1.55;
  padding: 14px 0 18px; min-height: 340px;
}
.gutter {
  padding: 0 12px 0 16px; text-align: right; color: #484f58;
  user-select: none; font-size: inherit; line-height: inherit;
  border-right: 1px solid var(--hairline); margin-right: 14px;
}
.code { padding-right: 16px; overflow-x: auto; white-space: pre; }
.hline { display: block; min-height: 1.55em; }
.hline.ghost-line { color: var(--ghost); font-style: italic; }
.block-caret {
  display: inline-block; width: 0.55em; height: 1.1em;
  background: var(--text); vertical-align: -0.18em;
  animation: blink 1.05s steps(1) infinite;
}
.tab-chip {
  display: inline-block; font-style: normal; font-size: 0.68rem;
  background: var(--panel-2); border: 1px solid var(--hairline);
  border-radius: 5px; padding: 1px 7px; margin-left: 10px;
  color: var(--text-2); vertical-align: 0.1em;
  animation: chipIn 0.25s ease;
}
@keyframes chipIn { from { opacity: 0; transform: scale(0.85); } }
.sparkle {
  display: inline-block; color: var(--copilot-a); margin-left: 8px;
  animation: sparklePulse 0.9s ease;
  text-shadow: 0 0 12px var(--copilot-a);
}
@keyframes sparklePulse { 0% { transform: scale(0.3); opacity: 0; } 40% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1); } }
.editor-toast {
  position: absolute; right: 14px; bottom: 12px;
  font-family: var(--mono); font-size: 0.74rem;
  background: var(--panel-2); border: 1px solid rgba(63, 185, 80, 0.4);
  color: var(--add-fg); border-radius: 8px; padding: 7px 12px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.editor-toast.show { opacity: 1; transform: none; }
.hero-scrollhint {
  text-align: center; margin-top: 3rem;
  font-family: var(--mono); font-size: 0.74rem; color: var(--text-2);
}
.hero-scrollhint span { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* syntax tokens */
.tok-kw { color: var(--kw); }
.tok-str { color: var(--str); }
.tok-fn { color: var(--fn); }
.tok-var { color: var(--var); }
.tok-num { color: var(--num); }
.tok-type { color: var(--type); }
.tok-comment { color: var(--comment); font-style: italic; }
.tok-tag { color: #7ee787; }
.tok-attr { color: var(--var); }
.tok-plain { color: var(--text); }
.tok-punct { color: var(--text-2); }

/* ============================================================
   COPILOT section
   ============================================================ */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.split > *, .hero-inner > * { min-width: 0; }
.copilot-mark {
  width: 1.1em; height: 1.1em; vertical-align: -0.2em;
  color: var(--copilot-a);
  filter: drop-shadow(0 0 10px rgba(163, 113, 247, 0.5));
}
.copilot-tb { color: var(--copilot-a); display: block; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 1rem; }
.chip {
  font-family: var(--mono); font-size: 0.74rem;
  background: var(--panel-2); border: 1px solid var(--hairline);
  border-radius: 7px; padding: 5px 10px; color: var(--str);
  overflow-wrap: anywhere;
}
.chip-ver { color: var(--type); }
.split-panes { display: flex; flex-direction: column; gap: 1.4rem; }

.pane {
  background: var(--canvas-2); border: 1px solid var(--hairline);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.pane:hover { border-color: rgba(163, 113, 247, 0.35); transform: perspective(900px) rotateX(0.6deg) rotateY(-0.6deg); }
.pane-titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 8px 12px; background: var(--panel);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-2);
}
.pane-file { color: var(--text-3); }
.pane-hint { font-size: 0.68rem; opacity: 0.7; }

.codeblock {
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.55;
  padding: 14px 16px 16px; overflow-x: auto; white-space: pre;
  position: relative; color: var(--text);
}
.codeblock .cline { padding: 0 2px; }

/* diff coloring */
.diff .diff-add, .cline.diff-add { background: var(--add-bg); color: #7ee787; }
.cline.diff-del { background: var(--del-bg); color: #ffa198; }
.cline.diff-meta { color: var(--var); }
.cline.diff-ctx { color: var(--text-2); }

/* Tab demo */
.tab-key-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--hairline); }
.tab-key {
  font-family: var(--mono); font-size: 0.8rem; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--hairline);
  border-bottom-width: 3px; border-radius: 7px; padding: 6px 14px; color: var(--text);
  transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.tab-key:hover, .tab-key:focus-visible { border-color: var(--copilot-a); box-shadow: 0 0 16px rgba(163, 113, 247, 0.25); }
.tab-key.pressed { transform: translateY(2px); border-bottom-width: 1px; }
.tab-key-label { font-family: var(--mono); font-size: 0.72rem; color: var(--text-2); }
#tab-demo-code .ghost-line { color: var(--ghost); font-style: italic; transition: color 0.3s ease; }

/* copy chip */
.copy-chip {
  position: absolute; top: 8px; right: 10px;
  font-family: var(--mono); font-size: 0.68rem;
  background: var(--panel-2); border: 1px solid var(--hairline);
  border-radius: 6px; color: var(--text-2); padding: 3px 9px; cursor: pointer;
  opacity: 0; transition: opacity 0.2s ease;
}
.codeblock-wrap { position: relative; }
.codeblock-wrap:hover .copy-chip, .copy-chip:focus-visible { opacity: 1; }
.copy-chip:hover { color: var(--text); border-color: var(--copilot-a); }
.copy-chip.copied { color: var(--add-fg); border-color: rgba(63, 185, 80, 0.5); opacity: 1; }

/* ============================================================
   FAMILY explorer
   ============================================================ */
.explorer {
  display: grid; grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 0; border: 1px solid var(--hairline); border-radius: var(--radius);
  overflow: hidden; background: var(--canvas-2); min-height: 380px;
}
.explorer-tree {
  background: var(--panel); border-right: 1px solid var(--hairline);
  padding: 10px 6px; font-family: var(--mono); font-size: 0.8rem;
  outline: none;
}
.tree-header { font-size: 0.66rem; letter-spacing: 0.08em; color: var(--text-2); padding: 4px 10px 10px; }
.tree-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  color: var(--text-2); outline: none; user-select: none;
}
.tree-item:hover { background: var(--panel-2); color: var(--text); }
.tree-item.focused { background: rgba(121, 192, 255, 0.09); color: var(--text); }
.tree-item[aria-expanded="true"] { color: var(--str); }
.tree-item[aria-expanded="true"] .twisty { transform: rotate(90deg); }
.twisty { display: inline-block; transition: transform 0.18s ease; font-size: 0.7em; width: 1em; }
.fi { font-size: 0.62rem; font-weight: 700; width: 20px; text-align: center; border-radius: 4px; padding: 1px 0; flex: none; }
.fi-ts { background: rgba(121, 192, 255, 0.15); color: var(--var); }
.fi-md { background: rgba(210, 168, 255, 0.15); color: var(--fn); }
.fi-ps { background: rgba(165, 214, 255, 0.15); color: var(--str); }
.fi-bot { background: rgba(163, 113, 247, 0.15); color: var(--copilot-a); }

.explorer-cards { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.explorer-empty { font-family: var(--mono); font-size: 0.8rem; color: var(--text-2); margin: auto; }
.fam-card {
  border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden;
  background: var(--panel); animation: cardIn 0.3s ease;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } }
.fam-card-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 9px 13px; border-bottom: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 0.76rem;
}
.fam-card-head b { color: var(--text); font-weight: 600; }
.fam-card-head span { color: var(--text-2); font-size: 0.68rem; }
.fam-card .codeblock { font-size: 0.78rem; padding: 10px 13px 12px; }
.fam-shot { display: block; width: 100%; max-width: 420px; border-top: 1px solid var(--hairline); opacity: 0.9; }

/* ============================================================
   AZURE terminal
   ============================================================ */
.terminal {
  background: #0a0d12; border: 1px solid var(--hairline);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.term-body {
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.6;
  padding: 14px 16px; min-height: 300px; white-space: pre-wrap; word-break: break-word;
  color: var(--text-3);
}
.term-body .t-time { color: #484f58; }
.term-body .t-ok { color: var(--add-fg); }
.term-body .t-info { color: var(--var); }
.term-body .t-cmd { color: var(--text); }
.term-body .t-warn { color: var(--type); }
.term-body .t-spark { color: var(--copilot-a); }
.regions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px 16px; border-top: 1px solid var(--hairline);
}
.region {
  font-family: var(--mono); font-size: 0.7rem;
  border: 1px solid var(--hairline); border-radius: 6px;
  padding: 4px 10px; color: var(--text-2); background: var(--panel);
  transition: all 0.4s ease;
}
.region.online {
  color: #7ee787; border-color: rgba(63, 185, 80, 0.5);
  background: var(--add-bg);
  box-shadow: 0 0 12px rgba(63, 185, 80, 0.15);
}

/* ============================================================
   WINDOWS stage
   ============================================================ */
.win-stage { display: flex; flex-direction: column; gap: 1.6rem; }
.win-desktop {
  position: relative; border: 1px solid var(--hairline);
  border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, #0b1526 0%, #101c33 55%, #0a1220 100%);
  min-height: 380px; display: flex; flex-direction: column; justify-content: flex-end;
}
.win-wallpaper { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.win-clock { font-family: var(--sans); font-weight: 200; font-size: clamp(3rem, 8vw, 5rem); color: rgba(230, 237, 243, 0.9); line-height: 1; }
.win-date { color: rgba(230, 237, 243, 0.55); font-size: 0.9rem; }
.win-hint { margin-top: 1.6rem; font-family: var(--mono); font-size: 0.7rem; color: rgba(230, 237, 243, 0.4); }
.win-copilot {
  position: absolute; top: 0; right: 0; bottom: 52px; width: min(300px, 82%);
  background: rgba(17, 21, 28, 0.96); backdrop-filter: blur(8px);
  border-left: 1px solid var(--hairline);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  transform: translateX(102%); transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-size: 0.82rem;
}
.win-stage.peek .win-copilot, .win-desktop:hover .win-copilot, .win-desktop:focus-within .win-copilot { transform: translateX(0); }
.wc-header { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.8rem; color: var(--text); padding-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.wc-header svg { color: var(--copilot-a); }
.wc-msg { background: var(--panel-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 8px 11px; color: var(--text-3); }
.wc-user { background: rgba(163, 113, 247, 0.12); border-color: rgba(163, 113, 247, 0.3); color: var(--text); align-self: flex-end; }
.win-taskbar {
  position: relative; z-index: 2; height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(13, 17, 23, 0.85); backdrop-filter: blur(12px);
  border-top: 1px solid var(--hairline);
}
.tb-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.tb-icon:hover { background: rgba(240, 246, 252, 0.08); transform: translateY(-2px); }
.tb-icon img { display: block; }
.spec-block { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--canvas-2); }

/* ============================================================
   MANIFESTO
   ============================================================ */
.mdiff { font-family: var(--mono); margin: 2rem 0 3rem; }
.mdiff-line {
  font-size: clamp(1.05rem, 2.6vw, 1.7rem); font-weight: 500;
  padding: 0.35em 0.6em; border-radius: 6px;
  display: flex; gap: 0.8em; align-items: baseline;
}
.mdiff-line .gut { width: 1.2em; flex: none; text-align: center; opacity: 0.7; }
.mdiff-del { color: #ffa198; text-decoration: line-through; text-decoration-color: rgba(248, 81, 73, 0.6); }
.mdiff-del.in { background: var(--del-bg); }
.mdiff-add { color: #7ee787; }
.mdiff-add.in { background: var(--add-bg); }
.mdiff-big { font-size: clamp(1.5rem, 4.2vw, 2.6rem); font-weight: 700; margin-top: 0.6em; color: var(--text); }
.mdiff-big .gut { color: var(--add-fg); }

.commit-card {
  max-width: 640px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 20px 22px;
  font-family: var(--mono); font-size: 0.84rem;
  box-shadow: 0 0 40px rgba(163, 113, 247, 0.08);
}
.commit-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 10px; flex-wrap: wrap; }
.commit-hash { color: var(--type); }
.verified {
  font-size: 0.7rem; color: var(--add-fg);
  border: 1px solid rgba(63, 185, 80, 0.45); border-radius: 20px; padding: 2px 10px;
}
.commit-msg { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.commit-meta { color: var(--text-2); font-size: 0.76rem; }
.commit-stat { color: var(--add-fg); font-size: 0.76rem; margin-top: 6px; }

/* ============================================================
   BACKMATTER + FOOTER
   ============================================================ */
.backmatter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 1.5rem; }
.bm-col h3 { font-family: var(--mono); font-size: 0.8rem; color: var(--text-2); font-weight: 500; margin-bottom: 0.7rem; }
.bm-link {
  display: block; font-family: var(--mono); font-size: 0.78rem;
  color: #6e7681; text-decoration: none; padding: 3px 0;
  transition: color 0.15s ease;
}
.bm-link:hover {
  color: var(--str);
  background: linear-gradient(90deg, var(--copilot-a), var(--copilot-b)) left bottom / 100% 1px no-repeat;
}

.footer { border-top: 1px solid var(--hairline); background: var(--canvas-2); }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 2.4rem clamp(1.1rem, 4vw, 2.5rem) 3rem; text-align: center; }
.gh-mark { opacity: 0.7; margin-bottom: 0.8rem; }
.foot-line { font-size: 0.82rem; color: var(--text-2); margin-bottom: 0.4rem; }
.foot-line.dim { font-size: 0.72rem; opacity: 0.75; }
.grad-text { font-family: var(--mono); font-weight: 600; }

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
.palette-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4, 6, 10, 0.6); backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.palette {
  position: fixed; z-index: 95; top: 16vh; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 2rem));
  background: var(--panel-2); border: 1px solid var(--hairline);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(163, 113, 247, 0.1);
  font-family: var(--mono);
  animation: palIn 0.18s ease;
}
@keyframes palIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } }
.palette-input-row { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--hairline); }
.palette-prefix { color: var(--copilot-a); font-weight: 700; }
#palette-input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--text); font-family: var(--mono); font-size: 0.9rem;
}
.palette-esc { font-size: 0.64rem; color: var(--text-2); border: 1px solid var(--hairline); border-radius: 4px; padding: 1px 6px; }
.palette-list { list-style: none; max-height: 320px; overflow-y: auto; padding: 6px; }
.palette-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 7px; cursor: pointer;
  font-size: 0.82rem; color: var(--text-2);
}
.palette-item .pi-icon { width: 1.3em; text-align: center; flex: none; }
.palette-item .pi-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .pi-tag { font-size: 0.64rem; color: var(--text-2); opacity: 0.8; }
.palette-item.sel { background: rgba(163, 113, 247, 0.14); color: var(--text); }
.palette-item.sel .pi-tag { color: var(--copilot-b); opacity: 1; }
.palette-item mark { background: none; color: var(--copilot-b); font-weight: 700; }
.palette-empty { padding: 18px; text-align: center; color: var(--text-2); font-size: 0.78rem; }

/* hint chip */
.hint-chip {
  position: fixed; right: 14px; bottom: calc(var(--status-h) + 12px); z-index: 55;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-2);
  background: var(--panel-2); border: 1px solid var(--hairline);
  border-radius: 8px; padding: 7px 12px;
  animation: floaty 4s ease-in-out infinite;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.hint-chip.gone { opacity: 0; transform: translateY(8px); pointer-events: none; }
body.zen .hint-chip { bottom: 14px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-inner, .split { grid-template-columns: 1fr; }
  .hero-copy { order: 0; }
  .editor-window { order: 1; }
  .breadcrumb { display: none; }
  .sb-hide-md { display: none; }
  .backmatter-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .sb-hide-sm { display: none; }
  .sb-section { display: none; }
  .ws-title { display: none; }
  .explorer { grid-template-columns: 1fr; }
  .explorer-tree { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .backmatter-grid { grid-template-columns: 1fr; }
  .palette { top: auto; bottom: 0; left: 0; transform: none; width: 100%; border-radius: 14px 14px 0 0; max-height: 70vh; }
  @keyframes palIn { from { opacity: 0; transform: translateY(12px); } }
  .editor-body { font-size: 0.72rem; min-height: 300px; }
  .autocomplete-demo { max-width: 100%; }
  .win-copilot { bottom: 52px; width: min(260px, 74%); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-line { opacity: 1; transform: none; }
  .codeblock .cline { opacity: 1; transform: none; }
  .caret, .block-caret { animation: none; }
}
