/* Theme colours, typography, layout and navigation shared by every slide. */

:root {
  color-scheme: light;
  /* riemer.fyi style: pure black on white, solid black lines, no grey text */
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #000000;
  --ink-2: #000000;
  --muted: #000000;
  --line: #000000;
  --grid: #e6e6e6;   /* only for chart grid lines and empty bar tracks, never for text */
  --rule: clamp(3px, .22vw, 8px);     /* the thick lines (4px on a 1920 wide screen) */
  --frame: clamp(8px, .85vw, 24px);   /* white margin between the screen edge and the frame */
  --s1: #2a78d6;  /* identity / primary */
  --s2: #eb6834;  /* anchors / "more likely" */
  --s3: #1baf7a;  /* neighbours */
  --s4: #6250d6;
  --s5: #e87ba4;
  --neutral: #9a988f;   /* background dots only */
  --accent-bg: #e9f1fb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --surface: #000000; --ink: #ffffff; --ink-2: #ffffff;
    --muted: #ffffff; --line: #ffffff; --grid: #2a2a2a;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #9085e9; --s5: #d55181; --neutral: #6f6d66; --accent-bg: #1c2a3c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --surface: #000000; --ink: #ffffff; --ink-2: #ffffff;
  --muted: #ffffff; --line: #ffffff; --grid: #2a2a2a;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #9085e9; --s5: #d55181; --neutral: #6f6d66; --accent-bg: #1c2a3c;
}

* { box-sizing: border-box; }
html { font-size: clamp(15px, 1.45vw, 36px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.35; overflow: hidden; height: 100vh;
}
button, select { font: inherit; color: inherit; }

/* the frame around every slide, like the border around the riemer.fyi page */
#deck { position: fixed; inset: var(--frame); border: var(--rule) solid var(--ink); overflow: hidden; }
.slide {
  position: absolute; inset: 0; display: none; flex-direction: column;
  padding: 4vh 6vw 9vh; gap: 2.2vh;
}
.slide.active { display: flex; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

h1 { font-size: 2.3rem; line-height: 1.1; margin: 0; font-weight: 700; text-transform: uppercase; text-wrap: balance; }
/* [words in brackets] get a black box, like "COMPLIANT." on riemer.fyi. The box wipes in from the left:
   a white layer in "difference" mode turns white into black and black into white (also in dark mode). */
.box { display: inline-block; position: relative; isolation: isolate; background: var(--bg); padding: 0 .18em; }
.box::after { content: ""; position: absolute; inset: 0; background: #fff; mix-blend-mode: difference; pointer-events: none;
              transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.7,0,.2,1); }
.box.on::after { transform: scaleX(1); }
.no-anim .box::after { transition: none; }
.svg-box-bg { fill: var(--ink); }
.svg-box-text { fill: var(--bg); font-weight: 700; white-space: pre; }
.caption { font-size: 1.15rem; color: var(--ink); margin: 0; max-width: 60rem; }
.todo { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(235,104,52,.08) 8px 16px);
        outline: 2px dashed var(--s2); outline-offset: 4px; }

/* title + text slides */
.slide.kind-title { justify-content: center; padding-left: 7vw; padding-right: 7vw; }
.slide.kind-title h1 { font-size: 4.6rem; line-height: 1.2; max-width: none; text-wrap: wrap; }
/* subtitle "a · b · c" becomes boxes, like the buttons on riemer.fyi */
.slide.kind-title .subtitle { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 6vh; }
.slide.kind-title .subtitle span { border: var(--rule) solid var(--ink); padding: .5em 1em; font-size: 1.05rem;
                                   font-weight: 700; text-transform: uppercase; line-height: 1; }
/* links on a title slide (thank you): a framed table with thick lines; rows with a url are clickable */
.slide.kind-title .links { display: grid; grid-template-columns: auto max-content auto; width: fit-content; margin-top: 6vh;
                           border: var(--rule) solid var(--ink); font-size: 1.2rem; line-height: 1.25; }
.links .link { display: contents; color: inherit; text-decoration: none; }
.links .link > span { padding: .55em 1.1em; border-top: var(--rule) solid var(--ink); display: flex; align-items: center; }
.links .link:first-child > span { border-top: 0; }
.links .link-icon { padding-right: 0 !important; }
.links .link-icon img { width: 1.5em; height: 1.5em; display: block; background: #fff; }
.links .link-icon:empty::before { content: ""; width: 1.5em; height: 1.5em; }
.links .link-name { font-weight: 700; border-right: var(--rule) solid var(--ink); }
.links .link.hl > span, .links a.link:hover > span { background: var(--ink); color: var(--bg); }
.slide.kind-text { justify-content: center; padding-left: 7vw; padding-right: 7vw; }
.slide.kind-text h1 { font-size: 3.4rem; }
.slide.kind-text .lead { font-size: 2.6rem; font-weight: 700; color: var(--s1); margin: 1vh 0 2vh; max-width: 26ch; line-height: 1.15; }
/* list lines start with an arrow, like the lists on riemer.fyi */
.slide.kind-text ul { margin: 5vh 0 0; padding: 0; list-style: none; display: grid; gap: 1.8rem; max-width: none; }
.slide.kind-text li { font-size: 2rem; padding-left: 1.6em; position: relative; }
.slide.kind-text li::before { content: "→"; position: absolute; left: 0; top: 0; font-weight: 700; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; align-items: center; }
.ctl-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; margin-right: .4rem; }
.seg { display: inline-flex; border: var(--rule) solid var(--ink); gap: 0; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: .35em .9em; cursor: pointer; font-size: .85rem; font-weight: 700; text-transform: uppercase; }
.seg button:hover { background: var(--ink); color: var(--bg); }
.seg button.on { background: var(--ink); color: var(--bg); }
select { font-size: .85rem; padding: .35em .7em; border-radius: 0; border: var(--rule) solid var(--ink); background: var(--surface); }

