/* Atlas Osobliwości Polski — „Gabinet osobliwości” */

/* ---------- Fonts: self-hosted, SIL Open Font License 1.1 (licenses in /fonts) ---------- */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-400-normal.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: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-400-italic.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: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.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: "Inter";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-italic.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: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.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;
}

/* ---------- Gabinet osobliwości: tokens ---------- */

:root {
  color-scheme: dark;
  --bg: #0c110f;
  --bg-2: #131b17;
  --bg-3: #1a241f;
  --line: rgba(236, 230, 216, 0.13);
  --line-2: rgba(236, 230, 216, 0.24);
  --ink: #ece6d8;
  --ink-2: #cfc8b8;
  --muted: #a39d90;
  --amber: #e9a43b;
  --amber-2: #f3bf6a;
  --on-amber: #1b1305;
  --warn: #f0a58f;
  --warn-bg: rgba(214, 96, 66, 0.1);
  --warn-line: rgba(240, 165, 143, 0.32);
  --good: #2c6145;
  --bad: #7a2b25;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 4px;
  --radius-lg: 8px;
  --tap: 48px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  font-family: var(--sans);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.6 var(--sans);
}
/* Soft light falling on the cabinet. */
body::before {
  content: "";
  position: fixed;
  top: -20vh;
  left: -10vw;
  z-index: -1;
  width: 80vw;
  height: 80vh;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(233, 164, 59, 0.09), transparent);
}

::selection { color: var(--on-amber); background: var(--amber); }
:focus-visible { outline: 2px solid var(--amber-2); outline-offset: 3px; }
/* #main takes focus when a view opens; that is not a place to draw a ring. */
[tabindex="-1"]:focus { outline: none; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { max-width: 100%; display: block; }
a { color: var(--amber-2); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
strong, b { font-weight: 600; }
.is-hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.005em;
}
h1, h2 { text-wrap: balance; }
h1 em, h2 em { color: var(--amber); }

.shell {
  width: min(1200px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  color: var(--on-amber);
  background: var(--amber);
  font: 500 13px/1 var(--mono);
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--amber);
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lead {
  max-width: 34em;
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(16.5px, 1.25vw, 19px);
}

/* Buttons: amber for the main action, hairline for the rest. */
.primary, .secondary, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font: 500 12.5px/1.25 var(--mono);
  letter-spacing: 0.09em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.primary { color: var(--on-amber); background: var(--amber); border-color: var(--amber); }
.primary:hover { color: var(--on-amber); background: var(--amber-2); border-color: var(--amber-2); }
.secondary:hover, .ghost:hover { color: var(--amber-2); border-color: var(--amber); }
.ghost { color: var(--ink-2); border-color: var(--line); }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.25rem; }

/* ---------- Top bar: wordmark and language ---------- */

.topbar { border-bottom: 1px solid var(--line); }
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}
.wordmark {
  color: var(--ink);
  font: 400 23px/1.1 var(--serif);
  letter-spacing: 0.005em;
  text-decoration: none;
}
.wordmark em { color: var(--amber); }
.wordmark:hover { color: var(--ink); }
.wordmark:hover em { color: var(--amber-2); }
.language-toggle {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font: 500 12px/1 var(--mono);
}
.language-btn {
  min-width: 40px;
  min-height: 44px;
  padding: 0 0.4rem;
  border: 0;
  color: var(--muted);
  background: none;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
}
.language-btn:hover { color: var(--ink); }
.language-btn.is-active {
  color: var(--ink);
  text-decoration: underline 1px var(--amber);
  text-underline-offset: 7px;
}
.language-toggle__sep { opacity: 0.6; }

