:root {
  --bg: #0e0e0d;
  --fg: #ece8e1;
  --muted: #9a958c;
  --line: #2a2926;
  --card: #171615;
  --accent: #d9542b;
  --serif: "Songti TC", "Noto Serif TC", "PMingLiU", serif;
  --sans: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--fg); font-family: var(--sans); line-height: 1.7; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hero (home + trip) */
.hero { position: relative; height: 100svh; min-height: 520px; overflow: hidden; }
.hero.short { height: 78svh; }
.hero > img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 55%, rgba(14,14,13,.92) 100%); }
.hero-text { position: absolute; left: 0; right: 0; bottom: 9vh; z-index: 1; text-align: center; padding: 0 24px; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.1rem, 6vw, 4.4rem); letter-spacing: .12em; text-shadow: 0 2px 24px rgba(0,0,0,.5); }
.hero h1 span { display: inline-block; }
.hero p { margin-top: .6em; color: #d8d3ca; letter-spacing: .3em; font-size: clamp(.8rem, 1.6vw, 1rem); }
.scroll-hint { position: absolute; bottom: 2.5vh; left: 50%; transform: translateX(-50%); z-index: 1; color: #bdb8ae; font-size: .75rem; letter-spacing: .3em; text-decoration: none; }

/* Top bar */
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; }
.topbar a { text-decoration: none; font-size: .85rem; letter-spacing: .2em; color: #e8e3da; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.topbar a:hover { color: #fff; }

/* Home: trip cards */
.home-main { max-width: 1280px; margin: 0 auto; padding: 72px 20px 96px; }
.section-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: .14em; margin-bottom: 28px; }
.trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 28px; }
.trip-card { display: block; text-decoration: none; background: var(--card); overflow: hidden; transition: transform .3s; }
.trip-card:hover { transform: translateY(-3px); }
.trip-card .cover { aspect-ratio: 3 / 2; overflow: hidden; background: #222; }
.trip-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.trip-card:hover .cover img { transform: scale(1.04); }
.trip-card .body { padding: 18px 20px 22px; }
.trip-card .date { color: var(--accent); font-size: .8rem; letter-spacing: .25em; }
.trip-card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; letter-spacing: .08em; margin: 4px 0 2px; }
.trip-card .place { color: var(--muted); font-size: .85rem; letter-spacing: .12em; }
.trip-card .summary { color: #bcb7ad; font-size: .9rem; margin-top: 10px; }

/* Trip: nav */
nav.filters { position: sticky; top: 0; z-index: 10; background: rgba(14,14,13,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
nav.filters ul { list-style: none; display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; padding: 10px 12px; max-width: 1400px; margin: 0 auto; }
nav.filters button { background: none; border: 1px solid transparent; color: var(--muted); font: inherit; font-size: .9rem; letter-spacing: .1em; padding: 6px 16px; border-radius: 999px; cursor: pointer; transition: color .2s, border-color .2s; }
nav.filters button:hover { color: var(--fg); }
nav.filters button[aria-pressed="true"] { color: var(--fg); border-color: #57544e; }

/* Trip: albums */
.trip-main { max-width: 1400px; margin: 0 auto; padding: 0 16px 80px; }
.trip-summary { max-width: 46em; margin: 48px auto 0; padding: 0 16px; color: #c9c4ba; text-align: center; }
.album { padding-top: 64px; scroll-margin-top: 56px; }
.album-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; padding: 0 4px; }
.album h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: .1em; }
.album .meta { color: var(--muted); font-size: .85rem; letter-spacing: .15em; }
.album .intro { color: #bcb7ad; max-width: 46em; padding: 0 4px; margin-bottom: 26px; font-size: .95rem; }
.grid { columns: 3 340px; column-gap: 12px; }
.grid figure { break-inside: avoid; margin-bottom: 12px; position: relative; cursor: zoom-in; overflow: hidden; background: #1a1918; }
.grid img { width: 100%; height: auto; transition: transform .6s ease, opacity .5s; opacity: 0; }
.grid img.loaded { opacity: 1; }
.grid figure:hover img { transform: scale(1.03); }
.grid figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 10px; font-size: .85rem; letter-spacing: .06em;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); opacity: 0; transition: opacity .3s; }
.grid figure:hover figcaption, .grid figure:focus-visible figcaption { opacity: 1; }
@media (hover: none) { .grid figcaption { opacity: 1; } }

.more-trips { max-width: 1400px; margin: 0 auto; padding: 24px 20px 72px; border-top: 1px solid var(--line); }
.more-trips .trips { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

footer { border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .8rem; letter-spacing: .12em; padding: 36px 16px 48px; }
footer a { color: var(--muted); }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(8,8,7,.97); display: none; align-items: center; justify-content: center; flex-direction: column; }
.lb.open { display: flex; }
.lb img { max-width: 94vw; max-height: 84svh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb .cap { margin-top: 14px; color: #cfcac1; font-size: .95rem; letter-spacing: .08em; text-align: center; padding: 0 60px; }
.lb .cap small { display: block; color: var(--muted); font-size: .75rem; letter-spacing: .2em; margin-top: 2px; }
.lb button { position: absolute; background: none; border: 0; color: #bdb8ae; cursor: pointer; font-size: 2rem; line-height: 1; padding: 16px; transition: color .2s; }
.lb button:hover { color: #fff; }
.lb .close { top: 8px; right: 12px; font-size: 1.8rem; }
.lb .prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lb .next { right: 6px; top: 50%; transform: translateY(-50%); }
.lb .count { position: absolute; top: 22px; left: 24px; color: var(--muted); font-size: .8rem; letter-spacing: .2em; }

@media (max-width: 640px) {
  .topbar { padding: 14px 16px; }
  .hero p { letter-spacing: .12em; }
  .trips { grid-template-columns: 1fr; gap: 20px; }
  nav.filters ul { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  nav.filters ul::-webkit-scrollbar { display: none; }
  nav.filters button { white-space: nowrap; padding: 6px 12px; }
  .grid { columns: 2 150px; column-gap: 6px; }
  .grid figure { margin-bottom: 6px; }
  .lb .prev, .lb .next { display: none; }
  .lb .cap { padding: 0 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grid img, .trip-card, .trip-card .cover img { transition: none; }
}