.body { flex: 1; min-height: 0; display: flex; gap: 2vw; }
.placeholder { margin: auto; font-size: 1.1rem; }

/* shared: chips, small labels, buttons */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips button { border: 2px solid var(--ink); background: var(--surface); padding: .15em .7em;
                font-size: .8rem; font-weight: 700; cursor: pointer; }
.chips button.on { background: var(--ink); color: var(--bg); }
.mini { font-size: .75rem; font-weight: 700; text-transform: uppercase; margin-bottom: .2rem; }
.more { align-self: flex-start; border: var(--rule) solid var(--ink); background: var(--surface); padding: .3em 1em; font-size: .8rem; font-weight: 700; text-transform: uppercase; cursor: pointer; }
.more:hover { background: var(--ink); color: var(--bg); }

/* shared: bars (probabilities, chat, WinoQueer) */
.prompt-line { font-size: 1.7rem; font-weight: 600; }
.prompt-line .x { background: var(--ink); color: var(--bg); padding: 0 .18em; }
.prompt-line .blank { color: var(--muted); }
.bars { display: grid; gap: .45rem; flex: 1; align-content: start; width: 100%; max-width: 56rem; }
.bar-row { display: grid; grid-template-columns: 9em 1fr 5.5em; align-items: center; gap: .8rem; font-size: 1rem; }
.bar-row .lab { text-align: right; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { height: 1.05em; position: relative; }
.bar-row .fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--ink);
                 transition: width .55s cubic-bezier(.3,.7,.2,1), left .55s cubic-bezier(.3,.7,.2,1), background .3s; }
.bar-row .val { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: .85rem; }
.bars.ratio .track::before { content: ""; position: absolute; left: 50%; top: -.3em; bottom: -.3em; width: 2px; background: var(--ink-2); }

.ratio-legend { display: flex; justify-content: space-between; max-width: 56rem; font-size: .8rem; color: var(--ink-2);
                padding-left: 9.8em; padding-right: 6.3em; }

/* chrome: slide number and arrows sit in the bottom right corner of the frame */
.source { position: absolute; left: 6vw; bottom: 3vh; font-size: .65rem; }
.nav { position: fixed; right: var(--frame); bottom: var(--frame); display: flex; align-items: stretch; z-index: 5; }
.nav > * { border: var(--rule) solid var(--ink); margin-left: calc(-1 * var(--rule)); background: var(--bg);
           height: 2.6rem; display: flex; align-items: center; justify-content: center; }
.nav button { width: 2.9rem; padding: 0; border-radius: 0; cursor: pointer; font-size: 1.1rem; font-weight: 700; }
.nav button:hover { background: var(--ink); color: var(--bg); }
.nav .count { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 .9em; min-width: 6em; }
/* progress: a black bar along the top edge, inside the frame */
.progress { position: fixed; left: calc(var(--frame) + var(--rule)); top: calc(var(--frame) + var(--rule)); height: var(--rule);
            width: calc((100% - 2 * (var(--frame) + var(--rule))) * var(--p, 0)); background: var(--ink); transition: width .3s; z-index: 5; }
.notes { position: fixed; left: calc(var(--frame) + var(--rule) + 1.2vw); right: 15rem; bottom: calc(var(--frame) + var(--rule) + 1.2vh);
         background: var(--bg); border: var(--rule) solid var(--ink); padding: .7rem 1rem; font-size: .8rem; display: none; z-index: 6;
         white-space: pre-line; max-height: 60vh; overflow-y: auto; }   /* keeps the line breaks of the notes; scrolls if long */
.notes.show { display: block; }
.keys { position: fixed; left: calc(var(--frame) + var(--rule) + 1.4vw); bottom: calc(var(--frame) + var(--rule) + 1.4vh);
        font-size: .6rem; font-weight: 700; text-transform: uppercase; }
.notes.show ~ .keys { display: none; }

/* layout: "statement" = one big centred line (title is the line, subtitle/lead optional) */
.slide.layout-statement { justify-content: center; }
.slide.layout-statement h1 { font-size: 4.6rem; line-height: 1.2; max-width: none; text-wrap: balance; }
.slide.layout-statement .lead, .slide.layout-statement .subtitle { color: var(--ink); font-size: 2.2rem; font-weight: 700; line-height: 1.3;
                                                                    margin: 6vh 0 0; max-width: none; }
.slide.layout-statement ul { display: none; }
