/*
 * The Morning Bytes presentation.
 *
 * Two modes, one markup:
 *   - Screens 1024px and wider: one slide at a time, drawn on a fixed design canvas and
 *     scaled to fit the window (the script adds .is-deck to <html>).
 *   - Under 1024px, or with no script: slides stack and the page scrolls normally (reader mode).
 *
 * Colours are the tokens in mb-shell.css and mb-theme.css. No new colour is introduced here.
 * Nothing on a slide is under 13px in the design canvas, so the 0.85 scale floor keeps it at 11px or more.
 */

:root {
  --rose: #C80E7D;        /* brand 700: small accent text that must stay readable */
  --tint: #FDE6F7;       /* brand 100 */
}

html { scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { min-height: 100vh; }
.topbar .who small { font-size: 11px; }
kbd {
  font: inherit; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--rule-firm); background: var(--sheet); color: var(--muted-firm);
  box-shadow: 0 1px 0 var(--rule-firm); white-space: nowrap;
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ================================================================ stacked (default) */
.deck { max-width: 1120px; margin: 0 auto; padding: 8px 18px 90px; }
.stage { display: block; }
.slide {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px;
  margin: 0 0 22px; scroll-margin-top: 76px;
}
.slide .inner { padding: 24px 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.s-head { display: flex; flex-direction: column; gap: 8px; }
.eyebrow-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.slide .eyebrow { color: var(--rose); margin: 0; font-size: 13px; }
.tag.chip { font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--warn); background: var(--rule); border-color: var(--rule-firm); }
.tag.dec { font-size: 13px; color: var(--up); background: var(--up-soft); border-color: var(--up-edge); }
.tag.prop { font-size: 13px; color: var(--wine); background: var(--pink); border-color: var(--pink-edge); }
.slide .title {
  font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.12;
  letter-spacing: -.02em; color: var(--wine); text-wrap: balance;
}
.s-body { display: grid; gap: 18px; align-content: start; grid-template-columns: minmax(0, 1fr); }
.s-text { display: grid; gap: 14px; align-content: start; min-width: 0; }
.body { font-size: 18px; line-height: 1.45; color: var(--ink); text-wrap: pretty; max-width: 62ch; }
.why { font-size: 14px; line-height: 1.4; color: var(--muted-firm); padding: 8px 0 0 12px; max-width: 46ch; }
.why b { color: var(--wine); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-right: 6px; }
.s-figs { display: grid; gap: 14px; min-width: 0; align-content: start; }

.fig { margin: 0; min-width: 0; }
.pic { display: block; width: 100%; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--sheet); }
.pic img { display: block; width: 100%; height: auto; }
.pic:hover { border-color: var(--rule-firm); }
.fig figcaption { margin-top: 7px; font-size: 14px; line-height: 1.4; color: var(--muted-firm); }

/* pictures on phones: keep them readable by letting the picture scroll inside its own box */
@media (max-width: 819px) {
  .scrollpic .pic, .duo .pic, .lay-wide > .s-body > .s-figs > .fig > .pic { overflow-x: auto; }
  .scrollpic .pic img { width: 760px; max-width: none; }
  .duo .pic img { width: 520px; max-width: none; }
  .lay-wide > .s-body > .s-figs > .fig > .pic img { min-width: 640px; }
  .tiles .pic img { min-width: 0; }
  .fig.foot .pic img { min-width: 560px; }
  .fig:not(.tile) figcaption::after { content: " Tap the picture to enlarge it."; color: var(--muted); }
}

/* ---- the drawn pieces */
.five { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: p; }
.five li { display: grid; grid-template-columns: 34px 130px minmax(0, 1fr); gap: 4px 14px; align-items: baseline; padding: 11px 16px; background: var(--paper); border: 1px solid var(--rule); border-radius: 11px; counter-increment: p; }
.five li::before { content: counter(p); width: 26px; height: 26px; border-radius: 50%; background: var(--wine); color: var(--sheet); font-size: 13px; font-weight: 700; text-align: center; line-height: 26px; }
.five b { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--rose); }
.five span { font-size: 17px; line-height: 1.35; color: var(--ink); }

