:root {
  --bg: #F3F4F5;
  --hero-bg: #FFFFFF;
  --fg: #0D0D0D;
  --muted: #5B6068;
  --hero-muted: #3F444B;
  --line: #D9DBDE;
  --ph: #E3E5E8;
  --ph-fg: #5B6068;
  --link: #0D0D0D;
  --marker: linear-gradient(transparent 58%, #FFBF00 58%);
  --link-deco: none;
  --yellow: #FFBF00;
  --on-yellow: #0D0D0D;
  --blue: #3D6BE0;
  --on-blue: #FFFFFF;
  --purple: #7047D6;
  --on-purple: #FFFFFF;
  --display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --body: "Lato", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D0D0D;
    --hero-bg: #0D0D0D;
    --fg: #F3F4F5;
    --muted: #9AA0A6;
    --hero-muted: #C7CAD0;
    --line: #34363B;
    --ph: #1C1D20;
    --ph-fg: #9AA0A6;
    --link: #FFBF00;
    --marker: none;
    --link-deco: underline;
    --blue: #7AA2FF;
    --on-blue: #0D0D0D;
    --purple: #B69CFF;
    --on-purple: #0D0D0D;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0D0D0D;
  --hero-bg: #0D0D0D;
  --fg: #F3F4F5;
  --muted: #9AA0A6;
  --hero-muted: #C7CAD0;
  --line: #34363B;
  --ph: #1C1D20;
  --ph-fg: #9AA0A6;
  --link: #FFBF00;
  --marker: none;
  --link-deco: underline;
  --blue: #7AA2FF;
  --on-blue: #0D0D0D;
  --purple: #B69CFF;
  --on-purple: #0D0D0D;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 18px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--yellow); color: var(--on-yellow); padding: 10px 14px; }

.wrap { max-width: 1140px; margin: 0 auto; padding-inline: 24px; }

/* Header and intro */
.hero { background: var(--hero-bg); }
.hero > .wrap { padding-block: 28px 88px; display: flex; flex-direction: column; gap: 72px; }

.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.logo { font: 800 18px/1 var(--display); letter-spacing: 0.06em; text-decoration: none; }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 16px; }
.nav > a:not(.btn) { padding: 12px 14px; text-decoration: none; }
.nav > a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 6px; }

.theme-toggle {
  width: 44px; height: 44px; margin: 0 6px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--fg); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--yellow); }
.icon-sun { display: none; }
.is-dark .icon-sun { display: block; }
.is-dark .icon-moon { display: none; }

