@font-face {
  font-family: Poppins;
  src: url("assets/poppins-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "IM Fell English";
  src: url("assets/im-fell-english.woff2") format("woff2");
  font-display: swap;
}

:root {
  --desk: #20160f;
  --ink: #2b2118;
  --paper: #e8dcc1;
  --cream: #f3e7d1;
  --muted: #c7b69e;
  --red: #762c23;
  --serif: "IM Fell English", Georgia, serif;
  --sans: Poppins, system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color: var(--cream);
  background: var(--desk);
  font-family: var(--serif);
}

* { box-sizing: border-box; }
body, h1, h2, p, ul { margin: 0; }

body {
  position: relative;
  min-height: 100svh;
  background: #20160f;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(#1c130c30, #150d08a6), url("assets/desk.webp") center / cover;
}

.desk {
  position: relative;
  width: min(100%, 1200px);
  margin-inline: auto;
  padding: clamp(52px, 8vh, 112px) clamp(32px, 5vw, 72px) 40px;
}

.heading {
  text-align: center;
  margin-bottom: clamp(36px, 6vw, 76px);
  animation: arrive 640ms var(--ease) both;
}

.event {
  color: var(--muted);
  font: 700 .75rem/1.5 var(--sans);
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(3.25rem, 8.5vw, 7.5rem);
  line-height: .98;
  font-weight: 400;
  text-wrap: balance;
  text-shadow: 0 3px 14px #100a05a6;
}

.subject {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(1rem, 2.1vw, 1.25rem);
  line-height: 1.4;
}

.subject .separator { padding-inline: 4px; }

.papers {
  display: grid;
  grid-template-columns: 1.06fr 1fr .94fr;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding: 0;
  list-style: none;
}

.evidence {
  --turn: -4deg;
  --offset: 12px;
  --delay: 60ms;
  --crop: 50% 20%;
  --lens-x: 60%;
  --lens-y: 48%;
  position: relative;
  min-width: 0;
  transform: translateY(var(--offset));
}

.evidence-board {
  --turn: 1.5deg;
  --offset: -12px;
  --delay: 130ms;
  --crop: 46% 0%;
}

.evidence-guide {
  --turn: -3deg;
  --offset: 20px;
  --delay: 200ms;
  --crop: 49% 14%;
}

.paper {
  position: relative;
  isolation: isolate;
  padding: 20px 14px 14px 20px;
  color: var(--ink);
  transform: rotate(var(--turn));
  transition: transform 420ms var(--ease);
  animation: settle 760ms var(--ease) var(--delay) backwards;
}

.paper::before {
  position: absolute;
  z-index: -1;
  inset: -3px;
  content: "";
  transform: rotate(calc(var(--turn) * -.4)) translateY(4px);
  background: #a48b62;
  clip-path: polygon(1% 1%, 97% 0, 100% 98%, 39% 99%, 10% 98%, 0 100%);
  box-shadow: inset 0 0 24px #573c24;
}

.paper::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    radial-gradient(ellipse at 18% 1%, #fff5d475, transparent 52%),
    radial-gradient(ellipse at 96% 100%, #a0714543, transparent 66%),
    repeating-linear-gradient(94deg, transparent 0 3px, #523a1907 4px, transparent 5px 8px),
    var(--paper);
  clip-path: polygon(0 2%, 5% .8%, 12% 1.2%, 19% 0, 26% .8%, 36% .2%, 44% 1%, 55% .3%, 63% 1.3%, 76% 0, 83% .7%, 93% 0, 100% 1%, 99% 26%, 100% 41%, 99.6% 70%, 100% 98%, 95% 99.6%, 87% 99%, 81% 100%, 68% 98.6%, 61% 99.6%, 47% 98.9%, 35% 100%, 23% 98.9%, 12% 99.8%, 1% 99%, 0 84%, .6% 65%, 0 49%, .4% 31%);
  box-shadow: inset 0 0 20px #734e2438;
}

.evidence { filter: drop-shadow(1px 12px 11px #0d0806aa); }
.evidence:focus-within, .evidence.is-selected { z-index: 2; }
.evidence:focus-within .paper, .evidence.is-selected .paper { transform: translateY(-5px) rotate(0); }

.print {
  position: relative;
  aspect-ratio: 1.29;
  margin-bottom: 14px;
  border: 5px solid #f5ebd6;
  outline: 1px solid #765d3c55;
  background-color: #d8cbb1;
  box-shadow: 0 2px 6px #503a2940;
}

.preview, .zoom {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--crop);
}

.preview { filter: saturate(.82) sepia(.12); }
.evidence-class .preview, .evidence-class .zoom { object-position: 48% 0%; }
.evidence-class .print { aspect-ratio: 1.38; }
.evidence-guide .print { aspect-ratio: 1.23; }

.tape {
  position: absolute;
  top: -9px;
  right: -14px;
  width: 52px;
  height: 18px;
  background: repeating-linear-gradient(90deg, #e9d9b744 0 2px, transparent 3px 5px), #d7c098a9;
  clip-path: polygon(4% 0, 100% 3%, 96% 23%, 99% 52%, 96% 70%, 100% 96%, 0 100%, 3% 77%, 0 42%, 3% 15%);
  transform: rotate(34deg);
  pointer-events: none;
}

.evidence-guide .tape { top: auto; bottom: -7px; left: -12px; right: auto; }
.evidence-board .tape { display: none; }

.pin {
  position: absolute;
  top: 4px;
  left: 51%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #bc6c50 8%, #8e382a 42%, #4c1a13 89%);
  box-shadow: 2px 4px 4px #2f170fa6, inset 0 1px 1px #f0b78668;
  pointer-events: none;
}

.evidence-class .pin { left: 44%; }
.evidence-guide .pin { left: 65%; }

.clip {
  position: absolute;
  top: -12px;
  left: 22px;
  width: 16px;
  height: 42px;
  border: 2px solid #a99e89;
  border-bottom-color: #5d5548;
  border-radius: 10px;
  transform: rotate(16deg);
  filter: drop-shadow(1px 2px 1px #38271699);
  pointer-events: none;
}

.clip::after {
  position: absolute;
  inset: 5px 2px 3px 3px;
  content: "";
  border: 1px solid #736857;
  border-bottom-color: transparent;
  border-radius: 8px;
}

.caption {
  min-height: 58px;
  padding: 0 2px 8px;
  border-bottom: 1px solid #72543943;
}

.caption h2 {
  font-size: clamp(1.54rem, 2.4vw, 2.35rem);
  font-weight: 400;
  line-height: 1;
}

.caption p {
  margin-top: 5px;
  color: #604a38;
  font: 700 .65rem/1.45 var(--sans);
}

.inspect {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
}

.js .inspect { display: block; }

.inspect:focus-visible, .open:focus-visible {
  outline: 3px solid #fff5db;
  outline-offset: 5px;
}

.open {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: fit-content;
  min-height: 44px;
  margin-top: 4px;
  padding: 0 12px;
  border-radius: 2px;
  background: var(--red);
  color: #fff4de;
  font: 700 .73rem/1.2 var(--sans);
  text-decoration: none;
  box-shadow: 0 3px 0 #4b1d17;
  transition: opacity 180ms linear, transform 340ms var(--ease), background-color 140ms linear;
}

.open:hover { background-color: #8b382b; }
.open span { font: 1rem/1 system-ui, sans-serif; }
.js .open { opacity: 0; pointer-events: none; transform: translateY(7px); }
.js .evidence:is(.is-selected, :focus-within) .open { opacity: 1; pointer-events: auto; transform: none; }

.lens {
  --radius: clamp(30px, 4.7vw, 58px);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(-12px, 13px);
  transition: opacity 180ms linear, transform 420ms var(--ease);
}

.lens-view {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: circle(var(--radius) at var(--lens-x) var(--lens-y));
}

.zoom {
  transform: scale(1.48);
  transform-origin: var(--lens-x) var(--lens-y);
}

.lens-ring {
  position: absolute;
  top: var(--lens-y);
  left: var(--lens-x);
  width: calc(2 * var(--radius) + 9px);
  aspect-ratio: 1;
  border: 5px solid #a48049;
  border-radius: 50%;
  background: radial-gradient(ellipse at 26% 16%, #fff4ce44, transparent 38%);
  box-shadow: 0 0 0 1px #5b422d, inset 0 0 0 1px #5b422d, 4px 7px 9px #24150d75;
  transform: translate(-50%, -50%) rotate(-29deg);
}

.lens-ring::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 11px;
  height: 36px;
  content: "";
  transform: translateX(-50%);
  border: 1px solid #38251b;
  border-top: 4px solid #997446;
  border-radius: 1px 1px 5px 5px;
  background: linear-gradient(90deg, #3b2a20, #8d6442 46%, #422b1d);
  box-shadow: 2px 3px 4px #23110871;
}

.evidence:is(.is-selected, :focus-within) .lens { opacity: 1; transform: none; }

.hint {
  display: none;
  margin-top: clamp(32px, 5vw, 56px);
  color: var(--muted);
  text-align: center;
  font-size: 1.05rem;
}

.js .hint, .hint-touch { display: block; }
.hint-desktop { display: none; }

@media (hover: hover) and (pointer: fine) {
  .evidence:hover { z-index: 3; }
  .evidence:hover .paper { transform: translateY(-5px) rotate(0); }
  .evidence:hover .lens, .js .evidence:hover .open { opacity: 1; transform: none; }
  .js .evidence:hover .open { pointer-events: auto; }
  .hint-touch { display: none; }
  .hint-desktop { display: inline; }
}

@media (max-width: 780px) {
  .desk { display: flex; flex-direction: column; width: min(100%, 520px); padding: 40px 32px 32px; }
  .heading { order: -2; margin-bottom: 24px; }
  .subject span { display: block; }
  .subject .separator { display: none; }
  .hint { order: -1; margin: 0 0 18px; font-size: .95rem; }
  .papers { grid-template-columns: 1fr; gap: 32px; }
  .evidence { --offset: 0px; }
  .evidence-class { --turn: -2.5deg; margin-right: 10px; }
  .evidence-board { --turn: 2deg; margin-left: 10px; }
  .evidence-guide { --turn: -2deg; margin-right: 5px; }
  .caption h2 { font-size: clamp(1.65rem, 6vw, 2.2rem); }
  .lens { --radius: clamp(39px, 13vw, 58px); }
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

@keyframes settle {
  from { opacity: 0; transform: translateY(18px) rotate(calc(var(--turn) + 3deg)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