.pg { display: grid; gap: 8px; }
.pg-row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px;
  border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--rule);
}
.pg-row:nth-child(1) { background: var(--wine); border-color: var(--wine); }
.pg-row:nth-child(1) .pg-l, .pg-row:nth-child(1) .pg-ref { color: var(--sheet); }
.pg-row:hover { border-color: var(--wine); }
.pg-n { width: 26px; height: 26px; border-radius: 50%; background: var(--pink); color: var(--wine); font-size: 13px; font-weight: 700; text-align: center; line-height: 26px; }
.pg-l { font-size: 18px; font-weight: 600; }
.pg-ref { font-size: 13px; color: var(--muted-firm); }
.times { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.times li { font-size: 15px; color: var(--muted-firm); }
.times b { display: inline-block; min-width: 104px; color: var(--wine); }

.ruleset { display: grid; gap: 14px; }
.tests { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.test { display: grid; gap: 6px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--rule); border-radius: 13px; align-content: start; }
.test b { width: 32px; height: 32px; border-radius: 50%; background: var(--wine); color: var(--sheet); font-size: 16px; text-align: center; line-height: 32px; }
.test span { font-family: var(--serif); font-size: 22px; line-height: 1.2; color: var(--ink); }
.verdicts { display: grid; gap: 10px; }
.v { margin: 0; padding: 12px 16px; border-radius: 12px; font-size: 17px; line-height: 1.4; border: 1px solid; }
.v em { display: inline-block; font-style: normal; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-right: 10px; }
.v--in { background: var(--up-soft); border-color: var(--up-edge); color: var(--ink); }
.v--in em { color: var(--up); }
.v--out { background: var(--down-soft); border-color: var(--down-edge); color: var(--ink); }
.v--out em { color: var(--down); }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { margin: 0; min-width: 0; }
.tile .pic { border-radius: 12px; }
.tile figcaption { margin-top: 8px; font-size: 14px; line-height: 1.35; color: var(--ink); }
.propline { font-size: 15px; color: var(--ink); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.duo--wl { grid-template-columns: minmax(0, 1.6fr) minmax(0, .7fr); }
.duo .fig .pic { border-radius: 12px; }

.ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lcol { padding: 18px 20px; border-radius: 14px; border: 1px solid var(--rule); background: var(--paper); }
.lcol h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 0 0 10px; color: var(--wine); }
.lcol ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lcol li { position: relative; padding-left: 16px; font-size: 18px; line-height: 1.35; }
.lcol li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); }
.lcol--dec { background: var(--up-soft); border-color: var(--up-edge); }
.lcol--dec li::before { background: var(--up); }
.lcol--prop { background: var(--pink); border-color: var(--pink-edge); }
.lcol--open { background: var(--rule); border-color: var(--rule-firm); }
.lcol--open li::before { background: var(--warn); }

