/* ============================================================
   BULLETIN — a journal of found city life
   Analog community noticeboard. Plain CSS, local fonts only.
   ============================================================ */

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --board: #a9713d;
  --board-deep: #7d5124;
  --board-light: #c08a52;
  --paper: #f7f0df;
  --paper-2: #efe3c9;
  --paper-3: #e6d8ba;
  --ink: #241d14;
  --ink-soft: #5c4f3d;
  --ink-faint: #7d6f5a;
  --sign: #1d3a30;
  --sign-ink: #f4ecd6;
  --red: #bf3822;
  --red-deep: #8f2817;
  --line: #d9c9a6;
  --tape: rgba(228, 216, 184, 0.78);
  --focus: #103f8c;
  --focus-on-dark: #ffd34d;

  --c-culture: #7a4cb0;
  --c-food: #c4632a;
  --c-movement: #2c7c95;
  --c-people: #bb8d16;
  --c-places: #3d8049;

  --font-display: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 10px 18px -10px rgba(46, 28, 8, 0.65),
    0 2px 4px rgba(46, 28, 8, 0.25);
  --shadow-lift: 0 18px 32px -14px rgba(46, 28, 8, 0.7), 0 3px 8px rgba(46, 28, 8, 0.28);
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--board);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(0, 0, 0, 0.16), transparent 45%),
    radial-gradient(circle at 82% 88%, rgba(0, 0, 0, 0.18), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 233, 190, 0.18), transparent 70%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

/* Fine grain over the cork. */
.board-texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
}

.skip-link {
  position: absolute;
  left: -100vw;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- Focus ---------- */
:where(a, button, input, select):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}
.overlay :where(a, button, input, select):focus-visible {
  outline-color: var(--focus);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Masthead ---------- */
.masthead {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) clamp(1rem, 3vw, 1.75rem);
  color: var(--ink);
}
.masthead__rule {
  height: 8px;
  margin-bottom: 1rem;
  background: repeating-linear-gradient(90deg, var(--sign) 0 26px, transparent 26px 40px);
  opacity: 0.75;
}
.masthead__kicker {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #33271a;
}
.masthead__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 13vw, 8rem);
  line-height: 0.82;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--sign);
  text-shadow: 3px 3px 0 rgba(247, 240, 223, 0.55);
}
.masthead__sub {
  max-width: 46ch;
  margin: 1rem 0 0;
  font-size: clamp(1rem, 2.4vw, 1.18rem);
  color: #2c2216;
}
.masthead__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0;
  margin-top: 1.25rem;
}
.masthead__link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2c2216;
  text-decoration: none;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(36, 29, 20, 0.35);
  border-right: 0;
  background: rgba(247, 240, 223, 0.28);
}
.masthead__link:last-child { border-right: 1px solid rgba(36, 29, 20, 0.35); }
.masthead__link:hover { background: var(--paper); }

/* ---------- How / controls ---------- */
main { position: relative; z-index: 1; }

.how {
  max-width: 1160px;
  margin: 0 auto 1.25rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}
.how p {
  max-width: 74ch;
  margin: 0;
  padding: 0.85rem 1.1rem;
  font-size: 0.98rem;
  background: rgba(247, 240, 223, 0.34);
  border-left: 5px solid var(--sign);
  color: #2c2216;
}
.how kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  padding: 0.1em 0.45em;
  background: var(--sign);
  color: var(--sign-ink);
  border-radius: 3px;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem 1.25rem;
  max-width: 1160px;
  margin: 0 auto 1.75rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, rgba(169, 113, 61, 0.98), rgba(150, 96, 47, 0.96));
  border-bottom: 3px solid rgba(36, 29, 20, 0.35);
  box-shadow: 0 10px 18px -14px rgba(36, 29, 20, 0.9);
  backdrop-filter: blur(2px);
}

.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #291f14;
}
.field--search { flex: 1 1 20rem; min-width: 0; }
.field--select { flex: 0 1 12rem; }