/* ---------- Start page: hero and the cabinet of five curiosities ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(32px, 6vw, 84px) 0 clamp(40px, 6vw, 80px);
}
.hero h1 {
  margin: 1.1rem 0 1.5rem;
  font-size: clamp(48px, 7.2vw, 108px);
  line-height: 0.94;
  letter-spacing: -0.012em;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.9rem;
  margin: 2.2rem 0 0;
  padding: 1.15rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.hero__stats li {
  color: var(--muted);
  font: 400 12.5px/1.4 var(--mono);
  letter-spacing: 0.04em;
}
.hero__stats strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--ink);
  font: 400 36px/1 var(--serif);
  letter-spacing: 0;
}

.cabinet {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 10px;
  aspect-ratio: 1 / 1.02;
  margin: 0;
  padding: 0;
  list-style: none;
}
.specimen {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #1d2a23, #0e1411);
  outline: 1px solid var(--line);
}
.specimen img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.specimen:hover img { transform: scale(1.04); }
/* The caption stays in the flow, so the link's overlay below covers the whole tile. */
.specimen__caption {
  padding: 2.4rem 0.95rem 0.85rem;
  background: linear-gradient(to top, rgba(7, 10, 9, 0.93), rgba(7, 10, 9, 0.55) 60%, transparent);
}
.specimen__cat {
  display: block;
  color: var(--amber);
  font: 400 10.5px/1.3 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.specimen__name {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink);
  font: 400 23px/1.08 var(--serif);
  text-decoration: none;
}
.specimen__name:hover { color: var(--ink); }
/* The whole tile opens the card. */
.specimen__name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.specimen__name:focus-visible { outline: none; }
.specimen__name:focus-visible::after { outline: 2px solid var(--amber-2); outline-offset: -2px; border-radius: var(--radius); }
.specimen__note {
  display: block;
  margin-top: 0.3rem;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.4;
}
.specimen--1 { grid-column: 1 / 4; grid-row: 1 / 5; }
.specimen--2 { grid-column: 4 / 7; grid-row: 1 / 3; }
.specimen--3 { grid-column: 4 / 7; grid-row: 3 / 5; }
.specimen--4 { grid-column: 1 / 3; grid-row: 5 / 7; }
.specimen--5 { grid-column: 3 / 7; grid-row: 5 / 7; }
.specimen--2 .specimen__note,
.specimen--3 .specimen__note,
.specimen--4 .specimen__note { display: none; }
.specimen--1 .specimen__name { font-size: 30px; }