/* cover and closing: the wine slides */
.slide--wine { background: linear-gradient(115deg, var(--wine), var(--wine-lift)); border: 0; color: var(--pink); }
.slide--wine .title { color: #FFFFFF; font-size: 40px; }
.slide--wine .eyebrow { color: var(--pink-edge); }
.slide--wine .body { color: #FFFFFF; }
.slide--wine .why { color: var(--pink); border-left-color: var(--pink-edge); }
.slide--wine .why b { color: #FFFFFF; }
.slide--wine .fig figcaption { color: var(--pink); }
.slide--wine .tag.chip { color: #FFFFFF; background: var(--wine-lift); border-color: var(--pink-edge); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; border: 1px solid var(--pink-edge); color: #FFFFFF; background: var(--wine-lift); }
.slide--close .body { font-family: var(--serif); font-size: 30px; line-height: 1.25; max-width: 30ch; }
.slide--close .title { font-size: 52px; }
.lay-text .s-body { align-content: center; }

/* ---- speaker notes (stacked mode: shown when N is pressed) */
.notes { display: none; margin-top: 4px; padding: 14px 16px; border-radius: 12px; background: var(--paper); border: 1px dashed var(--rule-firm); color: var(--ink); }
.notes h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--rose); margin: 0 0 6px; }
.notes p { font-size: 15px; line-height: 1.5; }
.notes p + p { margin-top: 8px; }
html.notes-on .notes { display: block; }
.slide--wine .notes { color: var(--ink); }

/* ---------------------------------------------------------------- deck bar, contents */
.deckbar { max-width: 1120px; margin: 0 auto; padding: 10px 18px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.deckbar .nav, .deckbar .count, .deckbar .hint { display: none; }
.helpbtn { display: none; }
#toc { position: relative; }
#toc summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--wine);
  background: var(--sheet); border: 1px solid var(--rule-firm);
}
#toc summary::-webkit-details-marker { display: none; }
#toc summary:hover { border-color: var(--wine); }
#toc[open] summary { background: var(--wine); color: var(--sheet); border-color: var(--wine); }
.toc-list { margin-top: 10px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 13px; padding: 14px 18px; }
.toc-cols { columns: 2; column-gap: 26px; }
.toc-list section { break-inside: avoid; margin-bottom: 12px; }
.toc-list h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--rose); margin: 0 0 4px; }
.toc-list ol { list-style: none; margin: 0; padding: 0; }
.toc-list li a {
  display: grid; grid-template-columns: 26px 1fr; gap: 4px; padding: 3px 6px; border-radius: 7px;
  font-size: 13px; line-height: 1.35; color: var(--ink); text-decoration: none;
}
.toc-list li a span { color: var(--muted); font-variant-numeric: tabular-nums; }
.toc-list li a:hover { background: var(--pink); color: var(--wine); }
.toc-list li a[aria-current="true"] { background: var(--wine); color: var(--sheet); }
.toc-list li a[aria-current="true"] span { color: var(--pink-edge); }
.progress { display: none; }

.navbtn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule-firm); background: var(--sheet); color: var(--wine); font-size: 16px; line-height: 1; padding: 0; }
.navbtn:hover:not(:disabled) { border-color: var(--wine); background: var(--pink); }
.navbtn:disabled { color: var(--rule-firm); border-color: var(--rule); cursor: default; }
.count { font-size: 13px; font-weight: 700; color: var(--ink); min-width: 62px; text-align: center; font-variant-numeric: tabular-nums; }
.hint { font-size: 12px; color: var(--muted); }
.helpbtn { font-size: 13px; font-weight: 600; color: var(--muted-firm); background: var(--sheet); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; }
.helpbtn:hover { border-color: var(--wine); color: var(--wine); }
.deckbar .helpbtn { display: inline-flex; gap: 6px; align-items: center; }

