/* ==========================================================================
   Nicolas Marincic — travel photography
   One stylesheet. Mobile first. Theme via custom properties.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --bg: #f6f3ee;
  --bg-2: #ece8e1;
  --bg-3: #e2ddd4;
  --fg: #161513;
  --fg-2: #5f5a53;
  --fg-3: #8d877e;
  --line: rgba(22, 21, 19, .12);
  --accent: #8a6a46;
  --header-bg: rgba(246, 243, 238, .9);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 30px rgba(0, 0, 0, .06);

  --f-ui: "Jost", "Helvetica Neue", Arial, sans-serif;
  --f-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;

  --header-h: 68px;
  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1180px;
  --wrap-wide: 1600px;
  --row: 180px;
  --gap: 6px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0e;
    --bg-2: #181816;
    --bg-3: #23221f;
    --fg: #ece8e1;
    --fg-2: #aaa49b;
    --fg-3: #79746c;
    --line: rgba(236, 232, 225, .12);
    --accent: #c9a97f;
    --header-bg: rgba(15, 15, 14, .88);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0e;
  --bg-2: #181816;
  --bg-3: #23221f;
  --fg: #ece8e1;
  --fg-2: #aaa49b;
  --fg-3: #79746c;
  --line: rgba(236, 232, 225, .12);
  --accent: #c9a97f;
  --header-bg: rgba(15, 15, 14, .88);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

@media (min-width: 700px) {
  :root { --row: 240px; --gap: 8px; --header-h: 76px; }
}
@media (min-width: 1100px) {
  :root { --row: 280px; --gap: 10px; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 300 1rem/1.65 var(--f-ui);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 300; line-height: 1.1; margin: 0; letter-spacing: 0; }
p { margin: 0 0 1em; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.i .fill, .i.fill { fill: currentColor; stroke: none; }
.muted { color: var(--fg-2); }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 300;
  background: var(--fg); color: var(--bg); padding: .6em 1em; font-size: .85rem;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--wide { max-width: calc(var(--wrap-wide) + 2 * var(--gutter)); }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  transition: transform .35s var(--ease), background-color .35s, color .35s, border-color .35s;
  height: var(--header-h);
  color: var(--fg);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease), transform .45s var(--ease);
}
.site-header.is-transparent:not(.is-solid) {
  color: #fff;
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header:not(.is-transparent) ~ main { padding-top: var(--header-h); }
.header-inner {
  height: 100%; max-width: calc(var(--wrap-wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 1.5rem;
}
.logo {
  font-family: var(--f-ui); font-weight: 400; font-size: .82rem; letter-spacing: .32em; text-transform: uppercase;
  white-space: nowrap; margin-right: auto;
}
.main-nav { display: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2.2rem; align-items: center; }
.main-nav a, .dd-toggle {
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 400;
  position: relative; display: inline-flex; align-items: center; gap: .3em; padding: .4em 0;
}
.main-nav > ul > li > a::after, .dd-toggle::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.main-nav > ul > li > a:hover::after, .main-nav a[aria-current]::after,
.has-dd.is-active .dd-toggle::after, .dd-toggle:hover::after { transform: scaleX(1); }
.i-chev { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.has-dd { position: relative; }
.main-nav .dd {
  display: block; /* vertical list (the nav's flex row must not apply here) */
  list-style: none; margin: 0; padding: .7rem 0; position: absolute; top: 100%; left: -1.2rem; min-width: 14rem;
  background: var(--bg); color: var(--fg); border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .25s, transform .25s, visibility .25s;
}
.dd a { display: block; padding: .5rem 1.2rem; letter-spacing: .14em; white-space: nowrap; }
.dd a:hover { color: var(--accent); }
.has-dd:hover .dd, .has-dd:focus-within .dd, .dd-toggle[aria-expanded="true"] + .dd { opacity: 1; visibility: visible; transform: none; }
.has-dd:hover .i-chev, .dd-toggle[aria-expanded="true"] .i-chev { transform: rotate(180deg); }

