/* KC7 desktop-style homepage (marketing/index-v3.html).
   The page is a "computer": menu bar, icons down both sides, draggable windows.
   Dark detective theme only. Brand: orange #ff7933 (actions), blue #00529f
   (links, lightened on dark surfaces), navy #0d1626, cream #f5efe3. */

:root {
  --canvas: #090909;
  --panel: #141414;
  --raised: #1c1c1c;
  --inset: #101010;
  --border: rgba(255, 255, 255, 0.1);
  --ink: #f5f5f5;
  --secondary: #c7c7c7;
  --muted: #969696;
  --success: #4ade80;
  --danger: #f87171;
  --gold: #eac75c;
  --gold-soft: rgba(234, 199, 92, 0.1);
  --navy: #0d1626;
  --cream: #f5efe3;
  --orange: #ff7933;
  --orange-deep: #e8611a;
  --blue: #5ba3f5;
  --glass: rgba(13, 22, 38, 0.72);
  --glow: rgba(255, 238, 196, 0.22);
  --bar-h: 44px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", monospace;
}

html.desk-html { background: var(--navy); }
body.desk-body {
  margin: 0;
  font: 14px/1.6 var(--sans);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
}
.desk-body *, .desk-body *::before, .desk-body *::after { box-sizing: border-box; }
.desk-body [hidden] { display: none !important; }
.desk-body button { font: inherit; cursor: pointer; }
.desk-body button:disabled { cursor: not-allowed; opacity: 0.5; }
.desk-body a { color: inherit; }
.desk-body h1, .desk-body h2, .desk-body h3 { margin: 0; line-height: 1.25; }
.desk-body :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------------ desktop */
.desktop {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--navy);
  background-image:
    radial-gradient(55% 58% at 50% 18%, rgba(255, 238, 196, 0.16), transparent 72%),
    linear-gradient(180deg, rgba(13, 22, 38, 0.42), rgba(13, 22, 38, 0.7) 70%, rgba(9, 14, 24, 0.88)),
    url("https://kc7photos.blob.core.windows.net/photos/kc7_background4_1920.webp");
  background-size: auto, auto, cover;
  background-position: center top, center, center;
  background-attachment: fixed;
  user-select: none;
}

