/* Barely a Detective
   A desk seen from above. The wood is the page, everything you read is paperwork lying on it,
   brass nameplates label the sections like the boxes in the game, and a supervisor's red pen has been at all of it. */
:root {
  color-scheme: dark;
  --wood-deep: #170d08;
  --wood: #2b170d;
  --paper: #f3e8cf;
  --manila: #e4cd98;
  --ink: #22170f;
  --ink-soft: #57442f;
  --rule: #cdb98f;
  --brass: #c79f45;
  --brass-hi: #f4df96;
  --brass-lo: #8a6624;
  --pen: #ad201a;
  --tape: #efe2c0;
  --cream-on-wood: #ecdcb8;
  --font-plate: 'IM Fell DW Pica SC', 'Times New Roman', serif;
  --font-type: 'Special Elite', 'Courier New', monospace;
  --font-body: 'Old Standard TT', Georgia, 'Times New Roman', serif;
  --font-pen: 'Grape Nuts', 'Segoe Script', 'Bradley Hand', cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--wood-deep) url(img/wood.webp) center top / 1440px auto;
  color: var(--cream-on-wood);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--brass-hi); outline-offset: 2px; }
.paper :focus-visible, .folder :focus-visible { outline-color: var(--pen); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Top bar */
.top { background: var(--wood-deep); border-bottom: 1px solid #000; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 10px; }
.top-logo img { width: 124px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 22px; list-style: none; font-family: var(--font-type); font-size: 1rem; }
.nav a { display: inline-block; padding-block: 6px; text-decoration: none; color: var(--cream-on-wood); }
.nav a:hover { color: var(--brass-hi); }
.nav a[aria-current="page"] { color: var(--brass-hi); text-decoration: underline; text-underline-offset: 5px; }

/* The ticker tape from the agency's desk */
.ticker {
  overflow: hidden;
  position: relative;
  background: var(--tape);
  color: var(--ink);
  font-family: var(--font-type);
  font-size: .95rem;
  line-height: 2.2;
  white-space: nowrap;
  border-block: 2px solid var(--brass-lo);
}
.ticker-tape { display: inline-flex; animation: ticker 110s linear infinite; }
.ticker-tape span { padding-right: 4rem; }
.ticker:hover .ticker-tape { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.ticker-flash {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--pen); color: #fff3df;
  letter-spacing: .06em;
}

/* Brass nameplates */
.plate {
  position: relative;
  display: inline-block;
  padding: .32em 1.5em .24em;
  background: linear-gradient(135deg, var(--brass-lo) 0%, var(--brass) 18%, var(--brass-hi) 46%, var(--brass) 74%, var(--brass-lo) 100%);
  color: var(--ink);
  font-family: var(--font-plate);
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem);
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px rgba(34, 23, 15, .55), inset 0 0 0 3px rgba(244, 223, 150, .5), 0 3px 8px rgba(0, 0, 0, .6);
}
.plate::before, .plate::after {
  content: "";
  position: absolute; top: 50%;
  width: .32em; height: .32em;
  margin-top: -.16em;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brass-hi), var(--brass-lo));
  box-shadow: inset 0 0 0 1px rgba(34, 23, 15, .6);
}
.plate::before { left: .45em; }
.plate::after { right: .45em; }

.section { padding-block: clamp(32px, 4.5vw, 52px); }
.section-head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 30px; }
.section-head p { max-width: 62ch; }

/* Paper */
.paper {
  position: relative;
  background: var(--paper) url(img/paper.webp);
  color: var(--ink);
  padding: clamp(22px, 4vw, 40px);
  box-shadow: 0 1px 0 #fff8 inset, 0 10px 24px rgba(0, 0, 0, .55);
}
.type { font-family: var(--font-type); }
.kicker { font-family: var(--font-type); font-size: 1rem; letter-spacing: .04em; }
.pen { font-family: var(--font-pen); color: var(--pen); line-height: 1.25; }
.note { display: block; margin-top: 10px; font-size: 1.3rem; transform: rotate(-1deg); transform-origin: left center; }