.header-tools { display: flex; align-items: center; gap: .9rem; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; transition: background-color .25s; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.lang-switch { font-size: .74rem; letter-spacing: .18em; font-weight: 400; opacity: .9; padding: .5em .2em; }
.lang-switch .on { opacity: 1; }
.lang-switch .sep { margin: 0 .35em; opacity: .4; }
.lang-switch:hover { opacity: 1; }
.header-tools .lang-switch, .header-tools .theme-toggle { display: none; }

/* theme icon reflects stored preference */
.theme-toggle .i { display: none; }
html:not([data-theme-pref]) .theme-toggle .i-auto,
html[data-theme-pref="auto"] .theme-toggle .i-auto,
html[data-theme-pref="light"] .theme-toggle .i-light,
html[data-theme-pref="dark"] .theme-toggle .i-dark { display: block; }

@media (min-width: 560px) {
  .header-tools .lang-switch, .header-tools .theme-toggle { display: inline-grid; }
  .header-tools .lang-switch { display: inline-block; }
}
@media (min-width: 900px) {
  .main-nav { display: block; }
  .menu-btn { display: none; }
}

/* ---------- mobile menu ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 200; background: var(--bg); color: var(--fg);
  display: flex; flex-direction: column; padding: 0 var(--gutter) 2rem;
  opacity: 0; transition: opacity .35s var(--ease);
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu.is-open { opacity: 1; }
.mobile-menu-top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; flex: none; }
.mobile-menu nav { flex: 1; display: flex; align-items: center; }
.mobile-menu ul { list-style: none; margin: 0; padding: 2rem 0; width: 100%; }
.mobile-menu li { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.mobile-menu.is-open li { opacity: 1; transform: none; }
.mobile-menu.is-open li:nth-child(2) { transition-delay: .04s; } .mobile-menu.is-open li:nth-child(3) { transition-delay: .08s; }
.mobile-menu.is-open li:nth-child(4) { transition-delay: .12s; } .mobile-menu.is-open li:nth-child(5) { transition-delay: .16s; }
.mobile-menu.is-open li:nth-child(6) { transition-delay: .2s; } .mobile-menu.is-open li:nth-child(7) { transition-delay: .24s; }
.mobile-menu.is-open li:nth-child(n+8) { transition-delay: .28s; }
.mobile-menu li > a { display: block; font-family: var(--f-display); font-size: clamp(2rem, 9vw, 3rem); font-weight: 300; line-height: 1.25; padding: .1em 0; }
.mobile-menu li.label { font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--fg-3); margin-top: 1.2rem; }
.mobile-menu li.sub > a { font-size: clamp(1.4rem, 6vw, 1.9rem); padding-left: .2em; color: var(--fg-2); }
.mobile-menu-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 1rem; flex: none; }
body.menu-open { overflow: hidden; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 78vh; min-height: 78svh;
  display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: #111;
  isolation: isolate;
}
.hero--home { min-height: 100vh; min-height: 100svh; align-items: center; justify-content: center; text-align: center; }
.hero--compact { min-height: 62vh; min-height: 62svh; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero--home .hero-img { opacity: 0; transition: opacity 2.2s ease-in-out; }
.hero--home .hero-img.is-active { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .hero-img { animation: hero-in 1.6s var(--ease) both; }
  .hero--home .hero-img { animation: none; transform: scale(1.06); transition: opacity 2.2s ease-in-out, transform 9s linear; }
  .hero--home .hero-img.is-active { transform: scale(1); }
}
@keyframes hero-in { from { transform: scale(1.04); opacity: .4; } to { transform: none; opacity: 1; } }
.hero-scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.42) 0, rgba(0,0,0,.12) 18%, rgba(0,0,0,0) 34%),
    linear-gradient(to top, rgba(0,0,0,.62) 0, rgba(0,0,0,.28) 30%, rgba(0,0,0,0) 58%);
}
.hero--home .hero-scrim {
  background:
    linear-gradient(to bottom, rgba(0,0,0,.4) 0, rgba(0,0,0,0) 26%),
    radial-gradient(ellipse 75% 50% at 50% 52%, rgba(0,0,0,.42), rgba(0,0,0,0) 72%),
    linear-gradient(to top, rgba(0,0,0,.4) 0, rgba(0,0,0,0) 30%);
}
.hero-text {
  width: 100%; max-width: calc(var(--wrap-wide) + 2 * var(--gutter)); margin: 0 auto;
  padding: calc(var(--header-h) + 2rem) var(--gutter) clamp(2.5rem, 7vh, 5rem);
  text-shadow: 0 1px 24px rgba(0, 0, 0, .3);
}
.hero-title { font-size: clamp(2.6rem, 8vw, 6.2rem); font-weight: 300; line-height: 1.02; letter-spacing: -.005em; }
.hero--home .hero-title { font-size: clamp(2.5rem, 7.4vw, 6.4rem); }
.hero-kicker, .hero-sub {
  font-size: .76rem; letter-spacing: .32em; text-transform: uppercase; font-weight: 400; margin: 0 0 1.1rem; opacity: .92;
}
.hero-sub { margin: 1.4rem 0 0; }
.hero-kicker a { border-bottom: 1px solid rgba(255,255,255,.4); padding-bottom: 2px; }
.hero-kicker a:hover { border-color: #fff; }
.hero-scroll {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1px solid rgba(255,255,255,.6); border-radius: 14px;
}
.hero-scroll span { position: absolute; left: 50%; top: 8px; width: 2px; height: 8px; margin-left: -1px; background: #fff; border-radius: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .hero-scroll span { animation: scrolldot 2.2s var(--ease) infinite; }
  .hero-text > * { animation: rise 1.4s var(--ease) both; }
  .hero-text > :nth-child(2) { animation-delay: .15s; }
  .hero-text > :nth-child(3) { animation-delay: .3s; }
}
@keyframes scrolldot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- title band (pages without hero) ---------- */
.band { padding: clamp(2.5rem, 8vh, 5.5rem) 0 clamp(1.5rem, 4vh, 2.5rem); }
.band .wrap { max-width: calc(var(--wrap-wide) + 2 * var(--gutter)); }
.band-kicker { font-size: .74rem; letter-spacing: .3em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 .8rem; font-weight: 400; }
.band-title { font-size: clamp(2.6rem, 7vw, 5rem); }
.band-title--small { font-size: clamp(2rem, 5vw, 3rem); }
.band-meta { margin: 1rem 0 0; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--fg-2); }