/* Menu bar */
.desk-bar {
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(245, 239, 227, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
}
.desk-brand { display: inline-flex; align-items: center; padding: 4px 8px 4px 4px; border-radius: 6px; }
.desk-brand img { height: 22px; width: auto; display: block; }
.desk-menus { display: flex; gap: 2px; }
.desk-menu { position: relative; }
.desk-menu > summary {
  list-style: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 6px;
  color: rgba(245, 239, 227, 0.78);
  cursor: pointer;
}
.desk-menu > summary::-webkit-details-marker { display: none; }
.desk-menu > summary:hover, .desk-menu[open] > summary { background: rgba(245, 239, 227, 0.1); color: var(--cream); }
.desk-menu > ul {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  z-index: 60;
}
.desk-menu > ul a, .desk-menu > ul button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}
.desk-menu > ul a:hover, .desk-menu > ul button:hover { background: rgba(91, 163, 245, 0.14); }
.desk-bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.desk-clock { font-size: 12px; color: rgba(245, 239, 227, 0.6); font-variant-numeric: tabular-nums; }
.desk-signin {
  background: var(--orange);
  color: #1a1612;
  font-weight: 600;
  font-size: 13px;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.desk-signin:hover { background: var(--orange-deep); color: #fff; }

/* Desktop area */
.desk-area { position: relative; flex: 1; min-height: calc(100vh - var(--bar-h)); overflow: hidden; }
.desk-icons {
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 96px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.desk-icons::-webkit-scrollbar { display: none; }
.desk-icons.left { left: 14px; }
.desk-icons.right { right: 14px; }
.desk-icon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(245, 239, 227, 0.85);
  text-decoration: none;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  flex: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.desk-icon:hover, .desk-icon:focus-visible { background: rgba(13, 22, 38, 0.55); border-color: rgba(245, 239, 227, 0.14); color: var(--cream); }
.desk-icon-tile {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(13, 22, 38, 0.78);
  border: 1px solid rgba(245, 239, 227, 0.14);
  color: var(--orange);
  font-size: 20px;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  transition: transform 150ms cubic-bezier(0.25, 1, 0.5, 1);
}
.desk-icon:hover .desk-icon-tile { transform: translateY(-2px); }
.desk-icon-label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 88px; }

/* Hanging lamp, lifted from the previous hero */
.desk-lamp { position: absolute; top: 0; left: 50%; width: 0; z-index: 0; transform-origin: top center; animation: desk-lamp-sway 8s ease-in-out infinite; pointer-events: none; }
.desk-lamp .cord { position: absolute; left: -1px; top: 0; width: 2px; height: 26px; background: rgba(245, 239, 227, 0.55); }
.desk-lamp .shade { position: absolute; top: 24px; left: -30px; width: 60px; height: 32px; background: var(--navy); border-radius: 50% 50% 6px 6px / 90% 90% 8px 8px; box-shadow: inset 0 -9px 12px -6px rgba(255, 216, 132, 0.9), 0 4px 10px rgba(0, 0, 0, 0.35); }
.desk-lamp .bulb { position: absolute; top: 52px; left: -6px; width: 12px; height: 12px; border-radius: 50%; background: #ffe9b8; box-shadow: 0 0 28px 13px rgba(255, 222, 146, 0.55); }
.desk-lamp .cone { position: absolute; top: 56px; left: -300px; width: 600px; height: 520px; background: linear-gradient(to bottom, var(--glow), rgba(255, 238, 196, 0) 92%); clip-path: polygon(46.5% 0, 53.5% 0, 100% 100%, 0 100%); }
@keyframes desk-lamp-sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } }

.desk-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: rgba(245, 239, 227, 0.7); font-size: 13px; }
.desk-empty i { font-size: 28px; }
.desk-dock { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: var(--glass); backdrop-filter: blur(12px); border: 1px solid rgba(245, 239, 227, 0.12); border-radius: 10px; z-index: 40; }
.desk-dock-item { font-size: 12px; padding: 6px 12px; border-radius: 6px; background: var(--panel); border: 1px solid var(--border); color: var(--secondary); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-dock-item:hover { color: var(--ink); border-color: var(--orange); }

/* Windows */
.desk-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 32px);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.75), 0 0 60px -10px rgba(255, 222, 146, 0.12);
  overflow: hidden;
  outline: none;
  user-select: text;
}
.desk-window.focused { border-color: rgba(255, 121, 51, 0.4); }
.desk-window.maximized { inset: 0 !important; width: auto !important; max-height: none; border-radius: 0; }
.desk-titlebar { position: relative; display: flex; align-items: center; height: 38px; padding: 0 12px; background: var(--raised); border-bottom: 1px solid var(--border); cursor: grab; touch-action: none; user-select: none; flex: none; }
.desk-titlebar:active { cursor: grabbing; }
.desk-lights { display: flex; gap: 7px; }
.desk-light { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.2); padding: 0; opacity: 0.85; }
.desk-light.close { background: #ff5f57; }
.desk-light.minimize { background: #febc2e; }
.desk-light.maximize { background: #28c840; }
.desk-window:not(.focused) .desk-light { background: var(--border); }
.desk-light:hover { opacity: 1; }
.desk-title { position: absolute; left: 90px; right: 90px; text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-window.focused .desk-title { color: var(--secondary); }
.desk-window-body { overflow: auto; flex: 1; min-height: 0; }

/* Small panes */
.desk-pane { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.desk-pane h3 { font-size: 18px; font-weight: 600; }
.desk-pane p { margin: 0; color: var(--secondary); }
.desk-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.desk-link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); text-decoration: none; font-weight: 500; }
.desk-link:hover { text-decoration: underline; color: var(--blue); }
.desk-link i { font-size: 11px; }
.link-button { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 500; }
.link-button:hover { text-decoration: underline; }
.desk-links { display: flex; gap: 16px; flex-wrap: wrap; }
.desk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.desk-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); color: var(--ink); text-decoration: none; font-size: 13px; }
.desk-card span { color: var(--muted); }
.desk-card:hover { border-color: var(--blue); }
.desk-trash { align-items: center; text-align: center; padding: 36px 24px; }
.desk-trash > i { font-size: 40px; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 6px; border: 1px solid transparent; font-size: 14px; font-weight: 500; text-decoration: none; transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--orange); color: #1a1612; font-weight: 600; }
.btn-primary:hover { background: var(--orange-deep); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--blue); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

/* Start / endgame options */
.start-options { display: flex; flex-direction: column; gap: 8px; }
.start-oauth { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--raised); color: var(--ink); text-decoration: none; font-weight: 500; }
.start-oauth i { width: 16px; text-align: center; color: var(--blue); }
.start-oauth:hover { border-color: var(--orange); }
.start-alt { font-size: 13px; color: var(--secondary); }
.start-alt a { color: var(--blue); }
.start-trust { font-size: 12px; color: var(--muted); }
.demo-endgame .start-options { max-width: 360px; margin: 0 auto; }