.field__wrap { position: relative; display: flex; align-items: center; }
.field__icon {
  position: absolute;
  left: 0.7rem;
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.9;
  stroke-linecap: round;
  pointer-events: none;
}
.field input {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.8rem 0.6rem 2.3rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(36, 29, 20, 0.5);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 3px rgba(60, 38, 10, 0.22);
}
.field input::placeholder { color: #8a7a61; }
.field input::-webkit-search-cancel-button { cursor: pointer; }

.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap select {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 2.2rem 0.6rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(36, 29, 20, 0.5);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 3px rgba(60, 38, 10, 0.22);
  appearance: none;
  cursor: pointer;
}
.select-wrap__chevron {
  position: absolute;
  right: 0.6rem;
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.controls__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Pocket toggle — a stitched kraft pocket */
.pocket {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.5rem 1.4rem 0.5rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: #e7d3ab;
  border: 2px solid #a9834a;
  border-radius: 4px 4px 12px 12px;
  cursor: pointer;
  box-shadow: 0 4px 0 #9c7943, 0 6px 10px -6px rgba(36, 29, 20, 0.7);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}
.pocket::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(120, 84, 36, 0.7);
  border-radius: 2px 2px 9px 9px;
  pointer-events: none;
}
.pocket:hover { background: #f0e0be; }
.pocket:active { transform: translateY(2px); box-shadow: 0 2px 0 #9c7943; }
.pocket[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red-deep);
  color: #fff6e8;
  box-shadow: 0 4px 0 var(--red-deep), 0 6px 10px -6px rgba(36, 29, 20, 0.7);
}
.pocket[aria-pressed="true"]::before { border-color: rgba(255, 240, 220, 0.7); }
.pocket__icon {
  width: 1.15rem; height: 1.15rem;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.pocket__count {
  min-width: 1.55em;
  padding: 0.05em 0.35em;
  font-size: 0.85em;
  text-align: center;
  background: var(--sign);
  color: var(--sign-ink);
  border-radius: 20px;
}
.pocket[aria-pressed="true"] .pocket__count { background: #fff6e8; color: var(--red-deep); }

.shuffle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sign);
  background: var(--paper);
  border: 2px solid var(--sign);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}
.shuffle:hover { background: var(--sign); color: var(--sign-ink); }
.shuffle:active { transform: translateY(1px); }
.shuffle svg {
  width: 1.05rem; height: 1.05rem;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Board ---------- */
.board[hidden] { display: none; }

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: 1.4rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(0.9rem, 3.5vw, 2.5rem) 3rem;
}

.lane { min-width: 0; }
.lane__sign {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
  padding: 0.55rem 0.9rem;
  background: var(--sign);
  color: var(--sign-ink);
  border-radius: 2px;
  box-shadow: 0 5px 0 rgba(13, 28, 23, 0.55), 0 8px 14px -8px rgba(0, 0, 0, 0.8);
  transform: rotate(-0.6deg);
}
.lane__sign::after {
  content: "";
  position: absolute;
  left: 50%; top: 100%;
  width: 2px; height: 1.1rem;
  background: repeating-linear-gradient(180deg, var(--sign) 0 5px, transparent 5px 9px);
  transform: translateX(-50%);
}
.lane__sign .lane__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.lane__pin {
  width: 0.7rem; height: 0.7rem;
  border-radius: 50%;
  background: var(--accent, var(--paper));
  box-shadow: 0 0 0 2px rgba(244, 236, 214, 0.5), 0 2px 3px rgba(0, 0, 0, 0.5);
  flex: none;
}
.lane__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  opacity: 0.8;
}

.lane__cards {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 0 0.15rem;
}
.lane__cards::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -1.1rem;
  bottom: -0.6rem;
  width: 2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, var(--accent, var(--line)) 0 6px, transparent 6px 11px);
  opacity: 0.5;
  z-index: 0;
}
.lane__cards > .notice { z-index: 1; }