.breadcrumb ol { list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-wrap: wrap; gap: .3em; font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-3); }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: .55em; opacity: .7; }
.breadcrumb a { color: var(--fg-2); transition: color .2s; }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb [aria-current] { color: var(--fg); }
.crumbs-row { padding-top: 1.4rem; }
.crumbs-row .breadcrumb ol { margin: 0; }

/* ---------- sections ---------- */
.section { padding: clamp(2.5rem, 7vw, 5.5rem) 0; }
.section + .section { padding-top: 0; }
.section--intro { padding: clamp(3.5rem, 10vw, 7.5rem) 0; text-align: center; }
.section--intro:empty, .section--intro .wrap:empty { display: none; }
.section--text { padding-bottom: clamp(1.5rem, 4vw, 3rem); }
.section--gallery { padding-top: 0; }
.band + .section--gallery { padding-top: .5rem; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: clamp(1.4rem, 3vw, 2.4rem); }
.section-title { font-size: clamp(2rem, 4.6vw, 3.2rem); }
.section-sub { margin: .5rem 0 0; color: var(--fg-2); font-size: .98rem; }
.section-link { font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 400; padding-bottom: .3em; border-bottom: 1px solid var(--line); transition: border-color .3s; white-space: nowrap; }
.section-link:hover { border-color: var(--fg); }
.lead-small { color: var(--fg-2); margin-bottom: 1.5rem; }