/* Author and license on a photo, linking to the Commons file page. */
.photo-credit {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  max-width: 100%;
  padding: 0.35rem 0.6rem;
  border-bottom-left-radius: var(--radius);
  color: rgba(236, 230, 216, 0.9);
  background: rgba(7, 10, 9, 0.66);
  font: 400 10.5px/1.3 var(--mono);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-credit:hover,
.photo-credit:focus-visible { color: var(--ink); text-decoration: underline; }

/* ---------- Start page sections ---------- */

.collection-picker,
.daily-fact,
.about {
  padding-block: clamp(44px, 6vw, 88px);
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1rem 1.5rem;
  margin: 0 0 2rem;
}
.section-head h2 { font-size: clamp(38px, 4.8vw, 66px); line-height: 1; }
.section-note { max-width: 30em; margin: 0; color: var(--muted); }

/* The collections are drawers on three shelves. */
.collection-grid.is-grouped { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.shelf__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.shelf__head h3 { font-size: clamp(27px, 2.8vw, 36px); }
.shelf__count {
  margin: 0;
  color: var(--amber);
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.shelf__lead { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 15px; }
.shelf__drawers {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.drawer {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 260px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #1d2a23, #0e1411);
  outline: 1px solid var(--line);
}
.drawer__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.4s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.drawer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(7, 10, 9, 0.95) 18%, rgba(7, 10, 9, 0.2) 62%, rgba(7, 10, 9, 0.55));
}
.drawer:hover .drawer__img { opacity: 0.95; transform: scale(1.05); }
.drawer__count {
  position: absolute;
  top: 0.9rem;
  left: 1rem;
  margin: 0;
  color: var(--amber);
  font: 400 11px/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  text-transform: uppercase;
}
.drawer__name { margin: 0; padding: 0 1rem; font-size: 31px; line-height: 1; }
.drawer__open {
  color: var(--ink);
  text-decoration: none;
}
.drawer__open:hover { color: var(--ink); }
/* The whole drawer opens the collection; the photo credit stays clickable above it. */
.drawer__open::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.drawer__open:focus-visible { outline: none; }
.drawer__open:focus-visible::after { outline: 2px solid var(--amber-2); outline-offset: -2px; border-radius: var(--radius); }
.drawer__teaser {
  margin: 0.45rem 0 0;
  padding: 0 1rem;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.45;
}
.photo-credit.drawer__credit {
  position: relative;
  top: auto;
  right: auto;
  align-self: flex-start;
  margin: 0.55rem 1rem 0.8rem;
  padding: 0.2rem 0;
  color: var(--muted);
  background: none;
}
.drawer--plain .drawer__teaser { padding-bottom: 1rem; }

/* Fact of the day: a plaque between the drawers and the project notes. */
.daily-fact__card {
  padding: clamp(1.4rem, 3.5vw, 2.6rem);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(233, 164, 59, 0.07), transparent 60%), var(--bg-2);
}
.daily-fact__title { margin: 0 0 1rem; }
.daily-fact__body { min-height: 5.5rem; }
.daily-fact__loading { margin: 0; color: var(--muted); }
.daily-fact__meta {
  margin: 0 0 1rem;
  color: var(--muted);
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.06em;
}
.daily-fact__fact {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
}
.daily-fact__fact .fact__icon { font-size: 1.8rem; line-height: 1.2; }
.daily-fact__text {
  margin: 0;
  color: var(--ink);
  font: 400 clamp(22px, 2.3vw, 30px)/1.3 var(--serif);
}
.daily-fact__actions { margin-top: 1.5rem; }

/* About the project and its three principles. */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.about__head h2 { font-size: clamp(34px, 4vw, 52px); }
.about__lead {
  margin: 1.6rem 0 0;
  padding: 0 0 0 1.25rem;
  border-left: 1px solid var(--amber);
}
.about__lead p {
  margin: 0;
  color: var(--ink-2);
  font: italic 400 clamp(19px, 1.6vw, 23px)/1.4 var(--serif);
}
.about__lead cite {
  display: block;
  margin-top: 0.85rem;
  color: var(--muted);
  font: normal 400 12px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.about__grid { border: 1px solid var(--line); border-radius: var(--radius); }
.about-card { padding: 1.5rem 1.6rem; border-bottom: 1px solid var(--line); }
.about-card:last-child { border-bottom: 0; }
.about-card__num {
  color: var(--amber);
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.14em;
}
.about-card h3 { margin: 0.65rem 0 0.5rem; font-size: 29px; line-height: 1.05; }
.about-card p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.6; }

/* Credits for every photo of the start page. */
.start-credits { padding: 0 0 2.5rem; }
.start-credits__box { padding-top: 0.6rem; border-top: 1px solid var(--line); }
.start-credits__box summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--muted);
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.start-credits__box summary::-webkit-details-marker { display: none; }
.start-credits__box summary::after { content: "▾"; transition: transform 0.2s ease; }
.start-credits__box[open] summary::after { transform: rotate(180deg); }
.start-credits__note { margin: 0.25rem 0 0.75rem; color: var(--muted); font-size: 14px; }
.start-credits__list {
  margin: 0;
  padding: 0;
  columns: 2 320px;
  column-gap: 2.5rem;
  list-style: none;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.start-credits__list li { padding: 0.3rem 0; break-inside: avoid; }
.start-credits__list strong { color: var(--ink); font-weight: 600; }

/* ---------- An opened collection: banner, navigation, notice ---------- */

.app-main { padding: 0 0 3.5rem; }
.collection-bar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.collection-bar__photo { position: absolute; inset: 0; }
.collection-bar__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.collection-bar__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 17, 15, 0.97) 0%, rgba(12, 17, 15, 0.84) 45%, rgba(12, 17, 15, 0.3) 100%),
    linear-gradient(to top, var(--bg) 0, transparent 45%);
}
.collection-bar__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem 2rem;
  min-height: clamp(230px, 28vw, 340px);
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1.5rem, 3vw, 2.25rem);
}
.collection-bar__text { max-width: 780px; }
.collection-bar h1 { font-size: clamp(40px, 6vw, 82px); line-height: 0.98; }
.collection-bar__lead { max-width: 44em; margin: 1rem 0 0; color: var(--ink-2); }
.photo-credit.collection-bar__credit { z-index: 2; }