.btn {
  display: inline-block; padding: 12px 18px; border-radius: 999px;
  background: var(--yellow); color: var(--on-yellow);
  font-weight: 700; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn-lg { padding: 14px 22px; }

.intro { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-end; }
.intro-text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
h1 {
  margin: 0; font: 800 clamp(56px, 10vw, 104px)/0.92 var(--display);
  letter-spacing: -0.01em; text-transform: uppercase;
}
.lede { margin: 0; font-size: clamp(19px, 2.2vw, 23px); line-height: 1.5; max-width: 560px; color: var(--hero-muted); }

.portrait-fig { flex: 1 1 280px; max-width: 360px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.portrait {
  aspect-ratio: 4 / 5; background: var(--ph);
  border-radius: 6px; border-bottom: 8px solid var(--yellow); overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
figcaption { font-size: 13px; color: var(--muted); }
.couple { margin: 8px 0 0; max-width: 320px; display: flex; flex-direction: column; gap: 8px; }
.couple img { border-radius: 6px; }

/* Placeholders until photos arrive */
.ph {
  background: var(--ph); color: var(--ph-fg); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px; font-size: 15px;
}

/* Tags (climbing-tape labels) */
.tag {
  align-self: flex-start; display: inline-block;
  font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 3px;
}
.tag-sm { font-size: 12px; padding: 2px 8px; vertical-align: 2px; }
.tag-yellow { background: var(--yellow); color: var(--on-yellow); }
.tag-blue { background: var(--blue); color: var(--on-blue); }
.tag-purple { background: var(--purple); color: var(--on-purple); }

/* Body */
.body { padding-block: 96px; display: flex; flex-direction: column; gap: 112px; }

.h-section { margin: 0; font: 800 40px/1 var(--display); text-transform: uppercase; }
.h-small { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.h-big { margin: 0; font: 800 clamp(36px, 6vw, 56px)/1 var(--display); text-transform: uppercase; }

.split { display: flex; flex-wrap: wrap; gap: 24px 64px; }
.split > h2 { flex: 0 0 220px; }
.prose { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; font-size: 20px; line-height: 1.65; }
.prose p { margin: 0; }
.prose.small { gap: 14px; font-size: 18px; line-height: 1.55; }
.muted { color: var(--muted); }

.link {
  color: var(--link); background: var(--marker);
  text-decoration: var(--link-deco); text-underline-offset: 3px;
  font-weight: 700;
}
.link:hover { text-decoration: underline; }

.climbing { display: flex; flex-wrap: wrap; gap: 32px; align-items: stretch; }
.climb-photo { flex: 1 1 420px; min-width: 0; min-height: 420px; border-radius: 6px; overflow: hidden; padding: 0; }
.climb-photo img { width: 100%; height: 100%; object-fit: cover; }
.climb-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.climb-text p { margin: 0; }
.quote { font: 500 clamp(24px, 3vw, 32px)/1.3 var(--display); }

.photos { display: flex; flex-direction: column; gap: 28px; }
.photos-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.grid > figure { background: var(--ph); }
.photos-title { display: flex; flex-direction: column; gap: 12px; }
.photos-title p { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid > * { margin: 0; aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden; }
.grid img { width: 100%; height: 100%; object-fit: cover; }

.making { border-top: 1px solid var(--line); padding-top: 32px; }

.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.grid a.lb, .justified a.lb { cursor: zoom-in; }

/* Gallery page */
.hero-short { gap: 56px !important; padding-bottom: 56px !important; }
.h-page { margin: 0; font: 800 clamp(48px, 8vw, 88px)/0.95 var(--display); text-transform: uppercase; }
.gallery { gap: 72px; padding-top: 40px; }
.g-controls {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button {
  min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--fg); font: 700 14px var(--body); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--yellow); color: var(--on-yellow); }
.g-years-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; font-size: 15px; }
.g-years-nav a { padding: 8px 2px; text-decoration: none; color: var(--muted); }
.g-years-nav a:hover { color: var(--fg); }
.g-years { display: flex; flex-direction: column; gap: 80px; }
.g-year { display: flex; flex-direction: column; gap: 32px; scroll-margin-top: 80px; }
.g-year-title { margin: 0; font: 800 clamp(40px, 6vw, 64px)/1 var(--display); }
.g-month { display: flex; flex-direction: column; gap: 12px; }
.g-month-title { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.g-count { font-weight: 400; margin-left: 6px; }
.justified { display: flex; flex-wrap: wrap; gap: 8px; }
.justified::after { content: ""; flex-grow: 999999; }
.justified figure {
  margin: 0; flex-grow: var(--r); flex-basis: calc(var(--r) * 240px);
  border-radius: 3px; overflow: hidden; background: var(--ph);
}
.justified img { width: 100%; height: auto; }
.justified a:hover img, .grid a:hover img { opacity: 0.9; }
@media (max-width: 600px) { .justified figure { flex-basis: calc(var(--r) * 150px); } }

/* Lightbox */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(10, 10, 10, 0.95); color: #F3F4F5;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.lightbox::backdrop { background: rgba(10, 10, 10, 0.95); }
.lightbox img { max-width: 92vw; max-height: 84vh; width: auto; height: auto; object-fit: contain; }
.lb-cap { margin: 0; font-size: 14px; color: #C7CAD0; }
.lb-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 999px;
  border: 1px solid #3A3D44; background: rgba(13, 13, 13, 0.7); color: #F3F4F5;
  font-size: 20px; cursor: pointer;
}
.lb-btn:hover { border-color: #FFBF00; color: #FFBF00; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

.contact { display: flex; flex-direction: column; gap: 28px; border-top: 1px solid var(--line); padding-top: 48px; }
.contact-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; font-size: 17px; }
.fine { margin: 0; font-size: 14px; }
