/* PandaDesign — a quiet gallery wall, so the screenshots are the loudest thing
   on the page. Warm grey wall, one serif for the design names, small mono caps
   for labels. Icons stay grey. Four looks: Auto (follows the device), Light,
   Dark, and Bold (black on white, heavy and larger, for a projector). */

:root {
  --wall:   #ecebe8;
  --wall-2: #f7f6f3;   /* raised: info panel, buttons */
  --ink:    #18181b;
  --ink-2:  #4f4f56;
  --ink-3:  #8a8a91;
  --rule:   rgba(24, 24, 27, 0.12);
  --rule-2: rgba(24, 24, 27, 0.06);
  --focus:  #18181b;
  --shadow: 0 1px 2px rgba(20, 20, 25, .06), 0 12px 40px -12px rgba(20, 20, 25, .28);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --name-font: var(--serif);
  --name-weight: 400;
  --base: 16px;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="bold"]) {
    --wall:   #121214;
    --wall-2: #1c1c20;
    --ink:    #f1f0ec;
    --ink-2:  #b3b2ad;
    --ink-3:  #7b7a76;
    --rule:   rgba(241, 240, 236, 0.14);
    --rule-2: rgba(241, 240, 236, 0.07);
    --focus:  #f1f0ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 48px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall:   #121214;
  --wall-2: #1c1c20;
  --ink:    #f1f0ec;
  --ink-2:  #b3b2ad;
  --ink-3:  #7b7a76;
  --rule:   rgba(241, 240, 236, 0.14);
  --rule-2: rgba(241, 240, 236, 0.07);
  --focus:  #f1f0ec;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 48px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
/* Bold: readable from the back of a room. */
:root[data-theme="bold"] {
  --wall:   #ffffff;
  --wall-2: #ffffff;
  --ink:    #000000;
  --ink-2:  #000000;
  --ink-3:  #1f1f1f;
  --rule:   #000000;
  --rule-2: rgba(0, 0, 0, .25);
  --focus:  #0038ff;
  --shadow: 0 0 0 3px #000;
  --name-font: var(--sans);
  --name-weight: 800;
  --base: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--base); -webkit-text-size-adjust: 100%; }
