/* ------------------------------------------------------------
   Tokens. Change the look here first.
   ------------------------------------------------------------ */
:root {
  --paper: #ffffff;
  --ink: #000000;
  --grey: #6b6b6b;      /* secondary text, 5.3:1 on white */
  --rule: #dadada;      /* hairlines and page edges */
  --accent: #1f3bd1;    /* links, hover, focus */

  /* forest map marks */
  --clear: #b8361a;
  --degr: #e5a43b;
  --front: #000000;

  --font: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;

  interpolate-size: allow-keywords;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--font);
  font-feature-settings: "ss01";
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button, input { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------
   Page frame
   ------------------------------------------------------------ */
.site-head, main, .site-foot {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.site-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 2rem;
  padding-top: clamp(24px, 5vw, 56px);
}
.name { grid-column: 1; font-size: 17px; font-weight: 700; margin: 0; }
.contact { grid-column: 2; grid-row: 1; margin: 0; }
.intro {
  grid-column: 1 / -1;
  margin: clamp(40px, 9vw, 120px) 0 0;
  max-width: 24ch;
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.site-foot { padding-block: 6rem 3rem; color: var(--grey); font-size: 15px; }

/* ------------------------------------------------------------
   The index: groups and rows
   ------------------------------------------------------------ */
.group { margin-top: clamp(56px, 9vw, 120px); }
.group-title {
  font-size: 17px; font-weight: 700; margin: 0 0 0.6rem;
}

.project > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr minmax(10rem, 15rem) 3.5rem 1.5rem;
  align-items: baseline;
  gap: 0 1.25rem;
  padding: 1rem 0 0.7rem;
}
.project > summary::-webkit-details-marker { display: none; }
.project > summary::after {
  content: "+";
  font-size: 28px; line-height: 1; text-align: right;
  transition: transform 0.25s ease;
}
.project[open] > summary::after { transform: rotate(45deg); }

.p-title {
  font-size: clamp(26px, 4.4vw, 56px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.p-kind, .p-year { color: var(--grey); font-size: 16px; }
.p-year { text-align: right; font-variant-numeric: tabular-nums; }
.project > summary:hover .p-title { color: var(--accent); }

/* opening motion, where the browser supports it */
.project::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.4s ease, content-visibility 0.4s allow-discrete;
}
.project[open]::details-content { block-size: auto; }

/* ------------------------------------------------------------
   Panel content
   ------------------------------------------------------------ */
.panel { padding: 1.25rem 0 clamp(48px, 7vw, 88px); }

.panel-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  margin-bottom: 2.5rem;
}
.facts { margin: 0; display: grid; grid-template-columns: 1fr; align-content: start; }
.facts dt { color: var(--grey); font-size: 15px; }
.facts dd { margin: 0 0 0.9rem; }
.prose { max-width: 62ch; font-size: 19px; line-height: 1.5; }
.prose p { margin: 0 0 1em; }

.sub {
  font-size: 19px; font-weight: 500; margin: 3rem 0 1rem;
}
.sub:first-child { margin-top: 0; }

figure { margin: 0; }
figcaption { margin-top: 0.75rem; font-size: 15px; color: var(--grey); }

/* Page strip: multi-page documents, scroll sideways */
.pages .strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 10px;
  overscroll-behavior-x: contain;
}
.pages .strip img {
  height: clamp(300px, 62vh, 620px);
  width: auto;
  max-width: none;
  flex: none;
  scroll-snap-align: start;
  outline: 1px solid var(--rule);
  outline-offset: -1px;
  cursor: zoom-in;
  background: #f3f3f3;
}

/* Gallery: plain images, two up; .wide spans the row */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.gallery > .wide { grid-column: 1 / -1; }
.gallery img {
  width: 100%; height: auto;
  outline: 1px solid var(--rule); outline-offset: -1px;
  cursor: zoom-in;
}
/* .thirds: three across (Zywave core values). .badges: four across, no frame,
   for transparent logos and marks (The Newz). */
.gallery.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery.badges { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); }
.gallery.badges img { outline: 0; }
.panel > .todo { max-width: 62ch; margin: -0.25rem 0 1rem; }

.video video { width: 100%; max-width: 1200px; background: var(--ink); }

/* Embedded video (YouTube and the like), held at 16:9 */
.embed { max-width: 1200px; margin-bottom: 1rem; }
.embed iframe {
  display: block; width: 100%; aspect-ratio: 16 / 9; height: auto;
  border: 0; background: var(--ink);
}

/* Small outbound links under the prose */
.links { list-style: none; margin: 1.5rem 0 0; padding: 0; font-size: 17px; }
.links li { border-top: 1px solid var(--rule); padding: 0.5rem 0; }
.links li:last-child { border-bottom: 1px solid var(--rule); }
.links a { text-decoration: none; display: flex; justify-content: space-between; gap: 1rem; }
.links a::after { content: "\2197"; }
.links a:hover { text-decoration: underline; }
.dim { color: var(--grey); }

