/* chester.kvds.media — the house style of kvds.media and Shootable: the story on the left
   in plain, large type; the app itself on the right, working. Warm paper, Jost for the
   display lines, the system font for reading, and Chester's pink-to-yellow kept for
   the app's own marks. Follows the visitor's light or dark setting. */

@font-face { font-family: "Jost"; src: url(../fonts/Jost.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light dark;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: "Jost", Futura, "Avenir Next", var(--sans);

  /* the page */
  --paper: #fbf8f4;
  --paper-2: #f3eee8;
  --text: #1b1719;
  --dim: #4e4649;          /* 8.6:1 on paper */
  --hair: rgb(40 20 30 / 0.12);
  --accent: #b3007a;       /* the welcome screen's deep pink: 6.6:1 on paper */
  --pink: #ff00ad;
  --yellow: #ffcd62;
  --glow-a: rgb(255 0 173 / 0.12);
  --glow-b: rgb(255 205 98 / 0.30);

  /* the app (macOS light) */
  --w-bg: #ffffff;
  --w-side: #f2f0ef;
  --w-card: #edebea;
  --w-card-line: rgb(0 0 0 / 0.07);
  --w-text: #1d1d1f;
  --w-dim: #6b6b70;        /* 5.1:1 on the card */
  --w-head: #75757a;
  --w-sel: #e0dedd;
  --w-shadow: 0 30px 80px rgb(60 20 40 / 0.20), 0 2px 8px rgb(0 0 0 / 0.08);
  --blue: #0a64d8;
  --red: #d70015;
  --orange: #c95400;
  --yellow-badge: #f5d34a;
  --clock-hands: #fff;
  --cam-lens: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131113;
    --paper-2: #1b181b;
    --text: #f4eff1;
    --dim: #c3babe;
    --hair: rgb(255 240 248 / 0.12);
    --accent: #ff7ccf;
    --glow-a: rgb(255 0 173 / 0.16);
    --glow-b: rgb(255 205 98 / 0.10);
    --w-bg: #1e1e1f;
    --w-side: #282729;
    --w-card: #2d2c2e;
    --w-card-line: rgb(255 255 255 / 0.07);
    --w-text: #f2f2f4;
    --w-dim: #a8a8ae;
    --w-head: #9c9ca2;
    --w-sel: #3a393c;
    --w-shadow: 0 30px 90px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.08);
    --blue: #3b8cff;
    --red: #ff5b5b;
    --orange: #ff9f40;
    --clock-hands: #1e1e1f;
    --cam-lens: #1e1e1f;
  }
}
@media (prefers-contrast: more) {
  :root { --dim: var(--text); --w-dim: var(--w-text); --hair: rgb(128 128 128 / 0.6); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; overflow-x: clip;
  background: var(--paper); color: var(--text);
  font: 400 1.1875rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sprite { position: absolute; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 50; background: var(--text); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 16px; }
button { font: inherit; color: inherit; }

/* ── Chapters: story left, the working app right ───────────────────────── */

.chapter {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 4vw, 72px);
  max-width: 1480px; margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px);
  overflow-x: clip;   /* the glow behind the window may spill; clip, not hidden, so the stage stays sticky */
}
.chapter-2 { border-top: 1px solid var(--hair); margin-top: clamp(48px, 8vw, 112px); }
.story { grid-column: 1; max-width: 34rem; }
.story-head { padding-top: clamp(32px, 5vw, 56px); }
.story-body { padding-bottom: clamp(40px, 6vw, 96px); }
.stage { grid-column: 2; grid-row: 1 / span 2; }

.brand { display: flex; align-items: center; gap: 12px; margin: 0 0 clamp(48px, 9vw, 104px); font: 600 1.5rem/1 var(--display); letter-spacing: -0.01em; }
.brand img { width: 44px; height: 44px; border-radius: 23%; }

h1, h2, h3 { font-family: var(--display); color: var(--text); margin: 0; }
h1 { font-weight: 600; font-size: clamp(3rem, 6vw, 5.4rem); line-height: 1.02; letter-spacing: -0.025em; margin-bottom: 28px; }
h2 { font-weight: 600; font-size: clamp(1.7rem, 2.4vw, 2.15rem); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 14px; }
h2.big { font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 1.04; letter-spacing: -0.025em; margin-bottom: 24px; }
h3 { font-weight: 600; font-size: 1.35rem; margin-bottom: 12px; }
p { margin: 0 0 16px; }
.lede { font-size: clamp(1.3rem, 1.8vw, 1.55rem); line-height: 1.42; font-weight: 500; margin-bottom: 30px; max-width: 26em; }
.story section { margin-top: clamp(48px, 6vw, 72px); }
.story section p { color: var(--dim); }
.story section b { color: var(--text); }

