/* Night study: dark green, warm paper, brass. */
:root {
  --bg: #0d1210;
  --bg-raised: #141b18;
  --surface: #18211d;
  --text: #ece5d8;
  --muted: #a49d8d;
  --border: rgba(236, 229, 216, 0.12);
  --accent: #d2b07a;
  --accent-strong: #e8c992;
  --green: #2c4638;
  --radius: 10px;
  --max: 1120px;
  --prose: 68ch;
  --font: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
strong, b { font-weight: 600; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 60% 40% at 12% -5%, rgba(210, 176, 122, 0.10), transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(44, 70, 56, 0.35), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 17px/1.7 var(--font);
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 500; line-height: 1.2; letter-spacing: 0.005em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.75rem); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.72rem; color: var(--muted); }

/* admin bar: floating pill, keeps full-screen pages intact */
.admin-bar {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(13, 18, 16, 0.88);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  font-size: 0.82rem;
}
.admin-bar a { color: var(--text); text-decoration: none; }
.admin-bar a:hover { color: var(--accent); }
.admin-bar-warn { color: #1d1608; background: var(--accent); padding: 0.05rem 0.55rem; border-radius: 999px; font-weight: 500; }

/* header + footer */
.site-header { position: relative; z-index: 2; }
.header-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; padding-top: 1.9rem; padding-bottom: 1.9rem; }
.brand { color: var(--text); text-decoration: none; display: flex; flex-direction: column; gap: 0.15rem; }
.brand:hover { color: var(--text); }
.brand-title { font-weight: 400; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.18em; }
.brand-tagline { font-weight: 300; font-size: 0.85rem; letter-spacing: 0.04em; opacity: 0.85; }
.site-nav { display: flex; gap: clamp(1.25rem, 3vw, 3rem); flex-wrap: wrap; padding-top: 0.15rem; }
.site-nav a { color: var(--text); text-decoration: none; font-size: 0.92rem; letter-spacing: 0.04em; opacity: 0.88; }
.site-nav a:hover, .site-nav a[aria-current] { opacity: 1; color: var(--accent); }
.site-main { padding-top: 2rem; padding-bottom: 5rem; min-height: 62vh; }
.site-footer { border-top: 1px solid var(--border); padding: 1.6rem 0; color: var(--muted); font-size: 0.85rem; }
.site-footer p { margin: 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem 2rem; flex-wrap: wrap; }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: 0.82rem; letter-spacing: 0.04em; }
.footer-nav a:hover, .footer-nav a[aria-current] { color: var(--accent); }

/* page building blocks */
.page-head { margin-bottom: 2.5rem; }
.page-head h1 { margin: 0.25rem 0 0; font-size: clamp(2rem, 4.5vw, 3rem); }
.lead { font-size: 1.2rem; font-weight: 300; color: var(--muted); margin-top: 0.5rem; }
.meta { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; margin: 0 0 0.4rem; }
.meta a { color: inherit; }
.section { margin-top: 3.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.hero { padding: 2rem 0 1rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.2s, transform 0.2s; }
.card:hover { border-color: rgba(210, 176, 122, 0.45); transform: translateY(-2px); }
.card-media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 1.15rem 1.3rem 1.35rem; }
.card-body h3 { margin: 0 0 0.45rem; font-size: 1.2rem; }
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body p { margin: 0 0 0.5rem; }

