/* =========================================================================
   FORMA — The Studio Wall
   A paste-up / pinboard identity: paper, tape, ink and one long thread.
   ========================================================================= */

/* --- Typefaces (local files, recorded in asset-sources.json) ------------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/artifacts/forma-frontend--v1--s4-whacky--deepseek-4.1-flash--web-design-guidelines--2026-09-19T02-13-35-553Z/assets/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/artifacts/forma-frontend--v1--s4-whacky--deepseek-4.1-flash--web-design-guidelines--2026-09-19T02-13-35-553Z/assets/fonts/spacemono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/artifacts/forma-frontend--v1--s4-whacky--deepseek-4.1-flash--web-design-guidelines--2026-09-19T02-13-35-553Z/assets/fonts/spacemono-bold-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Mono";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/artifacts/forma-frontend--v1--s4-whacky--deepseek-4.1-flash--web-design-guidelines--2026-09-19T02-13-35-553Z/assets/fonts/spacemono-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens -------------------------------------------------------------- */
:root {
  color-scheme: light;

  --paper: #efe7d8;
  --paper-deep: #e3d7be;
  --card: #faf5ea;
  --card-2: #f3ecdc;

  --ink: #211c16;
  --ink-2: #6b5f4c;
  --ink-3: #94866e;
  --line: #cdbda1;

  --thread: #b8402b;
  --teal: #236b76;
  --stamp: #c0361f;

  --baking: #c17f14;
  --ceramics: #b5512f;
  --floristry: #5f7f30;
  --painting: #a13a6c;

  --shadow-card: 3px 4px 0 rgba(33, 28, 22, 0.09),
    0 18px 30px -22px rgba(33, 28, 22, 0.6);

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, "Times New Roman", serif;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", "Menlo", Consolas,
    monospace;

  --gut: clamp(1rem, 4vw, 3.25rem);
  --radius: 2px;
}

/* --- Reset-ish ----------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  /* Faint paper grain, generated locally as an inline SVG tile. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  background-attachment: scroll;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(184, 64, 43, 0.18);
  touch-action: manipulation;
  padding-bottom: env(safe-area-inset-bottom);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

.eyebrow,
.toolbar label,
.toolbar__label,
.toolbar__hint,
.wall-label dt,
.card__cat,
.card__spec dd,
.footer__meta,
.empty__title,
.detail__kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
  transition: top 0.18s ease;
}
.skip-link:focus {
  top: 0.75rem;
}

/* --- Paper edge: torn strip along the very top --------------------------- */
.paper-edge {
  height: 10px;
  background: repeating-linear-gradient(
      -45deg,
      var(--ink) 0 6px,
      transparent 6px 13px
    )
    left bottom / auto 3px no-repeat;
  opacity: 0.5;
}

/* --- Masthead ------------------------------------------------------------ */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-areas:
    "intro photo"
    "label photo";
  gap: clamp(1rem, 3vw, 2.25rem) clamp(1.25rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(1.5rem, 4vw, 3.25rem) var(--gut) clamp(1.5rem, 3vw, 2.5rem);
  max-width: 1320px;
  margin: 0 auto;
  position: relative;
}

.masthead__intro {
  grid-area: intro;
  min-width: 0;
}

.eyebrow {
  color: var(--ink-2);
  margin-bottom: 0.9rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(3.6rem, 12vw, 9.5rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.82;
  text-transform: uppercase;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  margin: 0 0 0.35rem;
}

.wordmark__a {
  position: relative;
  display: inline-block;
  color: var(--thread);
}
.wordmark__a::after {
  /* stitched underline, the first appearance of the thread */
  content: "";
  position: absolute;
  left: -2%;
  right: 6%;
  bottom: 0.16em;
  height: 5px;
  background: repeating-linear-gradient(
    90deg,
    var(--thread) 0 10px,
    transparent 10px 18px
  );
  opacity: 0.85;
}

.masthead__lead {
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--ink-2);
  margin-top: 0.6rem;
}