body {
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
:root[data-theme="bold"] .label { font-weight: 700; color: var(--ink); font-size: .72rem; }

/* ---------------------------------------------------------------- top bar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 3vw, 40px) 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}
/* A little framed picture: the idea of the app in one shape. */
.brand-mark {
  width: 22px; height: 16px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 55%, var(--ink-3) 55%) no-repeat;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.count { margin-right: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--wall-2);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill:hover { color: var(--ink); border-color: var(--ink-3); }
:root[data-theme="bold"] .pill { border: 2px solid #000; color: #000; }

/* ----------------------------------------------------------------- viewer */
.viewer {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas: "stage info" "strip info";
  grid-template-rows: auto 1fr;
  column-gap: clamp(20px, 3vw, 44px);
  row-gap: 18px;
  padding: 4px clamp(16px, 3vw, 40px) 20px;
  align-items: start;
}
.stage-wrap { grid-area: stage; min-width: 0; }
.stage {
  position: relative;
  height: clamp(320px, calc(100dvh - 300px), 820px);
  border-radius: var(--radius);
  background: var(--stage, var(--wall-2));
  box-shadow: inset 0 0 0 1px var(--rule-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(14px, 2.4vw, 36px);
  touch-action: pan-y;
  transition: background .5s ease;
}
.shot {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
  background: #fff;
  opacity: 1;
  transform: none;
  transition: opacity .28s ease, transform .28s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.shot.is-tall { border-radius: 22px; }
.shot.out { opacity: 0; transform: scale(.985); }

.nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--wall-2) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  box-shadow: 0 4px 14px -6px rgba(0,0,0,.3);
  font-size: 22px;
  transition: color .15s, transform .15s;
}
.nav:hover { color: var(--ink); }
.nav:active { transform: scale(.94); }
.nav.prev { left: 14px; }
.nav.next { right: 14px; }
:root[data-theme="bold"] .nav { background: #fff; border: 2px solid #000; color: #000; }

.shot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.shot-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.shot-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
}
.shot-tab[aria-selected="true"] { background: var(--ink); color: var(--wall); border-color: var(--ink); }
:root[data-theme="bold"] .shot-tab { border: 2px solid #000; color: #000; }
:root[data-theme="bold"] .shot-tab[aria-selected="true"] { color: #fff; }
.full-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.full-link:hover { color: var(--ink); }

/* ------------------------------------------------------------------- info */
.info {
  grid-area: info;
  min-width: 0;
  padding-top: 6px;
}
.index { margin-bottom: 10px; }
.name {
  font-family: var(--name-font);
  font-weight: var(--name-weight);
  font-size: clamp(2.6rem, 4.4vw, 3.8rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.aka {
  margin-top: 6px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-2);
}
:root[data-theme="bold"] .aka { font-family: var(--sans); font-style: normal; font-weight: 700; }
.what {
  margin-top: 18px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink);
}
.said {
  margin-top: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--ink-3);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--ink-2);
}
.said::before { content: '\201C'; }
.said::after { content: '\201D  \2014 Jeff'; font-family: var(--sans); font-size: .8rem; color: var(--ink-3); }
:root[data-theme="bold"] .said { font-family: var(--sans); font-weight: 600; color: #000; border-left: 4px solid #000; }

.notes {
  margin-top: 22px;
  border-top: 1px solid var(--rule);
}
.notes div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.notes dt { padding-top: 3px; }
.notes dd { font-size: .9rem; color: var(--ink-2); line-height: 1.45; }
:root[data-theme="bold"] .notes dd { color: #000; font-weight: 500; }

.palette-head { margin-top: 20px; margin-bottom: 8px; }
.palette {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}
.swatch {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--wall-2);
}
.swatch-chip { display: block; height: 34px; }
.swatch-text { display: block; padding: 5px 7px 6px; line-height: 1.2; }
.swatch-name { display: block; font-size: .72rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatch-hex { display: block; font-family: var(--mono); font-size: .62rem; color: var(--ink-3); letter-spacing: .04em; }
.swatch.copied .swatch-hex { color: var(--ink); }

.from {
  margin-top: 20px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.from a { font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--rule); }
.from a:hover { border-bottom-color: var(--ink); }
.recipe { margin-top: 6px; font-size: .84rem; color: var(--ink-3); line-height: 1.45; }
:root[data-theme="bold"] .recipe { color: #000; }

/* ------------------------------------------------------------------ strip */
.strip-wrap {
  grid-area: strip;
  min-width: 0;
  align-self: start;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}
.strip-head { margin-bottom: 8px; }
.strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.thumb {
  flex: 0 0 auto;
  width: 172px;
  scroll-snap-align: start;
  text-align: left;
  opacity: .62;
  transition: opacity .2s;
}
.thumb:hover, .thumb[aria-current="true"] { opacity: 1; }
.thumb-img {
  display: block;
  width: 100%;
  aspect-ratio: 480 / 264;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--wall-2);
}
.thumb[aria-current="true"] .thumb-img { outline: 2px solid var(--ink); outline-offset: 3px; }
:root[data-theme="bold"] .thumb { opacity: 1; }
:root[data-theme="bold"] .thumb[aria-current="true"] .thumb-img { outline: 4px solid var(--focus); }
.thumb-name { display: block; margin-top: 7px; font-size: .82rem; font-weight: 600; }
.thumb-app { display: block; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px clamp(16px, 3vw, 40px) max(14px, env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------------ sizes */
@media (max-width: 1100px) {
  .viewer { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 860px) {
  .viewer { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "strip" "info"; grid-template-rows: auto; }
  .stage { height: auto; min-height: 260px; max-height: 76dvh; }
  .shot { max-height: calc(76dvh - 40px); }
  .info { padding-top: 0; }
  .count { display: none; }
}
@media (max-width: 520px) {
  .top { padding-left: 16px; padding-right: 16px; }
  .viewer, .foot { padding-left: 16px; padding-right: 16px; }
  .stage { padding: 12px; border-radius: 12px; }
  .nav { width: 40px; height: 40px; font-size: 19px; }
  .nav.prev { left: 8px; }
  .nav.next { right: 8px; }
  .thumb { width: 132px; }
  .shot-tab { min-height: 38px; }
  .foot .label:first-child { display: none; }
  .pill { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .shot, .stage, .thumb { transition: none; }
}

/* Dated session archive; all colors follow the existing light/dark/bold theme. */
.session-meta { line-height: 1.7; }
.session-archive { padding: 24px clamp(16px, 3vw, 40px) 40px; border-top: 1px solid var(--rule); }
.session-archive > p { max-width: 65ch; }
.session-group { margin-top: 28px; }
.session-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px; }
.session-card { display: block; min-width: 0; border: 1px solid var(--rule); border-radius: 12px; padding: 16px; color: var(--ink); background: var(--wall-2); text-decoration: none; }
.session-card img { width: 100%; height: 210px; object-fit: contain; background: #F4EFE5; border-radius: 6px; }
.session-card h4 { font-size: 1.1rem; margin: 14px 0 8px; }
.session-card p { line-height: 1.5; }
.session-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