/* ---------------------------------------------------------------- home window */
.home-window { padding: 36px 36px 40px; display: flex; flex-direction: column; gap: 28px; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.home-hero h1 { font-family: var(--serif); font-weight: 500; font-size: 46px; letter-spacing: -0.015em; line-height: 1.04; margin: 0 0 16px; max-width: 18ch; }
.home-hero h1 .it { font-style: italic; color: var(--orange); }
.home-sub { font-size: 15px; line-height: 1.7; color: var(--secondary); max-width: 560px; margin: 0 0 20px; }
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.home-casey { width: 200px; height: 200px; display: block; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35)); animation: desk-casey-bob 6s ease-in-out infinite; }
@keyframes desk-casey-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.home-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 32px; margin: 0; padding-top: 24px; border-top: 1px solid var(--border); justify-content: start; }
.home-stats dt { font-size: 10px; letter-spacing: 0.12em; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.home-stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--blue); }

.home-section { display: flex; flex-direction: column; gap: 18px; padding-top: 28px; border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.home-section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -0.01em; line-height: 1.15; max-width: 28ch; }
.home-section-head .lede { margin: 8px 0 0; color: var(--secondary); max-width: 60ch; }

.home-cases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.case-card { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); overflow: hidden; text-decoration: none; color: var(--ink); transition: border-color 150ms ease; }
.case-card:hover { border-color: var(--orange); }
.case-card img, .case-card-fallback { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: grid; place-items: center; background: var(--inset); color: var(--muted); font-size: 24px; }
.case-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.case-meta { display: flex; justify-content: space-between; font-size: 11px; }
.tier { padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.tier-1 { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.tier-2 { background: rgba(91, 163, 245, 0.15); color: var(--blue); }
.tier-3 { background: rgba(255, 121, 51, 0.15); color: var(--orange); }
.tier-4 { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.case-card h3 { font-size: 14px; font-weight: 600; }
.case-card p { margin: 0; font-size: 12.5px; color: var(--secondary); flex: 1; }
.case-card .desk-link { font-size: 12.5px; }

.home-quotes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.home-quote { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); }
.quote-mark { font-family: var(--serif); font-size: 36px; line-height: 0.6; color: var(--orange); }
.home-quote blockquote { margin: 0; flex: 1; font-family: var(--serif); font-size: 15px; line-height: 1.5; color: var(--ink); }
.home-quote footer { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.home-quote footer strong { color: var(--ink); font-weight: 600; }

.home-faq { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); overflow: hidden; }
.home-faq details + details { border-top: 1px solid var(--border); }
.home-faq summary { cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-faq summary::-webkit-details-marker { display: none; }
.home-faq summary::after { content: "+"; font-family: var(--mono); color: var(--blue); font-size: 16px; line-height: 1; }
.home-faq details[open] summary::after { content: "−"; }
.home-faq summary:hover { background: rgba(255, 255, 255, 0.04); }
.home-faq p { margin: 0; padding: 0 18px 16px; color: var(--secondary); line-height: 1.65; max-width: 70ch; }
.home-faq a { color: var(--blue); }

.home-posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.post-card { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); overflow: hidden; text-decoration: none; color: var(--ink); }
.post-card:hover { border-color: var(--blue); }
.post-card img, .post-card-fallback { width: 100%; height: 150px; object-fit: cover; background: var(--inset); }
.post-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.post-card h3 { font-size: 14px; font-weight: 600; }
.post-card p { margin: 0; font-size: 12.5px; color: var(--secondary); }

.home-sponsors { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.home-sponsors li { height: 80px; padding: 12px 22px; background: #fff; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; }
.home-sponsors a { display: flex; align-items: center; height: 100%; }
.home-sponsors img { max-height: 100%; max-width: 170px; width: auto; height: auto; display: block; filter: grayscale(1); opacity: 0.8; transition: filter 150ms ease, opacity 150ms ease; }
.home-sponsors a:hover img { filter: none; opacity: 1; }

.home-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.home-footer a { color: var(--muted); text-decoration: none; }
.home-footer a:hover { color: var(--ink); }

/* --------------------------------------------------------------------- demo */
.demo { position: relative; scroll-margin-top: 16px; }
.demo-split { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 560px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--raised); transition: box-shadow 300ms ease; }
.demo-split.celebrate { box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.6); }
.demo-split.endgame { height: auto; border-color: rgba(234, 199, 92, 0.5); }
.demo-split.endgame .demo-story, .demo-split.endgame .demo-console { display: none; }
.demo-story { min-width: 0; padding: 18px 20px; display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow-y: auto; }
.case-breadcrumb { font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 12px; }
.story-body { flex: 1; overflow-y: auto; margin-bottom: 14px; }
.beat { display: none; font-family: var(--serif); font-size: 15px; line-height: 1.55; color: var(--ink); }
.beat.active { display: block; animation: demo-fade-up 0.4s ease; }
.beat p { margin: 0 0 10px; }
.beat em { color: var(--muted); }
.beat strong { font-weight: 500; }
.beat-art { width: 100%; height: auto; max-height: 140px; object-fit: cover; border-radius: 6px; margin-bottom: 12px; display: block; }
.beat .hl, .q-text .hl-inline { font-family: var(--mono); font-size: 13px; background: #f5d547; color: #1a1612; padding: 1px 5px; font-style: normal; }
.verse { margin: 4px 0 12px; padding: 10px 12px; border-left: 2px solid var(--gold); background: var(--gold-soft); font-style: italic; color: var(--secondary); display: flex; flex-direction: column; gap: 4px; }
.verse .note { font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-style: normal; }
.verse .tell { color: var(--gold); font-weight: 600; font-style: normal; }
@keyframes demo-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.question-block { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); flex: none; }
.q-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--danger); font-weight: 600; margin: 0 0 8px; }
.q-text { display: block; font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.4; color: var(--ink); margin-bottom: 12px; }
.answer-row { display: flex; gap: 8px; }
.answer-row input { flex: 1; min-width: 0; height: 36px; padding: 0 11px; border-radius: 3px; border: 2px solid var(--border); background: var(--inset); color: var(--ink); font-family: var(--mono); font-size: 13px; transition: border-color 200ms ease, box-shadow 200ms ease; }
.answer-row input:focus { border-color: var(--danger); outline: none; box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25); }
.demo-submit-btn { background: #d93b2b; color: #fff; border: 0; border-radius: 3px; font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.1em; padding: 0 18px; white-space: nowrap; box-shadow: 0 0 12px rgba(217, 59, 43, 0.4); }
.demo-submit-btn:hover:not(:disabled) { background: #e8503e; box-shadow: 0 0 18px rgba(217, 59, 43, 0.6); }
.demo-feedback { min-height: 16px; margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.demo-feedback.right { color: var(--success); }
.demo-feedback.wrong { color: var(--danger); }

.demo-console { min-width: 0; display: flex; flex-direction: column; background: var(--inset); }
.demo-console-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.demo-run { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--blue); color: #0b1a2e; font-size: 12.5px; font-weight: 600; }
.demo-run:hover:not(:disabled) { filter: brightness(1.08); }
.demo-run.nudge { animation: demo-nudge 2s ease; }
@keyframes demo-nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(91, 163, 245, 0.6); } 20% { transform: scale(1.06); box-shadow: 0 0 0 8px transparent; } 40% { transform: scale(1); } }
.demo-query { margin: 0; padding: 14px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; border-bottom: 1px solid var(--border); color: var(--ink); min-height: 96px; }
.demo-query .kw { color: #c586c0; }
.demo-query .fn { color: #dcdcaa; }
.demo-query .str { color: #ce9178; }
.demo-query .cm { color: #6a9955; font-style: italic; }
.demo-query .tbl { color: #4ec9b0; }
.type-cursor { display: inline-block; width: 7px; height: 14px; vertical-align: text-bottom; background: var(--blue); animation: demo-blink 1s steps(2) infinite; }
@keyframes demo-blink { 50% { opacity: 0; } }
.demo-results { flex: 1; overflow: auto; min-height: 0; padding: 10px 14px 14px; font-size: 12px; color: var(--secondary); }
.empty-msg { color: var(--muted); font-style: italic; }
.count-strip { color: var(--muted); margin-bottom: 8px; }
.count-strip .cnt { color: var(--success); font-weight: 600; }
.exec-strip { height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 10px; }
.exec-bar { height: 100%; width: 40%; background: var(--blue); animation: demo-exec 0.8s ease-in-out infinite; }
@keyframes demo-exec { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.demo-results table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.demo-results th { text-align: left; font-weight: 500; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--border); }
.demo-results th:first-child, .demo-results td.time { width: 22%; }
.demo-results th:nth-child(2), .demo-results td.ip { width: 26%; }
.demo-results td { padding: 5px 6px; vertical-align: top; border-bottom: 1px solid var(--border); word-break: break-all; }
.demo-results td.time { color: var(--muted); }
.demo-results td.ip { color: var(--blue); }
.demo-results tr.flash td { background: var(--gold-soft); }
.demo-results tr.answer-flash td { animation: demo-row-flash 0.9s ease; }
@keyframes demo-row-flash { 0%, 100% { background: transparent; } 30% { background: rgba(74, 222, 128, 0.25); } }
.demo-results .pop { color: var(--gold); font-weight: 600; background: var(--gold-soft); border-radius: 3px; padding: 0 2px; }

.demo-endgame { grid-column: 1 / -1; padding: 40px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.demo-endgame[hidden] { display: none; }
.demo-endgame .eyebrow { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.demo-endgame h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; max-width: 520px; }

.demo-celebration { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.demo-success-flash { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); animation: demo-success 2.2s ease forwards; }
@keyframes demo-success { 0% { opacity: 0; transform: translate(-50%, -40%) scale(0.8); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1); } }
.demo-particle { position: absolute; left: 50%; top: 50%; border-radius: 50%; opacity: 0; animation: demo-particle var(--duration) ease-out var(--delay) forwards; }
.demo-particle.square { border-radius: 2px; }
.demo-particle.star { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
@keyframes demo-particle { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(0.4); } }

/* ----------------------------------------------------------- story / video */
.story-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.story-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.story-play { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; background: #000; overflow: hidden; }
.story-play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; transition: opacity 150ms ease, transform 300ms cubic-bezier(0.25, 1, 0.5, 1); }
.story-play:hover img { opacity: 1; transform: scale(1.02); }
.story-play-badge { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #1a1612; font-size: 22px; box-shadow: 0 0 0 8px rgba(255, 121, 51, 0.25), 0 12px 30px rgba(0, 0, 0, 0.5); transition: transform 150ms ease; }
.story-play-badge i { margin-left: 3px; }
.story-play:hover .story-play-badge { transform: translate(-50%, -50%) scale(1.08); }
.story-play-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 16px 12px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--cream); background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent); text-align: left; }

/* ---------------------------------------------------------------- scoreboard */
.score-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.score-table th { text-align: left; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.score-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.score-table .num { text-align: right; }
.score-table td img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; border: 1px solid var(--border); }
.score-table tbody tr:first-child td { background: var(--gold-soft); }
.pulse { border: 1px solid var(--border); border-radius: 8px; background: var(--raised); padding: 12px 14px; }
.pulse[hidden] { display: none; }
.pulse-head { font-size: 11px; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); animation: pulse-dot 2s ease-out infinite; }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); } 100% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } }
.pulse-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.pulse-feed li { display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; color: var(--secondary); }
.pulse-feed li.pulse-new { animation: demo-fade-up 0.4s ease; }
.pf-user { color: var(--ink); font-weight: 600; }
.pf-module { color: var(--blue); }
.pf-points { color: var(--success); font-family: var(--mono); font-size: 11px; }
.pf-time { margin-left: auto; color: var(--muted); font-size: 11px; }