/* Taped photo */
.hero-photo {
  grid-area: photo;
  margin: 0;
  min-width: 0;
  position: relative;
}
.hero-photo__frame {
  position: relative;
  padding: 0.7rem 0.7rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  transform: rotate(1.1deg);
}
.hero-photo__frame::before,
.hero-photo__frame::after {
  content: "";
  position: absolute;
  top: -0.7rem;
  width: 6.5rem;
  height: 1.9rem;
  background: rgba(226, 180, 96, 0.55);
  border-left: 1px dashed rgba(33, 28, 22, 0.18);
  border-right: 1px dashed rgba(33, 28, 22, 0.18);
  box-shadow: 0 2px 5px rgba(33, 28, 22, 0.14);
  mix-blend-mode: multiply;
}
.hero-photo__frame::before {
  left: -1.3rem;
  transform: rotate(-8deg);
}
.hero-photo__frame::after {
  right: -1.1rem;
  transform: rotate(7deg);
  background: rgba(122, 170, 176, 0.5);
}
.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
}
.hero-photo figcaption {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  max-width: 46ch;
}

/* Wall label */
.wall-label {
  grid-area: label;
  align-self: end;
  max-width: 34rem;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-left: 5px solid var(--thread);
  box-shadow: 2px 3px 0 rgba(33, 28, 22, 0.07);
  transform: rotate(-0.5deg);
}
.wall-label__title {
  font-size: 1.35rem;
  margin-bottom: 0.7rem;
}
.wall-label__facts {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
}
.wall-label__facts > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
}
.wall-label dt {
  color: var(--ink-3);
}
.wall-label dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.wall-label__note {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-2);
  border-top: 1px dashed var(--line);
  padding-top: 0.7rem;
}

/* --- Toolbar ------------------------------------------------------------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(12rem, 1.6fr) minmax(9rem, 1fr) auto;
  gap: 0.9rem 1.1rem;
  align-items: end;
  padding: 0.85rem var(--gut);
  margin-top: 0.5rem;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, white);
  border-top: 1px solid var(--line);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 8px 18px -16px rgba(33, 28, 22, 0.9);
}

.toolbar__field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}
.toolbar label,
.toolbar__label {
  color: var(--ink-2);
}
.toolbar input[type="search"],
.toolbar select {
  width: 100%;
  padding: 0.62rem 0.7rem;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.9rem;
  box-shadow: 2px 2px 0 rgba(33, 28, 22, 0.12);
  transition: box-shadow 0.15s ease, transform 0.15s ease,
    border-color 0.15s ease;
}
.toolbar input[type="search"] {
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: 0;
}
.toolbar input[type="search"]::placeholder {
  font-style: italic;
  color: var(--ink-3);
}
.toolbar input[type="search"]:hover,
.toolbar select:hover {
  border-color: var(--thread);
}
.toolbar input[type="search"]:focus-visible,
.toolbar select:focus-visible {
  box-shadow: 3px 3px 0 rgba(35, 107, 118, 0.35);
}
.toolbar select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 1.05rem center, right 0.7rem center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.1rem;
}

.toolbar__field--toggle {
  align-items: flex-start;
}
.toolbar__field--toggle .toolbar__label {
  visibility: hidden;
}
.toolbar__field--toggle > .toggle {
  height: 2.72rem;
}
.toolbar__hint {
  color: var(--ink-3);
  font-size: 0.66rem;
}

.toolbar__count {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: -0.35rem 0 0;
}

/* Toggle button (saved filter) */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(33, 28, 22, 0.14);
  transition: background-color 0.15s ease, transform 0.12s ease,
    box-shadow 0.12s ease, color 0.15s ease;
  white-space: nowrap;
}
.toggle__text {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.toggle__pip {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.toggle:hover {
  background: var(--card-2);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(33, 28, 22, 0.2);
}
.toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(33, 28, 22, 0.2);
}
.toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.toggle[aria-pressed="true"] .toggle__pip {
  background: var(--thread);
  border-color: var(--thread);
  box-shadow: 0 0 0 3px rgba(184, 64, 43, 0.3);
}

/* --- Board head ---------------------------------------------------------- */
#board-region {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3rem) var(--gut) 3rem;
}

#board-region:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: -3px;
}

