/*
   This file has two parts:
     1. a generic CSS reset + base typography (safe to tweak: sizes,
        colors, the "a" link style, etc.)
     2. the "Slides specific part" below - the opacity/visibility rules
        that make step reveal, token animations and the overview modes
        work. Leave those alone unless you know what you're changing.

   Add your own per-slide rules (image widths, custom color classes,
   etc.) at the bottom of this file as your talk grows.
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ==========================================================================
   Theme: light on ink. Every slide artwork in img/ has a transparent
   background, so the slides float on the global backdrop without edges.
   ========================================================================== */

:root {
    --ink:    #0b0f1d;
    --text:   #eee7d8;
    --muted:  #a3aac0;
    --gold:   #f3b848;
    --teal:   #4fd1c5;
    --coral:  #ff6a5c;
    --rose:   #ff8fa8;
    --violet: #a594ff;
    --cyan:   #7cc4ff;
    --sans:   "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --serif:  "PT Serif", Georgia, serif;
    --glow:   0 0 14px rgba(11,15,29,.95), 0 0 4px rgba(11,15,29,.95);
}

html, body {
    background: var(--ink);
    color: var(--text);
}

body {
    font-family: var(--serif);
    min-height: 740px;
    line-height: 1;
    overflow: hidden;
}

b, strong { font-weight: bold }
i, em { font-style: italic }

/* colour words */
gold   { color: var(--gold); }
teal   { color: var(--teal); }
coral  { color: var(--coral); }
rose   { color: var(--rose); }
violet { color: var(--violet); }
cyan   { color: var(--cyan); }

a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(243,184,72,.5);
    transition: .3s;
}
a:hover { color: var(--gold); }

/* --- slides --------------------------------------------------------------- */

.step {
    position: relative;
    width: 900px;
    height: 620px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: var(--serif);
    font-size: 23px;
    line-height: 1.45;
    color: var(--text);
    text-shadow: var(--glow);
    transition: opacity .1s;
}

/* full-bleed artwork behind the slide */
.step > img.art {
    position: absolute;
    left: 0; top: 0;
    width: 900px; height: 620px;
    max-width: none;
    pointer-events: none;
    user-select: none;
}

/* a block of text placed on the slide */
.txt {
    position: absolute;
    left: 56px;
    top: 52px;
    width: 340px;
}

.kicker {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
}
.kicker .num { color: var(--muted); margin-right: .7em; }

h1, h2, h3 { font-weight: normal; text-align: left; }

h1 {
    font-size: 70px;
    line-height: 1.02;
    letter-spacing: -.01em;
}

h2 {
    font-size: 44px;
    line-height: 1.08;
    margin-bottom: 22px;
    letter-spacing: -.005em;
}

h2 em, h1 em { color: var(--gold); }

p { margin: 0 0 14px 0; }

.lead { font-size: 25px; }
.small { font-size: 18px; line-height: 1.45; }
.tiny  { font-size: 14px; line-height: 1.4; color: var(--muted); }
.muted { color: var(--muted); }
.cite  { font-size: 14px; color: var(--muted); font-style: italic; white-space: nowrap; }

.rule {
    width: 54px; height: 2px; margin: 18px 0;
    background: linear-gradient(90deg, var(--gold), rgba(243,184,72,0));
}

/* labels written on top of an artwork, positioned in % of the slide */
.label {
    position: absolute;
    transform: translate(10px, -50%);
    font-style: italic;
    font-size: 15px;
    color: var(--muted);
    white-space: nowrap;
}
.label.big { font-size: 22px; color: var(--gold); font-style: normal; letter-spacing: .02em; }
.label.left { transform: translate(calc(-100% - 12px), -50%); }

/* small rounded badge, e.g. the venue of a paper */
.badge {
    display: inline-block;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink);
    text-shadow: none;
    background: var(--gold);
    padding: 6px 13px 5px;
    border-radius: 30px;
    box-shadow: 0 0 22px rgba(243,184,72,.55);
    vertical-align: middle;
}

/* a quotation from a model */
.quote {
    font-size: 21px;
    font-style: italic;
    color: var(--coral);
    border-left: 2px solid var(--coral);
    padding: 2px 0 2px 16px;
    margin: 6px 0 14px;
}

