/* PENN demo deck. Tokens are the frontend's (frontend/app/globals.css, frontend/lib/api.ts), at slide scale.
   Every slide is drawn on a fixed 1920x1080 stage; deck.js scales the stage to the window. */
@import url("assets/fonts/fonts.css");

:root {
  color-scheme: light;
  /* frontend/app/globals.css */
  --ink: #1B2433;
  --muted: #5A6474;
  --rule: #E1E4E8;
  --wash: #F4F5F6;
  --surface: #FFFFFF;
  --sign: #1E5B44;          /* street-name sign green */
  --hl: #FFD43B;            /* highlighter: what an answer cites */
  --construction: #E35205;
  --event: #5A3FC0;
  --blockparty: #0E9F6E;
  --parking: #6B7280;
  --listing: var(--ink);
  --ticketed: var(--ink);
  --ui: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  --flat: 0 0 0 1px rgba(27, 36, 51, .09), 0 1px 2px rgba(27, 36, 51, .06);
  --lift: 0 1px 2px rgba(27, 36, 51, .12), 0 6px 20px rgba(27, 36, 51, .10);
  --high: 0 0 0 1px rgba(27, 36, 51, .05), 0 2px 4px rgba(27, 36, 51, .08), 0 16px 40px rgba(27, 36, 51, .18);
  /* frontend/lib/api.ts GROUND */
  --land: #F4F5F1;
  /* The frontend's corners at slide scale: a 1920 stage reads like the app zoomed about 2x. */
  --r-card: 24px;
  --r-ctl: 14px;
  --r-chip: 8px;
  /* Placeholders: loud on purpose, so none survives into a recording unnoticed. */
  --todo: #D6246E;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--ink); color: var(--ink); font: 24px/1.4 var(--ui); -webkit-font-smoothing: antialiased; }

/* ---- the stage ---- */
#stage {
  position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; overflow: hidden;
  transform-origin: 0 0; background: var(--wash);
}
.slide { position: absolute; inset: 0; overflow: hidden; visibility: hidden; background: var(--wash); }
.slide.is-active { visibility: visible; }
/* Notes live in each slide's markup and are only ever read into #notes-panel. */
.slide > .notes { display: none; }

/* ---- shared pieces ---- */
.basemap { position: absolute; inset: 0; width: 1920px; height: 1080px; display: block; }
.card { position: absolute; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--high); }
/* The place plate from the answer view: a street-name sign. One per slide carries the slide's phrase. */
.plate {
  position: absolute; display: inline-block; white-space: nowrap;
  font: 600 52px/1 var(--display); letter-spacing: .02em; color: #fff; background: var(--sign);
  padding: 12px 22px 10px; border-radius: var(--r-chip);
  box-shadow: inset 0 0 0 4px var(--sign), inset 0 0 0 7px rgba(255, 255, 255, .9), var(--lift);
}
.todo {
  display: inline-block; font: 600 20px/1.3 var(--ui); color: var(--todo); background: #fff;
  border: 2px dashed var(--todo); border-radius: var(--r-chip); padding: 4px 10px;
}

/* ---- 1. Hook ---- */
#s1 .basemap { opacity: .42; filter: saturate(.55); }
#s1-ask {
  left: 300px; top: 456px; width: 1320px; height: 168px; padding: 0 18px 0 48px;
  display: flex; align-items: center; gap: 24px; border-radius: 34px;
}
#s1-ask .ask-text { flex: 1; font: 400 54px/1.12 var(--ui); text-wrap: balance; }
#s1-ask .ask-btn {
  flex: none; height: 132px; padding: 0 56px; border-radius: 22px; background: var(--hl);
  display: grid; place-items: center; font: 700 48px/1 var(--ui);
}
#s1-ask .todo { position: absolute; left: 48px; top: calc(100% + 14px); }
.source-card {
  width: 380px; padding: 22px 26px 22px 24px; display: grid; grid-template-columns: 64px 1fr; gap: 4px 20px; align-items: center;
  border-radius: var(--r-card);
}
.source-card .glyph { grid-row: span 2; width: 64px; height: 64px; }
.source-card .label { font: 600 30px/1.15 var(--ui); }
.source-card .source { font: 400 21px/1.2 var(--ui); color: var(--muted); }
#s1-card-permits { left: 120px; top: 120px; }
#s1-card-blockparties { left: 770px; top: 84px; }
#s1-card-closures { left: 1420px; top: 168px; }
#s1-card-tickets { left: 250px; top: 812px; }
#s1-card-picks { left: 1330px; top: 838px; }