/* Keep focused elements clear of the sticky toolbar. */
#board-region,
.board-head,
.card,
.footer {
  scroll-margin-top: 7.5rem;
}

.board-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem 2rem;
  align-items: end;
  border-bottom: 3px double var(--ink);
  padding-bottom: 0.9rem;
  margin-bottom: 2.2rem;
}
.board-head__title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-variation-settings: "SOFT" 30;
}
.board-head__note {
  grid-column: 1;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: 0.98rem;
}
.legend {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.legend__dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
}
.legend__dot--baking {
  background: var(--baking);
}
.legend__dot--ceramics {
  background: var(--ceramics);
}
.legend__dot--floristry {
  background: var(--floristry);
}
.legend__dot--painting {
  background: var(--painting);
}

/* --- Thread layer -------------------------------------------------------- */
.board-wrap {
  position: relative;
  padding-left: 0;
}

.thread {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
.thread__line {
  fill: none;
  stroke: var(--thread);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.3s ease, opacity 0.3s ease;
}
.thread__knots circle {
  fill: var(--card);
  stroke: var(--thread);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}
.board-wrap[data-cat="Baking"] .thread__line {
  stroke: var(--baking);
}
.board-wrap[data-cat="Baking"] .thread__knots circle {
  stroke: var(--baking);
}
.board-wrap[data-cat="Ceramics"] .thread__line {
  stroke: var(--ceramics);
}
.board-wrap[data-cat="Ceramics"] .thread__knots circle {
  stroke: var(--ceramics);
}
.board-wrap[data-cat="Floristry"] .thread__line {
  stroke: var(--floristry);
}
.board-wrap[data-cat="Floristry"] .thread__knots circle {
  stroke: var(--floristry);
}
.board-wrap[data-cat="Painting"] .thread__line {
  stroke: var(--painting);
}
.board-wrap[data-cat="Painting"] .thread__knots circle {
  stroke: var(--painting);
}

/* --- Board grid ---------------------------------------------------------- */
.board {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: clamp(2.6rem, 5vw, 4.2rem) clamp(1.4rem, 3vw, 2.6rem);
  position: relative;
  z-index: 1;
}

/* --- Card ---------------------------------------------------------------- */
.card {
  position: relative;
  min-width: 0;
}

.card__inner {
  --rot: 0deg;
  --lift: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transform: rotate(var(--rot)) translateY(var(--lift));
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.22s ease;
  overflow: visible;
}

.card:nth-child(4n + 1) .card__inner {
  --rot: -0.7deg;
}
.card:nth-child(4n + 2) .card__inner {
  --rot: 0.55deg;
  --lift: 14px;
}
.card:nth-child(4n + 3) .card__inner {
  --rot: -0.35deg;
  --lift: -6px;
}
.card:nth-child(4n + 4) .card__inner {
  --rot: 0.75deg;
  --lift: 8px;
}

/* the pin: this is where the thread meets the card */
.card__pin {
  position: absolute;
  top: -0.62rem;
  left: 50%;
  width: 1.25rem;
  height: 1.25rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--card-2);
  border: 1.5px solid var(--ink);
  box-shadow: 0 2px 0 rgba(33, 28, 22, 0.25);
  z-index: 3;
  display: grid;
  place-items: center;
}
.card__pin::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--cat, var(--ink));
}

/* washi tape at one corner */
.card__inner::before {
  content: "";
  position: absolute;
  top: -0.7rem;
  right: 1.3rem;
  width: 4.6rem;
  height: 1.5rem;
  background: var(--paper-deep);
  background: color-mix(in srgb, var(--cat, var(--thread)) 42%, transparent);
  border-left: 1px dashed rgba(33, 28, 22, 0.2);
  border-right: 1px dashed rgba(33, 28, 22, 0.2);
  transform: rotate(6deg);
  mix-blend-mode: multiply;
  z-index: 2;
  pointer-events: none;
}

.card__media {
  position: relative;
  border-bottom: 1.5px solid var(--ink);
  overflow: hidden;
  background: var(--paper-deep);
}
.card__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.9);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
}
.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.95rem 1.05rem 1.1rem;
  flex: 1 1 auto;
}

