@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
}

:root {
  --paper: #f8f4ef;
  --paper-deep: #eee6df;
  --ink: #201b18;
  --muted: #796d66;
  --line: #ded4cc;
  --red: #a42b20;
  --blue: #185fce;
  --header-height: 88px;
  --page-x: clamp(20px, 3.2vw, 52px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
img { max-width: 100%; }

.skip-link {
  position: fixed;
  left: 16px;
  top: 10px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 14px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { transform: none; }

.site-header {
  position: relative;
  z-index: 20;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 18px var(--page-x);
  background: rgba(248, 244, 239, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; flex: 0 0 auto; }
.brand img { display: block; width: clamp(184px, 18vw, 224px); height: auto; }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 34px); }
.site-nav a {
  position: relative;
  padding: 10px 0;
  font-size: .875rem;
  letter-spacing: .01em;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 3px;
  height: 1px;
  background: var(--red);
  transition: right .25s ease;
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a.is-current::after { right: 0; }
.menu-toggle { display: none; }

.project-heading {
  min-height: 118px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 20px var(--page-x);
  border-bottom: 1px solid var(--line);
}
.breadcrumbs { display: flex; align-items: center; gap: 14px; }
.breadcrumbs a,
.section-kicker {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.2;
  letter-spacing: .04em;
}
.breadcrumbs span { color: #b3a69e; }
.project-title-wrap { display: flex; align-items: baseline; gap: 18px; min-width: 0; }
.project-title-wrap h1 { margin: 0; font-size: clamp(1.45rem, 2.1vw, 2rem); line-height: 1.1; font-weight: 500; letter-spacing: -.025em; }
.project-title-wrap p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.project-title-wrap p span { color: var(--red); }
.drawing-prompt {
  margin: 0;
  max-width: 250px;
  color: var(--blue);
  font: 600 clamp(1.1rem, 1.5vw, 1.35rem)/1.05 Caveat, cursive;
  text-align: right;
  transform: rotate(-2deg);
}

.drawing-stage {
  --stage-h: calc(100svh - var(--header-height) - 118px);
  position: relative;
  height: max(540px, var(--stage-h));
  overflow: hidden;
  background: #fbf9f6;
  border-bottom: 1px solid var(--line);
  transition: height .8s cubic-bezier(.65, 0, .2, 1);
  touch-action: manipulation;
}
.drawing-stage.is-active { height: clamp(320px, 48svh, 560px); }
.drawing-canvas {
  position: absolute;
  will-change: left, top, width, height;
  transition: left .8s cubic-bezier(.65, 0, .2, 1), top .8s cubic-bezier(.65, 0, .2, 1), width .8s cubic-bezier(.65, 0, .2, 1), height .8s cubic-bezier(.65, 0, .2, 1);
}
.drawing-canvas > img { display: block; width: 100%; height: 100%; user-select: none; }
.hotspot-lines,
.hotspots { position: absolute; inset: 0; width: 100%; height: 100%; }
.hotspot-lines { overflow: visible; pointer-events: none; }
.hotspot-lines ellipse {
  fill: none;
  stroke: var(--blue);
  stroke-width: 6px;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset .65s ease, opacity .25s;
}
.hotspot-lines ellipse.is-visible { stroke-dashoffset: 0; opacity: 1; }
.hotspot {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.hotspot:focus-visible { outline: 4px solid var(--blue); outline-offset: 4px; }
.drawing-stage.is-active .hotspot { pointer-events: none; }
.hotspot-label {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%) rotate(-3deg);
  color: var(--blue);
  font: 650 clamp(1.1rem, 2vw, 2.1rem)/1 Caveat, cursive;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  text-shadow: 0 0 7px var(--paper), 0 0 14px var(--paper);
  transition: opacity .25s;
}
.hotspot-label.is-visible { opacity: 1; }
.stage-actions { position: absolute; inset: auto var(--page-x) 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.stage-actions[hidden] { display: none; }
.back-button,
.chapter-arrows button {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font: 500 .85rem/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.back-button { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 18px; border-radius: 999px; }
.chapter-arrows { display: flex; gap: 8px; }
.chapter-arrows button { width: 42px; height: 42px; border-radius: 50%; font-size: 1.35rem; }
.back-button:hover,
.chapter-arrows button:hover { background: var(--red); }

.chapter { animation: fade-up .55s ease both; }
.chapter[hidden] { display: none; }
.chapter-heading {
  display: grid;
  grid-template-columns: minmax(240px, .85fr) minmax(0, 1.5fr);
  gap: clamp(30px, 6vw, 90px);
  align-items: end;
  padding: clamp(42px, 6vw, 88px) var(--page-x) clamp(28px, 4vw, 52px);
}
.chapter-count { margin: 0 0 12px; color: var(--muted); font-size: .75rem; letter-spacing: .04em; }
.chapter h2 { margin: 0; font-size: clamp(2.4rem, 5vw, 5.4rem); line-height: .94; font-weight: 500; letter-spacing: -.05em; text-wrap: balance; }
.chapter-lede { margin: 0; max-width: 58ch; font-size: clamp(1.12rem, 1.8vw, 1.45rem); line-height: 1.45; color: #443b36; text-wrap: pretty; }
.media-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 12px var(--page-x) 28px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--page-x);
  scrollbar-color: var(--red) var(--paper-deep);
}
.media-strip figure { flex: none; margin: 0; scroll-snap-align: start; }
.media-strip img,
.media-strip video,
.media-strip iframe,
.media-placeholder { display: block; width: auto; height: clamp(300px, 52svh, 560px); background: var(--paper-deep); }
.media-strip video,
.media-strip iframe { width: min(80vw, 900px); max-width: min(80vw, 900px); border: 0; aspect-ratio: 16 / 9; }
.media-placeholder {
  display: grid;
  place-items: center;
  width: min(72vw, 620px);
  padding: 24px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, #f3ece6 0 11px, #e9dfd7 11px 22px);
  color: var(--muted);
  font: .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}
.media-strip figcaption { display: flex; gap: 8px; max-width: 62ch; padding-top: 9px; color: var(--muted); font-size: .75rem; }
.media-kind { flex: none; color: var(--red); letter-spacing: .03em; }
.chapter-copy { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(30px, 5vw, 74px); margin-top: 16px; padding: clamp(38px, 5vw, 70px) var(--page-x); border-top: 1px solid var(--line); }
.chapter-copy h3 { margin: 0 0 15px; color: var(--muted); font-size: .75rem; letter-spacing: .04em; }
.chapter-copy p { margin: 0; color: #443b36; font-size: 1rem; line-height: 1.65; text-wrap: pretty; }
.doc-list { margin: 0; padding: 0; list-style: none; }
.doc-list a { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.doc-list small { color: var(--muted); letter-spacing: .08em; }
.chapter-pagination { display: flex; justify-content: space-between; gap: 20px; padding: 28px var(--page-x) 56px; border-top: 1px solid var(--line); }
.chapter-pagination button { max-width: 42%; padding: 0; border: 0; background: none; cursor: pointer; font: 500 1rem/1.35 "Helvetica Neue", Helvetica, Arial, sans-serif; text-align: left; }
.chapter-pagination button:last-child { text-align: right; }
.chapter-pagination small { display: block; margin-bottom: 5px; color: var(--muted); font-size: .7rem; letter-spacing: .04em; }

.chapter-index { padding: clamp(42px, 5vw, 72px) var(--page-x) clamp(58px, 7vw, 98px); }
.chapter-index[hidden] { display: none; }
.chapter-index ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 48px); margin: 22px 0 0; padding: 0; list-style: none; }
.index-button { display: flex; gap: 12px; align-items: baseline; width: 100%; min-height: 52px; padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; font: 500 .95rem/1.25 "Helvetica Neue", Helvetica, Arial, sans-serif; text-align: left; }
.index-button span { color: var(--red); font-size: .7rem; letter-spacing: .06em; }
.index-button:hover { color: var(--red); }

.project-gallery,
.making-section { padding: clamp(64px, 9vw, 132px) var(--page-x); border-top: 1px solid var(--line); }
.project-gallery[hidden],
.making-section[hidden] { display: none; }
.showcase-heading { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.7fr); gap: 16px clamp(36px, 7vw, 110px); align-items: end; margin-bottom: clamp(34px, 5vw, 70px); }
.showcase-heading .section-kicker { grid-row: 1 / span 2; align-self: start; padding-top: 12px; }
.showcase-heading h2 { margin: 0; font-size: clamp(2.8rem, 6vw, 6.5rem); line-height: .92; font-weight: 500; letter-spacing: -.055em; text-wrap: balance; }
.showcase-heading > p:last-child { max-width: 62ch; margin: 2px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.gallery-scroll-shell { position: relative; }
.gallery-controls { display: flex; justify-content: flex-end; gap: 9px; margin: 0 0 16px; }
.gallery-controls[hidden] { display: none; }
.gallery-controls button { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; font-size: 1.2rem; transition: color .2s, background .2s, opacity .2s; }
.gallery-controls button:hover,
.gallery-controls button:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.gallery-controls button:disabled { opacity: .28; cursor: default; }
.gallery-grid { display: flex; gap: clamp(12px, 1.7vw, 24px); overflow-x: auto; overscroll-behavior-inline: contain; padding: 2px 0 16px; scroll-padding-inline: 2px; scroll-snap-type: inline mandatory; scrollbar-color: var(--ink) var(--line); scrollbar-width: thin; }
.gallery-grid::-webkit-scrollbar { height: 5px; }
.gallery-grid::-webkit-scrollbar-track { background: var(--line); }
.gallery-grid::-webkit-scrollbar-thumb { background: var(--ink); }
.gallery-card { position: relative; display: block; flex: 0 0 auto; width: auto; height: clamp(260px, 38vw, 540px); aspect-ratio: var(--photo-ratio, 4 / 3); padding: 0; overflow: hidden; border: 0; background: var(--paper-deep); cursor: zoom-in; scroll-snap-align: start; text-align: left; }
.gallery-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.2,.65,.25,1); }
.gallery-card span { position: absolute; inset: auto 12px 12px; padding: 7px 10px; background: rgba(32,27,24,.86); color: white; font-size: .78rem; line-height: 1.3; opacity: 0; transform: translateY(5px); transition: opacity .25s, transform .25s; }
.gallery-card:hover img,
.gallery-card:focus-visible img { transform: scale(1.035); }
.gallery-card:hover span,
.gallery-card:focus-visible span { opacity: 1; transform: none; }
.gallery-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.making-section { background: var(--ink); color: var(--paper); }
.making-section .section-kicker,
.making-section .showcase-heading > p:last-child { color: #bfb4ac; }
.making-videos { display: grid; gap: clamp(28px, 5vw, 64px); }
.making-videos figure { margin: 0; }
.making-videos video,
.making-videos iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.making-videos figcaption { margin-top: 12px; color: #d6ccc5; font-size: .9rem; }

.gallery-dialog { width: 100vw; max-width: none; height: 100svh; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; background: rgba(17,15,14,.98); color: white; }
.gallery-dialog::backdrop { background: rgba(17,15,14,.94); }
.gallery-viewer { display: grid; grid-template-columns: 64px minmax(0,1fr) 64px; align-items: center; width: 100%; height: 100%; padding: clamp(54px, 7vw, 82px) clamp(12px, 3vw, 40px) 24px; }
.gallery-viewer figure { display: grid; grid-template-rows: minmax(0,1fr) auto; align-items: center; justify-items: center; min-width: 0; height: 100%; margin: 0; }
.gallery-viewer img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100svh - 150px); object-fit: contain; }
.gallery-viewer figcaption { display: flex; justify-content: space-between; gap: 20px; min-height: 42px; padding-top: 14px; color: #ddd3cc; font-size: .86rem; }
.gallery-viewer figcaption span:last-child { flex: none; color: #a99e97; }
.gallery-close,
.gallery-arrow { display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(17,15,14,.5); color: white; cursor: pointer; }
.gallery-close:hover,
.gallery-arrow:hover,
.gallery-close:focus-visible,
.gallery-arrow:focus-visible { background: white; color: var(--ink); outline: none; }
.gallery-close { position: absolute; z-index: 2; top: 18px; right: 20px; width: 44px; height: 44px; font-size: 1.7rem; }
.gallery-arrow { z-index: 3; width: 46px; height: 46px; justify-self: center; font-size: 1.8rem; }
.gallery-arrow[hidden] { display: none; }

.credits {
  display: grid;
  grid-template-columns: minmax(240px, .75fr) minmax(0, 2fr);
  gap: clamp(44px, 8vw, 120px);
  padding: clamp(68px, 9vw, 132px) var(--page-x);
  background: var(--red);
  color: var(--paper);
}
.credits .section-kicker { color: #f1bcb5; }
.credits h2 { margin: 13px 0 0; font-size: clamp(3.5rem, 8vw, 8rem); line-height: .85; font-weight: 500; letter-spacing: -.065em; }
.credits-grid { columns: 3; column-gap: clamp(30px, 5vw, 76px); }
.credits-grid > section { display: inline-block; width: 100%; margin: 0 0 48px; break-inside: avoid; vertical-align: top; }
.credits-grid h3 { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid rgba(248,244,239,.35); font-size: .78rem; letter-spacing: .04em; }
.credits-grid h4 { margin: 22px 0 7px; color: #f1bcb5; font-size: .72rem; letter-spacing: .04em; }
.credits-grid p { margin: 0; font-size: 1rem; line-height: 1.7; }

.site-footer { display: flex; justify-content: space-between; gap: 24px; padding: 30px var(--page-x) 42px; border-top: 1px solid #7e1e17; background: var(--red); color: #f4d5d1; font-size: .75rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px; }
.site-footer a { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(248,244,239,.45); border-radius: 50%; transition: color .2s ease, background .2s ease, border-color .2s ease; }
.site-footer a:hover,
.site-footer a:focus-visible { color: var(--red); background: var(--paper); border-color: var(--paper); outline: none; }
.site-footer svg { width: 19px; height: 19px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.site-footer svg .icon-fill { fill: currentColor; stroke: none; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.noscript { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: 320px; margin: 0; padding: 12px 16px; background: var(--ink); color: white; font-size: .8rem; }

@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 1020px) {
  :root { --header-height: 76px; }
  .site-header { min-height: var(--header-height); }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border: 0;
    background: transparent;
    font: 500 .8rem/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
    cursor: pointer;
  }
  .menu-toggle i,
  .menu-toggle i::before { display: block; width: 21px; height: 1px; background: currentColor; transition: transform .25s ease; content: ""; }
  .menu-toggle i::before { transform: translateY(6px); }
  .menu-toggle[aria-expanded="true"] i { transform: translateY(3px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] i::before { transform: rotate(-90deg); }
  .site-nav {
    position: absolute;
    inset: 100% 0 auto;
    display: grid;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0 var(--page-x);
    background: var(--paper);
    border-bottom: 1px solid transparent;
    transition: max-height .35s ease, padding .35s ease, border-color .35s ease;
  }
  .site-nav.is-open { max-height: calc(100svh - var(--header-height)); padding-top: 14px; padding-bottom: 22px; border-color: var(--line); }
  .site-nav a { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .site-nav a::after { display: none; }
  .project-heading { grid-template-columns: auto minmax(0, 1fr); min-height: 112px; }
  .drawing-prompt { grid-column: 2; max-width: none; text-align: left; }
  .chapter-index ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credits { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --page-x: 20px; }
  .brand img { width: 178px; }
  .project-heading { display: block; min-height: 0; padding-top: 18px; padding-bottom: 18px; }
  .breadcrumbs { margin-bottom: 13px; }
  .project-title-wrap { display: block; }
  .project-title-wrap h1 { font-size: 1.75rem; }
  .project-title-wrap p { margin-top: 7px; }
  .drawing-prompt { margin-top: 13px; font-size: 1.12rem; text-align: left; }
  .drawing-stage { --stage-h: 66svh; height: max(480px, var(--stage-h)); }
  .drawing-stage.is-active { height: 44svh; min-height: 300px; }
  .hotspot-label { display: none; }
  .hotspot::after {
    content: attr(data-number);
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--blue);
    color: white;
    box-shadow: 0 0 0 3px rgba(248,244,239,.82);
    font: 700 .58rem/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  }
  .drawing-stage.is-active .hotspot::after { display: none; }
  .stage-actions { inset: auto 14px 14px; }
  .back-button { min-height: 40px; padding: 0 14px; font-size: .78rem; }
  .chapter-arrows button { width: 40px; height: 40px; }
  .chapter-heading { grid-template-columns: 1fr; gap: 24px; }
  .chapter h2 { font-size: clamp(2.6rem, 14vw, 4rem); }
  .media-strip { gap: 10px; }
  .media-strip img,
  .media-strip video,
  .media-strip iframe,
  .media-placeholder { height: 44svh; min-height: 280px; max-width: 84vw; }
  .chapter-copy { grid-template-columns: 1fr; }
  .chapter-pagination { align-items: flex-start; padding-bottom: 44px; }
  .chapter-pagination button { max-width: 47%; font-size: .88rem; }
  .chapter-index ol { grid-template-columns: 1fr; }
  .showcase-heading { grid-template-columns: 1fr; }
  .showcase-heading .section-kicker { grid-row: auto; padding-top: 0; }
  .showcase-heading h2 { font-size: clamp(2.7rem, 14vw, 4.5rem); }
  .gallery-controls { margin-bottom: 12px; }
  .gallery-controls button { width: 42px; height: 42px; }
  .gallery-grid { margin-right: calc(var(--page-x) * -1); padding-right: var(--page-x); }
  .gallery-card { height: min(64svh, 480px); }
  .gallery-card span { inset: auto 7px 7px; padding: 5px 7px; opacity: 1; transform: none; font-size: .7rem; }
  .gallery-viewer { grid-template-columns: 1fr; padding: 64px 12px 72px; }
  .gallery-arrow { position: absolute; bottom: 18px; width: 44px; height: 44px; }
  .gallery-arrow-prev { left: 16px; }
  .gallery-arrow-next { right: 16px; }
  .gallery-viewer figcaption { padding: 12px 4px 0; }
  .credits-grid { columns: 2; column-gap: 28px; }
  .credits-grid > section { margin-bottom: 40px; }
  .site-footer { display: grid; }
}

@media (max-width: 420px) {
  .credits-grid { columns: 1; }
  .drawing-stage { height: max(430px, 60svh); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