/* ------------------------------------------------------------------- mobile */
@media (max-width: 767px) {
  .desktop { background-attachment: scroll; }
  .desk-menus, .desk-clock, .desk-lamp, .desk-dock { display: none !important; }
  .desk-area { min-height: 0; overflow: visible; padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
  .desk-icons { position: static; width: auto; display: flex; flex-direction: row; gap: 2px; overflow-x: auto; overflow-y: hidden; margin: 0 -16px; padding: 0 12px; }
  .desk-icons + .desk-icons { margin-top: -8px; }
  .desk-icon { width: 84px; font-size: 10.5px; }
  .desk-icon-tile { width: 44px; height: 44px; border-radius: 12px; }
  .desk-window { position: static !important; width: auto !important; max-height: none; }
  .desk-window.minimized { display: none; }
  .desk-titlebar { cursor: default; }
  .desk-light.minimize, .desk-light.maximize { display: none; }
  .desk-title { left: 40px; right: 12px; text-align: left; }
  .desk-empty { display: none !important; }
  .home-window { padding: 22px 18px 26px; gap: 22px; }
  .home-hero { grid-template-columns: 1fr; }
  .home-hero h1 { font-size: 32px; }
  .home-casey { width: 120px; height: 120px; justify-self: end; margin-top: -8px; }
  .home-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .demo-split { grid-template-columns: minmax(0, 1fr); height: auto; }
  .demo-story { border-right: 0; border-bottom: 1px solid var(--border); }
  .story-body { overflow: visible; }
  .demo-results { max-height: 220px; }
  .demo-results table { min-width: 520px; }
  .home-sponsors li { height: 56px; padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .desk-lamp, .home-casey, .beat, .demo-run.nudge, .type-cursor, .exec-bar, .demo-particle, .demo-success-flash, .pulse-dot, .pulse-feed li.pulse-new { animation: none !important; }
  .demo-success-flash { opacity: 1; }
}
