:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --ink: #1f1a16;
  --muted: #6f655c;
  --line: #e9e1d6;
  --accent: #c2562f;
  --accent-ink: #fff7ee;
  --chip: #f2ebe1;
  --shadow: 0 1px 2px rgba(40, 25, 10, .06), 0 8px 24px rgba(40, 25, 10, .08);
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110f;
    --surface: #1d1916;
    --ink: #f3ece4;
    --muted: #a99d91;
    --line: #2e2823;
    --accent: #e0774c;
    --accent-ink: #1a0f08;
    --chip: #27211d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--serif); }
.brand svg { width: 30px; height: 30px; }
.brand svg rect { fill: var(--accent); }
.brand svg path, .brand svg circle { fill: var(--accent-ink); }
.brand em { font-style: italic; font-weight: 400; color: var(--accent); }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted);
  padding: 6px 12px; border-radius: 999px;
}
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.active { color: var(--ink); background: var(--chip); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: min(72vh, 620px);
  display: flex; align-items: flex-end;
  padding: clamp(24px, 6vw, 72px) clamp(16px, 4vw, 48px);
  color: #fff;
  overflow: hidden;
  background: #2a2019;
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.04); animation: drift 30s ease-in-out infinite alternate; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 20%, rgba(10,6,3,.72) 100%); }
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 600; opacity: .85; margin: 0 0 8px; }
.hero h1 { font: 600 clamp(44px, 9vw, 104px)/.95 var(--serif); margin: 0; letter-spacing: -.02em; }
.hero h1 em { font-weight: 400; }
.hero .lede { font-size: clamp(16px, 2vw, 20px); max-width: 560px; margin: 16px 0 20px; opacity: .92; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stats span { background: rgba(255,255,255,.16); backdrop-filter: blur(6px); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; }
@keyframes drift { to { transform: scale(1.12) translate(-1%, -1%); } }

/* ---------- sections ---------- */
.section { padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 48px); max-width: 1400px; margin: 0 auto; width: 100%; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { font: 600 clamp(26px, 3.5vw, 36px)/1.1 var(--serif); margin: 0; }
.search {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 999px; font: inherit; font-size: 14px; width: min(280px, 100%);
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- destination cards ---------- */
.dest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.card {
  position: relative; display: block; text-decoration: none;
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow); aspect-ratio: 4 / 5;
  transition: transform .35s ease, box-shadow .35s ease;
}
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.card:hover { transform: translateY(-4px); }
.card:hover img { transform: scale(1.06); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.card-body {
  position: absolute; inset: auto 0 0 0; padding: 22px 20px 18px; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(8,5,2,.82));
}
.card-date { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; opacity: .85; }
.card h3 { font: 600 28px/1.1 var(--serif); margin: 4px 0 6px; }
.card-meta { font-size: 13px; opacity: .85; margin: 0; }
.card-empty { display: grid; place-items: center; height: 100%; background: var(--chip); color: var(--muted); }

/* ---------- destination page ---------- */
.trail-hero { min-height: min(56vh, 480px); }
.back { display: inline-flex; gap: 6px; align-items: center; color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; opacity: .9; margin-bottom: 18px; }
.back:hover { opacity: 1; }
.story { max-width: 720px; font: 400 clamp(17px, 1.8vw, 20px)/1.65 var(--serif); color: var(--ink); margin: 0 0 28px; white-space: pre-line; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; cursor: pointer; color: var(--muted);
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.masonry { display: flex; gap: 14px; align-items: flex-start; }
.mcol { flex: 1; min-width: 0; }
.tile {
  position: relative; display: block; width: 100%; padding: 0; margin: 0 0 14px; border: 0;
  border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--chip);
}
.tile img { width: 100%; height: auto; transition: transform .6s ease, opacity .4s ease; opacity: 0; }
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.03); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.play {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.play span {
  width: 58px; height: 58px; border-radius: 50%; background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: grid; place-items: center; color: #fff; font-size: 20px; padding-left: 4px;
}
.dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 6px; font-weight: 500; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(8, 6, 4, .95);
  display: grid; grid-template-columns: 64px 1fr 64px; grid-template-rows: 1fr auto; align-items: center;
}
.lightbox[hidden] { display: none; }
.lb-stage { grid-column: 2; grid-row: 1; height: 100%; display: grid; place-items: center; padding: 56px 0 8px; min-width: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 4px; }
.lb-stage iframe, .lb-stage video { width: min(100%, 1280px); aspect-ratio: 16 / 9; max-height: calc(100vh - 120px); border: 0; border-radius: 6px; background: #000; }
.lb-stage iframe.portrait, .lb-stage video.portrait { width: auto; height: calc(100vh - 120px); aspect-ratio: 9 / 16; }
.lb-btn { background: rgba(255,255,255,.08); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; cursor: pointer; justify-self: center; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-prev { grid-column: 1; grid-row: 1; }
.lb-next { grid-column: 3; grid-row: 1; }
.lb-close { position: absolute; top: 12px; right: 12px; font-size: 18px; z-index: 2; }
.lb-caption { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-between; gap: 16px; color: #d9cfc4; font-size: 13px; padding: 10px 20px 16px; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .lightbox { grid-template-columns: 0 1fr 0; }
  .lb-prev, .lb-next { position: absolute; bottom: 10px; z-index: 2; }
  .lb-prev { left: 16px; } .lb-next { right: 16px; }
  .lb-caption { padding: 10px 76px 22px; flex-direction: column; gap: 2px; text-align: center; }
  .masonry { gap: 8px; }
  .tile { margin-bottom: 8px; }
}

/* ---------- misc ---------- */
.about { max-width: 720px; font: 400 clamp(18px, 2vw, 22px)/1.7 var(--serif); }
.notice { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 20px 24px; max-width: 720px; }
.notice h3 { margin: 0 0 6px; font: 600 20px var(--serif); }
.notice code { background: var(--chip); padding: 1px 6px; border-radius: 4px; font-size: 14px; }
.demo-banner { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 13px; font-weight: 500; padding: 7px 16px; }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.loading .spinner { border-color: var(--line); border-top-color: var(--accent); margin-bottom: 12px; }
.skeleton { background: linear-gradient(90deg, var(--chip), var(--line), var(--chip)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 24px clamp(16px, 4vw, 48px); color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

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