/* ---------- prose ---------- */
.prose { max-width: 65ch; font-size: 1.08rem; line-height: 1.8; }
.prose p { margin: 0 0 1.25em; }
.prose h2, .prose h3, .prose h4 { margin: 1.8em 0 .6em; }
.prose h2 { font-size: 2rem; } .prose h3 { font-size: 1.55rem; } .prose h4 { font-size: 1.25rem; }
.prose > :first-child { margin-top: 0; }
.prose strong { font-weight: 500; }
.prose em { font-style: italic; }
.prose a { border-bottom: 1px solid var(--accent); }
.prose a:hover { color: var(--accent); }
.prose blockquote { margin: 1.6em 0; padding-left: 1.2em; border-left: 1px solid var(--accent); font-family: var(--f-display); font-size: 1.4rem; font-style: italic; line-height: 1.5; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5em 0; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1.25em; }
.prose--lead { margin: 0 auto; max-width: 60ch; }
.prose--lead > p:first-child, .prose--lead > h2:first-child + p {
  font-family: var(--f-display); font-size: clamp(1.45rem, 2.6vw, 1.95rem); line-height: 1.45; font-weight: 300;
}
.prose--lead > p:first-child::before {
  content: ""; display: block; width: 40px; height: 1px; background: var(--accent); margin: 0 auto 2rem;
}
.lead { font-family: var(--f-display); font-size: clamp(1.4rem, 2.5vw, 1.8rem); line-height: 1.45; font-weight: 300; max-width: 34ch; }

/* ---------- justified gallery ---------- */
.jg { display: flex; flex-wrap: wrap; gap: var(--gap); justify-content: center; } /* a lone portrait on its row (flex-grow < 1) is centred */
.jg-item {
  position: relative; display: block; overflow: hidden;
  flex: var(--r) 1 calc(var(--r) * var(--row));
  aspect-ratio: var(--r);
  background: var(--bg-2);
  cursor: zoom-in;
}
.jg-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), opacity .6s, filter .6s; }
/* placeholder: the photo's average colour, then the image fades in (site.js adds .is-loaded) */
.jg-item, .card-media, .exp-card-media, .hero-media { background-color: var(--c, var(--bg-2)); }
.js .jg-item img, .js .card-media img, .js .exp-card-media img { opacity: 0; }
.js .jg-item img.is-loaded, .js .card-media img.is-loaded, .js .exp-card-media img.is-loaded { opacity: 1; }
.jg-item::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background-color .5s var(--ease); pointer-events: none; }
@media (hover: hover) {
  .jg-item:hover img { transform: scale(1.035); }
  .jg-item:hover::after { background: rgba(0,0,0,.08); }
}
.jg-fill { flex: 1000000 1 0; height: 0; }
.jg-item:focus-visible { outline-offset: 2px; }
.empty { color: var(--fg-2); }

/* ---------- large galleries: filters + progressive loading (filters.js) ---------- */
.jg-item.is-filtered, .jg-item.is-paged { display: none; }
/* before filters.js runs: show only the first page (no flash of 600 thumbnails) */
.js .jg[data-paged]:not(.is-ready) > .jg-item:nth-child(n+61) { display: none; }
html:not(.js) .gfilters, html:not(.js) .gmore { display: none; }
.section--highlights + .section--all { padding-top: 0; }

