/* Cut-paper gallery (mock-up L, Nov 2026). Specs: docs/superpowers/specs/2026-11-06-cut-paper-redesign.md and 2026-11-20-card-polish.md */
@font-face { font-family: 'Fraunces'; src: url('assets/fonts/fraunces-latin-full-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --paper: #f5ead4; --ink: #244749; --text: #345a5a; --muted: #47625f; --card: #faf4e8; --pressed: #e6dcc6;
  --coral: #a04f38; --rule: #c9bfa6; --game: #eab39d; --app: #a9c8c1; --animation: #2f5f60;
  --shadow: rgba(36, 71, 73, .22); --shadow-deep: rgba(36, 71, 73, .36);
  --card-shadow: 0 2px 6px rgba(36, 71, 73, .2);
  --card-lifted: 0 12px 24px rgba(36, 71, 73, .2), 0 4px 8px rgba(36, 71, 73, .14);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}
* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: auto; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: 'Fraunces', Georgia, serif; font-variation-settings: 'SOFT' 100; isolation: isolate; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .14; mix-blend-mode: multiply; background: url('assets/paper.svg'); }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 4px; }
[hidden] { display: none !important; }

.sample-notice { padding: 10px clamp(20px, 5.5vw, 80px); border-bottom: 1px solid var(--rule); font-size: .8125rem; line-height: 1.6; color: var(--muted); }
.wrap { max-width: 1360px; margin: 0 auto; padding-inline: clamp(20px, 5.5vw, 80px); }

/* Header and paper band */
.mast { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 28px 40px; padding-top: clamp(36px, 6vw, 64px); }
.brand { margin: 0; min-width: 0; font-weight: 850; font-size: clamp(3rem, 7vw, 7rem); line-height: .9; letter-spacing: -.035em; font-variation-settings: 'SOFT' 100, 'WONK' 1; text-shadow: .03em .03em 0 var(--app), .04em .06em .08em rgba(36, 71, 73, .18); overflow-wrap: anywhere; }
.intro { flex: 0 1 340px; min-width: 0; padding-bottom: 8px; overflow-wrap: anywhere; }
.intro h2 { margin: 0; font-weight: 500; font-size: 1.75rem; line-height: 1.12; letter-spacing: -.015em; }
.intro p { margin: 10px 0 0; font-size: 1.0625rem; line-height: 1.6; font-weight: 380; color: var(--text); }
.band { display: block; width: 100%; height: clamp(90px, 12vw, 170px); margin-top: 36px; }
main.wrap { padding-top: 32px; padding-bottom: 56px; overflow-x: clip; }

/* Collection bar and filters */
.collection-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 44px; }
.collection-heading h2 { margin: 0; font-weight: 500; font-size: 2.125rem; letter-spacing: -.015em; }
.count { margin: 4px 0 0; font-size: .9375rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; max-width: 100%; }
button { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; min-width: 44px; padding: 0 18px; border: 0; border-radius: 4px; font: inherit; font-weight: 500; font-size: 1.0625rem; line-height: 1; color: var(--ink); background: var(--card); box-shadow: 0 2px 5px var(--shadow); cursor: pointer; }
button[aria-pressed=true] { background: var(--pressed); box-shadow: inset 0 2px 6px var(--shadow-deep); }
button:disabled { cursor: default; opacity: .6; }
.swatch { flex: none; width: 14px; height: 14px; border-radius: 2px; box-shadow: 2px 2px 0 rgba(36, 71, 73, .2); }
.swatch-Game { background: var(--game); }
.swatch-App { background: var(--app); }
.swatch-Animation { background: var(--animation); }

/* Cards: a paper card on a second sheet whose colour shows the type */
/* Each project fills two grid rows: its card, then its note slip (if any). Card rows line up across a row of
   projects, so an open slip only adds height below its own card. Space between projects is the project's padding. */