.card__cat {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-2);
  font-weight: 700;
}
.card__cat::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--cat, var(--thread));
  border: 1.5px solid var(--ink);
}
.card__title {
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  font-weight: 700;
  font-variation-settings: "SOFT" 20;
}
.card__summary {
  color: var(--ink-2);
  font-size: 0.98rem;
  flex: 1 1 auto;
}

.card__spec {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.18rem 0.9rem;
  margin: 0.15rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
}
.card__spec dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.12rem;
}
.card__spec dd {
  margin: 0;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 2px 2px 0 rgba(33, 28, 22, 0.16);
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background-color 0.15s ease, color 0.15s ease;
}
.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(33, 28, 22, 0.22);
  background: var(--card-2);
}
.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(33, 28, 22, 0.22);
}
.btn--ink {
  background: var(--ink);
  color: var(--paper);
}
.btn--ink:hover {
  background: #000;
  color: #fff;
}
.btn--block {
  width: 100%;
  justify-content: center;
}
.btn__arrow {
  transition: transform 0.18s ease;
}
.btn:hover .btn__arrow {
  transform: translateX(3px);
}

.card__state {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 1.5px solid var(--stamp);
  border-radius: 999px;
  padding: 0.24rem 0.6rem;
  transform: rotate(-3deg);
  white-space: nowrap;
}

/* Saved stamp on the card */
.card__stamp {
  position: absolute;
  right: -0.5rem;
  top: 0.9rem;
  z-index: 4;
  padding: 0.3rem 0.7rem;
  color: var(--stamp);
  border: 2.5px solid var(--stamp);
  border-radius: 3px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-9deg);
  opacity: 0.9;
  mix-blend-mode: multiply;
  background: rgba(240, 232, 216, 0.35);
  pointer-events: none;
}

.card:hover .card__inner,
.card:focus-within .card__inner {
  transform: rotate(0deg) translateY(calc(var(--lift) - 6px));
  box-shadow: 6px 9px 0 rgba(33, 28, 22, 0.12),
    0 26px 40px -26px rgba(33, 28, 22, 0.75);
}
.card:hover .card__media img,
.card:focus-within .card__media img {
  transform: scale(1.035);
  filter: saturate(1);
}

/* --- Empty state --------------------------------------------------------- */
.empty {
  margin: 1rem auto 0;
  max-width: 34rem;
  padding: 2rem 1.6rem;
  text-align: center;
  background: var(--card-2);
  border: 2px dashed var(--ink);
  box-shadow: var(--shadow-card);
  transform: rotate(-0.6deg);
}
.empty__title {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 0.5rem;
}
.empty__body {
  color: var(--ink-2);
  margin-bottom: 1.1rem;
}

/* --- Footer -------------------------------------------------------------- */
.footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.4rem var(--gut) 3rem;
  border-top: 3px double var(--ink);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem 2rem;
  align-items: start;
  color: var(--ink-2);
  font-size: 0.88rem;
}
.footer__brand {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.footer p {
  max-width: 62ch;
}
.footer__meta {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  color: var(--ink-3);
}

/* --- Detail dialog ------------------------------------------------------- */
.detail {
  position: relative;
  width: min(46rem, 100% - 2rem);
  max-width: 46rem;
  max-height: min(94vh, 62rem);
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
  overscroll-behavior: contain;
}
.detail::backdrop {
  background: rgba(28, 23, 18, 0.55);
  backdrop-filter: blur(2px) saturate(0.9);
}
.detail__card {
  position: relative;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 8px 10px 0 rgba(15, 12, 9, 0.35);
  max-height: min(94vh, 62rem);
  overflow: auto;
  overscroll-behavior: contain;
}
.detail__close {
  position: absolute;
  top: calc(0.6rem + env(safe-area-inset-top, 0px));
  right: calc(0.6rem + env(safe-area-inset-right, 0px));
  z-index: 6;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 2px 2px 0 rgba(33, 28, 22, 0.3);
  transition: transform 0.12s ease, background-color 0.15s ease;
}
.detail__close:hover {
  transform: rotate(90deg);
  background: var(--stamp);
  border-color: var(--stamp);
}

.detail__body {
  padding: 0 0 0;
}

.detail__media {
  position: relative;
  border-bottom: 2px solid var(--ink);
}
.detail__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.detail__media .detail__kicker {
  position: absolute;
  left: 1.1rem;
  bottom: -0.85rem;
  padding: 0.32rem 0.75rem;
  background: var(--cat, var(--thread));
  color: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 2px 2px 0 rgba(33, 28, 22, 0.35);
}

.detail__main {
  padding: 1.9rem clamp(1.1rem, 4vw, 2.2rem) clamp(1.4rem, 4vw, 2rem);
}
.detail__title {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  font-weight: 800;
  font-variation-settings: "SOFT" 25, "WONK" 1;
  margin-bottom: 0.55rem;
  text-wrap: balance;
}
.detail__prose {
  font-size: 1.12rem;
  color: var(--ink);
  max-width: 46ch;
}
.detail__instructor {
  margin-top: 0.7rem;
  font-style: italic;
  color: var(--ink-2);
}

.detail__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 2px solid var(--ink);
}
.detail__fact dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.28rem;
}
.detail__fact dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.detail__fact dd.big {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
}

