@font-face {
  font-family: "DM Sans";
  src: url("./assets/dm-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url("./assets/manrope.woff2") format("woff2");
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #1d2140;
  --orange: #ff6a3d;
  --cream: #f4efe6;
  --paper: #fffdf9;
  --blue: #4748d9;
  --muted: #62667e;
  --line: #dcd8cf;
  --white: #fff;
  --deep-orange: #a63a22;
  --ocean: #e6eafb;
  --map-grid: #777fb12b;
  --map-coast: #ada99f;
  --map-highlight: #fbd9c7;
  --map-highlight-coast: #b68571;
  --map-water-label: #4b5683;
  --sans: "DM Sans", system-ui, sans-serif;
  --display: Manrope, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
a, button, input { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1360px, 90%); margin-inline: auto; }
.site-header, .intro-panel { background: var(--ink); color: var(--white); }
.site-header { border-bottom: 1px solid #ffffff20; }
.site-header :focus-visible, .footer :focus-visible { outline-color: var(--orange); }
.header-inner { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; font: 800 1.25rem/1.05 var(--display); }
.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border: 2px solid currentColor; border-radius: 50%; font: italic 700 23px/1 Georgia, serif; }
.brand small { display: block; font: 600 .625rem/1.2 var(--sans); letter-spacing: .13em; text-transform: uppercase; margin-top: 4px; color: #d6d7e3; white-space: nowrap; }
nav { display: flex; gap: 34px; align-items: center; }
nav a { font-size: .875rem; font-weight: 600; text-decoration: none; padding-block: 23px; position: relative; color: #d6d7e3; }
nav a:hover, nav a.nav-current { color: var(--white); }
nav a.nav-current::after, nav a:hover::after { content: ""; position: absolute; bottom: 15px; left: 0; right: 0; height: 2px; background: var(--orange); }
.short-nav { display: none; }

.intro-panel { position: relative; overflow: hidden; }
.intro-panel::before { content: ""; position: absolute; bottom: -200px; left: -220px; width: 420px; height: 420px; border: 1px solid #ffffff17; border-radius: 50%; pointer-events: none; }
.intro { position: relative; padding: 43px 0 47px; display: flex; gap: clamp(30px, 6vw, 98px); align-items: center; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 800; }
.intro h1 { flex: 0 0 auto; font-size: clamp(3.2rem, 6.25vw, 6rem); line-height: .98; letter-spacing: -.055em; }
.intro h1 span { color: var(--orange); }
.intro p { max-width: 420px; font-size: clamp(1rem, 1.32vw, 1.16rem); color: #d6d7e3; line-height: 1.55; }

#explore, #stories { scroll-margin-top: 18px; }
#explore { padding-top: 24px; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  min-height: 42px; padding: 7px 15px; border: 1px solid var(--line); border-radius: 99px;
  background: transparent; font-weight: 700; font-size: .875rem; white-space: nowrap;
}
.filters button:hover { background: var(--cream); }
.filters button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--white); }
.result-count { color: var(--muted); font-size: .875rem; white-space: nowrap; }

.atlas { display: grid; grid-template-columns: minmax(0, 2.23fr) minmax(310px, 1fr); gap: 16px; align-items: start; }
.map-column { display: flex; flex-direction: column; min-width: 0; }
.map {
  height: clamp(476px, 36.3vw, 525px); position: relative; overflow: hidden; isolation: isolate;
  background: var(--ocean); border: 1px solid #c8cee5; border-radius: 12px;
  cursor: grab; touch-action: none; user-select: none;
}
.map:focus-visible { outline-offset: 3px; }
.map.dragging { cursor: grabbing; }
#basemap, .markers { position: absolute; inset: 0; width: 100%; height: 100%; }
.markers { pointer-events: none; }
.map-marker {
  display: flex; gap: 6px; align-items: center; position: absolute; z-index: 1; min-width: 44px; min-height: 44px;
  background: transparent; border: 0; border-radius: 100px; padding: 4px; pointer-events: auto;
}
.map-marker:hover, .map-marker:focus-visible, .map-marker.selected { z-index: 2; }
.map-marker.right { flex-direction: row-reverse; transform: translateX(-100%); }
.map-marker.local .marker-name { position: absolute; top: 43px; left: 50%; transform: translateX(-50%); }
.map-marker.local.above .marker-name { top: auto; bottom: 43px; }
.marker-dot {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 100%; display: grid; place-items: center;
  background: var(--blue); color: var(--white); border: 2px solid var(--white); box-shadow: 0 2px 7px #1d214044; font-weight: 700; font-size: .9rem;
}
.marker-dot svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.map-marker.philippines .marker-dot { background: var(--orange); color: var(--ink); }
.map-marker.reverse .marker-dot { background: var(--ink); }
.map-marker:hover .marker-dot, .map-marker.selected .marker-dot { box-shadow: 0 0 0 4px #fff8, 0 2px 7px #1d214053; }
.marker-name {
  padding: 4px 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; white-space: nowrap;
  font-size: .78rem; line-height: 1.1; font-weight: 700; color: var(--ink);
}
.map-toolbar {
  position: absolute; z-index: 3; top: 13px; left: 13px; right: 13px; display: flex; align-items: center;
  justify-content: space-between; gap: 6px; pointer-events: none;
}
.map-region, .map-button {
  background: var(--paper); border: 1px solid var(--line); border-radius: 99px; font-size: .875rem; font-weight: 700;
  box-shadow: 0 2px 8px #1d214019;
}
.map-region { display: flex; align-items: center; min-height: 38px; padding: 5px 11px; }
.map-button { display: grid; place-items: center; padding: 0; width: 44px; height: 44px; pointer-events: auto; }
.map-button:hover { background: var(--cream); }
.map-button:disabled { opacity: .55; cursor: default; }
.map-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.view-switch { display: flex; align-items: center; justify-content: center; gap: 6px; width: auto; padding: 0 11px; }
.view-switch svg { width: 17px; height: 17px; }
.map-controls { position: absolute; right: 13px; bottom: 14px; display: grid; gap: 6px; z-index: 3; }
.scale { position: absolute; left: 14px; bottom: 13px; border: 1px solid var(--map-water-label); border-top: 0; text-align: center; color: var(--ink); font-size: .75rem; line-height: 1.3; background: var(--paper); white-space: nowrap; }
.map-error { position: absolute; left: 20px; right: 65px; bottom: 40px; padding: 10px; background: var(--cream); border-radius: 6px; }
.map-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: .8125rem; color: var(--muted); padding: 10px 1px 0; }
.map-foot a { text-underline-offset: 3px; white-space: nowrap; }
.touch-help { display: none; }

.selection {
  min-width: 0; display: flex; flex-direction: column; overflow: hidden; align-self: start;
  border: 1px solid var(--line); border-radius: 12px; background: var(--cream);
  scroll-margin-top: 12px;
}
.selection-photo { width: 100%; aspect-ratio: 1.92; display: block; object-fit: cover; background: #e7dfcf; }
.selection-photo.maina { object-position: 50% 44%; }
.selection-body { padding: 19px 21px 21px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.story-place { display: flex; align-items: center; gap: 5px; color: var(--deep-orange); font-size: .875rem; font-weight: 700; }
.story-place svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; flex-shrink: 0; }
.selection h2 { font-size: clamp(1.65rem, 2.25vw, 2.33rem); letter-spacing: -.045em; line-height: 1.08; }
.story-summary { line-height: 1.54; color: var(--muted); }
.story-meta { color: var(--muted); font-size: .825rem; font-weight: 600; }
.journey-legend { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--blue); }
.journey-legend span { width: 20px; border-top: 2px dashed currentColor; }
.story-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; margin-top: 2px; }
.primary, .secondary {
  min-height: 44px; border: 1px solid var(--orange); padding: 8px 16px; border-radius: 99px;
  background: var(--orange); color: var(--ink); text-decoration: none; font-size: .875rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.primary:hover { background: #ff7d58; border-color: #ff7d58; }
.secondary { background: transparent; border-color: #9a9db0; }
.secondary:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }

.story-section { padding-block: 48px 59px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { font-size: clamp(1.9rem, 3.25vw, 3rem); line-height: 1.05; letter-spacing: -.045em; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); padding-inline: 13px; }
.search svg { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 1.7; flex-shrink: 0; }
.search input { background: transparent; border: none; width: 191px; height: 42px; }
.search:focus-within { outline: 2px solid var(--blue); outline-offset: 1px; }
.search input:focus-visible { outline: none; }
.story-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.story-card {
  text-align: left; display: grid; grid-template-columns: 74px minmax(0,1fr); align-items: center; gap: 12px;
  padding: 10px; background: var(--cream); border: 1px solid var(--line); border-radius: 9px; min-height: 94px;
}
.story-card:hover { border-color: #a69a8a; background: #ebe3d6; }
.story-card[aria-current="true"] { border-color: var(--deep-orange); }
.story-card img { width: 74px; height: 68px; object-fit: cover; border-radius: 5px; }
.story-card span { display: block; color: var(--deep-orange); font-size: .8rem; font-weight: 700; line-height: 1.28; }
.story-card strong { display: block; color: var(--ink); font: 800 1rem/1.23 var(--display); margin-top: 4px; }
.text-button { background: none; border: 0; text-decoration: underline; font-weight: 700; }
.no-stories { padding: 12px 0; color: var(--muted); }
.footer { background: #13162c; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 24px; color: #dedfea; font-size: .875rem; }
.footer a { text-underline-offset: 3px; }

dialog { padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; width: min(590px, calc(100% - 32px)); max-height: calc(100% - 32px); }
dialog::backdrop { background: #1d2140b3; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 13px 19px; gap: 10px; }
.dialog-close { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--paper); border-radius: 99px; font-size: 1.55rem; line-height: 1; }
.dialog-close:hover { background: var(--cream); }
.dialog-photo { display: block; width: 100%; height: clamp(155px, 30vh, 240px); object-fit: cover; }
.dialog-body { padding: 20px 23px 24px; display: grid; gap: 11px; justify-items: start; }
.dialog-body h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.03; letter-spacing: -.036em; }
.dialog-body p { color: var(--muted); }
.dialog-body .map-note { font-size: .875rem; border-left: 2px solid var(--orange); padding-left: 10px; }
.dialog-body .image-note { font-size: .8125rem; }

@media (max-width: 1100px) {
  .shell { width: calc(100% - 64px); }
  .intro { gap: 32px; }
}
@media (max-width: 820px) {
  .shell { width: calc(100% - 44px); }
  .intro { display: block; padding-block: 34px 23px; }
  .intro p { max-width: 560px; margin-top: 12px; }
  .atlas { grid-template-columns: minmax(0, 1fr); }
  .selection { display: grid; grid-template-columns: 36% minmax(0, 1fr); }
  .selection-photo { height: 100%; aspect-ratio: auto; }
  .map { height: 420px; }
  .story-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 66px; gap: 8px; }
  .brand { gap: 6px; }
  .brand strong { font-size: 1.02rem; }
  .brand-mark { width: 35px; height: 35px; font-size: 20px; }
  nav { gap: 17px; }
  nav a { font-size: .875rem; padding-block: 22px; }
  .wide-nav { display: none; }
  .short-nav { display: inline; }
  .intro { padding-top: 25px; }
  .intro h1 { font-size: clamp(2.5rem, 10vw, 3.6rem); }
  .intro p { line-height: 1.42; }
  #explore { padding-top: 16px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .filters button { padding: 6px 9px; min-height: 42px; }
  .result-count { display: none; }
  .filter-bar { margin-bottom: 10px; }
  .map { height: 358px; }
  .map.wide-world { height: 275px; }
  .map-toolbar { top: 8px; left: 8px; right: 8px; }
  .map-controls { right: 8px; bottom: 8px; }
  .map-region, .view-switch { font-size: .8rem; }
  .map-foot { padding-top: 7px; font-size: .755rem; gap: 7px; }
  .selection { display: flex; }
  .selection-photo { height: auto; aspect-ratio: 2.2; }
  .selection-body { padding: 16px; }
  .story-section { padding-block: 34px 35px; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .search { width: 100%; }
  .search input { width: 100%; }
  .story-list { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .footer-inner { display: block; }
  .footer a { display: inline-block; margin-top: 6px; }
}
@media (pointer: coarse) {
  .desktop-help { display: none; }
  .touch-help { display: inline; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background-color 140ms, color 140ms, border-color 140ms; }
}