.gfilters { display: grid; gap: .7rem; margin: 0 0 clamp(1.2rem, 2.5vw, 1.8rem); min-width: 0; }
.chips {
  display: flex; align-items: center; gap: .5rem; min-width: 0;
  flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); /* bleed to the screen edge while scrolling */
  scroll-padding-inline: var(--gutter);
}
.chips::-webkit-scrollbar { display: none; }
.chips-label {
  flex: none; font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--fg-3);
  font-weight: 400; margin-right: .4rem; min-width: 6.5rem;
}
.chip {
  flex: none; display: inline-flex; align-items: baseline; gap: .45em; white-space: nowrap;
  padding: .5em 1.05em; border: 1px solid var(--line); border-radius: 999px;
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 400; color: var(--fg-2);
  transition: background-color .25s, color .25s, border-color .25s;
}
.chip-n { font-size: .66rem; letter-spacing: .04em; color: var(--fg-3); font-variant-numeric: tabular-nums; transition: color .25s; }
.chip:hover:not(:disabled) { border-color: var(--fg); color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip[aria-pressed="true"] .chip-n { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.chip:disabled { opacity: .38; cursor: default; }
.gfilters-status { margin: .2rem 0 0; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-3); }
@media (min-width: 900px) {
  .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
}
.gfilters-empty { padding: 2.5rem 0 1rem; color: var(--fg-2); }
.gfilters-empty[hidden] { display: none; }
.gmore { display: flex; justify-content: center; padding: clamp(1.8rem, 4vw, 2.8rem) 0 0; position: relative; }
.gmore-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 1px; }
.gmore-btn[hidden] { display: none; }
.gmore-n { color: var(--fg-3); margin-left: .3em; }
.gmore-btn:hover .gmore-n { color: inherit; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: clamp(1.8rem, 3vw, 2.6rem) clamp(1rem, 2vw, 1.8rem); }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { .cards:not(.cards--3) { grid-template-columns: repeat(4, 1fr); } }
.card { display: block; }
.card-media { display: block; position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .6s; }
.card-ph { position: absolute; inset: 0; background: linear-gradient(135deg, var(--bg-2), var(--bg-3)); }
.card-body { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .95rem 0 0; border-bottom: 1px solid var(--line); padding-bottom: .8rem; transition: border-color .4s; }
.card-title { font-family: var(--f-display); font-size: clamp(1.45rem, 2.2vw, 1.75rem); line-height: 1.15; }
.card-meta { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
@media (hover: hover) {
  .card:hover .card-media img { transform: scale(1.04); }
  .card:hover .card-body { border-color: var(--fg); }
}

/* ---------- map ---------- */
.map-wrap { margin-bottom: 1rem; }
.worldmap--placeholder {
  aspect-ratio: 2 / 1; display: grid; place-items: center; background: var(--bg-2); color: var(--fg-3);
  font-size: .8rem; letter-spacing: .2em; text-transform: uppercase;
}

/* ---------- country pages: "Expeditions: …" line ---------- */
.band-exp { margin: .9rem 0 0; font-size: .82rem; color: var(--fg-2); }
.band-exp a { border-bottom: 1px solid var(--accent); transition: color .2s; }
.band-exp a:hover { color: var(--accent); }

/* ---------- pager ---------- */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; border-top: 1px solid var(--line); padding: 2rem 0 clamp(3rem, 7vw, 5rem); margin-top: clamp(2rem, 5vw, 3.5rem); }
.pager a { display: flex; flex-direction: column; gap: .2rem; }
.pager-next { text-align: right; align-items: flex-end; }
.pager-up { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--fg-2); text-align: center; }
.pager-up:hover { color: var(--fg); }
.pager-dir { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-3); }
.pager-name { font-family: var(--f-display); font-size: clamp(1.3rem, 3vw, 2rem); line-height: 1.15; transition: color .25s; }
.pager a:hover .pager-name { color: var(--accent); }
@media (max-width: 560px) { .pager-up { display: none; } .pager { grid-template-columns: 1fr 1fr; } }