/* ---------------------------------------------------------------- overlays */
.layer { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(48, 28, 24, .5); }
.layer[hidden], .notes-strip[hidden], .typed[hidden], .toast[hidden] { display: none; }
.panelbox { width: min(640px, 100%); max-height: 100%; overflow: auto; background: var(--sheet); color: var(--ink); border: 1px solid var(--rule-firm); border-radius: 16px; padding: 20px 22px; display: grid; gap: 12px; }
.panelbox.small { width: min(380px, 100%); }
.panelbox h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; color: var(--wine); }
.panelbox label { font-size: 14px; color: var(--muted-firm); }
.panelbox input { font: inherit; font-size: 20px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--rule-firm); background: var(--paper); color: var(--ink); width: 100%; }
.panelbox .err { color: var(--down); font-size: 14px; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.btn { font-size: 14px; font-weight: 600; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--rule-firm); background: var(--sheet); color: var(--wine); }
.btn:hover { border-color: var(--wine); }
.btn.primary { background: var(--wine); color: var(--sheet); border-color: var(--wine); }
.keys { border-collapse: collapse; width: 100%; }
.keys th, .keys td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); font-size: 15px; vertical-align: baseline; line-height: 1.5; }
.keys th { font-weight: 400; width: 52%; }
.layer--full { align-items: stretch; justify-content: stretch; flex-direction: column; background: var(--paper); padding: 0; }
.ov-head { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--rule); }
.ov-head h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--wine); }
.ov-tip { font-size: 13px; color: var(--muted-firm); margin-right: auto; }
.ov-grid { flex: 1; overflow: auto; padding: 18px 20px 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-content: start; }
.ov-tile { display: grid; gap: 6px; text-align: left; background: none; border: 0; padding: 4px; border-radius: 12px; color: var(--ink); }
.ov-tile:focus-visible, .ov-tile:hover { outline: 3px solid var(--magenta); outline-offset: 0; }
.ov-thumb { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; border: 1px solid var(--rule-firm); background: var(--sheet); }
.ov-clone { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; pointer-events: none; }
.ov-clone .slide { position: relative !important; display: block !important; height: 720px; margin: 0; border-radius: 0; overflow: hidden; }
.ov-clone .slide .inner { height: 100%; padding: 26px 44px 18px; gap: 12px; }
.ov-label { font-size: 14px; font-weight: 600; line-height: 1.3; }
.notes-strip {
  position: fixed; left: 0; right: 0; bottom: 45px; z-index: 70; max-height: 34vh; overflow: auto;
  background: var(--sheet); color: var(--ink); border-top: 3px solid var(--wine); padding: 12px 24px 14px; box-shadow: 0 -8px 24px rgba(48, 28, 24, .14);
}
.notes-strip h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--rose); margin: 0 0 4px; }
.notes-strip p { font-size: 16px; line-height: 1.5; max-width: 120ch; }
.notes-strip p + p { margin-top: 6px; }
.typed { position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 95; background: var(--wine); color: #FFFFFF; font-size: 18px; font-weight: 700; padding: 10px 22px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 95; background: var(--ink); color: var(--paper); font-size: 14px; padding: 10px 18px; border-radius: 12px; max-width: 90vw; }

/* ============================================================ wider than a phone */
@media (min-width: 820px) {
  .deck { padding-top: 10px; }
  .slide .inner { padding: 30px 40px 26px; }
  .slide .title { font-size: 34px; }
  .lay-side .s-body { grid-template-columns: minmax(300px, .78fr) minmax(0, 1.5fr); gap: 34px; align-items: center; }
  .lay-wide .s-body { gap: 20px; }
  .lay-wide .s-text { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px 30px; align-items: start; }
  .lay-wide .s-text .propline, .lay-wide .s-text .pills, .lay-wide .s-text .times { grid-column: 1; }
  .lay-wide .s-text .why { grid-column: 2; grid-row: 1; margin-top: 4px; }
  .lay-wide .s-text .body { grid-column: 1; }
  .s-figs.wide .fig, .lay-wide .s-figs { justify-items: start; }
  .slide--wine .title { font-size: 52px; }
  .toc-cols { columns: 3; }
}
@media (max-width: 819px) {
  .five li { grid-template-columns: 34px minmax(0, 1fr); }
  .five li span { grid-column: 2; }
  .tests, .ledger, .duo, .duo--wl { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc-cols { columns: 1; }
  .slide--close .title { font-size: 36px; }
  .slide--close .body { font-size: 24px; }
  .panelbox { padding: 16px; }
  .keys th, .keys td { display: block; width: auto; border: 0; padding: 2px 0; }
  .keys tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--rule); }
  .helpbtn { display: none !important; }
  .hint { display: none !important; }
  .notes-strip { bottom: 0; }
  .typed { bottom: 20px; }
}