/* a thin framed note */
.note {
    position: absolute;
    border: 1px solid rgba(243,184,72,.45);
    border-radius: 14px;
    padding: 14px 18px;
    background: rgba(11,15,29,.55);
    font-size: 18px;
    line-height: 1.4;
}

/* three-line definition list (3H) */
.hhh { margin: 4px 0 16px; }
.hhh div { margin-bottom: 10px; font-size: 20px; line-height: 1.35; }
.hhh b { font-weight: normal; font-size: 23px; display: block; }

ul.refs { margin: 0; padding: 0; list-style: none; }
ul.refs li { font-size: 16px; line-height: 1.4; margin-bottom: 8px; padding-left: 0; color: var(--text); }
ul.refs li::before { display: none; }
ul.refs li span { color: var(--muted); }

.flides-slide-number {
    position: absolute;
    right: 26px;
    bottom: 18px;
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: .15em;
    color: var(--muted);
    opacity: .7;
    pointer-events: none;
    text-shadow: none;
}

/* nested close-up slide (Sudoku cell): no number */
#cell .flides-slide-number { display: none; }
/* a dark matte behind the close-up, so the magnified Sudoku stays in the background */
#cell::before {
    content: "";
    position: absolute;
    left: -60px; top: -60px; right: -60px; bottom: -60px;
    background: radial-gradient(closest-side, rgba(11,15,29,.92) 55%, rgba(11,15,29,0));
    opacity: 0;
    transition: opacity .8s;
}
.flides-on-cell #cell::before { opacity: 1; }

/*
	Slides specific part
*/

#overview { 
    display: none 
}

#flides { 
    pointer-events: auto 
}

/*
 opacity issues for animations (token)
*/

.token {
    opacity: 0;
}

.token_invisible_past {
    opacity: 0;
}

.token_invisible_future {
    opacity: 0;
}

.token_visible {
    opacity: 1;
}

/*
 opacity issues for steps
*/

.step[data-fixed="1"] { 
     opacity: 1;
}

.step.active { 
     opacity: 1;
}

.step {
     opacity: .1;
}

/*
 opacity issues for slide_steps
*/

.slide_step.slide_step_visible { 
     opacity: 1;
}

.slide_step.slide_step_hidden { 
     opacity: .1;
}

.slide_step { 
     opacity: .1;
}

/*
 opacity issues for overview
*/

.flides-on-overview_intermediate .step.seen {
    opacity: 1;
}

.flides-on-overview_intermediate .slide_step { 
     opacity: 1;
}

.flides-on-overview .step {
    opacity: 1;
    cursor: pointer;
}

.flides-on-overview .slide_step {
    opacity: 1;
}

/*
 corner menu linking to the backup slides (budget, timeline, CV). It lives
 outside #flides (a sibling in the body, see index.html) so the canvas
 pan/zoom transform never touches it - position: fixed then places it in
 the actual top-right of the screen instead of some point on the canvas.
 Shown only while the overview is on screen.
*/
#backup-links {
    display: none;
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10;

    flex-direction: column;
    align-items: flex-end;
    gap: 8px;

    font-family: 'PT Sans', sans-serif;
    font-size: 18px;
}

body.flides-on-overview #backup-links {
    display: flex;
}

#backup-links a {
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.85);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* backup menu, restyled for the dark theme */
#backup-links { font-family: var(--sans); font-size: 15px; }
#backup-links a {
    color: var(--text);
    border: 1px solid rgba(243,184,72,.5);
    background: rgba(11,15,29,.85);
    box-shadow: none;
}

/* ==========================================================================
   Canvas: backdrop, section titles, intermediate overviews
   ========================================================================== */

/* one image under the whole canvas, in canvas units (BD_RECT in art/pieces.py) */
#backdrop {
    position: absolute;
    left: -2500px;
    top: -2696px;
    width: 10400px;
    height: 6400px;
    max-width: none;
    opacity: .38;
    transition: opacity 1.2s ease-in-out;
    pointer-events: none;
    user-select: none;
}
/* quiet behind a slide, brighter when the camera zooms out */
.flides-on-overview #backdrop,
.flides-on-overview_intermediate #backdrop { opacity: .7; }

