:root {
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #172236; }
body {
  min-height: 100vh;
  margin: 0;
  padding: 82px clamp(16px, 5vw, 80px) 26px;
  color: var(--atlas-ink);
  font-family: var(--font-display, Georgia, "Times New Roman", "Songti SC", serif);
  background: radial-gradient(ellipse at 88% 0%, rgba(168, 104, 76, .18), transparent 38%), linear-gradient(145deg, #172236, #1b293b 60%, #211e2a);
}
body.theme-atlas {
  --color-ink: #f8f2ea;
  --color-muted: rgba(248, 242, 234, .68);
  --color-line: rgba(255, 255, 255, .15);
  --color-highlight: #ffd7a6;
  --color-surface: rgba(18, 25, 39, .76);
  --atlas-ink: var(--color-ink);
  --atlas-muted: var(--color-muted);
  --atlas-faint: rgba(248, 242, 234, .42);
  --atlas-line: var(--color-line);
  --atlas-sun: var(--color-highlight);
  --atlas-panel: var(--color-surface);
}
button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--atlas-sun); outline-offset: 4px; }
.skip-link { position: absolute; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-160%); color: #192337; background: var(--atlas-sun); border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.atlas-header { max-width: 1280px; margin: 0 auto 34px; }
.back-link { display: inline-flex; gap: 9px; align-items: center; margin-bottom: 22px; color: var(--atlas-muted); text-decoration: none; font: 500 .8rem/1.4 "Helvetica Neue", Arial, sans-serif; }
.back-link:hover { color: var(--atlas-sun); }
.eyebrow { margin: 0 0 10px; color: var(--atlas-sun); font: 500 .65rem/1.4 "Helvetica Neue", Arial, sans-serif; letter-spacing: .18em; text-transform: uppercase; }
.atlas-header h1 { max-width: 800px; margin: 0; font-size: clamp(2.2rem, 5.2vw, 4.8rem); font-weight: 400; letter-spacing: -.055em; line-height: 1.12; }
.atlas-header h1 em { color: var(--atlas-sun); font-style: normal; }
.atlas-intro { max-width: 570px; margin: 18px 0 0; color: var(--atlas-muted); font-size: clamp(.95rem, 1.5vw, 1.08rem); line-height: 1.8; }
.atlas-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .8fr); gap: clamp(18px, 3vw, 42px); align-items: start; max-width: 1440px; margin: 0 auto; }
.map-column, .memory-column { min-width: 0; }
.map-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; }
.map-heading-row h2, .section-heading h2 { margin: 0; font-size: clamp(1.35rem, 2.4vw, 1.8rem); font-weight: 400; letter-spacing: -.035em; }
.map-hint { margin: 0 0 4px; color: var(--atlas-faint); font: .68rem/1.5 "Helvetica Neue", Arial, sans-serif; }
.map-toolbar { display: grid; justify-items: end; gap: 7px; }
.atlas-overview-button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 5px 12px; border: 1px solid var(--atlas-line); border-radius: 999px; color: var(--atlas-ink); background: rgba(255,255,255,.06); cursor: pointer; font: .65rem/1.3 "Helvetica Neue", Arial, sans-serif; }
.atlas-overview-button[hidden] { display: none; }
.atlas-overview-button:hover { border-color: rgba(255,215,166,.5); color: var(--atlas-sun); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }
.atlas-map { width: 100%; height: min(68vh, 760px); min-height: 480px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 22px; background: #dce6e3; box-shadow: 0 24px 70px rgba(2, 7, 16, .33); }
.atlas-map .leaflet-container { font: inherit; background: #dce6e3; }
.atlas-map .leaflet-control-zoom a { color: #f8f2ea; background: rgba(21, 32, 49, .92); border-color: rgba(255,255,255,.2); }
.atlas-map .leaflet-control-zoom a { display: grid; width: 36px; height: 36px; place-items: center; text-decoration: none; }
.atlas-map .leaflet-control-zoom a:hover { color: var(--atlas-sun); background: #26374d; }
.map-disclaimer { margin: 10px 0 0; color: var(--atlas-faint); font: .69rem/1.6 "Helvetica Neue", Arial, sans-serif; }
.memory-column { display: grid; gap: 18px; }
.atlas-viewer, .memory-index { overflow: hidden; border: 1px solid var(--atlas-line); border-radius: var(--radius-panel, 20px); background: var(--atlas-panel); box-shadow: 0 18px 48px rgba(2,7,16,.2); }
.atlas-viewer { min-height: 330px; }
.atlas-viewer-empty { display: grid; min-height: 330px; margin: 0; padding: 34px; place-items: center; color: var(--atlas-muted); text-align: center; font-size: 1rem; line-height: 1.7; }
.atlas-photo { position: relative; height: min(64vh, 520px); min-height: 300px; margin: 0; background: #223147; }
.atlas-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.atlas-photo-expand { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; color: #fff7ed; background: rgba(17,25,39,.72); cursor: zoom-in; }
.atlas-photo-expand:hover { color: var(--atlas-sun); background: rgba(17,25,39,.92); }
.atlas-photo::after { position: absolute; inset: 45% 0 0; content: ""; background: linear-gradient(transparent, rgba(10, 15, 25, .62)); pointer-events: none; }
.atlas-photo figcaption { position: absolute; z-index: 1; right: 18px; bottom: 15px; color: #fff7ed; font: .7rem/1.4 "Helvetica Neue", Arial, sans-serif; letter-spacing: .08em; }
.atlas-memory-copy { padding: 19px 22px 20px; }
.atlas-place-label { margin: 0 0 8px; color: var(--atlas-sun); font: .65rem/1.4 "Helvetica Neue", Arial, sans-serif; letter-spacing: .09em; }
.atlas-memory-copy h2 { margin: 0; font-size: 1.28rem; font-weight: 400; letter-spacing: -.03em; line-height: 1.3; }
.atlas-memory-copy > p:not(.atlas-place-label) { margin: 9px 0 0; color: var(--atlas-muted); font-size: .84rem; line-height: 1.65; }
.atlas-album-link { display: inline-flex; gap: 7px; align-items: center; margin-top: 12px; color: var(--atlas-sun); font: .68rem/1.4 "Helvetica Neue", Arial, sans-serif; text-decoration: none; }
.atlas-album-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.atlas-navigation { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--atlas-line); color: var(--atlas-faint); font: .67rem/1.4 "Helvetica Neue", Arial, sans-serif; }
.atlas-navigation button { min-height: 44px; padding: 5px 7px; border: 0; border-radius: 8px; color: var(--atlas-ink); background: transparent; cursor: pointer; }
.atlas-navigation button:hover:not(:disabled) { color: var(--atlas-sun); background: rgba(255,255,255,.07); }
.atlas-navigation button:disabled { color: rgba(248,242,234,.28); cursor: default; }
.memory-index { padding: 20px 20px 12px; }
.section-heading { margin-bottom: 14px; }
.section-heading h2 { font-size: 1.15rem; }
.atlas-memory-list { display: grid; gap: 3px; max-height: 356px; margin: 0; padding: 0 4px 4px 0; overflow-y: auto; list-style: none; scrollbar-color: rgba(255,255,255,.24) transparent; scrollbar-width: thin; }
.atlas-memory-link { display: grid; width: 100%; gap: 4px; padding: 11px 12px; border: 1px solid transparent; border-radius: 11px; color: var(--atlas-ink); text-align: left; background: transparent; cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease; }
.atlas-memory-fallback { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 12px; padding: 8px; border: 1px solid transparent; border-radius: 11px; color: var(--atlas-ink); text-decoration: none; transition: background-color 160ms ease, border-color 160ms ease; }
.atlas-memory-fallback:hover, .atlas-memory-fallback:focus-visible { border-color: rgba(255,215,166,.21); background: rgba(255,215,166,.08); }
.atlas-memory-fallback img { display: block; width: 62px; height: 62px; border-radius: 7px; object-fit: cover; }
.atlas-memory-fallback span { display: grid; gap: 4px; }
.atlas-memory-fallback time { color: var(--atlas-faint); font: .62rem/1.4 "Helvetica Neue", Arial, sans-serif; letter-spacing: .04em; }
.atlas-memory-fallback strong { font-size: .85rem; font-weight: 400; line-height: 1.4; }
.atlas-memory-link:hover, .atlas-memory-link[aria-current="true"] { border-color: rgba(255,215,166,.21); background: rgba(255,215,166,.08); }
.atlas-memory-link span, .atlas-memory-link small { color: var(--atlas-faint); font: .62rem/1.4 "Helvetica Neue", Arial, sans-serif; letter-spacing: .04em; }
.atlas-memory-link strong { font-size: .85rem; font-weight: 400; line-height: 1.4; }
.atlas-memory-link small { color: var(--atlas-sun); }
.atlas-footer { max-width: 1440px; margin: 42px auto 0; padding-top: 15px; border-top: 1px solid var(--atlas-line); color: var(--atlas-faint); text-align: center; font: .64rem/1.5 "Helvetica Neue", Arial, sans-serif; letter-spacing: .15em; }
.atlas-marker { border: 0; background: transparent; }
.atlas-marker > span { position: relative; display: grid; width: 42px; height: 48px; place-items: start center; filter: drop-shadow(0 5px 8px rgba(0,0,0,.38)); }
.atlas-marker-pin { width: 42px; height: 48px; color: #fff0d7; stroke-width: 1.55; }
.atlas-marker-count { position: absolute; top: 7px; left: 50%; display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; color: #36272a; background: #fff2df; font: 600 .6rem/1 "Helvetica Neue", Arial, sans-serif; transform: translateX(-50%); }
.atlas-marker--active > span { filter: drop-shadow(0 0 8px rgba(255, 215, 166, .9)) drop-shadow(0 5px 8px rgba(0,0,0,.38)); transform: translateY(-4px) scale(1.12); }
.atlas-marker--active .atlas-marker-pin { color: #ffd7a6; stroke-width: 2.2; }
.atlas-cluster { border: 0; background: transparent; }
.atlas-cluster > span { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #fff0d7; border-radius: 50%; color: #34272b; background: #f2c899; box-shadow: 0 4px 12px rgba(0,0,0,.35); font: 600 .72rem/1 "Helvetica Neue", Arial, sans-serif; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.atlas-cluster:focus-visible { outline: 2px solid #fff0d7; outline-offset: 3px; border-radius: 50%; }
.atlas-marker:focus-visible { outline: 2px solid #fff0d7; outline-offset: 4px; border-radius: 50%; }
.leaflet-marker-icon.atlas-marker { overflow: visible; }
.leaflet-marker-icon.atlas-marker:focus { outline: 2px solid #fff0d7; outline-offset: 2px; border-radius: 50%; }

@media (max-width: 1000px) {
  body { padding-right: clamp(16px, 4vw, 40px); padding-left: clamp(16px, 4vw, 40px); }
  .atlas-layout { grid-template-columns: minmax(0, 1fr); }
  .atlas-map { height: min(62vh, 680px); min-height: 430px; }
  .memory-column { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); align-items: start; }
  .atlas-photo { height: min(64vh, 520px); }
}
@media (max-width: 640px) {
  body { padding: 18px 14px 22px; }
  .atlas-header { margin-bottom: 25px; }
  .back-link { margin-bottom: 18px; }
  .atlas-header h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .atlas-intro { margin-top: 12px; font-size: .9rem; }
  .map-heading-row { align-items: center; }
  .map-hint { max-width: 160px; text-align: right; font-size: .59rem; }
  .atlas-map { height: min(62vh, 570px); min-height: 360px; border-radius: 16px; }
  .memory-column { grid-template-columns: minmax(0, 1fr); }
  .atlas-viewer, .atlas-viewer-empty { min-height: 0; }
  .atlas-photo { height: min(72vh, 520px); min-height: 280px; }
  .memory-index { padding: 18px 14px 10px; }
  .atlas-memory-list { max-height: 310px; }
  .atlas-footer { margin-top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
