/* ------------------------------------------------------------
   CORE — shared across every page: reset, type, nav, drawer,
   page-transition curtain, film grain.
------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Inter:wght@300;400;500&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-raised: #111111;
  --fg: #f4f2ee;
  --fg-dim: rgba(244, 242, 238, 0.62);
  --fg-faint: rgba(244, 242, 238, 0.35);
  --accent: #d8c9a3;
  --line: rgba(244, 242, 238, 0.12);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.65, 0, 0.35, 1);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  appearance: none;
  -webkit-appearance: none;
}

/* ---------- Film grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Page transition curtain ---------- */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #050505;
  pointer-events: none;
  transform-origin: bottom;
  transform: scaleY(0);
}

.curtain.is-covering {
  transform: scaleY(1);
  transition: transform 0.7s var(--ease-soft);
}

.curtain.is-revealing {
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 0.9s var(--ease-soft) 0.05s;
}

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px clamp(20px, 5vw, 56px);
  z-index: 900;
}

.site-nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 140px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  pointer-events: none;
  z-index: -1;
}

.site-nav__logo {
  font-family: var(--font-serif);
  font-size: 2.35rem;
  letter-spacing: normal;
}

.site-nav__right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav__count {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}

.menu-toggle {
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.menu-toggle span {
  display: block;
  width: 32px;
  height: 2.5px;
  background: var(--fg);
  border-radius: 1px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

body.drawer-open .menu-toggle span:nth-child(1) {
  transform: translateY(5.25px) rotate(45deg);
}
body.drawer-open .menu-toggle span:nth-child(2) {
  transform: translateY(-5.25px) rotate(-45deg);
}

/* ---------- Drawer ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 940;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
body.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(420px, 88vw);
  background: rgba(9, 9, 9, 0.97);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--line);
  z-index: 950;
  transform: translateX(100%);
  transition: transform 0.6s var(--ease-soft);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 70px clamp(28px, 6vw, 60px) 20px;
  overflow-y: auto;
}

body.drawer-open .drawer { transform: translateX(0); }

.drawer__close {
  position: absolute;
  top: 26px;
  right: clamp(20px, 5vw, 56px);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg-dim);
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
}

.drawer__close:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

.drawer__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.drawer__section + .drawer__section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.drawer__label {
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 18px;
}

.drawer__link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  padding: 5px 0;
  color: var(--fg-dim);
  text-align: left;
  transform: translateX(0);
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
  will-change: transform;
}

.drawer__link:hover,
.drawer__link.is-active {
  color: var(--accent);
  transform: translateX(10px);
}

.drawer__link .idx {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--fg-faint);
}

.drawer__trip-link {
  font-size: 1.1rem;
}

/* Journeys accordion toggle */
.drawer__accordion-toggle {
  justify-content: space-between;
  cursor: pointer;
}

.drawer__accordion-icon {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--fg-faint);
  transition: transform 0.4s var(--ease);
}

.drawer__accordion-toggle.is-open .drawer__accordion-icon {
  transform: rotate(45deg);
}

.drawer__accordion {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-soft);
  border-left: 1px solid var(--line);
  margin-left: 4px;
  padding-left: 18px;
}

.drawer__accordion.is-open {
  max-height: 400px;
}

.drawer__accordion .drawer__trip-link {
  padding: 4px 0;
}

.drawer__trip-group + .drawer__trip-group {
  margin-top: 12px;
}

.drawer__trip-group-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--fg);
  margin-bottom: 2px;
}

.drawer__trip-sublink {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--fg-faint);
  padding: 3px 0 3px 20px;
  transform: translateX(0);
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
}

.drawer__trip-sublink:hover,
.drawer__trip-sublink.is-active {
  color: var(--accent);
  transform: translateX(6px);
}

.drawer__meta {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--fg-faint);
  line-height: 1.5;
}

/* ---------- Shared utility ---------- */
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 5px;
  cursor: pointer;
}

/* ---------- Site footer (every page) ---------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--line);
  padding: clamp(50px, 8vh, 90px) clamp(24px, 8vw, 100px) clamp(30px, 5vh, 50px);
  background: var(--bg-raised);
}

.site-footer__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: clamp(30px, 5vh, 50px);
}

.site-footer__logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  letter-spacing: normal;
}

.site-footer__tagline {
  font-size: 0.85rem;
  color: var(--fg-faint);
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: clamp(20px, 3.5vh, 32px);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--fg-faint);
}

.site-footer__links {
  display: flex;
  gap: 28px;
}

.site-footer__links a {
  transition: color 0.3s var(--ease);
}
.site-footer__links a:hover { color: var(--accent); }

.site-footer__social {
  display: flex;
  gap: 16px;
}

.site-footer__icon-link {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--fg-dim);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.site-footer__icon-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.site-footer__icon-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

/* ---------- Gallery tab (left edge, every page that has a gallery) ---------- */
.gallery-tab {
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 500;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 16px 14px;
  background: rgba(9, 9, 9, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-left: none;
  border-radius: 0 2px 2px 0;
  color: var(--fg-dim);
  transition: color 0.3s var(--ease), padding-left 0.3s var(--ease), background 0.3s var(--ease);
}

.gallery-tab:hover {
  color: var(--accent);
  padding-left: 22px;
  background: rgba(9, 9, 9, 0.8);
}

.gallery-tab__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.gallery-tab__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.gallery-tab__text {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

@media (max-width: 720px) {
  .gallery-tab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .curtain, .drawer, .menu-toggle span { transition: none !important; }
}
