/* Sketchbook portfolio: the drawings set the look. Paper and ink match the drawings' own. */
:root {
  --paper: #f0f0e4;
  --tone: #e5e5d6;
  --ink: #161513;
  --soft: #55524a;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;
  --m: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.2, .9, .3, 1.3);
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px / 1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wrap { width: 100%; max-width: 1600px; margin-inline: auto; padding-inline: var(--m); }
/* Fraunces with its soft, slightly wonky letters, on every serif line. */
.hero h1, .lede, .close h2, .words h1, .stats dt { font-variation-settings: "SOFT" 100, "WONK" 1; }
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease); }

/* Entrances: hidden only when script runs, revealed once on scroll. */
html.js .rise { opacity: 0; transform: translateY(24px); }
html.js .rise.in { opacity: 1; transform: none; transition: opacity .7s ease, transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 24px 48px; padding-block: clamp(40px, 7vw, 104px) clamp(32px, 4vw, 56px); }
.hero h1 { margin: 0; font: 600 clamp(56px, 8vw, 140px) / .92 var(--serif); letter-spacing: -.025em; white-space: nowrap; }
.lede { margin: 0 0 .35em; justify-self: end; max-width: 17ch; font: 400 clamp(22px, 2.3vw, 34px) / 1.15 var(--serif); }

.panels { list-style: none; margin: 0 0 clamp(96px, 12vw, 180px); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(32px, 3.4vw, 52px) clamp(14px, 2vw, 28px); }
.panels a { display: block; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.panels img { width: 100%; height: auto; transition: transform .45s var(--spring); }
.panels li:nth-child(odd) { --r: -1.2deg; }
.panels li:nth-child(even) { --r: 1.2deg; }
.panels a:hover img, .panels a:focus-visible img { transform: translateY(-6px) rotate(var(--r)); }
.panels a:active img { transform: scale(.98); transition-duration: .12s; }
.panels span { display: block; margin-top: 12px; font-weight: 600; font-size: 17px; }
.panels a:hover span { text-decoration: underline; text-underline-offset: 4px; }

.close { background: var(--tone); padding-block: clamp(64px, 9vw, 140px); }
.close .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 48px; align-items: end; }
.close h2 { margin: 0; font: 600 clamp(48px, 6.8vw, 110px) / .95 var(--serif); letter-spacing: -.025em; }
.old { margin: 20px 0 0; font-size: 16px; }
.old a { text-underline-offset: 4px; }

/* ---------- Detail pages ---------- */
.detail { min-height: 100svh; display: flex; flex-direction: column; }
.top { padding-block: 16px 8px; }
.top a, .next a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; text-underline-offset: 4px; }
.top a:hover, .next a:hover { text-decoration: underline; }
.sheet { flex: 1; max-width: 1440px; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 6vw, 96px); align-items: center; padding-block: 8px clamp(56px, 7vw, 104px); }
.sheet.no-pic { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.pic { margin: 0; }
.pic img { width: 100%; height: auto; max-height: 86svh; object-fit: contain; }
.words h1 { margin: 0 0 28px; font: 600 clamp(34px, 4vw, 54px) / 1.06 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.words p { margin: 0 0 14px; font-size: 18px; max-width: 58ch; }
.stats { margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 24px 44px; }
.stats dt { font: 600 40px / 1 var(--serif); letter-spacing: -.01em; }
.stats dd { margin: 8px 0 0; font-size: 15px; line-height: 1.4; color: var(--soft); max-width: 22ch; }
.next { padding-block: 8px 32px; text-align: right; }

/* Filled ink pills, used for every outbound link. */
.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 0 !important; max-width: none !important; }
.links a { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 16px; font-weight: 600; text-decoration: none; transition: transform .25s var(--spring), background .2s; }
.links a:hover { transform: translateY(-2px); background: #34312c; }
.links a:active { transform: scale(.97); }

/* ---------- Narrower screens ---------- */
@media (max-width: 1000px) {
  .panels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { white-space: normal; font-size: clamp(48px, 15vw, 88px); }
  .lede { justify-self: start; max-width: 24ch; text-wrap: balance; }
  .close .wrap { grid-template-columns: minmax(0, 1fr); }
  .sheet { grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
  .pic img { max-height: 62svh; width: auto; margin-inline: auto; }
  .words p { font-size: 17px; }
}
@media (max-width: 640px) {
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .panels span { font-size: 16px; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html.js .rise { opacity: 1; transform: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  @view-transition { navigation: none; }
}