/* =============================================================== the deck (>= 1024px, script on) */
.is-deck, .is-deck body { height: 100%; overflow: hidden; }
.is-deck body { display: flex; flex-direction: column; min-height: 0; }
.is-deck .topbar { position: relative; flex: none; order: 1; min-height: 0; padding: 5px 18px; }
.is-deck .deck { order: 2; position: relative; flex: 1; min-height: 0; max-width: none; margin: 0; padding: 0; overflow: hidden; }
.is-deck .deckbar { order: 3; }
.is-deck .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: block; }
.is-deck .slide {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; margin: 0; display: none; max-width: none;
  border-radius: 18px; overflow-x: hidden; overflow-y: auto;
}
.is-deck .slide.is-current { display: block; }
.is-deck .slide .inner { height: 100%; padding: 26px 44px 18px; gap: 12px; }
.is-deck .s-body { flex: 1 0 auto; align-content: center; }
.is-deck .s-head { flex: none; }
.is-deck .slide .notes { display: none !important; }
.is-deck .body { font-size: 20px; }
.is-deck .lay-side .pic { max-width: 720px; }
.is-deck .lay-wide .fig .pic { max-width: 1040px; }
.is-deck .lay-wide .tiles, .is-deck .lay-wide .duo { max-width: 1120px; }
.is-deck .duo .pic { max-width: none; }
.is-deck .lay-side .narrow .pic { max-width: 420px; }
.is-deck .lay-wide .s-figs { max-height: 470px; }
.is-deck .duo--wl .fig .pic { max-height: 400px; }
.is-deck .duo--wl .wl-a .pic img { width: auto; max-height: 398px; }
.is-deck .duo--wl .wl-b .pic img { width: auto; max-height: 398px; }
.is-deck .duo--wl .pic { width: auto; display: inline-block; }
.is-deck .duo--wl { grid-template-columns: auto auto; justify-content: start; }

.is-deck .deckbar {
  flex: none; height: 42px; max-width: none; margin: 0; padding: 0 18px; gap: 12px; flex-wrap: nowrap;
  background: var(--paper); border-top: 1px solid var(--rule); position: relative; z-index: 30;
}
.is-deck .deckbar .nav, .is-deck .deckbar .count { display: inline-flex; align-items: center; justify-content: center; }
.is-deck .deckbar .hint { display: block; margin-left: auto; }
.is-deck .deckbar .helpbtn { padding: 3px 12px; }
.is-deck .toc-list {
  position: absolute; left: 0; bottom: calc(100% + 12px); width: min(980px, calc(100vw - 36px)); margin: 0;
  max-height: calc(100vh - 170px); overflow: auto; z-index: 40; border: 1px solid var(--rule-firm);
}
.is-deck .progress { display: block; position: fixed; left: 0; right: 0; bottom: 0; height: 3px; background: var(--rule); z-index: 60; }
.is-deck .progress i { display: block; height: 100%; width: 0; background: var(--wine); }

@media print {
  .topbar, .deckbar, .progress, .layer, .typed, .toast, .notes-strip { display: none !important; }
  .is-deck, .is-deck body { height: auto; overflow: visible; }
  .is-deck .stage { position: static; transform: none !important; width: auto !important; height: auto !important; }
  .is-deck .slide, .slide { position: static; display: block; break-inside: avoid; page-break-after: always; }
  html.notes-on .slide .notes { display: block !important; }
}

.startline { margin: 8px 0 16px; font-size: 16px; line-height: 1.45; color: var(--ink); }
.btn--go { background: var(--wine); border-color: var(--wine); color: #FFFFFF; }

/* Full screen: the slide is the screen. Bars go; the bottom bar returns when the pointer goes there. Content grows to the canvas. */
.is-full .topbar { display: none; }
.is-full .deckbar { position: fixed; left: 0; right: 0; bottom: 0; opacity: 0; transition: opacity .2s; }
.is-full .deckbar:hover, .is-full .deckbar:focus-within { opacity: 1; }
.is-full .slide { border-radius: 0; border: 0; }
.is-full .slide .inner { padding: 36px 72px 32px; gap: 16px; }
.is-full .body { font-size: 24px; }
.is-full .why, .is-full .propline { font-size: 18px; }
.is-full .lay-side .pic { max-width: 860px; }
.is-full .lay-side .narrow .pic { max-width: 520px; }
.is-full .lay-wide .fig .pic { max-width: none; width: 100%; }
.is-full .lay-wide .tiles, .is-full .lay-wide .duo { max-width: none; }
.is-full .lay-wide .s-figs { max-height: none; }
.is-full .duo--wl { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); justify-content: stretch; align-items: start; gap: 24px; }
.is-full .duo--wl .fig .pic { max-height: none; width: 100%; display: block; }
.is-full .duo--wl .wl-a .pic img { width: 100%; height: auto; max-height: none; }
.is-full .duo--wl .wl-b .pic img { width: auto; max-width: 100%; height: auto; max-height: 560px; margin: 0 auto; display: block; }