.chapter-2 .story-head { padding-top: clamp(48px, 7vw, 96px); }

.get { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-bottom: 30px; }
.store { display: inline-block; line-height: 0; border-radius: 10px; }
.store img { width: 150px; height: auto; }
.get span { font-size: 1rem; line-height: 1.45; color: var(--dim); }

.try { display: flex; align-items: center; gap: 14px; font-weight: 600; font-size: 1.0625rem; color: var(--accent); }
.try-arrow { width: 30px; height: 2.5px; background: currentColor; border-radius: 2px; position: relative; flex: none; }
.try-arrow::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6.25px solid transparent; border-left-color: currentColor; border-right: 0; }

.kinds { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.kinds li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; color: var(--dim); }
.kinds svg { width: 22px; height: 22px; margin-top: 4px; }
.k-active { color: var(--pink); } .k-waiting { color: #5772ad; } .k-done { color: #49855a; }
@media (prefers-color-scheme: dark) { .k-waiting { color: #7f9be0; } .k-done { color: #6fbf86; } }

/* ── The stage: sticky, with Chester's glow behind the window ──────────── */

.stage {
  position: sticky; top: 0; align-self: start; container-type: inline-size;
  min-height: 100vh; padding: clamp(24px, 4vh, 56px) 0;
  display: flex; flex-direction: column; justify-content: center;
}
.stage::before {
  content: ""; position: absolute; inset: 6% -10% 6% -6%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 50% at 30% 35%, var(--glow-a), transparent 70%),
    radial-gradient(50% 45% at 75% 75%, var(--glow-b), transparent 70%);
}
.stage-note { margin: 16px 4px 0; font-size: 0.9375rem; color: var(--dim); }

/* ── The window ─────────────────────────────────────────────────────────── */

.win {
  --side: 210px;
  position: relative;
  display: grid; grid-template-columns: var(--side) minmax(0, 1fr);
  height: min(680px, calc(100vh - 140px)); min-height: 460px;
  background: var(--w-bg); color: var(--w-text);
  border-radius: 14px; overflow: hidden; box-shadow: var(--w-shadow);
  font: 400 13px/1.3 var(--sans);
}
.win svg { width: 1em; height: 1em; flex: none; }

.win-side { background: var(--w-side); display: flex; flex-direction: column; padding: 14px 10px 10px; border-right: 1px solid var(--w-card-line); }
.lights { display: flex; gap: 8px; padding: 2px 6px 18px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; } .lights i:nth-child(3) { background: #28c840; }
.side { flex: 1; overflow: auto; }
.side-h { font-size: 11px; font-weight: 600; color: var(--w-head); margin: 10px 8px 4px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side button {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  border: 0; background: none; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px;
}
.side button svg { width: 17px; height: 17px; color: var(--blue); }
.side button .n { margin-left: auto; font-size: 11px; color: var(--w-dim); font-variant-numeric: tabular-nums; }
.side button:hover { background: color-mix(in srgb, var(--w-sel) 60%, transparent); }
.side button[aria-pressed="true"] { background: var(--w-sel); font-weight: 600; }
.side .add { color: var(--w-dim); } .side .add svg { color: var(--w-dim); }
.sync { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 6px 2px; border-top: 1px solid var(--w-card-line); font-size: 11px; }
.sync svg { width: 16px; height: 16px; color: #2ba84a; }
.sync small { color: var(--w-dim); font-size: 11px; }

/* min-height 0 lets the list fit the window and scroll inside it; without it the
   list grew to its full length, never scrolled, and swallowed the page's scrolling */
.win-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.win-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px 10px; border-bottom: 1px solid var(--w-card-line); }
.win-title { font: 600 15px/1.2 var(--sans); color: var(--w-text); margin: 0; letter-spacing: 0; }
.client-pick { display: none; margin-left: auto; }
.client-pick select { font: 500 13px var(--sans); color: var(--w-text); background: var(--w-card); border: 1px solid var(--w-card-line); border-radius: 8px; padding: 6px 8px; }

.list { flex: 1; min-height: 0; overflow: auto; padding: 4px 16px 24px; }
.sec { padding: 8px 0 6px; border-radius: 10px; transition: background-color .15s; }
.sec.over { background: color-mix(in srgb, var(--sec, #888) 12%, transparent); }
.sec-h {
  display: flex; align-items: center; gap: 7px; padding: 8px 2px 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--w-head);
}
.sec-h svg { width: 13px; height: 13px; color: var(--sec); }
.sec-h .n { font-variant-numeric: tabular-nums; }
.cards { display: grid; gap: 6px; }
/* An empty stage takes a drop over a card's height, in em so it grows with the text,
   and says what a drop will do, so the highlight isn't colour alone (as in the app). */
.empty {
  display: flex; align-items: center; min-height: 4.485em; padding: 10px 14px 10px 28px;   /* a card: two lines inside 10 px padding */
  border: 1px dashed color-mix(in srgb, var(--sec, var(--w-dim)) 45%, transparent); border-radius: 10px;
  color: var(--w-dim); font-size: 13px; line-height: 1.3;
}
.empty .over { display: none; }
.sec.over .empty { border: 2px solid var(--sec, var(--w-dim)); background: color-mix(in srgb, var(--sec, #888) 12%, transparent); color: var(--w-text); }
.sec.over .empty .idle { display: none; }
.sec.over .empty .over { display: inline; }

.card {
  position: relative; display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; text-align: left; cursor: grab; touch-action: pan-y;
  background: var(--w-card); border: 1px solid var(--w-card-line); border-radius: 10px;
  padding: 10px 14px 10px 10px; font-size: 13px;
  transition: transform .2s, opacity .2s;
}
.card .bar { align-self: stretch; border-radius: 2px; background: var(--sec, #999); }
.card .t { display: block; font-weight: 600; font-size: 14px; line-height: 1.25; }
.card .meta { display: flex; gap: 12px; margin-top: 3px; font-size: 11.5px; color: var(--w-dim); }
.card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.card .meta svg { width: 12px; height: 12px; }
.card .notes { display: block; margin-top: 3px; font-size: 11.5px; color: var(--w-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.kind { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--w-dim); }
.kind svg { width: 10px; height: 10px; color: var(--sec); }
.due { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 500; color: var(--w-dim); }
.due svg { width: 11px; height: 11px; }
.due.overdue { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--w-text); } .due.overdue svg { color: var(--red); }
.due.today { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--w-text); } .due.today svg { color: var(--orange); }
.due.soon { background: color-mix(in srgb, var(--yellow-badge) 24%, transparent); color: var(--w-text); } .due.soon svg { color: #d1a400; }
.card:hover { border-color: color-mix(in srgb, var(--w-text) 18%, transparent); }
.card.lift { opacity: .35; }
.ghost {
  position: fixed; z-index: 100; pointer-events: none; margin: 0;
  box-shadow: 0 18px 40px rgb(0 0 0 / .28); transform: rotate(-1.5deg) scale(1.02); cursor: grabbing;
}
.flash { animation: flash 1.1s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--sec, var(--accent)); } to { box-shadow: 0 0 0 3px transparent; } }

/* the context menu, as in the app */
.menu {
  position: absolute; z-index: 20; min-width: 230px; max-height: 70%; overflow: auto;
  background: color-mix(in srgb, var(--w-bg) 92%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--w-card-line); border-radius: 10px; padding: 5px;
  box-shadow: 0 14px 40px rgb(0 0 0 / .22);
}
.menu p { margin: 6px 10px 2px; font-size: 11px; font-weight: 600; color: var(--w-head); }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 5px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.menu button svg { width: 13px; height: 13px; color: var(--sec, var(--w-dim)); }
.menu button:hover, .menu button:focus-visible { background: var(--blue); color: #fff; outline: none; }
.menu button:hover svg, .menu button:focus-visible svg { color: #fff; }
.menu hr { border: 0; border-top: 1px solid var(--w-card-line); margin: 4px 6px; }

/* narrow windows: the sidebar becomes a menu, as on iPhone */
@container (max-width: 600px) {
  .win { grid-template-columns: 0 minmax(0, 1fr); }
  .win-side { visibility: hidden; }
  .client-pick { display: block; }
}

/* ── The pipeline editor: a sheet ─────────────────────────────────────── */

.win-sheet { display: flex; flex-direction: column; grid-template-columns: none; max-width: 600px; }
.ed-list { list-style: none; margin: 0; padding: 14px 20px 0; flex: 1; min-height: 0; overflow: auto; }
.ed-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--w-card-line); background: var(--w-bg); }
.ed-row.dragging { opacity: .4; }
.grip { width: 22px; height: 26px; display: grid; place-items: center; border: 0; background: none; color: var(--w-dim); cursor: grab; padding: 0; touch-action: none; border-radius: 5px; }
.grip svg { width: 16px; height: 16px; }
.ed-name { min-width: 0; border: 0; background: none; font: 400 14px var(--sans); color: var(--w-text); padding: 3px 0; border-radius: 4px; }
.ed-name::placeholder { color: var(--w-dim); }
.ed-name:focus { outline: none; box-shadow: 0 2px 0 0 var(--blue); border-radius: 0; }
.ed-end { display: flex; align-items: center; gap: 8px; }
.ed-dup { color: var(--orange); font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.ed-dup svg { width: 13px; height: 13px; }
.minus { border: 0; background: none; padding: 2px; color: var(--w-dim); cursor: pointer; display: grid; border-radius: 50%; transition: transform .2s, color .2s; }
.minus svg { width: 17px; height: 17px; }
.minus[aria-expanded="true"] { color: var(--red); transform: rotate(90deg); }
.del { border: 0; background: var(--red); color: #fff; font: 600 12px var(--sans); padding: 4px 10px; border-radius: 99px; cursor: pointer; }
.ed-kind { grid-column: 1; display: grid; place-items: center; }
.ed-kind svg { width: 16px; height: 16px; }
.seg { grid-column: 2 / -1; display: inline-flex; justify-self: start; background: var(--w-card); border-radius: 8px; padding: 2px; border: 0; margin: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 4px 16px; border-radius: 6px; font-size: 13px; }
.seg input:checked + span { background: var(--blue); color: #fff; font-weight: 500; }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.ed-foot { padding: 12px 20px 16px; border-top: 1px solid var(--w-card-line); background: var(--w-side); }
.ed-warn { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--w-dim); margin: 0 0 10px; }
.ed-warn svg { width: 15px; height: 15px; color: var(--orange); }
.ed-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flex { flex: 1; }
.pill { border: 1px solid var(--w-card-line); background: var(--w-bg); color: var(--w-text); font: 500 13px var(--sans); padding: 7px 14px; border-radius: 99px; cursor: pointer; box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
.pill:hover:not(:disabled) { border-color: color-mix(in srgb, var(--w-text) 25%, transparent); }
.pill:disabled { opacity: .45; cursor: default; }
.pill.prominent { background: var(--blue); border-color: transparent; color: #fff; font-weight: 600; }
.pill.confirm { background: var(--red); border-color: transparent; color: #fff; }

/* ── After the chapters ───────────────────────────────────────────────── */

.after { border-top: 1px solid var(--hair); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px); }
.devices { padding: clamp(64px, 9vw, 120px) 0 0; background: linear-gradient(180deg, var(--paper), var(--paper-2)); }
.intro { color: var(--dim); max-width: 36em; font-size: 1.25rem; }
.shots {
  max-width: 1320px; margin: clamp(40px, 6vw, 72px) auto 0; padding: 0 clamp(20px, 4vw, 64px);
  display: grid; grid-template-columns: 1.5fr 0.27fr 0.5fr; gap: clamp(12px, 2vw, 32px); align-items: end;
}
.shots figure { margin: 0; }
.shot-mac { margin: 0 -2% -1.5% -3% !important; }   /* the capture carries the window shadow */
.shot-iphone { margin-bottom: 2% !important; }
.access { padding-top: clamp(48px, 6vw, 80px); padding-bottom: clamp(64px, 9vw, 112px); }
.access ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 48px; max-width: 980px; }
.access li { color: var(--dim); border-top: 1px solid var(--hair); padding-top: 14px; }
.access b { color: var(--text); }

.prose { padding-top: clamp(64px, 8vw, 104px); }
.prose ul { max-width: 40em; padding-left: 1.1em; margin: 20px 0 0; color: var(--dim); }
.prose li { margin-top: 12px; }
.prose li::marker { color: var(--accent); }
.updated { color: var(--dim); margin-top: 24px; font-size: 1rem; }

.footer {
  max-width: 1180px; margin: clamp(72px, 9vw, 120px) auto 0; padding: 28px clamp(20px, 4vw, 64px) 48px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  border-top: 1px solid var(--hair); font-size: 1rem; color: var(--dim);
}
.footer p { margin: 0; display: flex; gap: 22px; }
.footer a { color: inherit; }
.footer a:hover { color: var(--accent); }

/* ── Small screens: the story, then the app, then the rest of the story ── */

@media (max-width: 960px) {
  .chapter { grid-template-columns: minmax(0, 1fr); }
  .story, .stage { grid-column: 1; grid-row: auto; max-width: 40rem; }
  .stage { position: relative; min-height: 0; padding: 8px 0 0; }
  /* phones and tablets: no scrolling inside the windows; they run the full length of
     the page, so a swipe anywhere always scrolls the page */
  .win, .win-sheet { height: auto; min-height: 0; max-width: none; }
  .list, .ed-list { overflow: visible; }
  .brand { margin-bottom: 40px; }
  .shots { grid-template-columns: 1fr 1fr; }
  .shot-mac { grid-column: 1 / -1; }
  .access ul { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 1.125rem; }
  .win { border-radius: 12px; }
  .card .notes { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .minus, .sec { transition: none; }
  .flash { animation: none; }
}
@media (forced-colors: active) {
  .stage::before { display: none; }
  .card .bar, .seg input:checked + span, .pill.prominent { forced-color-adjust: none; }
}
