/* Shared styles for presentation.qmd (Quarto reveal.js) and the pandoc preview */
:root {
  --ink: #e6e8eb; --muted: #9aa4b2; --accent: #7aa2ff; --pos: #45c27a; --neg: #f2707a;
  --panel: #151b23; --line: #2b3340; --violet: #b18cff;
}
.reveal { font-size: 30px; }
.reveal .slides section { text-align: left; }
.reveal h1, .reveal h2 { letter-spacing: -0.01em; text-transform: none; }
.reveal h2 { font-size: 1.45em; margin-bottom: 0.5em; }
.reveal .muted, .reveal small { color: var(--muted); }
.reveal .accent { color: var(--accent); }
.reveal .pos { color: var(--pos); font-weight: 600; }
.reveal .neg { color: var(--neg); font-weight: 600; }
.reveal .tag { display: inline-block; padding: 2px 12px; border-radius: 99px; font-size: 0.6em; font-weight: 700; vertical-align: middle; }
.reveal .tag.done { background: rgba(69,194,122,.18); color: var(--pos); }
.reveal .tag.next { background: rgba(177,140,255,.18); color: var(--violet); }
.reveal .big { font-size: 2.2em; font-weight: 800; line-height: 1.05; }
.reveal .lead { font-size: 1.15em; line-height: 1.4; }
.reveal table { font-size: 0.8em; }
.reveal table th { color: var(--muted); }
.reveal img.shot { border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.45); }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat .n { font-size: 1.6em; font-weight: 800; color: var(--ink); }
.stat .l { font-size: 0.62em; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* pipeline diagram */
.flow { display: flex; align-items: stretch; gap: 10px; margin-top: 24px; }
.flow .node { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; font-size: 0.7em; line-height: 1.35; }
.flow .node b { display: block; font-size: 1.25em; color: var(--accent); margin-bottom: 6px; }
.flow .arrow { align-self: center; color: var(--muted); font-size: 1.1em; }

/* timeline */
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.timeline .step { border-top: 4px solid var(--accent); background: var(--panel); border-radius: 0 0 12px 12px; padding: 16px 18px; font-size: 0.72em; }
.timeline .step .d { color: var(--accent); font-weight: 800; font-size: 1.3em; }

/* criteria grid */
.criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.criteria .c { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; font-size: 0.72em; }
.criteria .c b { color: var(--accent); font-size: 1.2em; }

/* lets the pandoc preview honour Quarto's .smaller slides */
.reveal .slides section.smaller { font-size: 0.82em; }

/* hub diagram: Supabase in the centre */
.hub { display: grid; grid-template-columns: 1fr auto 1.35fr auto 1.7fr auto 1.15fr; grid-template-rows: auto repeat(3, 1fr); gap: 10px 10px; margin-top: 14px; align-items: stretch; }
.hub .col-h { font-size: 0.5em; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.hub .node { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 0.58em; line-height: 1.3; }
.hub .node b { display: block; font-size: 1.15em; margin-bottom: 3px; color: var(--accent); }
.hub .node.src b { color: var(--ink); }
.hub .node.db { grid-column: 5; grid-row: 2 / span 3; border: 2px solid var(--pos); background: rgba(69,194,122,.07); }
.hub .node.db b { color: var(--pos); font-size: 1.35em; }
.hub .node.db ul { margin: 6px 0 6px 1.1em; padding: 0; }
.hub .node.db li { margin: 3px 0; }
.hub .node.db .sm { color: var(--muted); font-size: 0.92em; }
.hub .node.web { grid-column: 7; grid-row: 2 / span 3; align-self: center; }
.hub .arrow { align-self: center; color: var(--muted); font-size: 0.9em; }
.hub .arrow.both { color: var(--pos); font-weight: 700; }
.hub .arrow.out { grid-column: 6; grid-row: 2 / span 3; }
.hub code { font-size: 0.92em; color: var(--ink); background: rgba(255,255,255,.06); padding: 0 4px; border-radius: 4px; }

/* sponsor emphasis: Fidelity (green) and n8n (coral) */
:root { --fid: #3fa45b; --n8n: #ff6d5a; }
.reveal .chip { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 0.78em; font-weight: 800; letter-spacing: .04em; text-transform: none; vertical-align: middle; }
.reveal .chip.fid { background: rgba(63,164,91,.2); color: var(--fid); border: 1px solid var(--fid); }
.reveal .chip.n8n { background: rgba(255,109,90,.18); color: var(--n8n); border: 1px solid var(--n8n); }
.reveal .chip.big { font-size: 1em; padding: 3px 14px; }
.hub .node.fid { border: 2px solid var(--fid); background: rgba(63,164,91,.1); }
.hub .node.fid b { color: var(--fid); font-size: 1.45em; }
.hub .node.fid .chip { font-size: 0.85em; margin-bottom: 4px; }
.hub .node.n8n { border: 2px solid var(--n8n); background: rgba(255,109,90,.08); }
.hub .node.n8n b { color: var(--n8n); }
.hub .col-h .chip { font-size: 1.1em; letter-spacing: 0; }
.hub .node.db { border: 1px solid var(--accent); background: var(--panel); }
.hub .node.db b { color: var(--accent); font-size: 1.2em; }
.hub .arrow.both { color: var(--n8n); }
.sponsors { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 18px; }
.sponsors .sp { background: var(--panel); border-radius: 16px; padding: 20px 24px; font-size: 0.66em; line-height: 1.4; }
.sponsors .sp.fid { border: 2px solid var(--fid); background: linear-gradient(180deg, rgba(63,164,91,.14), var(--panel) 55%); }
.sponsors .sp.n8n { border: 2px solid var(--n8n); background: linear-gradient(180deg, rgba(255,109,90,.13), var(--panel) 55%); }
.sponsors .name { font-size: 2.3em; font-weight: 800; margin-top: 6px; line-height: 1.1; }
.sponsors .fid .name { color: var(--fid); } .sponsors .n8n .name { color: var(--n8n); }
.sponsors .role { color: var(--muted); font-size: 1.1em; margin-bottom: 8px; }
.sponsors ul { margin: 0 0 0 1.1em; padding: 0; } .sponsors li { margin: 6px 0; }
.reveal .powered { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 0.7em; color: var(--muted); margin: 22px 0 10px; }

/* animated process flow */
.pflow { margin-top: 4px; }
.pf-svg { width: 100%; height: auto; display: block; font-family: inherit; }
.pf-group { fill: rgba(255,109,90,.06); stroke: var(--n8n); stroke-width: 1.5; stroke-dasharray: 6 5; }
.pf-grouplabel { fill: var(--n8n); font-size: 15px; font-weight: 800; letter-spacing: .04em; }
#pf-lines line { stroke: var(--line); stroke-width: 3; transition: stroke .3s; }
#pf-lines line.on { stroke: var(--ink); stroke-width: 3.5; }
.pf-tipfill { fill: var(--ink); }
.pf-node rect { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; transition: all .3s; }
.pf-node text { text-anchor: middle; transition: fill .3s; }
.pf-node .t { font-size: 21px; font-weight: 800; fill: var(--ink); }
.pf-node .s { font-size: 14px; fill: var(--muted); }
.pf-node.fid rect { stroke: var(--fid); stroke-width: 2.5; fill: rgba(63,164,91,.12); } .pf-node.fid .t { fill: var(--fid); font-size: 25px; }
.pf-node.n8n rect { stroke: var(--n8n); stroke-width: 2; fill: rgba(255,109,90,.1); } .pf-node.n8n .t { fill: var(--n8n); }
.pf-node.db rect { stroke: var(--accent); fill: rgba(122,162,255,.08); } .pf-node.db .t { fill: var(--accent); }
.pf-node.on rect { stroke-width: 4; filter: drop-shadow(0 0 10px rgba(255,255,255,.25)); }
.pf-node.src.on rect, .pf-node.web.on rect { stroke: var(--ink); }
#pf-dotbg { fill: #ffd166; } #pf-dottext { fill: #1b1b1b; font-size: 14px; font-weight: 800; text-anchor: middle; }
.pf-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 12px; font-size: 0.62em; }
.pf-cap { flex: 1; min-height: 2.6em; line-height: 1.35; }
.pf-when { display: inline-block; background: #ffd166; color: #1b1b1b; font-weight: 800; border-radius: 99px; padding: 1px 10px; margin-right: 10px; font-size: .9em; }
.pf-ctl { display: flex; gap: 5px; align-items: center; white-space: nowrap; }
.pf-ctl button { width: 30px; height: 30px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: 700 14px/1 inherit; cursor: pointer; padding: 0; }
.pf-ctl button.on { background: #ffd166; color: #1b1b1b; border-color: #ffd166; }
#pf-play { margin-left: 8px; width: 38px; }

/* plain names: no colour emphasis on Fidelity, n8n or Alpha Vantage */
.reveal .chip, .reveal .chip.fid, .reveal .chip.n8n { background: none; border: 0; padding: 0; color: inherit; font-weight: inherit; letter-spacing: 0; font-size: inherit; }
.pf-group { fill: none; stroke: var(--line); }
.pf-grouplabel { fill: var(--muted); font-weight: 600; letter-spacing: 0; }
.pf-node.fid rect, .pf-node.n8n rect, .pf-node.db rect { stroke: var(--line); stroke-width: 1.5; fill: var(--panel); }
.pf-node.fid .t, .pf-node.n8n .t, .pf-node.db .t { fill: var(--ink); font-size: 21px; }
.pf-node.on rect { stroke: var(--ink); stroke-width: 3; }
.sponsors .sp.fid, .sponsors .sp.n8n { border: 1px solid var(--line); background: var(--panel); }
.sponsors .fid .name, .sponsors .n8n .name { color: var(--ink); font-size: 1.7em; }

/* higher contrast for the animated flow (was too dark on the projector) */
.pf-node rect, .pf-node.fid rect, .pf-node.n8n rect, .pf-node.db rect, .pf-node.src rect, .pf-node.web rect { fill: #262f3d; stroke: #6b7689; stroke-width: 2; }
.pf-node .t, .pf-node.fid .t, .pf-node.n8n .t, .pf-node.db .t { fill: #ffffff; font-size: 24px; }
.pf-node .s { fill: #c3cad6; font-size: 16px; }
.pf-node.on rect { fill: #34405a; stroke: #ffd166; stroke-width: 4; filter: drop-shadow(0 0 12px rgba(255,209,102,.45)); }
#pf-lines line { stroke: #6b7689; stroke-width: 3; }
#pf-lines line.on { stroke: #ffd166; stroke-width: 5; }
.pf-tipfill { fill: #ffd166; }
.pf-group { stroke: #8a94a6; stroke-width: 2; fill: rgba(255,255,255,.03); }
.pf-grouplabel { fill: #c3cad6; font-size: 17px; }
.pf-bar { font-size: 0.7em; }
.pf-cap { color: #ffffff; }
.pf-ctl button { color: #c3cad6; border-color: #6b7689; background: #262f3d; }

/* sources + impact columns */
.reveal p.src { font-size: 0.45em; color: var(--muted); margin-top: 18px; }
.reveal sup { font-size: 0.55em; color: var(--muted); }
.impact { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; margin-top: 10px; }
.impact .ic { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; font-size: 0.7em; line-height: 1.4; }
.impact .ic > b { display: block; font-size: 1.3em; margin-bottom: 6px; color: var(--accent); }
.impact ul { margin: 0 0 0 1.1em; padding: 0; } .impact li { margin: 8px 0; }

/* demo slide: today's Fidelity view */
.demo-today { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; margin-top: 4px; }
.demo-today img.shot { max-height: 540px; width: auto; margin: 0; }
.dt-h { font-size: 0.95em; font-weight: 800; margin: 0 0 12px; }
.dt-list { list-style: none; margin: 0; padding: 0; font-size: 0.8em; }
.dt-list li { margin: 10px 0; padding-left: 1.5em; position: relative; }
.dt-list li::before { position: absolute; left: 0; font-weight: 800; }
.dt-list li.yes::before { content: "✓"; color: var(--pos); }
.dt-list li.no { color: var(--muted); }
.dt-list li.no::before { content: "✗"; color: var(--neg); }
.dt-next { margin-top: 22px; font-size: 0.75em; color: #ffd166; font-weight: 700; }

/* problem slide with screenshot */
.prob { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: start; }
.prob img.shot { max-height: 520px; width: auto; margin: 0; }
.prob-text .lead { font-size: 0.8em; margin: 0 0 14px; line-height: 1.35; }
.prob-text .dt-h { font-size: 0.7em; margin-bottom: 4px; }
.prob-text .dt-list { font-size: 0.66em; } .prob-text .dt-list li { margin: 5px 0; }
.prob-facts { font-size: 0.6em; margin: 14px 0 0 1.1em; padding: 0; line-height: 1.35; } .prob-facts li { margin: 8px 0; }
/* demo link slide */
.demo-link { text-align: center; margin-top: 40px; }
.demo-link .dl-k { font-size: 0.8em; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin: 0; }
.demo-link .dl-url { font-size: 1.15em; font-weight: 800; margin-top: 10px; }
.demo-link a { color: #ffd166; text-decoration: none; border-bottom: 3px solid #ffd166; }