.collection { --row-gap: 60px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 44px; padding: 0 12px 12px 0; margin-bottom: calc(-1 * var(--row-gap)); }
.collection:empty { margin-bottom: 0; }
.project { position: relative; isolation: isolate; min-width: 0; display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; padding-bottom: var(--row-gap); }
.project::before { content: ''; position: absolute; grid-area: 1 / 1 / 2 / 2; inset: 0; z-index: -1; border-radius: 6px; background: var(--game); translate: 9px 9px; rotate: 1.2deg; box-shadow: 0 2px 5px rgba(36, 71, 73, .2); }
.project[data-type=App]::before { background: var(--app); }
.project[data-type=Animation]::before { background: var(--animation); }
.card { position: relative; display: flex; flex-direction: column; height: 100%; padding: 14px 14px 22px; border-radius: 6px; background: var(--card); box-shadow: var(--card-shadow); }
.preview { position: relative; flex: none; aspect-ratio: 5 / 4; overflow: hidden; border: 0; border-radius: 4px; background: #dcd8c0; }
.preview img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.preview::after { content: ''; position: absolute; inset: 0; border-radius: 4px; box-shadow: inset 0 4px 10px var(--shadow-deep), inset 0 0 0 1px oklch(0 0 0 / .1); pointer-events: none; }
.preview-missing { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; font-size: .875rem; text-align: center; color: var(--text); }
.caption { min-width: 0; padding: 18px 6px 0; }
/* The type tag: a paper label stuck over the preview's top-left corner */
.type { position: absolute; inset-block-start: 6px; inset-inline-start: 4px; z-index: 2; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px 8px 10px; border-radius: 3px; font-size: 1.0625rem; font-weight: 600; line-height: 1; color: var(--ink); background: var(--game); rotate: -2.5deg; box-shadow: 1px 2px 0 rgba(36, 71, 73, .18), 0 2px 6px var(--shadow); pointer-events: none; }
.project[data-type=App] .type { background: var(--app); }
.project[data-type=Animation] .type { background: var(--animation); color: var(--card); }
.type svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.caption h3 { margin: 0; font-weight: 600; font-size: 1.75rem; line-height: 1.05; letter-spacing: -.015em; font-variation-settings: 'SOFT' 100, 'WONK' 1; overflow-wrap: anywhere; }
.caption a { display: inline-block; min-height: 44px; padding: 4px 0; text-decoration-thickness: 1px; }
/* The title link covers the whole card, so the picture opens the project too */
/* It reaches past the card over the back sheet. While the card is lifted (3px left, 5px up) it grows by that much,
   so it still covers everything it covered at rest: the card can't lift away from a still pointer and drop back. */
/* Below the card it stops at the card's edge when a note slip is there, so the slip's tab stays clickable. */
.project { --reach-bottom: 14px; }
.project:has(.slip) { --reach-bottom: 0px; }
.caption a::after { content: ''; position: absolute; inset: -6px -12px calc(-1 * var(--reach-bottom)) -4px; z-index: 1; }
.project:has(.caption a:focus-visible) .caption a::after { inset: -6px -15px calc(-5px - var(--reach-bottom)) -4px; }
/* Ring drawn inside the card edge, on card paper, so it keeps contrast over every back-sheet colour.
   Only where :has() works; otherwise the link keeps its own ring. */
@supports selector(:has(*)) {
  .caption a:focus-visible { outline: 2px solid transparent; }
  .card:has(.caption a:focus-visible) { outline: 2px solid var(--coral); outline-offset: -6px; }
}
.project p { margin: 10px 6px 0; max-width: 38ch; font-size: 1rem; line-height: 1.6; font-weight: 380; color: var(--text); overflow-wrap: anywhere; }
.go { margin: auto 6px 0; padding-top: 16px; font-size: .9375rem; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.project:has(.caption a:focus-visible) .card { box-shadow: var(--card-lifted); }
.project .added { margin: 6px 6px 0; font-size: .875rem; color: var(--muted); }

/* Workshop notes: a strip of graph paper tucked under the card (spec 2026-11-23-workshop-notes-design.md) */
.slip { position: relative; z-index: -1; align-self: start; margin: -4px 16px 0 12px; padding: 0 18px; border-radius: 0 0 3px 3px; color: var(--ink); rotate: -.7deg;
  background-color: #fbf8ef; background-position: -1px -1px; background-size: 65px 65px, 65px 65px, 13px 13px, 13px 13px;
  background-image: linear-gradient(rgba(47, 95, 96, .2) 1px, transparent 1px), linear-gradient(90deg, rgba(47, 95, 96, .2) 1px, transparent 1px),
                    linear-gradient(rgba(47, 95, 96, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(47, 95, 96, .09) 1px, transparent 1px);
  box-shadow: 0 2px 6px rgba(36, 71, 73, .22); }
.slip[open] { padding-bottom: 20px; }
/* The tab fills the whole strip of a closed slip, edge to edge, so any click on it opens the notes */
.slip summary { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-inline: -18px; padding: 8px 18px 12px; list-style: none; cursor: pointer; font-size: .9375rem; font-weight: 500; }
.slip summary::-webkit-details-marker { display: none; }
/* The slip sits under the card, so its tab's focus ring is drawn inside the tab, clear of the card's edge */
.slip summary:focus-visible { outline-offset: -10px; }
/* forced-color-adjust keeps the transparent borders that make the triangle in high-contrast mode */
.slip summary::before { content: ''; flex: none; border-block: 5px solid transparent; border-inline-start: 7px solid currentColor; forced-color-adjust: none; }
.slip[open] summary::before { rotate: 90deg; }
.slip .notes p { max-width: none; margin: 0 0 14px; font-size: .9375rem; line-height: 1.6; color: var(--ink); }
.slip .notes p:last-child { margin-bottom: 0; }

/* Messages and footer */
.message { font-size: 1.0625rem; line-height: 1.7; }
.message:not(:empty) { padding: 24px 0 48px; }
.message p { margin: 0 0 16px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.empty-window { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin-bottom: 22px; border-radius: 8px; background: #e4d9c2; box-shadow: inset 0 8px 18px rgba(36, 71, 73, .42), inset 0 0 0 1px rgba(36, 71, 73, .2); }
.empty h3 { margin: 0; font-weight: 600; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.05; letter-spacing: -.02em; font-variation-settings: 'SOFT' 100, 'WONK' 1; overflow-wrap: anywhere; }
.empty p { margin: 0; max-width: 44ch; font-size: 1.125rem; line-height: 1.6; font-weight: 380; color: var(--text); }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-top: 96px; font-size: .9375rem; color: var(--muted); }
.footer a { display: inline-flex; align-items: center; min-height: 44px; }

/* Hover: only where a real pointer can hover */
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-thickness: 2px; }
  button:hover { box-shadow: 0 3px 8px rgba(36, 71, 73, .3); }
  button[aria-pressed=true]:hover { box-shadow: inset 0 2px 6px var(--shadow-deep); }
  /* Hover is keyed on the card (and its link area), not the whole project, so the note slip doesn't lift it */
  .card:has(.caption a):hover { box-shadow: var(--card-lifted); }
  .card:hover .caption a { text-decoration-thickness: 2px; }
  .card:hover .caption a::after { inset: -6px -15px calc(-5px - var(--reach-bottom)) -4px; }
}

/* Motion: short responses to the visitor and one band entrance, all off under reduced motion */
@media (prefers-reduced-motion: no-preference) {
  button { transition: translate 120ms var(--ease-out), box-shadow 120ms var(--ease-out); }
  button:active { translate: 0 1px; }
  .card { transition: translate 220ms var(--ease-out), box-shadow 220ms var(--ease-out); }
  .slip summary::before { transition: rotate 150ms var(--ease-out); }
  .project::before { transition: rotate 220ms var(--ease-out), translate 220ms var(--ease-out); }
  /* Lift distance (-3px -5px, here and in the hover rule below) is matched by the grown link area
     (inset -6px -15px -19px -4px, above). Change them together, or the lifted card jitters near its edge. */
  .project:has(.caption a:focus-visible) .card { translate: -3px -5px; }
  .project:has(.caption a:focus-visible)::before { rotate: 2.4deg; }
  .band path:nth-of-type(-n+3) { animation: band-rise 650ms var(--ease-out) both; }
  .band path:nth-of-type(2) { animation-delay: 110ms; }
  .band path:nth-of-type(3) { animation-delay: 220ms; }
  @media (hover: hover) and (pointer: fine) {
    .card:has(.caption a):hover { translate: -3px -5px; }
    .project:has(> .card:hover .caption a)::before { rotate: 2.4deg; }
  }
  /* Press comes last: same specificity as hover and focus, so order decides */
  .project:has(.caption a:active) .card { translate: 0 0; box-shadow: var(--card-shadow); }
  .project:has(> .card .caption a:active)::before { rotate: 1.2deg; }
}
@keyframes band-rise { from { translate: 0 40px; } }

@media (max-width: 1100px) { .collection { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; } }
/* One or two projects: two wider columns, so no column sits empty */
@media (min-width: 641px) { .collection:not(:has(> :nth-child(3))) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .collection { grid-template-columns: minmax(0, 1fr); --row-gap: 48px; }
  .collection-heading h2 { font-size: 1.875rem; }
  .filters { gap: 8px; }
  .filters button { padding: 0 14px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (forced-colors: active) {
  .card, .preview, .empty-window, button, .type, .slip { border: 1px solid CanvasText; }
  button[aria-pressed=true] { border-width: 3px; }
  .project::before { display: none; }
  .slip summary::before { border-inline-start-color: CanvasText; }
}