/* =====================================================================================================================
 * macOS layer (24 Sept). Frosted glass toolbars and controls, larger radii, softer depth, pictures shown as titled app
 * windows, roomier type. It only re-skins: structure, order and every word are unchanged. Every colour is a token, so the
 * Dark button still works. Glass = a translucent token over a blur; depth = a tight, low shadow (no glow).
 * ===================================================================================================================== */
:root {
  --glass: color-mix(in srgb, var(--sheet) 70%, transparent);
  --glass-strong: color-mix(in srgb, var(--sheet) 86%, transparent);
  --glass-edge: color-mix(in srgb, var(--sheet) 55%, var(--rule-firm));
  --blur: saturate(1.5) blur(22px);
  --depth-1: 0 1px 1px color-mix(in srgb, var(--ink) 6%, transparent), 0 6px 18px color-mix(in srgb, var(--ink) 7%, transparent);
  --depth-2: 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent), 0 14px 40px color-mix(in srgb, var(--ink) 11%, transparent);
  --r-window: 26px; --r-card: 18px; --r-chip: 999px;
}
body { background: linear-gradient(165deg, var(--paper) 0%, color-mix(in srgb, var(--pink) 55%, var(--paper)) 100%) fixed; }

/* toolbar (top) */
.topbar { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--glass-edge); }
.topbar .who { letter-spacing: -.015em; }
.capsule { background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--depth-1); padding: 3px; }
.capsule a, .capsule button { padding: 6px 15px; }

/* the slide is a window */
.slide { background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: var(--r-window); box-shadow: var(--depth-2); }
.slide .title { font-weight: 500; letter-spacing: -.028em; }
.slide .eyebrow { letter-spacing: .16em; font-weight: 700; }
.tag { border-radius: var(--r-chip); }
.tag.chip { background: var(--glass); border-color: var(--glass-edge); color: var(--warn); }
.why { border-left: 0; background: color-mix(in srgb, var(--pink) 80%, transparent); border-radius: 14px; padding: 9px 14px; max-width: 52ch; }
.why b { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: var(--r-chip); background: var(--sheet); font-size: 11px; }