.detail__actions {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}
.detail__actions .btn {
  flex: 1 1 15rem;
  justify-content: center;
}

.detail__legend {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* --- Reveal animation ---------------------------------------------------- */
@keyframes pin-drop {
  from {
    opacity: 0;
    transform: rotate(var(--rot)) translateY(calc(var(--lift) - 22px));
  }
  to {
    opacity: 1;
    transform: rotate(var(--rot)) translateY(var(--lift));
  }
}
.card__inner {
  animation: pin-drop 0.34s cubic-bezier(0.2, 0.9, 0.25, 1) backwards;
}
.card:nth-child(2) .card__inner {
  animation-delay: 0.03s;
}
.card:nth-child(3) .card__inner {
  animation-delay: 0.06s;
}
.card:nth-child(4) .card__inner {
  animation-delay: 0.09s;
}
.card:nth-child(5) .card__inner {
  animation-delay: 0.12s;
}
.card:nth-child(6) .card__inner {
  animation-delay: 0.15s;
}
@keyframes knot-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.thread__knots circle {
  animation: knot-in 0.5s ease backwards;
}

.noscript {
  margin: 2rem var(--gut);
  padding: 1rem;
  border: 2px dashed var(--ink);
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .masthead {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "intro"
      "photo"
      "label";
  }
  .hero-photo {
    max-width: 34rem;
  }
  .board-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .legend {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0.6rem;
  }
}

@media (max-width: 680px) {
  .masthead {
    padding-top: 1.2rem;
  }
  .wordmark {
    font-size: clamp(3rem, 20vw, 5rem);
  }
  .hero-photo figcaption {
    display: none;
  }
  .hero-photo img {
    aspect-ratio: 16 / 10;
  }
  .toolbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.7rem;
    position: static;
  }
  .toolbar__field--toggle {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .toolbar__field--toggle .toolbar__label {
    visibility: visible;
  }
  .toolbar__hint {
    width: 100%;
  }
  .board {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.4rem;
    /* leave a gutter for the thread / spine */
    padding-left: 2.1rem;
    position: relative;
  }
  .card__inner {
    --rot: -0.3deg;
  }
  .card:nth-child(even) .card__inner {
    --rot: 0.4deg;
    --lift: 0px;
  }
  .footer {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer__meta {
    grid-column: 1;
  }
  .detail {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
  }
  .detail__card {
    max-height: 100dvh;
    height: 100%;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .detail__media img {
    aspect-ratio: 4 / 3;
  }
}

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .card:hover .card__inner,
  .card:focus-within .card__inner {
    transform: rotate(var(--rot)) translateY(var(--lift));
  }
  .card:hover .card__media img,
  .card:focus-within .card__media img {
    transform: none;
  }
  .detail__close:hover {
    transform: none;
  }
}

/* --- Forced colors ------------------------------------------------------- */
@media (forced-colors: active) {
  .thread__line,
  .thread__knots circle {
    stroke: CanvasText;
  }
  .card__inner,
  .btn,
  .toggle {
    border: 1px solid CanvasText;
  }
}