/* ---------- about / contact ---------- */
.about-grid, .contact-grid { display: grid; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (min-width: 860px) {
  .about-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .contact-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: center; }
  .about-photo { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.about-photo, .contact-photo { margin: 0; }
.about-photo img, .contact-photo img { width: 100%; }
.about-photo img { aspect-ratio: 4 / 5; object-fit: cover; }
.about-cta { margin-top: 2.5rem; }
.btn {
  display: inline-block; padding: .95em 1.8em; border: 1px solid var(--fg); font-size: .74rem; letter-spacing: .24em;
  text-transform: uppercase; font-weight: 400; transition: background-color .3s, color .3s;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.contact-list { list-style: none; padding: 0; margin: 2.5rem 0 2rem; }
.contact-list li { padding: 1.1rem 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .35rem; }
.contact-list li:last-child { border-bottom: 1px solid var(--line); }
.contact-label { display: inline-flex; align-items: center; gap: .6em; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--fg-3); }
.contact-label .i { width: 18px; height: 18px; }
.contact-list a { font-family: var(--f-display); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; word-break: break-word; transition: color .25s; }
.contact-list a:hover { color: var(--accent); }

/* ---------- 404 ---------- */
.notfound { padding: clamp(4rem, 14vh, 9rem) 0; }
.notfound .lead { margin: 1.2rem 0 2rem; }
.rule { border: 0; height: 1px; background: var(--line); margin: 3.5rem 0 3rem; max-width: 480px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(2rem, 6vw, 4rem); padding: clamp(3rem, 6vw, 4.5rem) 0 2rem; background: var(--bg); }
.page-home .site-footer, .page-region .site-footer, .page-theme .site-footer { margin-top: 0; }
.footer-inner {
  max-width: calc(var(--wrap-wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; gap: 2.5rem; grid-template-columns: 1fr;
}
@media (min-width: 700px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.footer-tag { color: var(--fg-2); margin: .6rem 0 1.2rem; font-size: .92rem; }
.footer-social { display: flex; gap: .4rem; margin-left: -9px; }
.footer-social a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--fg-2); transition: color .25s, background-color .25s; }
.footer-social a:hover { color: var(--fg); background: var(--bg-2); }
.footer-col h2 { font-family: var(--f-ui); font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: var(--fg-3); font-weight: 400; margin-bottom: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; columns: 1; }
.footer-col li { margin: 0 0 .45rem; }
.footer-col a { color: var(--fg-2); font-size: .92rem; transition: color .2s; }
.footer-col a:hover { color: var(--fg); }
.footer-legal a { color: inherit; text-underline-offset: .2em; }
.footer-legal { max-width: calc(var(--wrap-wide) + 2 * var(--gutter)); margin: 3rem auto 0; padding: 1.5rem var(--gutter) 0; font-size: .74rem; color: var(--fg-3); letter-spacing: .04em; border-top: 1px solid var(--line); }
.footer-brand .logo { display: inline-block; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 500; background: rgba(8, 8, 8, .97); color: #f2efe9;
  display: grid; place-items: center; opacity: 0; transition: opacity .3s var(--ease);
  touch-action: pan-y pinch-zoom;
}
.lb[hidden] { display: none; }
.lb.is-open { opacity: 1; }
.lb-stage { position: absolute; inset: 56px 0 72px; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 0 8px; }
@media (min-width: 700px) { .lb-stage { inset: 64px 84px 76px; padding: 0; } }
.lb-img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  user-select: none; -webkit-user-drag: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.lb-img.is-loading { opacity: 0; }
.lb-counter, .lb-caption { position: absolute; margin: 0; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(242, 239, 233, .75); }
.lb-counter { top: 20px; left: 20px; font-variant-numeric: tabular-nums; }
.lb-caption { bottom: 24px; left: 20px; right: 20px; text-align: center; letter-spacing: .16em; }
.lb-btn {
  position: absolute; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%;
  color: rgba(242, 239, 233, .85); transition: background-color .25s, color .25s;
}
.lb-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.lb-btn .i { width: 26px; height: 26px; stroke-width: 1.1; }
.lb-close { top: 8px; right: 8px; }
.lb-prev, .lb-next { top: 50%; margin-top: -24px; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
@media (max-width: 699px) {
  .lb-prev, .lb-next { top: auto; bottom: 12px; margin: 0; }
  .lb-caption { bottom: 26px; left: 64px; right: 64px; font-size: .66rem; }
}
body.lb-open { overflow: hidden; }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Photo protection (deterrent): no long-press save on iOS, no selection or drag ghost */
img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

/* Page transitions (browsers with cross-document View Transitions; others just load the page):
   the page cross-fades, the header stays put, and a clicked card photo grows into the next page's hero */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; }
  [data-header] { view-transition-name: site-header; }
  .hero:not(.hero--home) .hero-img { view-transition-name: hero-photo; }
  ::view-transition-group(hero-photo) { animation-duration: .6s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
}

/* lightbox extras: expedition link, copy-link button + toast, zoom */
.lb-link { margin-left: 1.2em; color: inherit; text-decoration: underline; text-underline-offset: .25em; text-decoration-color: rgba(242, 239, 233, .4); }
.lb-link:hover { color: #fff; text-decoration-color: currentColor; }
.lb-share { top: 8px; right: 60px; }
.lb-share .i { width: 22px; height: 22px; }
.lb-toast { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); margin: 0; padding: .4em 1em; border-radius: 99px; background: rgba(255,255,255,.12); font-size: .78rem; letter-spacing: .08em; }
.lb-img { cursor: zoom-in; transform-origin: center; }
.lb.is-zoomed .lb-img { cursor: grab; }
.lb.is-zoomed .lb-caption, .lb.is-zoomed .lb-counter { opacity: 0; }
.lb.is-dragging .lb-img { transition: none; cursor: grabbing; }
.lb-stage { touch-action: none; }
@media (max-width: 699px) { .lb-link { display: block; margin: .5em 0 0; } }

/* country pager with cover thumbnails */
.pager--thumbs a.pager-prev, .pager--thumbs a.pager-next { flex-direction: row; align-items: center; gap: .9rem; }
.pager--thumbs .pager-next { flex-direction: row-reverse; }
.pager--thumbs .pager-text { display: flex; flex-direction: column; gap: .2rem; }
.pager-thumb { flex: none; width: clamp(56px, 9vw, 96px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background-color: var(--c, var(--bg-2)); }
.pager-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.pager--thumbs a:hover .pager-thumb img { transform: scale(1.08); }
@media (max-width: 560px) { .pager-thumb { display: none; } }

.footer-random { margin: 1rem 0 0; }
.footer-random a { display: inline-flex; align-items: center; gap: .5em; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); }
.footer-random a:hover { color: var(--accent); }
.footer-random .i { width: 18px; height: 18px; stroke-width: 1.3; transition: transform .5s var(--ease); }
.footer-random a:hover .i { transform: rotate(90deg); }

/* home: "A few random photos" 3D carousel (site.js) */
.shuffle { overflow: hidden; }
.sh-stage { position: relative; height: clamp(200px, 32vw, 420px); perspective: 1400px; transform-style: preserve-3d; margin-top: 1.5rem; touch-action: pan-y; user-select: none; }
.sh-slide { position: absolute; left: 50%; top: 0; height: 100%; aspect-ratio: 3 / 2; max-width: 60%; translate: -50% 0; border-radius: 6px; overflow: hidden;
  background-color: var(--c, var(--bg-2)); transition: transform .7s var(--ease), opacity .5s, filter .7s var(--ease); will-change: transform; }
.sh-slide img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s; }
.sh-slide img.is-loaded { opacity: 1; }
.sh-stage { cursor: pointer; }
.sh-slide.is-center { cursor: zoom-in; }
.sh-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.sh-cap { margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: baseline; }
.sh-name { font-family: var(--f-display); font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
.sh-cap a { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-2); }
.sh-cap a:hover { color: var(--accent); }
.sh-ctrl { display: flex; gap: .5rem; }
.sh-btn { min-width: 44px; height: 44px; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 99px; color: var(--fg-2); display: inline-flex; align-items: center; justify-content: center; gap: .5em; font-size: 1rem; transition: color .25s, border-color .25s; }
.sh-btn--text { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.sh-btn .i { width: 16px; height: 16px; stroke-width: 1.4; }
.sh-btn:hover { color: var(--fg); border-color: var(--fg-3); }
@media (prefers-reduced-motion: reduce) { .sh-slide { transition: none; } }

/* silent drone / GoPro loops (loops_block): one large, then smaller ones side by side */
.loops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap, 8px); }
.loops .loop { margin: 0; aspect-ratio: var(--r); overflow: hidden; border-radius: 2px; background: var(--bg-2); }
.loops .loop:first-child { grid-column: 1 / -1; }
.loops video { width: 100%; height: 100%; object-fit: cover; display: block; }
.section--loops { padding-bottom: 0; }

/* loops mixed into a gallery (video_item) */
.jg-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.jg-badge { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.42); color: #fff; pointer-events: none; }
.jg-badge .i { width: 12px; height: 12px; margin-left: 2px; }
.lb-video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb-video[hidden], .lb-img[hidden] { display: none; }

/* back to top (desktop only; site.js shows it after two screens of scrolling) */
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--fg-2);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .35s, transform .35s, color .25s; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--fg); }
.to-top .i { width: 20px; height: 20px; }
@media (max-width: 899px) { .to-top { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 42px; height: 42px; } }
body.lb-open .to-top, body.menu-open .to-top { display: none; }

