:root {
  /* Provisional identity: replace these tokens when the final identity arrives. */
  --paper: #f2eadb;
  --paper-strong: #e8dcc7;
  --ink: #1e2922;
  --muted: #687069;
  --line: #cfc2ac;
  --accent: #d94d2b;
  --accent-dark: #a9341a;
  --white: #fffdf8;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", Arial, sans-serif;
  --header-height: 72px;
  --tabs-height: 0px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--font-body); }
button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-150%); background: var(--ink); color: var(--white); }
.skip-link:focus { transform: translateY(0); }

.site-header { height: var(--header-height); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--paper); position: relative; z-index: 20; }
.header-start { min-width: 0; display: flex; align-items: center; justify-self: start; gap: 12px; }
.list-toggle { width: 44px; height: 44px; display: grid; place-items: center; justify-self: start; padding: 0; border: 0; background: transparent; cursor: pointer; }
.list-toggle:hover { color: var(--accent-dark); }
.list-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.list-toggle-panel { transition: opacity .15s ease; }
.list-toggle-arrow { transform-origin: center; transition: transform .15s ease; }
.list-toggle[aria-expanded="true"] .list-toggle-arrow { transform: rotate(180deg); }
.list-toggle[aria-expanded="false"] .list-toggle-panel { opacity: .25; }
.language-switcher { min-height: 44px; display: flex; align-items: center; color: var(--muted); font-size: .68rem; font-weight: 500; letter-spacing: .08em; }
.language-switcher a { min-width: 25px; min-height: 44px; display: grid; place-items: center; color: inherit; text-decoration: none; }
.language-switcher span { opacity: .45; }
.language-switcher a:hover { color: var(--accent-dark); }
.language-switcher a[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.wordmark { min-width: 0; display: flex; align-items: center; justify-self: center; text-decoration: none; }
.wordmark img { display: block; width: 140px; max-width: 100%; height: auto; max-height: 53px; object-fit: contain; }
.place { margin: 0; color: var(--muted); font-size: .86rem; letter-spacing: .06em; }
.about-button { justify-self: end; min-height: 44px; min-width: 56px; padding: 0; border: 0; border-bottom: 1px solid var(--ink); background: transparent; cursor: pointer; }
.about-button:hover { color: var(--accent-dark); border-color: var(--accent-dark); }

.about-panel { position: fixed; z-index: 40; top: var(--header-height); right: 0; width: min(430px, 100%); padding: 48px 40px; background: var(--ink); color: var(--white); box-shadow: -18px 20px 50px rgb(30 41 34 / 20%); }
.about-panel h1 { margin: 4px 0 24px; font: 600 3.2rem/1 var(--font-display); }
.about-panel p { line-height: 1.65; }
.about-panel a { color: inherit; text-underline-offset: 3px; }
.about-close { position: absolute; top: 10px; right: 16px; width: 44px; height: 44px; border: 0; background: transparent; color: inherit; font-size: 2rem; cursor: pointer; }
.data-note { color: #c9d0c9; font-size: .82rem; }

.explorer { height: calc(100dvh - var(--header-height)); display: grid; grid-template-columns: minmax(320px, 380px) 1fr; grid-template-areas: "list map"; }
.map-region { grid-area: map; position: relative; min-width: 0; background: #d8ded5; }
#map { width: 100%; height: 100%; }
.map-status, .map-error { position: absolute; z-index: 5; top: 18px; left: 50%; transform: translateX(-50%); padding: 10px 14px; background: var(--white); border: 1px solid var(--line); font-size: .82rem; box-shadow: 0 3px 16px rgb(30 41 34 / 12%); }
.map-error { display: grid; gap: 3px; min-width: min(380px, calc(100% - 32px)); }
.map-error[hidden], .map-status[hidden] { display: none; }
.locate-button { position: absolute; z-index: 4; right: 14px; bottom: 48px; min-height: 46px; padding: 0 15px; border: 1px solid var(--ink); background: var(--white); cursor: pointer; box-shadow: 0 3px 12px rgb(30 41 34 / 14%); }
.locate-button:hover { background: var(--ink); color: var(--white); }

.collection { grid-area: list; min-width: 0; overflow-y: auto; padding: 38px 26px 20px; border-right: 1px solid var(--line); background: var(--paper); }
.collection-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.eyebrow { margin: 0 0 10px; color: var(--accent-dark); font-size: .7rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.collection h1 { margin: 0; font: 600 clamp(2.3rem, 4vw, 3.7rem)/.92 var(--font-display); letter-spacing: -.04em; }

.instruction { max-width: 27ch; margin: 26px 0 20px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.artwork-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.artwork-item { border-bottom: 1px solid var(--line); }
.artwork-card { width: 100%; min-height: 82px; display: grid; grid-template-columns: 1fr 24px; align-items: center; gap: 10px; padding: 10px 2px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.artwork-card:hover .artwork-title, .artwork-card[aria-expanded="true"] .artwork-title { color: var(--accent-dark); }
.artwork-copy { display: grid; gap: 6px; }
.artwork-title { white-space: pre-line; font: 600 1.2rem/1.1 var(--font-display); transition: color .15s ease; }
.artwork-artist { color: var(--ink); font-size: .78rem; font-weight: 600; line-height: 1.3; }
.artwork-type { width: fit-content; padding: 3px 6px; background: var(--paper-strong); color: var(--accent-dark); font-size: .66rem; font-weight: 600; line-height: 1.2; }
.artwork-address { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.artwork-arrow { font-size: 1rem; transform: rotate(45deg); transition: transform .2s ease; }
.artwork-card[aria-expanded="true"] .artwork-arrow { transform: rotate(135deg); }
.artwork-detail { padding: 0 24px 18px 0; }

.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-actions a, .detail-actions button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--ink); background: transparent; color: var(--ink); text-decoration: none; cursor: pointer; }
.detail-actions a:hover, .detail-actions button:hover { background: var(--ink); color: var(--white); }
.list-footer { display: flex; flex-direction: column; gap: 3px; margin-top: 24px; color: var(--muted); font-size: .62rem; }
.list-footer a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.list-footer a:hover { color: var(--ink); }

.ispera-marker { width: 44px; height: 44px; display: grid; place-items: end center; padding: 0; border: 0; background: transparent; color: var(--white); cursor: pointer; filter: drop-shadow(0 3px 4px rgb(30 41 34 / 34%)); }
.marker-pin { width: 28px; height: 36px; overflow: visible; transition: transform .15s ease; }
.marker-shape { fill: var(--accent); stroke: var(--white); stroke-width: 1.7; }
.marker-center { fill: var(--white); }
.ispera-marker:hover .marker-pin, .ispera-marker.is-active .marker-pin { transform: scale(1.14) translateY(-1px); }
.ispera-marker.is-active .marker-shape { fill: var(--ink); }
.user-marker { width: 18px; height: 18px; border: 4px solid var(--white); border-radius: 50%; background: #2373d2; box-shadow: 0 0 0 2px #2373d2, 0 3px 12px rgb(0 0 0 / 25%); }
.maplibregl-ctrl-group { border-radius: 0; }
.maplibregl-popup-content { padding: 14px 36px 14px 16px; border-radius: 0; font-family: var(--font-body); }
.maplibregl-popup-content strong { white-space: pre-line; font-family: var(--font-display); font-size: 1rem; }
.popup-card { display: grid; gap: 5px; min-width: 170px; }
.popup-artist { color: var(--muted); font-size: .78rem; }
.popup-meta { min-width: 170px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.popup-type { width: fit-content; padding: 3px 6px; background: var(--paper-strong); color: var(--accent-dark); font-size: .68rem; font-weight: 600; }
.popup-details, .popup-navigate { width: fit-content; margin-top: 7px; color: var(--accent-dark); font-size: .78rem; font-weight: 600; text-underline-offset: 3px; }
.popup-share { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; margin: -8px -8px -8px 0; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.popup-share svg { width: 18px; height: 18px; fill: var(--white); stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.popup-share:hover { background: var(--paper-strong); color: var(--accent-dark); }

.mobile-tabs { display: none; }
.noscript { position: fixed; z-index: 100; inset: 80px 20px auto; padding: 20px; background: var(--white); border: 2px solid var(--accent); }

@media (min-width: 721px) {
  body[data-list-collapsed="true"] .explorer { grid-template-columns: 1fr; grid-template-areas: "map"; }
  body[data-list-collapsed="true"] .collection { display: none; }
}

@media (max-width: 720px) {
  :root { --header-height: 62px; --tabs-height: 64px; }
  .site-header { grid-template-columns: 1fr auto 1fr; padding: 0 16px; }
  .header-start { gap: 0; }
  .list-toggle { display: none; }
  .wordmark img { width: 116px; max-height: 44px; }
  .explorer { height: calc(100dvh - var(--header-height) - var(--tabs-height)); display: block; }
  .map-region, .collection { width: 100%; height: 100%; }
  .collection { display: none; padding: 26px 20px 90px; border: 0; }
  body[data-view="list"] .map-region { display: none; }
  body[data-view="list"] .collection { display: block; }
  .locate-button { bottom: 64px; }
  .mobile-tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--tabs-height); display: grid; grid-template-columns: 1fr 1fr; padding: 7px max(12px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: var(--paper); border-top: 1px solid var(--line); }
  .mobile-tabs button { min-height: 48px; border: 0; background: transparent; cursor: pointer; }
  .mobile-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
  .mobile-tabs span { color: var(--accent); }
  .about-panel { bottom: var(--tabs-height); overflow-y: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