/* ---- 2. Laminates ---- */
/* Each layer is a full-stage container: its tinted sheet, its features, its labels and its legend row. */
.map-layer { position: absolute; inset: 0; }
.map-layer .sheet { position: absolute; inset: 0; background: var(--c); opacity: .045; }
.map-layer .features { position: absolute; inset: 0; width: 1920px; height: 1080px; overflow: visible; }
.features .casing { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 9; }
.features .line { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
.features .line.full { stroke-width: 5.5; }
.features .line.lane { stroke-width: 2.6; opacity: .85; }
#s2-layer-construction { --c: var(--construction); }
#s2-layer-blockparties { --c: var(--blockparty); }
#s2-layer-eventclosures { --c: var(--event); }
#s2-layer-ticketed { --c: var(--ticketed); }
/* A label: a dot on the feature (placed by deck.js from data-lon/data-lat) and a pill offset by --dx/--dy. */
.geo { position: absolute; width: 0; height: 0; }
.geo .dot {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 0 3px #fff;
}
.geo .pill {
  position: absolute; left: var(--dx, 0px); top: var(--dy, 0px); transform: translate(-50%, -50%); white-space: nowrap;
  font: 600 22px/1 var(--ui); color: #fff; background: var(--c); padding: 9px 16px 10px; border-radius: 999px;
  box-shadow: 0 0 0 3px #fff, var(--lift);
}
.geo .pill small { font-weight: 400; opacity: .85; margin-left: 8px; font-size: 20px; }
/* Labels, the legend card and its rows sit over every layer's lines. The layer containers make no stacking
   context of their own (no z-index, transform or opacity), so these z-indexes reach across layers; an animation
   that transforms or fades a whole layer would put its labels back under the later layers. */
.geo, .legend-row { z-index: 3; }
#s2-legend-card { z-index: 2; left: 1452px; top: 610px; width: 428px; height: 430px; }
#s2-plate { z-index: 3; left: 1452px; top: 520px; }
.legend-row {
  position: absolute; left: 1480px; top: calc(632px + var(--row) * 100px); width: 380px; height: 88px;
  display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 18px; align-content: center;
}
.legend-row svg { grid-row: span 2; width: 52px; height: 52px; align-self: center; }
.legend-row .name { font: 600 26px/1.2 var(--ui); }
.legend-row .src { grid-column: 2; font: 400 19px/1.3 var(--ui); color: var(--muted); }
#s2-legend-construction { --row: 0; }
#s2-legend-blockparties { --row: 1; }
#s2-legend-eventclosures { --row: 2; }
#s2-legend-ticketed { --row: 3; }
/* Alignment check: ?debug draws City Hall's centroid from its coordinates. */
#s2-debug { display: none; }
body.debug #s2-debug { display: block; }
#s2-debug .cross { position: absolute; left: -30px; top: -30px; width: 60px; height: 60px;
  background: linear-gradient(#D6246E, #D6246E) center / 2px 100% no-repeat, linear-gradient(#D6246E, #D6246E) center / 100% 2px no-repeat; }

/* ---- 3 to 6. The app, from screenshots ----
   Each slide is the real PENN window (assets/app/*.webp, 1920x1080 at 2x, captured by tools/capture_app.py) with
   its items placed in the same window px. Every item is positioned by --x/--y (and --w/--h for boxes), so an item
   can be moved without touching the others. Screenshots stack in order: the later state is on top. */
.app-slide .item { position: absolute; left: var(--x); top: var(--y); }
.app-slide .shot { left: 0; top: 0; width: 1920px; height: 1080px; display: block; }
/* A camera target: where a zoom should frame for this beat. Not drawn; ?debug outlines it. */
.app-slide .focus { width: var(--w); height: var(--h); visibility: hidden; pointer-events: none; }
body.debug .app-slide.is-active .focus { visibility: visible; outline: 3px dashed var(--todo); outline-offset: -3px; }
body.debug .app-slide .focus::after { content: attr(id); position: absolute; left: 4px; top: 4px; font: 600 14px/1 var(--ui);
  color: #fff; background: var(--todo); padding: 3px 6px; border-radius: 4px; }
/* A highlight on something in the window. */
.app-slide .ring { width: var(--w); height: var(--h); border-radius: var(--r-ctl);
  box-shadow: 0 0 0 4px var(--hl), 0 0 22px 6px rgba(255, 212, 59, .55); }
/* The pointer, drawn at 2x: its tip (3, 2 of 24) sits on --x/--y. */
.app-slide .cursor { width: 48px; height: 48px; margin: -4px 0 0 -6px; filter: drop-shadow(0 2px 3px rgba(27, 36, 51, .35)); }
.app-slide .cursor svg { width: 100%; height: 100%; display: block; }
/* The logic flow, at the map's top-right corner, clear of the zoom buttons. */
.app-slide .flow { left: auto; right: var(--flow-r, 72px); top: 74px; width: 700px; height: 270px;
  background: rgba(255, 255, 255, .96); border-radius: var(--r-card); box-shadow: var(--high); }
.flow svg { width: 100%; height: 100%; display: block; }
.flow-node rect { fill: var(--surface); stroke: var(--rule); stroke-width: 2; }
.flow-node .t { font: 600 19px var(--ui); fill: var(--ink); }
.flow-node .s { font: 400 15px/1.25 var(--ui); fill: var(--muted); color: var(--muted); margin: 0; }
.flow-node.in rect { fill: var(--ink); stroke: none; }
.flow-node.in .t { fill: #fff; }
.flow-node.in .s { color: rgba(255, 255, 255, .82); }
.flow-node.out rect { fill: var(--hl); stroke: none; }
.flow-node.out .s { color: var(--ink); }
.flow-node.tool rect { stroke: var(--ink); stroke-width: 2.5; }
.flow-node.store rect { fill: var(--wash); }
.flow-node.web rect { fill: var(--wash); stroke: var(--muted); stroke-dasharray: 6 5; }
.flow-edge { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-linejoin: round; marker-end: url(#arrow); }
.flow-edge.web { stroke-dasharray: 7 6; }
.app-slide .caption { transform: translateX(-50%); white-space: nowrap; }
.app-slide .caption span { display: block; font: 600 34px/1.2 var(--ui); color: #fff; background: rgba(27, 36, 51, .9);
  padding: 12px 24px; border-radius: var(--r-ctl); }
.app-slide .callout { display: flex; align-items: baseline; gap: 12px; background: var(--surface); border-radius: var(--r-ctl);
  padding: 12px 20px; box-shadow: var(--high), inset 5px 0 0 var(--hl); white-space: nowrap; }
.app-slide .callout b { font: 700 30px/1 var(--ui); }
.app-slide .callout span { font: 400 26px/1 var(--ui); color: var(--muted); }

/* ---- 7. Architecture ---- */
#s7-diagram { position: absolute; inset: 0; width: 1920px; height: 1080px; }
.arch-node rect { fill: var(--surface); stroke: none; filter: drop-shadow(0 1px 2px rgba(27, 36, 51, .12)) drop-shadow(0 6px 14px rgba(27, 36, 51, .08)); }
.arch-node .t { font: 600 28px var(--ui); fill: var(--ink); }
.arch-node .s { font: 400 20px var(--ui); fill: var(--muted); }
.arch-node.model rect { fill: var(--ink); }
.arch-node.model .t { fill: #fff; }
.arch-node.model .s { fill: rgba(255, 255, 255, .8); }
.arch-node.store rect { stroke: var(--ink); stroke-width: 3; }
.arch-node.tool .t { font: 600 27px var(--ui); }
.arch-node.container > rect { fill: var(--surface); }
.arch-node.web rect { fill: var(--wash); stroke: var(--muted); stroke-width: 2; stroke-dasharray: 7 6; filter: none; }
.arch-node.source rect { fill: var(--surface); }
.arch-node.source .t { font: 600 22px var(--ui); }
.arch-node.source .s { font: 400 17px var(--ui); }
.arch-node.checks rect { fill: var(--surface); stroke: var(--hl); stroke-width: 5; }
.arch-edge { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linejoin: round; marker-end: url(#arrow); }
.arch-edge.web { stroke-dasharray: 8 7; }
.arch-edge.feed { stroke-width: 2.5; marker-end: url(#arrow-small); }
.arch-edge.answer { stroke: var(--sign); stroke-width: 4; marker-end: url(#arrow-sign); }
.arch-label { font: 400 19px var(--ui); fill: var(--muted); }
.arch-label.answer { fill: var(--sign); font-weight: 600; }
.arch-note { font: 400 19px var(--ui); fill: var(--muted); }
#s7-plate { left: 80px; top: 52px; }

/* ---- 8. Closing ---- */
#s8 .basemap { opacity: .32; filter: saturate(.5); }
#s8-sign {
  left: 50%; top: 330px; transform: translateX(-50%);
  font: 700 190px/1 var(--display); letter-spacing: .06em; padding: 26px 56px 18px; border-radius: 22px;
  box-shadow: inset 0 0 0 10px var(--sign), inset 0 0 0 17px rgba(255, 255, 255, .92), var(--high);
}
#s8-name { position: absolute; left: 0; right: 0; top: 600px; text-align: center; font: 600 46px/1.2 var(--display); letter-spacing: .02em; }
#s8-line { position: absolute; left: 0; right: 0; top: 670px; text-align: center; font: 400 34px/1.35 var(--ui); color: var(--muted); }
#s8-link { position: absolute; left: 0; right: 0; top: 800px; text-align: center; }
#s8-link .todo { font-size: 28px; padding: 8px 18px; }

/* ---- notes (N) ---- */
#notes-panel {
  position: fixed; left: 16px; right: 16px; bottom: 16px; max-height: 42vh; overflow: auto; z-index: 10;
  background: rgba(255, 255, 255, .97); color: var(--ink); border-radius: 14px; box-shadow: var(--high);
  padding: 16px 22px; font: 15px/1.5 var(--ui);
}
#notes-panel[hidden] { display: none; }
#notes-panel h2 { font: 600 13px/1 var(--ui); color: var(--muted); margin: 0 0 10px; }
#notes-panel h3 { font: 700 14px/1.2 var(--ui); margin: 12px 0 4px; }
#notes-panel p, #notes-panel ul { margin: 0 0 6px; max-width: 110ch; }
#notes-panel .todo { font-size: 13px; padding: 1px 6px; border-width: 1.5px; }