/* ---------- mobile: denser layouts ---------- */
.site-header.is-hidden { transform: translateY(-100%); }
@media (max-width: 699px) {
  /* 1. galleries: 3 square thumbnails per row (the lightbox shows the whole photo) */
  .jg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .jg-item { aspect-ratio: 1; }
  .jg-fill { display: none; }
  .jg-badge { right: 4px; top: 4px; width: 20px; height: 20px; }
  .jg-badge .i { width: 10px; height: 10px; }
  /* 2. home and theme pages: card rows that scroll sideways */
  .page-home .cards, .page-theme .cards {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px;
    margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px; scroll-padding-inline: var(--gutter);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .page-home .cards::-webkit-scrollbar, .page-theme .cards::-webkit-scrollbar { display: none; }
  .page-home .cards > *, .page-theme .cards > * { flex: 0 0 78%; scroll-snap-align: start; }
  .jg-item.is-more { display: none; }
  .daily-more { display: flex; justify-content: center; margin-top: 1rem; }
}
@media (min-width: 700px) { .daily-more { display: none; } }

/* QR code to Instagram (desktop only: on a phone, the link itself is one tap away) */
.qr { display: none; align-items: center; gap: .9rem; margin-top: 1.2rem; color: var(--fg-2); font-size: .74rem; letter-spacing: .08em; }
.qr svg { flex: none; width: 84px; height: 84px; padding: 6px; background: #fff; color: #000; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.qr span { max-width: 12ch; line-height: 1.4; }
.qr:hover { color: var(--fg); }
.qr--contact svg { width: 112px; height: 112px; }
@media (hover: hover) and (min-width: 900px) { .qr { display: inline-flex; } }

/* guestbook */
.gb { max-width: 760px; }
.gb-form { display: grid; gap: 1rem; margin: 2rem 0 3rem; padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.gb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 599px) { .gb-row { grid-template-columns: 1fr; } }
.gb-form label { display: grid; gap: .35rem; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); }
.gb-form input, .gb-form textarea { font: inherit; font-size: 1rem; letter-spacing: normal; text-transform: none; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: .7em .8em; width: 100%; }
.gb-form textarea { resize: vertical; min-height: 7em; }
.gb-form input:focus, .gb-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.gb-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.gb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 0; }
.gb-status { font-size: .9rem; color: var(--fg-2); }
.gb-status.is-ok { color: var(--accent); }
.gb-status.is-err { color: #b0442c; }
.gb-privacy { margin: 0; font-size: .8rem; color: var(--fg-3); }
.gb-privacy a { color: inherit; text-decoration: underline; }
.gb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }
.gb-msg { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.gb-who { margin: 0 0 .4rem; display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.gb-who strong { font-family: var(--f-display); font-size: 1.25rem; font-weight: 400; }
.gb-who time { margin-left: auto; font-size: .74rem; color: var(--fg-3); letter-spacing: .08em; }
.gb-body { margin: 0; white-space: pre-line; }
.gb-empty { color: var(--fg-2); }
.contact-gb { margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.contact-gb-title { font-family: var(--f-display); font-weight: 300; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .4rem; }
.contact-gb p { margin: 0 0 1rem; color: var(--fg-2); }
.qr--contact { margin: .4rem 0 1rem; }