/* pictures are app windows with a title bar */
.pic { border: 1px solid var(--glass-edge); border-radius: 16px; background: var(--sheet); box-shadow: var(--depth-1); }
.pic[data-win]::before {
  content: attr(data-win); display: block; height: 32px; line-height: 32px; text-align: center; padding: 0 56px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em; color: var(--muted-firm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background:
    radial-gradient(circle at 16px 50%, var(--down-edge) 0 5px, transparent 5.5px),
    radial-gradient(circle at 34px 50%, var(--rule-firm) 0 5px, transparent 5.5px),
    radial-gradient(circle at 52px 50%, var(--up-edge) 0 5px, transparent 5.5px),
    linear-gradient(var(--glass-strong), var(--glass-strong));
  border-bottom: 1px solid var(--rule);
}
.tile .pic[data-win]::before { display: none; }
.pic:hover { border-color: var(--rule-firm); box-shadow: var(--depth-2); }
.fig figcaption { color: var(--muted-firm); }

/* drawn pieces: rounder, glassier */
.five li, .pg-row, .test, .v, .lcol, .notes { border-radius: var(--r-card); }
.five li { background: var(--glass); border-color: var(--glass-edge); }
.pg-row { background: var(--glass); border-color: var(--glass-edge); }
.pg-row:nth-child(1) { background: var(--wine-fill); border-color: var(--wine-fill); }
.test { background: var(--glass); border-color: var(--glass-edge); }
.lcol { border-color: var(--glass-edge); }
.pill { background: color-mix(in srgb, var(--wine-lift) 70%, transparent); border-color: var(--pink-edge); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.slide--wine { background: linear-gradient(120deg, var(--wine-fill), var(--wine-fill-lift)); border: 1px solid color-mix(in srgb, var(--pink-edge) 40%, transparent); }
.slide--wine .why { background: color-mix(in srgb, var(--sheet) 16%, transparent); }
.slide--wine .why b { background: color-mix(in srgb, var(--sheet) 22%, transparent); color: #FFFFFF; }
.slide--wine .pic { border-color: color-mix(in srgb, var(--pink-edge) 45%, transparent); }

/* controls: capsules of glass */
#toc summary, .navbtn, .helpbtn, .btn { background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--depth-1); }
#toc summary { padding: 8px 17px; }
#toc[open] summary { background: var(--wine-fill); color: #FFFFFF; border-color: var(--wine-fill); }
.navbtn { width: 36px; height: 36px; }
.btn.primary, .btn--go { background: var(--wine-fill); border-color: var(--wine-fill); color: #FFFFFF; }
.toc-list { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-edge); border-radius: 20px; box-shadow: var(--depth-2); }
.toc-list li a { border-radius: 9px; }

/* sheets and overlays */
.layer { background: color-mix(in srgb, var(--ink) 30%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.layer--full { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
.panelbox { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-edge); border-radius: 22px; box-shadow: var(--depth-2); }
.panelbox input { border-radius: 12px; }
.ov-thumb { border-radius: 14px; box-shadow: var(--depth-1); }
.toast, .typed { border-radius: var(--r-chip); box-shadow: var(--depth-2); }
.notes-strip { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid var(--glass-edge); border-radius: 20px 20px 0 0; }

/* the deck (one slide per screen) */
.is-deck .slide .inner { padding: 30px 52px 22px; gap: 14px; }
.is-deck .slide .title { font-size: 42px; }
.is-deck .slide--wine .title { font-size: 58px; }
.is-deck .body { font-size: 22px; line-height: 1.42; }
.is-deck .why { font-size: 16px; }
.is-deck .deckbar { height: 54px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid var(--glass-edge); padding: 0 22px; gap: 10px; }
.is-deck .progress { height: 3px; background: color-mix(in srgb, var(--rule-firm) 60%, transparent); }
.is-deck .progress i { border-radius: 0 3px 3px 0; }

/* full screen keeps the bar as a floating glass capsule that appears on hover */
.is-full .deckbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: auto; height: 54px; border: 1px solid var(--glass-edge); border-radius: var(--r-chip); box-shadow: var(--depth-2); padding: 0 16px; }
.is-full .slide { background: var(--glass-strong); }
.is-full .slide--wine { background: linear-gradient(120deg, var(--wine-fill), var(--wine-fill-lift)); }
.is-full .slide .title { font-size: 48px; }
.is-full .slide--wine .title { font-size: 66px; }
.is-full .body { font-size: 26px; }

.pic, .pic:hover { text-decoration: none; }
.pic[data-win]::before { text-decoration: none; }

/* the title bar adds height: give the pictures room so nothing is cropped or pushed off the slide */
.is-deck .lay-side .pic { max-width: 620px; }
.is-deck .lay-wide .fig .pic { max-width: 1000px; }
.is-deck .lay-wide .s-figs { max-height: none; }
.is-deck .duo--wl .fig .pic { max-height: none; }
.is-deck .duo--wl .wl-a .pic img, .is-deck .duo--wl .wl-b .pic img { max-height: 372px; }

/* centre the picture block in the slide so wide slides are balanced */
.is-deck .lay-wide .s-figs { justify-items: center; }
.is-deck .lay-wide .fig { width: 100%; max-width: 1000px; }
.is-deck .duo--wl { justify-content: center; }
.is-deck .duo--wl .fig { width: auto; max-width: none; }
.is-deck .lay-wide .tiles, .is-deck .lay-wide .duo { margin-inline: auto; }
.is-full .lay-wide .fig { max-width: none; }