.tags { margin: 0.6rem 0 0; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag { font-size: 0.78rem; letter-spacing: 0.03em; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0.05rem 0.65rem; text-decoration: none; }
a.tag:hover { color: var(--accent); border-color: var(--accent); }
.tag.draft { color: #1d1608; background: var(--accent); border-color: var(--accent); }

.post-list { display: flex; flex-direction: column; gap: 2.5rem; max-width: 860px; }
.post-item { display: grid; grid-template-columns: 220px 1fr; gap: 1.75rem; align-items: start; }
.post-item:not(:has(.post-thumb)) { grid-template-columns: 1fr; }
.post-item h2 { margin: 0 0 0.4rem; font-size: 1.5rem; }
.post-item h2 a { color: var(--text); text-decoration: none; }
.post-item h2 a:hover { color: var(--accent); }
.post-item p { margin: 0 0 0.4rem; }
.post-thumb img { border-radius: 8px; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
@media (max-width: 640px) { .post-item { grid-template-columns: 1fr; } }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; max-width: 860px; }

.article { max-width: var(--prose); margin: 0 auto; }
.article.wide { max-width: 940px; }
.article-head { margin-bottom: 2rem; }
.article-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0.3rem 0 0.5rem; }
.cover { margin: 1.75rem 0; }
.cover img { border-radius: var(--radius); display: block; }
.links { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.25rem; }
.button { display: inline-block; padding: 0.45rem 1rem; border: 1px solid var(--accent); border-radius: 999px; text-decoration: none; font-size: 0.9rem; letter-spacing: 0.03em; }
.button:hover { background: var(--accent); color: #1d1608; }
.subpages { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.prose h2 { margin-top: 2.4rem; }
.prose img { border-radius: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.prose pre { background: var(--bg-raised); border: 1px solid var(--border); padding: 0.9rem 1rem; border-radius: 8px; overflow-x: auto; font-size: 0.88rem; }
.prose code { font-size: 0.88em; background: var(--bg-raised); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 1.75rem 0; padding-left: 1.1rem; border-left: 2px solid var(--accent); color: var(--muted); font-style: italic; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 0.45rem 0.6rem; text-align: left; }

/* itinerary */
.map { height: 440px; border-radius: var(--radius); border: 1px solid var(--border); margin: 1.75rem 0 2.25rem; z-index: 0; background: var(--bg-raised); }
.map .leaflet-tile { filter: brightness(0.62) saturate(0.55) sepia(0.35) hue-rotate(-8deg); }
.map .leaflet-control-attribution { background: rgba(13, 18, 16, 0.75); color: var(--muted); }
.map .leaflet-control-attribution a { color: var(--accent); }
.timeline { list-style: none; padding: 0; margin: 2.25rem 0 0; }
.stop { display: grid; grid-template-columns: 2.6rem 1fr; gap: 1.1rem; padding-bottom: 2.25rem; position: relative; }
.stop::before { content: ""; position: absolute; left: 1.25rem; top: 2.7rem; bottom: 0.2rem; border-left: 1px dashed rgba(210, 176, 122, 0.45); }
.stop:last-child::before { display: none; }
.stop-index { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 500; }
.stop-body h2 { margin: 0 0 0.2rem; }
.stop-body .meta { margin-top: 0.45rem; }

.error-page { text-align: center; padding: 4rem 0; }
.error-code { font-size: 4.5rem; font-weight: 300; color: var(--accent); margin: 0; letter-spacing: 0.1em; }

.maintenance { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.maintenance-box { max-width: 34rem; text-align: center; }
.maintenance-box h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); margin: 0.75rem 0 1rem; }

/* ------------------------------------------------------------ home scene */

.scene {
  --ratio: 2.3337;
  --focus: 0.45;
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #070a09;
}
.scene-viewport { position: absolute; inset: 0; overflow: hidden; }
/* Covers the screen like object-fit: cover, but keeps hotspots glued to the image. */
.scene-canvas {
  --w: max(100vw, calc(100svh * var(--ratio)));
  position: absolute;
  top: 50%;
  left: clamp(calc(100vw - var(--w)), calc(50vw - var(--w) * var(--focus)), 0px);
  width: var(--w);
  aspect-ratio: var(--ratio);
  transform: translateY(-50%);
}
.scene-canvas img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.scene-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(5, 8, 7, 0.72), transparent 22%),
    linear-gradient(to top, rgba(5, 8, 7, 0.75), transparent 20%);
}
.scene .site-header,
.scene-footer { position: absolute; left: 0; right: 0; z-index: 3; }
.scene .site-header { top: 0; }
.scene .header-inner { max-width: none; }
.scene-footer {
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem clamp(1.25rem, 4vw, 2.75rem);
  align-items: flex-end;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.scene-footer > * { flex: 1; }
.scene-footer > :last-child { text-align: right; }
.scene-footer .footer-nav { flex: 0 1 auto; justify-content: center; pointer-events: auto; }
.scene-footer .footer-nav a { color: var(--text); opacity: 0.75; font-size: 0.75rem; }
.scene-footer .footer-nav a:hover { opacity: 1; color: var(--accent); }
.scene-footer .eyebrow { color: var(--text); opacity: 0.85; font-size: 0.7rem; }
.scene-hint { display: none; }

/* Portrait screens: the room is wider than the screen, so it becomes swipeable. */
@media (max-aspect-ratio: 1/1) {
  .scene-viewport { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .scene-viewport::-webkit-scrollbar { display: none; }
  .scene-canvas { position: relative; top: 0; left: 0; transform: none; height: 100%; width: calc(100svh * var(--ratio)); aspect-ratio: auto; }
  .scene-hint {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 5.5rem;
    white-space: nowrap;
    z-index: 3;
    transform: translateX(-50%);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: rgba(5, 8, 7, 0.6);
    pointer-events: none;
    animation: hint-fade 1s ease 4s forwards;
  }
  .scene-footer { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .scene-footer > :last-child { text-align: left; }
  .scene-footer .footer-nav { justify-content: flex-start; }
}
@keyframes hint-fade { to { opacity: 0; } }