/* section titles: fixed slides above each part, read on the overviews */
.step.section {
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
}
.section .sec-num {
    font-family: var(--sans);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: .4em;
    margin-bottom: 2px;
}
.section .sec-name { font-size: 66px; line-height: 1.1; letter-spacing: -.005em; }
.section.s1 .sec-num { color: var(--coral); }
.section.s2 .sec-num { color: var(--teal); }
.section.s3 .sec-num { color: var(--violet); }

/* the intermediate overviews are camera targets only, like #overview */
#overview_intermediate { display: none; }
/* they show the talk so far: keep the references backup out of them */
.flides-on-overview_intermediate .step[data-fixed="1"]:not(.section) { opacity: .1; }

/* ==========================================================================
   Per-slide layout
   ========================================================================== */

/* title */
#title .txt { top: 58px; width: 790px; }
#title h1 { font-size: 58px; margin-bottom: 18px; }
#title .sub { font-size: 23px; font-style: italic; color: var(--muted); max-width: 640px; }
#title .who { position: absolute; left: 56px; bottom: 46px; font-size: 21px; line-height: 1.4; }
#title .who .muted { font-size: 17px; }
#title .event { position: absolute; right: 56px; bottom: 50px; text-align: right; font-size: 15px; line-height: 1.5; color: var(--muted); }

/* motivation: text on the left of the artwork */
#em .txt, #personas .txt, #directions .txt { width: 352px; }
#directions .small { margin-bottom: 10px; }
#em .txt { top: 44px; }
#axis .txt { width: 480px; top: 40px; }

/* games: title on top, captions under the two pieces */
#games .txt { width: 790px; top: 40px; }
#games h2 { margin-bottom: 14px; }
#games .cap { position: absolute; top: 436px; width: 330px; font-size: 18px; line-height: 1.42; }
#games .cap b { font-weight: normal; color: var(--gold); font-size: 21px; }
#games .cap.l { left: 66px; }
#games .cap.r { left: 470px; }
#games .cap.r b { color: var(--teal); }
#games .punch { position: absolute; left: 0; right: 0; top: 576px; text-align: center; font-size: 22px; font-style: italic; }

/* slides without artwork: a wide title block, then figures and side text */
.txt.wide { width: 790px; }
.side-txt { position: absolute; top: 160px; left: 610px; width: 250px; }
.side-txt.left { left: 56px; width: 330px; }
.side-txt .small { margin-bottom: 10px; }
.more { font-family: var(--sans); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; margin-top: 8px; }
.center { text-align: center; }

/* the paper's own figures, inverted to sit on the dark canvas */
img.inv { display: block; }

/* inline SVG charts (art/figures.py) */
.chart text { font-family: var(--sans); text-shadow: none; }
.chart .tick { font-size: 13px; fill: var(--muted); }
.chart .axlabel { font-size: 14px; fill: var(--muted); font-style: italic; font-family: var(--serif); }
.chart .gridline { stroke: rgba(163,170,192,.16); stroke-width: 1; }
.chart .axis { stroke: rgba(163,170,192,.6); stroke-width: 1.2; }
.chart .series { fill: none; stroke-width: 3; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(11,15,29,.9)); }
.chart .serieslabel { font-family: var(--serif); font-size: 17px; }
.chart .clean { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .8; }
.chart .cleanlabel { font-family: var(--serif); font-style: italic; font-size: 14px; fill: var(--gold); }
.chart-box { position: absolute; left: 30px; top: 150px; }
.chart-box.right { left: 400px; top: 160px; }

/* small Sudoku grids (art/figures.py) */
.sgrid { display: block; }
.sgrid .thin  { stroke: rgba(163,170,192,.28); stroke-width: 1; }
.sgrid .thick { stroke: rgba(163,170,192,.75); stroke-width: 1.6; }
.sgrid text { font-family: var(--serif); font-size: 21px; fill: var(--text); text-anchor: middle; text-shadow: none; }
.sgrid.heat text { font-family: var(--sans); font-size: 11px; }
.sgrid.heat text.lo  { fill: var(--muted); opacity: .55; }
.sgrid.heat text.mid { fill: var(--text); }
.sgrid.heat text.hi  { fill: var(--ink); font-weight: 700; }