/* Awards: certificates two up, each with its category set large beneath */
.awards { align-items: start; }
.awards .award { margin: 0; }
.aw-name {
  margin: 0.7rem 0 0;
  font-size: clamp(22px, 2.4vw, 32px); font-weight: 500;
  line-height: 1.1; letter-spacing: -0.02em;
}
.awards > figcaption { grid-column: 1 / -1; margin-top: 0.25rem; }

/* ------------------------------------------------------------
   Showcase: the 3D art leads, the documents follow as a collage
   ------------------------------------------------------------ */
.panel { counter-reset: case; }
.showcase {
  counter-increment: case;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(12rem, 1fr);
  gap: 1rem clamp(1.5rem, 3vw, 3rem);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.showcase + .showcase { margin-top: clamp(40px, 6vw, 72px); }

/* the art, with optional drag-to-reveal linework */
.sc-art {
  --pos: 0%;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f3f3f3;
  user-select: none;
  -webkit-user-select: none;
}
.sc-art > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
}
.sc-art > .sc-lines {          /* linework on the left of the seam, render on the right */
  background: var(--paper);
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.sc-art.compare { cursor: ew-resize; touch-action: pan-y; }
.sc-art:has(.sc-range:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

.sc-handle {
  position: absolute; top: 0; bottom: 0;
  left: var(--pos);
  width: 0;
  pointer-events: none;
}
.sc-handle::before {           /* the seam */
  content: ""; position: absolute; top: 0; bottom: 0; left: -0.5px;
  width: 1px; background: var(--ink);
}
.sc-handle::after {            /* the grip */
  content: "\2039\00a0\203A";
  position: absolute; top: 50%; left: 0;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--ink);
  font-size: 20px; line-height: 1;
}
.sc-label {
  position: absolute; bottom: 12px;
  font-size: 13px; line-height: 1; padding: 6px 8px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sc-label.lines { left: 12px; z-index: 1; background: var(--paper); color: var(--ink); outline: 1px solid var(--ink); outline-offset: -1px; }
.sc-label.render { right: 12px; background: var(--ink); color: var(--paper); }
.sc-art[data-side="lines"] .sc-label.render,
.sc-art[data-side="render"] .sc-label.lines { opacity: 0; }

/* the side column: number and title */
.sc-side {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 1.5rem;
  min-width: 0;
}
.sc-side::before {
  content: counter(case, decimal-leading-zero);
  color: var(--grey); font-size: 15px; font-variant-numeric: tabular-nums;
}
.sc-title {
  font-size: clamp(19px, 1.7vw, 24px); font-weight: 500;
  line-height: 1.2; letter-spacing: -0.01em;
  margin: -1.1rem 0 auto;    /* sits right under the number */
  text-wrap: balance;
}

/* the docs row: title above, collage full width */
.showcase.docs { grid-template-columns: 1fr; }
.showcase.docs .sc-title { margin: -1.1rem 0 0; }

/* Collage: every page placed by hand with --x --y (percent) --r (degrees) --z (stacking).
   On the figure, --w sets page width, --w-lg the width of pages marked class="lg",
   --ratio the collage's shape and --page-ratio the page shape (landscape by default). */
.collage-scroll {            /* the padding leaves room for tilted corners and the hover lift */
  overflow-x: auto; overscroll-behavior-x: contain;
  padding: 16px 12px 10px; margin: -16px -12px 0;
}
.collage {
  --w: 28%;
  position: relative;
  aspect-ratio: var(--ratio, 100 / 46);
  min-width: 760px;
  margin: 0.5rem 0 0;
}
.collage img {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: var(--w); height: auto;
  aspect-ratio: var(--page-ratio, 1800 / 1012);
  background: #f3f3f3;
  z-index: var(--z);
  transform: rotate(calc(var(--r) * 1deg));
  outline: 1px solid var(--rule); outline-offset: -1px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.collage img.lg { width: var(--w-lg, var(--w)); }   /* featured pages */
@media (hover: hover) {
  .collage img:hover {
    z-index: 20;
    transform: rotate(0deg) scale(1.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  }
}
.collage-key {
  list-style: none; margin: 1rem 0 0; padding: 0;
  min-width: 760px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem;
  font-size: 15px;
}
.collage-key li { border-top: 1px solid var(--ink); padding-top: 0.5rem; }
.collage-key span { display: block; color: var(--grey); }

/* ------------------------------------------------------------
   Writing prompts. Visible only while <body class="draft">.
   ------------------------------------------------------------ */
.todo { display: none; }
body.draft .todo {
  display: block;
  color: var(--accent);
  border-left: 2px dashed var(--accent);
  padding-left: 0.8rem;
  font-style: italic;
}
body.draft span.todo { display: inline; border: 0; padding: 0; }
body.draft .gallery > .todo.slot {
  display: grid; place-items: center; text-align: center;
  aspect-ratio: 16 / 10; margin: 0; padding: 1rem;
  border: 1.5px dashed var(--accent); font-size: 15px;
}

/* ------------------------------------------------------------
   BuddyJeff: the layer stack
   ------------------------------------------------------------ */
.layers {
  list-style: none; margin: 0; padding: 0;
  border-bottom: 1px solid var(--rule);
}
.layers li {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(10rem, 1.2fr) minmax(0, 2.4fr);
  gap: 0.25rem 1.5rem;
  align-items: baseline;
  padding: 0.9rem 0 0.9rem;
  border-top: 1px solid var(--rule);
  position: relative;
}
.l-name { font-size: 24px; font-weight: 500; letter-spacing: -0.015em; }
.l-where { color: var(--grey); font-size: 15px; }
.l-what { max-width: 52ch; }

/* ------------------------------------------------------------
   Real Frog Mugs: the loop (three across, so six steps sit in two rows)
   ------------------------------------------------------------ */
.loop {
  list-style: none; margin: 0 0 2.5rem; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  counter-reset: step;
}
.loop li {
  counter-increment: step;
  border-top: 1px solid var(--ink);
  padding-top: 0.6rem;
  display: grid; gap: 0.3rem; align-content: start;
}
.loop li::before {
  content: counter(step);
  font-size: 44px; font-weight: 500; line-height: 1; letter-spacing: -0.03em;
}
.loop b { font-weight: 500; font-size: 19px; }
.loop li:last-child::after { content: "Then back to 1."; color: var(--grey); font-size: 15px; }

/* ------------------------------------------------------------
   Amazon Visualizer: the live map
   ------------------------------------------------------------ */
.forest-watch {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem);
  margin-bottom: 1rem;
}
.fw-stage { position: relative; align-self: start; }
.fw-map {
  width: 100%; height: auto; aspect-ratio: 1;
  background: #ececec;
  cursor: crosshair;
}
.fw-hover {
  position: absolute; left: 10px; bottom: 10px; margin: 0;
  background: var(--paper); padding: 0.35rem 0.6rem;
  font-size: 14px; line-height: 1.35;
  pointer-events: none;
}
.fw-hover:empty { display: none; }
.fw-pin {
  position: absolute; transform: translate(-4px, -4px);
  font-size: 14px; line-height: 1; pointer-events: none;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.fw-pin::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink);
}
.fw-pin span { background: rgba(255,255,255,0.85); padding: 1px 4px; }

.fw-side { display: flex; flex-direction: column; gap: 1rem; }
.fw-year {
  margin: 0;
  font-size: clamp(64px, 9vw, 120px);
  font-weight: 500; line-height: 0.9; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.fw-range { width: 100%; accent-color: var(--ink); margin: 0; }
.fw-play {
  border: 1px solid var(--ink); background: var(--paper);
  padding: 0.4rem 0.9rem; cursor: pointer;
}
.fw-play:hover { background: var(--ink); color: var(--paper); }
.fw-toggles { display: grid; gap: 0.35rem; font-size: 16px; }
.fw-toggles label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.fw-toggles label.static { cursor: default; padding-left: 1.55rem; }
.fw-toggles input { accent-color: var(--ink); margin: 0; }
.swatch { width: 14px; height: 14px; display: inline-block; }
.swatch.clear { background: var(--clear); }
.swatch.degr { background: var(--degr); }
.swatch.front { background: var(--front); }
.fw-tally { margin: 0; font-size: 17px; max-width: 30ch; }
.fw-tally b { font-weight: 500; font-variant-numeric: tabular-nums; }
.fw-chart { width: 100%; height: 80px; overflow: visible; }
.fw-axis {
  margin: -0.5rem 0 0; display: flex; justify-content: space-between;
  font-size: 13px; color: var(--grey); font-variant-numeric: tabular-nums;
}
.fw-source {
  grid-column: 1 / -1; margin: 0;
  font-size: 14px; color: var(--grey); max-width: 90ch;
}

/* the 3D viewer embed */
.lp-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 420px;
  max-height: 80vh;
  background: #070a0d;
  overflow: hidden;
  margin-bottom: 1rem;
}
.lp-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------ */
.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: var(--paper);
}
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lightbox::backdrop { background: var(--paper); }
.lightbox img {
  max-width: 94vw; max-height: calc(100dvh - 72px);
  width: auto; height: auto; margin: auto; align-self: center;
}
.lb-bar {
  display: flex; gap: 1.5rem; justify-content: center; align-items: center;
  padding: 0.8rem; font-size: 15px;
}
.lb-bar button { background: none; border: 0; padding: 0.3rem; cursor: pointer; }
.lb-bar button:hover { color: var(--accent); }
.lb-count { color: var(--grey); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   Small screens
   ------------------------------------------------------------ */
@media (max-width: 760px) {
  .project > summary {
    grid-template-columns: 1fr auto 1.5rem;
    grid-template-areas: "title title mark" "kind year .";
  }
  .p-title { grid-area: title; }
  .p-kind { grid-area: kind; }
  .p-year { grid-area: year; }
  .project > summary::after { grid-area: mark; }
  .panel-intro, .forest-watch { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gallery.thirds { grid-template-columns: 1fr; }
  .gallery.badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layers li { grid-template-columns: 1fr; }
  .loop { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .showcase { grid-template-columns: 1fr; }
  .sc-side { gap: 0.25rem; }
  .sc-title, .showcase.docs .sc-title { margin: 0; }
  .sc-handle::after { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .project::details-content, .project > summary::after, .collage img { transition: none; }
}