/* ---------- Notice card ---------- */
.notice {
  position: relative;
  padding: 1.7rem 1.1rem 1.1rem;
  background: var(--paper);
  background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.55), rgba(0, 0, 0, 0.03));
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.notice::after {
  /* torn/hand-cut bottom edge */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -7px;
  height: 8px;
  background: var(--paper);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 13px);
  mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 13px);
  opacity: 0.95;
}
.notice:hover,
.notice:focus-within {
  transform: rotate(0deg) translateY(-3px) scale(1.012);
  box-shadow: var(--shadow-lift);
  z-index: 3;
}
.notice__pin {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  width: 1rem; height: 1rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffd9c9 0 18%, var(--pin) 22% 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 3px 4px rgba(36, 29, 20, 0.55);
}
.notice__pin::before {
  content: "";
  position: absolute;
  left: 50%; top: 60%;
  width: 2px; height: 0.55rem;
  background: rgba(36, 29, 20, 0.5);
  transform: translateX(-50%);
}
.notice__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.notice__dot {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.notice__title {
  margin: 0 0 0.45rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.14rem;
  line-height: 1.26;
  color: var(--ink);
  text-wrap: balance;
}
.notice__summary {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.notice__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.notice__date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
}
.notice__open {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.14s ease;
}
.notice__open:hover { background: var(--sign); }
.notice__open:active { transform: translateY(1px); }
.notice__open svg {
  width: 0.9rem; height: 0.9rem;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.notice__stamp {
  position: absolute;
  top: 0.7rem;
  right: 0.6rem;
  padding: 0.25rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 3px;
  transform: rotate(9deg);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.notice.is-saved .notice__stamp { opacity: 0.92; }

/* Enter animation when board re-renders */
.notice.is-entering { animation: pin-drop 0.34s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes pin-drop {
  from { opacity: 0; transform: rotate(var(--rot, 0deg)) translateY(-10px) scale(0.97); }
  to { opacity: 1; transform: rotate(var(--rot, 0deg)) translateY(0) scale(1); }
}

/* ---------- Empty state ---------- */
.empty {
  max-width: 560px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}
.empty__note {
  position: relative;
  padding: 2rem 1.5rem 1.75rem;
  text-align: center;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  transform: rotate(-1.2deg);
  border: 1px solid var(--line);
}
.empty__pin {
  position: absolute;
  top: -0.5rem; left: 50%;
  width: 1.1rem; height: 1.1rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffd9c9 0 18%, var(--red) 22% 100%);
  box-shadow: 0 3px 4px rgba(36, 29, 20, 0.5);
}
.empty__note h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--sign);
}
.empty__note p { margin: 0 auto 1.25rem; max-width: 42ch; color: var(--ink-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.6rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}
.btn:active { transform: translateY(1px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--sign); }
.btn__icon {
  width: 1.05rem; height: 1.05rem;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Detail overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(0.5rem, 3vw, 2.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.overlay[hidden] { display: none; }
.overlay__scrim {
  position: fixed;
  inset: 0;
  background: rgba(24, 15, 6, 0.68);
  backdrop-filter: blur(3px);
  animation: scrim-in 0.22s ease both;
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }

.detail {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  margin: auto;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.75), 0 4px 10px rgba(0, 0, 0, 0.4);
  animation: sheet-in 0.3s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
/* Tape corners */
.detail::before,
.detail::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 108px; height: 28px;
  background: var(--tape);
  border-left: 1px solid rgba(120, 95, 55, 0.25);
  border-right: 1px solid rgba(120, 95, 55, 0.25);
  box-shadow: 0 2px 4px rgba(36, 29, 20, 0.25);
}
.detail::before { left: 10%; transform: rotate(-4deg); }
.detail::after { right: 10%; transform: rotate(3.5deg); }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(26px) scale(0.975) rotate(-0.5deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

.detail__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem 0.6rem 1.3rem;
  background: var(--sign);
  color: var(--sign-ink);
}
.detail__bar-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}
.detail__close {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sign-ink);
  background: transparent;
  border: 1px solid rgba(244, 236, 214, 0.5);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.detail__close:hover { background: var(--sign-ink); color: var(--sign); }
.detail__close svg {
  width: 0.95rem; height: 0.95rem;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round;
}

.detail__sheet {
  padding: clamp(1.4rem, 4vw, 2.75rem);
}
.detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.detail__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem;
  color: var(--paper);
  background: var(--accent);
  border-radius: 20px;
}
.detail__tag-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}
.detail__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}
.detail__summary {
  margin: 0;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.02rem, 2.6vw, 1.2rem);
  line-height: 1.5;
  color: var(--ink-soft);
}
.detail__rule {
  height: 2px;
  margin: 1.5rem 0;
  background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 16px);
}
.detail__body {
  max-width: 64ch;
  font-size: clamp(1.02rem, 2.4vw, 1.12rem);
  line-height: 1.75;
  color: #2a2318;
}
.detail__body p { margin: 0 0 1.15em; }
.detail__body p:first-child::first-letter {
  float: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.1em;
  line-height: 0.78;
  padding: 0.06em 0.12em 0 0;
  color: var(--sign);
}
.detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.btn--save {
  background: var(--red);
  color: #fff6e8;
  border-color: var(--red-deep);
  box-shadow: 0 3px 0 var(--red-deep);
}
.btn--save:hover { background: var(--red-deep); }
.btn--save[aria-pressed="true"] {
  background: var(--paper-2);
  color: var(--red-deep);
  border-color: var(--red);
  box-shadow: none;
}
.btn--save .btn__icon { transition: transform 0.18s ease; }
.btn--save[aria-pressed="true"] .btn__icon { transform: rotate(180deg); }
.detail__footnote {
  margin: 1.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
}

/* ---------- Colophon ---------- */
.colophon {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 3.5rem;
  color: #2b2115;
  border-top: 2px dashed rgba(36, 29, 20, 0.4);
}
.colophon p { max-width: 70ch; margin: 0 0 0.7rem; font-size: 0.9rem; }
.colophon__type { font-family: var(--font-mono); font-size: 0.76rem; color: #34281a; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .board { grid-template-columns: 1fr; gap: 2rem; }
  .controls {
    position: static;
    align-items: stretch;
  }
  .field--search, .field--select { flex: 1 1 100%; }
  .controls__actions { width: 100%; }
  .pocket, .shuffle { flex: 1 1 auto; justify-content: center; }
  .detail__bar { flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.7rem; }
  .detail__close { justify-content: center; }
  .notice:hover, .notice:focus-within { transform: rotate(var(--rot, 0deg)); }
}

/* ---------- 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;
  }
  .notice:hover, .notice:focus-within { transform: rotate(var(--rot, 0deg)); }
}

/* Windows high-contrast support */
@media (forced-colors: active) {
  .notice, .detail, .empty__note { border: 1px solid CanvasText; }
  .notice__pin, .lane__pin, .empty__pin { forced-color-adjust: none; }
}