.app-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 15, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.app-nav__inner {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.app-nav__inner::-webkit-scrollbar { display: none; }
.nav-btn {
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0 1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: none;
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-btn:hover { color: var(--ink); }
.nav-btn.is-active { color: var(--amber-2); border-bottom-color: var(--amber); }

.notice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 1.5rem 0 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--warn-line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  color: var(--ink-2);
  background: var(--warn-bg);
  font-size: 15px;
}
.notice strong { color: var(--warn); }

.view { display: none; }
.view.is-active { display: block; }
.view .section-head { margin: 2.25rem 0 1.25rem; }
.view .section-head h2 { font-size: clamp(30px, 3.6vw, 46px); }

/* ---------- Atlas: search, filters, numbers, cards ---------- */

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 2fr;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}
.search-box { display: grid; gap: 0.45rem; }
.search-box span {
  color: var(--muted);
  font: 400 11.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.search-box input {
  width: 100%;
  min-height: var(--tap);
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  background: var(--bg-2);
  font: 16px/1.3 var(--sans);
}
.search-box input::placeholder { color: #8f897d; opacity: 1; }
.search-box input:focus { outline: 2px solid var(--amber-2); outline-offset: 2px; border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-2);
  background: transparent;
  font: 14px/1.2 var(--sans);
}
.chip:hover { color: var(--ink); border-color: var(--amber); }
.chip.is-active { color: var(--on-amber); background: var(--amber); border-color: var(--amber); font-weight: 600; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 1.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}
.stat-card { padding: 1rem 1.1rem; background: var(--bg); }
.stat-card strong { display: block; color: var(--ink); font: 400 34px/1 var(--serif); }
.stat-card span {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
  font: 400 11.5px/1.4 var(--mono);
  letter-spacing: 0.06em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.m-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-2);
  outline: 1px solid var(--line);
}
.m-card__visual,
.visual-fallback {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  color: var(--ink-2);
  background: linear-gradient(145deg, #1d2a23, #0e1411);
}
.m-card__visual img { width: 100%; height: 100%; object-fit: cover; }
.m-card__credit {
  position: absolute;
  right: 0;
  bottom: 0;
  max-width: 100%;
  padding: 0.35rem 0.6rem;
  border-top-left-radius: var(--radius);
  color: rgba(236, 230, 216, 0.9);
  background: rgba(7, 10, 9, 0.66);
  font: 400 10.5px/1.3 var(--mono);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-card__credit:hover,
.m-card__credit:focus-visible { color: var(--ink); text-decoration: underline; }
.m-card__credit--static { cursor: default; }
.visual-fallback span:first-child { color: var(--amber); font: 400 3.4rem/1 var(--serif); }
.visual-fallback span:last-child {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  max-width: 70%;
  color: var(--muted);
  font: 400 11px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}
.visual-error::after {
  content: "zdjęcie chwilowo niedostępne";
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 1rem;
  color: var(--muted);
  font: 400 12px/1.4 var(--mono);
  text-align: center;
}
.photo-caption {
  margin: 0;
  padding: 0.55rem 1.1rem 0;
  color: var(--muted);
  font: italic 400 15.5px/1.35 var(--serif);
}
.m-card__body { flex: 1; padding: 1rem 1.1rem 0.5rem; }
.m-card__body h3 { margin: 0 0 0.25rem; font-size: 27px; line-height: 1.05; }
.m-card__title { color: inherit; text-decoration: none; }
.m-card__title:hover { color: var(--amber-2); }
/* What readers without scripts see on the page of a collection or card. */
.static-card, .static-list { margin: 1.5rem 0; color: var(--ink-2); }
.static-list li { margin: 0.4rem 0; }
.latin {
  color: var(--muted);
  font: italic 400 17px/1.3 var(--serif);
}
.hook { margin: 0.75rem 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.occurrence-snippet { margin: 0.6rem 0 0; color: var(--muted); font-size: 14px; }
.occurrence-snippet strong { color: var(--ink-2); }
.meta-line { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-2);
  font: 400 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card-actions { display: flex; gap: 0.5rem; padding: 0.5rem 1.1rem 1.1rem; }
.card-actions button { flex: 1; padding-inline: 0.6rem; }
.card-actions .secondary { color: var(--amber-2); border-color: rgba(233, 164, 59, 0.55); }

.empty-state {
  padding: 2rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* Badges pair an icon with text; colour is only a second cue. */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}
.badge__icon { font-size: 0.95rem; line-height: 1; }
.badge--protection-strict { color: #9fd8b3; background: rgba(46, 107, 69, 0.2); }
/* Partial protection: dashed outline as a second, non-colour cue next to the text. */
.badge--protection-partial { color: #ddd28e; border-style: dashed; background: rgba(217, 157, 54, 0.1); }
.badge--toxic { color: var(--warn); background: var(--warn-bg); }

.synonyms { margin: 0.3rem 0 0; color: var(--muted); font-size: 14px; }
.synonyms strong { color: var(--ink-2); }

.field-notes,
.safety__notes {
  display: grid;
  gap: 0.3rem;
  padding: 0;
  list-style: none;
}
.field-notes {
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.75rem;
  border-left: 2px solid var(--warn);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--warn);
  background: var(--warn-bg);
  font-size: 13.5px;
  font-weight: 600;
}
.field-notes li,
.safety__notes li { display: flex; gap: 0.4rem; align-items: flex-start; }
.safety__notes { margin: 0.55rem 0 0; }

/* Fun facts with their sources. */
.facts__list {
  display: grid;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.fact {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}
.fact__icon { font-size: 1.1rem; line-height: 1.4; text-align: center; }
.fact__text { margin: 0; color: var(--ink-2); }
.fact__source {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font: 400 11.5px/1.45 var(--mono);
}
.fact__source a {
  color: var(--muted);
  text-decoration-color: rgba(163, 157, 144, 0.5);
  overflow-wrap: anywhere;
}
.fact__source a:hover,
.fact__source a:focus-visible { color: var(--amber-2); }
.facts--card { margin-top: 0.9rem; border-top: 1px solid var(--line); }
.facts--card summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  color: var(--amber-2);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.facts--card summary::-webkit-details-marker { display: none; }
.facts--card summary::after { content: "▾"; margin-left: auto; transition: transform 0.2s ease; }
.facts--card[open] summary::after { transform: rotate(180deg); }
.facts--card .facts__list { margin-bottom: 0.5rem; font-size: 14.5px; }
.facts--dialog {
  margin: 1.25rem 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-3);
}
.facts--dialog h3 { margin-bottom: 0.8rem; font-size: 26px; }

.card-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
}
.card-tools__link {
  padding: 0.6rem 0.1rem;
  color: var(--amber-2);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-underline-offset: 4px;
}
.share-status {
  display: none;
  margin: 0.5rem 0 0;
  color: var(--amber-2);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.share-status.is-visible { display: block; }

/* ---------- Card dialog ---------- */

.mushroom-dialog {
  width: min(780px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--bg-2);
  box-shadow: var(--shadow);
}
.mushroom-dialog::backdrop { background: rgba(4, 6, 5, 0.78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(12, 17, 15, 0.82);
  font-size: 1.5rem;
  line-height: 1;
}
.dialog-close:hover { color: var(--amber-2); border-color: var(--amber); }
.dialog-body { padding: 1.25rem 1.4rem 1.5rem; }
.dialog-body .m-card__visual { aspect-ratio: 16 / 10; border-radius: var(--radius); }
.dialog-body .photo-caption { padding: 0.6rem 0 0; }
.dialog-body h2 { font-size: clamp(36px, 5vw, 54px); }
.dialog-body > h3 { margin: 1.3rem 0 0.4rem; font-size: 25px; }
.dialog-body > p { color: var(--ink-2); }
.dialog-body .hook { font-size: 16.5px; }
.occurrence-box {
  margin: 1.1rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-3);
}
.occurrence-box h3 { margin-bottom: 0.6rem; font-size: 25px; }
.occurrence-box p { margin: 0.45rem 0; color: var(--ink-2); }
.occurrence-box strong { color: var(--ink); }
.safety {
  margin-top: 1.1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--warn-line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  color: var(--ink-2);
  background: var(--warn-bg);
}
.safety strong { color: var(--warn); }
.dialog-credits {
  margin: 1.1rem 0 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.dialog-credits h3 {
  margin: 0 0 0.5rem;
  color: var(--amber);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dialog-credits p { margin: 0.35rem 0; color: var(--muted); font-size: 14px; word-break: break-word; }
.dialog-credits strong { color: var(--ink-2); }

/* ---------- Learn: flashcards ---------- */

.flashcard, .quiz-box, .source-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.flash-inner { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
.flash-visual { min-width: 0; border-right: 1px solid var(--line); }
.flash-visual .photo-caption { padding-bottom: 0.7rem; }
.flash-content { padding: clamp(1.2rem, 4vw, 2.2rem); }
.flash-content .big-icon { color: var(--amber); font: 400 4.2rem/1 var(--serif); }
.flash-content blockquote {
  margin: 1.1rem 0 1.3rem;
  padding-left: 1.1rem;
  border-left: 1px solid var(--amber);
  color: var(--ink);
  font: italic 400 clamp(21px, 2.2vw, 28px)/1.35 var(--serif);
}
.flash-content p { color: var(--ink-2); }
.flash-content p strong { color: var(--ink); }
.reveal-box {
  margin-top: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-3);
}
.reveal-box h3 { font-size: 30px; }

/* ---------- Quiz ---------- */

.quiz-box { padding: clamp(1.1rem, 4vw, 2.2rem); }
.quiz-progress {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  color: var(--muted);
  font: 400 12px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.question-card h3 { font-size: clamp(25px, 3vw, 37px); line-height: 1.15; }
.question-card > p { color: var(--ink-2); }
.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1.25rem;
}
.answer-btn {
  width: 100%;
  min-height: 60px;
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--bg-3);
  font: 16px/1.35 var(--sans);
  text-align: left;
}
.answer-btn:hover:not(:disabled) { border-color: var(--amber); }
.answer-btn:disabled { color: var(--ink-2); }
.answer-btn.is-correct { color: #fff; background: var(--good); border-color: #57a67b; }
.answer-btn.is-wrong { color: #fff; background: var(--bad); border-color: #c0625a; }
.feedback {
  margin-top: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
  background: var(--bg-3);
}
.feedback strong { color: var(--ink); }
.feedback .fact__source { margin-top: 0.35rem; }
.tf-fact {
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr);
  gap: 0.55rem;
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
  background: var(--bg-3);
  font-size: 16.5px;
}

/* ---------- Sources ---------- */

.source-panel { margin-bottom: 1rem; padding: 1.3rem 1.4rem; }
.source-panel h3 { margin: 0 0 0.6rem; font-size: 26px; }
.source-panel h3:not(:first-child) { margin-top: 1.4rem; }
.source-panel p, .source-panel li { color: var(--ink-2); }
.source-panel ul { margin-top: 0.25rem; }
.fact-sources h4 {
  margin: 1.2rem 0 0.6rem;
  color: var(--amber);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.fact-sources__method { color: var(--ink); }
.fact-status-list { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.domain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.domain-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.3rem 0.4rem 0.3rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13.5px;
}
.domain-list__host { overflow-wrap: anywhere; }
.domain-list__count {
  min-width: 1.7rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  color: var(--on-amber);
  background: var(--amber);
  font: 500 12px/1.4 var(--mono);
  text-align: center;
}
.credits-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
table { width: 100%; min-width: 720px; border-collapse: collapse; }
.credits-table table { min-width: 760px; }
th, td { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th {
  color: var(--muted);
  font: 500 11.5px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
td { color: var(--ink-2); font-size: 15px; }
td strong { color: var(--ink); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Map of places (MapLibre GL 4.7.1, loaded with the map view) ---------- */

.place-map {
  position: relative;
  /* Room for the sticky navigation when the app scrolls the map into view. */
  scroll-margin-top: 4.5rem;
  height: min(62vh, 560px);
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #1a201d;
}
.map-status { display: none; margin: 0.75rem 0 0; color: var(--muted); font-weight: 600; }
.map-status.is-visible { display: block; }
.place-list { margin-top: 1rem; }
.place-list h3 { margin: 0 0 0.35rem; font-size: 26px; }
.place-list__count { margin: 0 0 0.8rem; color: var(--muted); }
.place-list__items {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.place-list__items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.place-list__items li:last-child { border-bottom: 0; }
.place-list__text { display: grid; min-width: 0; }
.place-list__text .latin { font-size: 15px; overflow-wrap: anywhere; }
.place-list__name {
  min-height: 44px;
  padding: 0.35rem 0;
  border: 0;
  color: var(--ink);
  background: none;
  font: 400 21px/1.15 var(--serif);
  text-align: left;
  text-decoration: underline 1px rgba(233, 164, 59, 0.55);
  text-underline-offset: 5px;
}
.place-list__name:hover { color: var(--amber-2); }
.place-list__card { flex: 0 0 auto; min-height: 44px; padding: 0.5rem 0.9rem; }
.map-source-note { margin: 0.8rem 0 0; color: var(--muted); font-size: 13.5px; }
.place-map .maplibregl-popup-content {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--bg-2);
  font-family: var(--sans);
  box-shadow: var(--shadow);
}
.place-map .maplibregl-popup-anchor-top .maplibregl-popup-tip,
.place-map .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.place-map .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--bg-2); }
.place-map .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.place-map .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.place-map .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--bg-2); }
.place-map .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--bg-2); }
.place-map .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--bg-2); }
.place-map .maplibregl-popup-close-button {
  width: 32px;
  height: 32px;
  color: var(--ink-2);
  font-size: 1.25rem;
}
.place-map .maplibregl-popup-close-button:hover { color: var(--amber-2); background: transparent; }
.map-popup { display: grid; gap: 0.3rem; padding-right: 1.2rem; color: var(--ink); }
.map-popup__name { font: 400 21px/1.15 var(--serif); }
.map-popup .latin { font-size: 15px; }
.map-popup__open { justify-self: start; min-height: 40px; margin-top: 0.4rem; padding: 0.5rem 0.9rem; }
.map-popup__list { margin: 0; padding-left: 1.1rem; }
.map-popup__list button {
  min-height: 40px;
  padding: 0.3rem 0;
  border: 0;
  color: var(--amber-2);
  background: none;
  font: 600 15px/1.3 var(--sans);
  text-align: left;
  text-decoration: underline;
}

/* ---------- Toast and footer ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 60;
  max-width: min(92vw, 520px);
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  color: var(--bg);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 600;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 1rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }

/* The "Made by Robert Oroloko" sticker is dark ink on a transparent background, so it sits on an ivory plaque. */
.site-footer {
  display: flex;
  justify-content: center;
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--line);
}
.site-footer__plaque {
  width: min(100%, 760px);
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius);
  background: #efe8d8;
  box-shadow: 0 0 0 1px rgba(233, 164, 59, 0.35), 0 18px 40px rgba(0, 0, 0, 0.35);
}
.site-footer img { width: 100%; height: auto; }