/* task */
#task .txt { width: 400px; top: 44px; }
#task h2 { margin-bottom: 16px; }
ul.facts { margin: 4px 0 0; }
ul.facts li { font-size: 18px; line-height: 1.4; margin-bottom: 6px; padding-left: 18px; position: relative; }
ul.facts li::before { content: "◆"; position: absolute; left: 0; top: 1px; font-size: 10px; color: var(--gold); }
#task .grid-task { position: absolute; left: 510px; top: 40px; }
.chips { position: absolute; left: 56px; right: 30px; top: 460px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips span {
    font-family: var(--sans); font-size: 13px; letter-spacing: .01em; text-shadow: none;
    padding: 5px 9px; border-radius: 6px;
    border: 1px solid rgba(163,170,192,.45); background: rgba(11,15,29,.7); color: var(--text);
}
.chips span.dim { border-color: transparent; background: none; color: var(--muted); font-style: italic; padding-left: 2px; padding-right: 2px; }
.chips span.key { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 14px rgba(243,184,72,.45); }
.chips span.ctl { color: var(--violet); border-color: rgba(165,148,255,.55); }
.chips-cap { position: absolute; left: 56px; top: 548px; font-size: 18px; font-style: italic; }

/* hypotheses */
.hyp { position: absolute; top: 150px; width: 300px; font-size: 17px; line-height: 1.45; text-align: center; }
.hyp svg.sgrid { margin: 0 auto 14px; }
.hyp b { font-weight: normal; font-size: 21px; display: block; margin-bottom: 4px; }
.hyp .tiny { margin-top: 4px; }
.hyp.l { left: 90px; }
.hyp.r { left: 510px; }
.hyp-rule { position: absolute; left: 0; right: 0; top: 540px; text-align: center; font-size: 21px; }

/* geometry */
.heat-box { position: absolute; left: 56px; top: 146px; width: 332px; }
.heat-box .tiny { margin-top: 8px; }
#geometry .side-txt { left: 470px; width: 380px; top: 160px; }
table.cos { margin: 0 0 18px; font-size: 18px; }
table.cos th { font-family: var(--sans); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 0 24px 8px 0; }
table.cos td { padding: 4px 24px 4px 0; border-top: 1px solid rgba(163,170,192,.2); }
table.cos td + td { color: var(--gold); }

/* patching */
#patching .side-txt.left { top: 160px; }

/* heads */
#heads .txt { top: 44px; }
#heads h2 { margin-bottom: 12px; }
.fig-heads { position: absolute; left: 40px; top: 210px; width: 820px; }
.fig-heads img { width: 100%; }
.heads-cap { position: absolute; left: 56px; top: 480px; width: 790px; font-size: 18px; line-height: 1.4; }
.heads-cap div { margin-bottom: 8px; }

/* decision (Sudoku artwork) */
#decision .txt { width: 340px; top: 46px; }
#decision .small { margin-bottom: 10px; }

/* the close-up inside the Sudoku cell */
#cell .side { position: absolute; top: 236px; width: 196px; font-size: 21px; line-height: 1.4; }
#cell .side.l { left: 36px; text-align: right; }
#cell .side.r { left: 668px; }

/* neuron */
.fig-neuron { position: absolute; left: 40px; top: 140px; width: 540px; }
.fig-neuron img { width: 100%; }
.neuron-txt { position: absolute; left: 600px; top: 150px; width: 260px; }
.neuron-txt .small { margin-bottom: 10px; }

/* algorithm */
.stages { position: absolute; left: 40px; right: 40px; top: 190px; display: flex; align-items: stretch; gap: 6px; }
.stage {
    flex: 1; padding: 14px 14px 16px; border-radius: 12px;
    border: 1px solid rgba(163,170,192,.4); background: rgba(11,15,29,.6);
    font-size: 17px; line-height: 1.4;
}
.stage .lay { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .18em; color: var(--muted); margin-bottom: 8px; }
.stage b { display: block; font-weight: normal; font-size: 22px; margin-bottom: 8px; }
.stages .arrow { align-self: center; font-size: 24px; color: var(--gold); }
.algo-foot { position: absolute; left: 56px; right: 56px; top: 470px; text-align: center; font-style: italic; }

/* closing */
#finale .txt { width: 380px; top: 60px; }
#finale .take { font-size: 19px; line-height: 1.4; margin-bottom: 14px; padding-left: 16px; border-left: 2px solid rgba(243,184,72,.6); }
#finale .refs-link { position: absolute; left: 56px; bottom: 40px; font-family: var(--sans); font-size: 13px; letter-spacing: .15em; text-transform: uppercase; }

/* backups */
#references .txt, #limits .txt, #math .txt { top: 44px; }
ul.bul li { font-size: 19px; line-height: 1.45; margin-bottom: 12px; padding-left: 18px; position: relative; }
ul.bul li::before { content: "◆"; position: absolute; left: 0; top: 2px; font-size: 10px; color: var(--gold); }
#math .small { margin-bottom: 10px; }
.fig-pair { position: absolute; left: 40px; right: 40px; top: 150px; display: flex; gap: 30px; align-items: flex-start; }
.fig-pair > div { flex: 1; }
.fig-pair img { width: 100%; max-height: 300px; object-fit: contain; }
.fig-pair .tiny { margin-top: 10px; }
#timing .back { position: absolute; left: 56px; bottom: 34px; }


/* explainer diagrams for a general audience (art/figures.py) */
.diagram text { font-family: var(--sans); text-shadow: none; }
.diagram .band { fill: rgba(255,255,255,.035); stroke: rgba(163,170,192,.22); stroke-width: 1; }
.diagram .bandlabel { font-size: 12px; fill: var(--muted); letter-spacing: .04em; }
.diagram .bandlabel.dots { font-size: 22px; }
.diagram .attn { fill: none; stroke: var(--teal); stroke-width: 1.4; opacity: .55; }
.diagram .stream { stroke: rgba(163,170,192,.35); stroke-width: 2; }
.diagram .tok { fill: rgba(11,15,29,.8); stroke: rgba(163,170,192,.6); }
.diagram .toktext { font-family: var(--serif); font-size: 18px; fill: var(--text); text-anchor: middle; }
.diagram .actlabel { font-family: var(--serif); font-style: italic; font-size: 16px; fill: var(--gold); }
.diagram .outword { font-family: var(--serif); font-size: 15px; fill: var(--text); }
.diagram .outword.coral { fill: var(--coral); }
.diagram .sep { stroke: var(--text); stroke-width: 1.6; stroke-dasharray: 6 5; }
.diagram .edit { fill: none; stroke: var(--coral); stroke-width: 2; }

/* inside */
#inside .txt { width: 360px; top: 44px; }
#inside h2 { margin-bottom: 16px; }
#inside .small { margin-bottom: 10px; }
.inside-fig { position: absolute; left: 418px; top: 44px; }

/* look */
.cards { position: absolute; left: 40px; right: 40px; top: 178px; display: flex; gap: 18px; }
.cards .card {
    flex: 1; padding: 16px 16px 18px; border-radius: 12px;
    border: 1px solid rgba(163,170,192,.35); background: rgba(11,15,29,.6);
    font-size: 17px; line-height: 1.42;
}
.cards .card svg { display: block; margin: 0 auto 12px; }
.cards .card b { display: block; font-weight: normal; font-size: 24px; margin-bottom: 6px; }
.look-foot { position: absolute; left: 56px; right: 56px; top: 540px; text-align: center; font-style: italic; }

/* games: one line under the title */
.games-lead { margin-top: -10px; }

/* Phone navigation toolbar (added by the engine on touch screens): dark,
   to match the deck. The engine sets inline styles, hence !important. */
#flides-phone-nav {
    background: rgba(11,15,29,.88) !important;
    box-shadow: 0 -1px 0 rgba(243,184,72,.25) !important;
}
#flides-phone-nav button { color: var(--text) !important; }
#flides-phone-nav button span + span { color: var(--muted) !important; }