.stamp {
  display: inline-block;
  padding: .2em .55em .12em;
  border: .14em solid currentColor;
  border-radius: .16em;
  color: var(--pen);
  font-family: var(--font-plate);
  line-height: 1.1;
  letter-spacing: .05em;
  filter: url(#ink);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .62em 1.1em .5em;
  font-family: var(--font-type); font-size: 1.02rem; line-height: 1.15;
  color: var(--ink); text-decoration: none;
  background: linear-gradient(135deg, var(--brass) 0%, var(--brass-hi) 50%, var(--brass) 100%);
  border: 0; border-radius: 3px;
  box-shadow: inset 0 0 0 2px rgba(34, 23, 15, .55), 0 2px 0 var(--brass-lo), 0 4px 8px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px rgba(34, 23, 15, .55); }
.btn.is-plain { background: none; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.is-soon { cursor: default; background: var(--ink); color: var(--brass-hi); box-shadow: inset 0 0 0 1px var(--brass-lo); }
.btn.is-soon:hover { filter: none; }
.btn.is-soon:active { transform: none; box-shadow: inset 0 0 0 1px var(--brass-lo); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.banner { display: block; width: 100%; background: #000; }
.banner img { width: 100%; }
.intro { position: relative; overflow-x: clip; } /* the stamp lands from 2.4x size; keep it from widening the page */
.intro .wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: clamp(32px, 5vw, 60px); }
.permit { margin-top: -70px; transform: rotate(-.7deg); z-index: 1; }
.permit-lines { margin-top: 2px; color: var(--ink-soft); }
.permit h1 { margin-top: 16px; font-family: var(--font-plate); font-size: clamp(2rem, 1.2rem + 3.4vw, 3.5rem); }
.permit h1 .pen { display: inline-block; font-size: 1.12em; transform: rotate(-3deg); }
.permit .lede { margin-top: 16px; max-width: 58ch; }
.permit .btn-row { margin-top: 22px; }
.permit-date { margin-top: 12px; color: var(--ink-soft); font-family: var(--font-type); font-size: 1rem; }
.permit .stamp {
  position: absolute; top: 18px; right: clamp(12px, 3vw, 30px);
  font-size: clamp(1.15rem, .9rem + 1.2vw, 1.7rem);
  transform: rotate(9deg);
  animation: stamp-down .34s cubic-bezier(.2, .9, .3, 1.3) .5s backwards;
}
@keyframes stamp-down {
  from { opacity: 0; transform: rotate(16deg) scale(2.4); }
  to { opacity: 1; transform: rotate(9deg) scale(1); }
}
.clip { position: absolute; top: -24px; left: 26px; width: 19px; height: 46px; }

/* The service bell */
.front-desk { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 26px; }
.bell {
  padding: 0; border: 0; background: none; cursor: pointer;
  width: 150px;
  color: inherit;
}
.bell svg { display: block; width: 100%; height: auto; overflow: visible; }
.bell-dome { transform-origin: 75px 92px; }
.bell.is-ringing .bell-dome { animation: bell-shake .45s ease-out; }
@keyframes bell-shake {
  0% { transform: rotate(0); }
  20% { transform: rotate(-7deg); }
  45% { transform: rotate(5deg); }
  70% { transform: rotate(-3deg); }
  100% { transform: rotate(0); }
}
.bell-label { font-family: var(--font-type); font-size: 1rem; text-align: center; }
.slip { width: 100%; max-width: 340px; padding: 14px 18px; font-size: 1.02rem; transform: rotate(1deg); }
.slip-who { font-family: var(--font-type); font-size: .9rem; color: var(--ink-soft); }
.slip-count { margin-top: 8px; font-family: var(--font-type); font-size: .9rem; color: var(--ink-soft); }

/* Your first day */
.duties { list-style: none; display: grid; gap: 26px; counter-reset: duty; }
.duties li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 4px 12px; counter-increment: duty; }
.duties li::before { content: counter(duty) "."; grid-row: span 3; font-family: var(--font-plate); font-size: 1.8rem; line-height: 1.1; }
.duties h3 { font-family: var(--font-type); font-size: 1.2rem; }

/* Case files */
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 26px; padding-top: 22px; }
.folder {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px 22px 20px;
  background: linear-gradient(170deg, #ecd8a8, var(--manila));
  color: var(--ink);
  border-radius: 0 6px 6px 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .5);
}
.folder::before {
  content: attr(data-tab);
  position: absolute; left: 0; bottom: 100%;
  padding: 4px 18px 2px;
  background: #ecd8a8;
  border-radius: 6px 6px 0 0;
  font-family: var(--font-type); font-size: .92rem; line-height: 1.5;
  white-space: nowrap;
}
.folder h3 { font-family: var(--font-plate); font-size: 1.65rem; padding-right: 4.2rem; }
.folder p { font-size: 1.05rem; }
.folder .stamp { position: absolute; top: 12px; right: 12px; font-size: .92rem; transform: rotate(7deg); text-align: center; }
.folder .note { margin-top: auto; padding-top: 8px; font-size: 1.2rem; }
.folder.is-wide { grid-column: span 2; }
.folder-games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; list-style: none; margin-top: 2px; }
.folder-games strong { display: block; font-family: var(--font-type); font-weight: 400; font-size: 1.05rem; }
.folder-games span { font-size: 1rem; }
.folder.is-sealed { background: linear-gradient(170deg, #6a5e4e, #52483b); color: #f5ecd9; }
.folder.is-sealed::before { background: #6a5e4e; color: #f5ecd9; }
.folder.is-sealed .stamp { color: #ffc2b4; mix-blend-mode: normal; }
.folder.is-sealed .note { color: #ffd0c4; }
.redact { background: #0d0a07; color: #0d0a07; border-radius: 1px; padding-inline: .2em; user-select: none; }

/* Evidence */
.evidence { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 22px; list-style: none; }
.evidence li { display: flex; }
.print {
  flex: 1;
  margin: 0;
  padding: 10px 10px 8px;
  background: #fbf5e6; color: var(--ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .55);
}
.evidence li:nth-child(4n+1) .print { transform: rotate(-1.4deg); }
.evidence li:nth-child(4n+2) .print { transform: rotate(.8deg); }
.evidence li:nth-child(4n+3) .print { transform: rotate(-.5deg); }
.evidence li:nth-child(4n) .print { transform: rotate(1.1deg); }
.print a { display: block; }
.print img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.print figcaption { padding: 8px 4px 0; font-size: 1.15rem; }
.evidence-more { margin-top: 26px; font-size: 1.45rem; color: var(--brass-hi); transform: rotate(-.6deg); transform-origin: left center; }

/* Terms */
.terms-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.terms { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 20px; }
.terms dt, .terms dd { margin: 0; padding-block: 9px; border-bottom: 1px solid var(--rule); }
.terms dt { font-family: var(--font-type); font-size: 1rem; }
.terms dt:last-of-type, .terms dd:last-of-type { border-bottom: 0; }
.signoff { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.signoff .pen { font-size: 1.5rem; color: var(--brass-hi); }

/* Other games */
.others { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.other { display: flex; flex-direction: column; }
.other img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.other-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 20px; background: var(--paper) url(img/paper.webp); color: var(--ink); }
.other-title { font-family: var(--font-plate); font-size: 1.55rem; }
.other-small { font-style: italic; color: var(--ink-soft); }
.other .btn-row { margin-top: auto; padding-top: 8px; }

/* Footer */
.foot { background: var(--wood-deep); border-top: 2px solid var(--brass-lo); padding-block: 36px; font-size: 1rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 20px 48px; justify-content: space-between; align-items: flex-start; }
.foot h2 { font-family: var(--font-type); font-size: 1rem; margin-bottom: 6px; color: var(--brass-hi); }
.foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 16px; }
.foot ul a { display: inline-block; padding-block: 9px; }
.foot a:hover { color: var(--brass-hi); }
.foot-legal { flex-basis: 100%; color: #b9a783; font-size: .92rem; }

/* Inner pages */
.page-head { padding-block: clamp(32px, 5vw, 56px) 0; }
.page-head-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.page-head h1 { font-family: var(--font-plate); font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.4rem); margin-top: 10px; }
.page-head .lede { margin-top: 14px; max-width: 58ch; }
.pass { position: relative; transform: rotate(-.5deg); }
.pass .stamp { position: absolute; top: 16px; right: clamp(12px, 3vw, 28px); font-size: clamp(1.05rem, .9rem + .9vw, 1.45rem); transform: rotate(8deg); }
.portrait { max-width: 340px; margin-inline: auto; padding: 10px; background: #fbf5e6; box-shadow: 0 8px 18px rgba(0, 0, 0, .55); transform: rotate(1.6deg); }
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.tick { list-style: none; display: grid; gap: 8px; }
.tick li { position: relative; padding-left: 1.6rem; }
.tick li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--pen); font-family: var(--font-pen); font-size: 1.3rem; line-height: 1.2; }
.paper h3 { font-family: var(--font-plate); font-size: 1.6rem; margin-bottom: 12px; }
.mail-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.mail-address { font-family: var(--font-type); font-size: 1.15rem; word-break: break-word; }

.table-scroll { overflow-x: auto; }
.tries { width: 100%; border-collapse: collapse; }
.tries th { font-family: var(--font-type); font-weight: 400; font-size: 1rem; text-align: left; padding: 0 16px 8px 0; border-bottom: 2px solid var(--ink); }
.tries td { vertical-align: top; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--rule); }
.tries tr:last-child td { border-bottom: 0; }
.tries td.pen { font-size: 1.22rem; }

.copyblock { display: grid; gap: 22px; }
.copyitem h3 { font-family: var(--font-type); font-size: 1.05rem; margin-bottom: 6px; }
.copyitem p { padding: 12px 14px; background: #fff8; border: 1px dashed var(--rule); }
.copyitem .btn { margin-top: 8px; font-size: .95rem; }

.kit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.kit-item { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.kit-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* Privacy policy: written to be read, so the jokes stop here */
.policy { max-width: 780px; margin-inline: auto; }
.policy-sheet { padding: clamp(24px, 5vw, 56px); }
.policy-sheet h1 { font-family: var(--font-plate); font-size: clamp(2.2rem, 1.5rem + 2.6vw, 3.2rem); }
.policy-sheet h2 { font-family: var(--font-plate); font-size: 1.7rem; margin-top: 2.1em; margin-bottom: .4em; scroll-margin-top: 16px; }
.policy-sheet h3 { font-family: var(--font-type); font-size: 1.1rem; margin-top: 1.5em; margin-bottom: .3em; }
.policy-sheet p + p, .policy-sheet ul + p { margin-top: .8em; }
.policy-sheet ul { padding-left: 1.3em; display: grid; gap: .35em; margin-top: .5em; }
.policy-meta { margin-top: 8px; color: var(--ink-soft); font-family: var(--font-type); font-size: 1rem; }
.policy-lede { margin-top: 18px; }
.short-version { margin-top: 24px; padding: 18px 22px; border: 2px solid var(--ink); }
.short-version h2 { margin-top: 0; font-size: 1.4rem; }
.delete-box { margin-top: 12px; padding: 16px 20px; border: 2px solid var(--pen); }
.delete-box p + p { margin-top: .6em; }

@media (max-width: 900px) {
  .evidence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro .wrap, .terms-grid, .page-head-grid { grid-template-columns: minmax(0, 1fr); }
  .permit { margin-top: -28px; }
  .front-desk { padding-top: 0; }
  .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* two columns: the first and last folders go full width, so no row is left half empty */
  .folder.is-wide, .cases > .folder:first-child, .folder.is-sealed { grid-column: span 2; }
}
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .cases, .others, .two-up, .kit { grid-template-columns: minmax(0, 1fr); }
  /* The prints become a strip you swipe through, like a stack of photos */
  .evidence { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; padding: 10px 6px 18px; }
  .evidence li { flex: 0 0 84%; scroll-snap-align: center; }
  .folder.is-wide, .cases > .folder:first-child, .folder.is-sealed { grid-column: auto; }
  .folder-games { grid-template-columns: minmax(0, 1fr); }
  .permit { margin-top: 0; transform: none; }
  .permit .stamp { position: static; display: inline-block; margin-top: 14px; }
  .permit h1 { margin-top: 12px; }
  .terms { grid-template-columns: minmax(0, 1fr); }
  .terms dt { border-bottom: 0; padding-bottom: 0; }
  .terms dd { padding-top: 2px; }
  .pass .stamp { position: static; display: inline-block; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-tape { animation: none; }
  .permit .stamp, .bell.is-ringing .bell-dome { animation: none; }
}