/* ---------- Page for an address that leads nowhere (404.html) ---------- */

.not-found { padding-block: clamp(48px, 9vw, 120px) clamp(40px, 6vw, 80px); }
.not-found h1 {
  max-width: 14em;
  margin: 1.1rem 0 1.4rem;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.96;
}
.not-found__en { margin: 0.6rem 0 0; color: var(--muted); font-size: 15px; }
.not-found__drawers { margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: 1.5rem; border-top: 1px solid var(--line); }
.not-found__drawers ul {
  margin: 0.5rem 0 0;
  padding: 0;
  columns: 3 220px;
  column-gap: 2rem;
  list-style: none;
}
.not-found__drawers li { padding: 0.35rem 0; break-inside: avoid; }
.not-found__drawers a {
  color: var(--ink);
  font: 400 24px/1.25 var(--serif);
  text-decoration: none;
}
.not-found__drawers a:hover { color: var(--amber-2); }
.not-found__drawers span { margin-left: 0.4rem; color: var(--muted); font: 400 11.5px/1 var(--mono); letter-spacing: 0.06em; }

/* ---------- Narrower screens ---------- */

@media (max-width: 1180px) {
  .drawer__name { font-size: 27px; }
  .drawer__teaser { font-size: 13px; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .shelf__drawers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* An odd shelf opens with one wide drawer, so every row stays full. */
  .shelf__drawers--odd > :first-child { grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flash-inner { grid-template-columns: 1fr; }
  .flash-visual { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .topbar__inner { min-height: 58px; }
  .wordmark { font-size: 20px; }
  .hero { padding-top: 28px; }
  .hero h1 { font-size: clamp(44px, 13vw, 60px); }
  .hero__actions > * { flex: 1 1 auto; }
  .hero__stats strong { font-size: 30px; }
  .section-head { flex-direction: column; align-items: start; margin-bottom: 1.5rem; }
  .drawer { min-height: 200px; }
  .drawer__name { font-size: 24px; }
  .drawer__teaser { display: none; }
  .collection-bar__inner { min-height: 0; padding: 2rem 0 1.5rem; }
  .notice { flex-direction: column; gap: 0.25rem; }
  .nav-btn { min-height: 48px; padding: 0 0.75rem; }
  .chips {
    flex-wrap: nowrap;
    margin-inline: calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .chip { flex: 0 0 auto; }
  .card-grid, .answers { grid-template-columns: 1fr; }
  .m-card__visual, .visual-fallback { aspect-ratio: 16 / 10; }
  .card-actions button { min-height: 44px; }
  .mushroom-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .dialog-body { padding: 1rem; }
  th, td { padding: 0.65rem; font-size: 14px; }
  .credits-table table { min-width: 640px; }
  .place-map { height: 58vh; }
  .about-card { padding: 1.25rem; }
  .site-footer { padding-block: 2rem 2.5rem; }
  .site-footer__plaque { padding: 0.7rem 0.9rem; }
}

/* Phones: the cabinet becomes a row of tiles to swipe through. */
@media (max-width: 560px) {
  .cabinet {
    display: flex;
    gap: 10px;
    aspect-ratio: auto;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .cabinet::-webkit-scrollbar { display: none; }
  .specimen { flex: 0 0 80%; height: 340px; scroll-snap-align: start; }
  .specimen .specimen__note { display: block; }
  .specimen--1 .specimen__name { font-size: 26px; }
}

@media (max-width: 380px) {
  .hero__actions > * { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .nav-btn { padding: 0 0.6rem; font-size: 12px; }
}

/* True or false keeps its two answers side by side on every screen. */
.answers--tf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.answers--tf .answer-btn { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
