:root {
  --bg: #f5f3ee;
  --fg: #1d1d1b;
  --muted: #6b6a66;
  --accent: #5f7c87;
  --line: #dedbd3;
  --tile-gap: 8px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1600px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  /* Slate charcoal tinted with the original todd.ly blue-grey (#cad8dd),
     with the light theme's warm cream for text. */
  :root {
    --bg: #1e2529;
    --fg: #efece6;
    --muted: #a9b4b9;
    --accent: #cad8dd;
    --line: #2f383d;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
a { color: inherit; text-decoration: none; }
p a, .intro a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header ---------- */
.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.wordmark { font: 500 30px/1 var(--serif); letter-spacing: .01em; }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.site-nav > a { color: var(--muted); transition: color .2s; padding: 4px 0; }
.site-nav > a:hover, .site-nav > a[aria-current] { color: var(--fg); }
.site-nav > a[aria-current] { box-shadow: inset 0 -1px 0 currentColor; }
.social { display: inline-flex; gap: 14px; align-items: center; }
.social a { color: var(--muted); display: inline-flex; transition: color .2s; }
.social a:hover { color: var(--fg); }
.social svg, .nav-toggle svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.nav-toggle { display: none; background: none; border: 0; color: var(--fg); padding: 8px; margin: -8px; cursor: pointer; }
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 699px) {
  .site-header { padding-block: 20px; flex-wrap: wrap; }
  .wordmark { font-size: 26px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 12px;
    font-size: 20px;
  }
  .site-nav.open { display: flex; }
  .site-nav .social { margin-top: 12px; }
  .site-nav .social svg { width: 24px; height: 24px; }
}

main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- headings ---------- */
.page-head { text-align: center; max-width: 720px; margin: 24px auto 48px; }
.page-head h1, .split-text h1 {
  font: 400 clamp(38px, 6vw, 64px)/1.05 var(--serif);
  margin: 0;
  letter-spacing: -.01em;
}
.intro { font: italic 400 clamp(19px, 2.2vw, 23px)/1.45 var(--serif); color: var(--muted); margin: 18px 0 0; }

/* ---------- cover grid (home, guides) ---------- */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 28px;
  padding: 8px 0 32px;
}
.cover-grid.two { grid-template-columns: repeat(2, 1fr); max-width: 1100px; margin: 0 auto; }
.cover { display: block; }
.cover picture { overflow: hidden; border-radius: 2px; }
.cover img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .8s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
.cover:hover img { transform: scale(1.035); }
.cover-title { display: block; margin-top: 14px; font: 400 24px/1.2 var(--serif); }
@media (max-width: 1099px) { .cover-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 20px; } }
@media (max-width: 699px) {
  .cover-grid, .cover-grid.two { grid-template-columns: 1fr; gap: 32px; }
  .cover-title { font-size: 22px; margin-top: 10px; }
}

/* ---------- gallery text (styles of the original pages; sizes as measured at 1710px) ---------- */
.gallery-text { text-align: center; margin: clamp(16px, 3vw, 56px) auto clamp(36px, 5vw, 80px); }
.has-hero .gallery-text { margin-top: 0; }
.gallery-text > p { max-width: var(--tw); margin: 0 auto; color: var(--fg); font-weight: 400; }
.gallery-text > p + p { margin-top: .55em; }
.t-p  { font: 400 clamp(16px, 1.03vw, 18px)/1.84 var(--sans); }
.t-h4 { font: 400 clamp(21px, 1.66vw, 28px)/1.37 var(--serif); }
.t-h3 { font: 400 clamp(28px, 3.1vw, 53px)/1.3 var(--serif); }
.t-h2 { font: 400 clamp(36px, 4.78vw, 82px)/1.22 var(--serif); letter-spacing: -.01em; }
.gallery-text.left { text-align: left; margin-inline: calc(50% - 50vw); padding-inline: 4vw; }
.gallery-text.left > p { margin-left: 0; }
.hero .gallery-text {
  position: absolute; left: 0; right: 0; bottom: clamp(20px, 2.5vw, 48px); z-index: 2;
  margin: 0; padding-inline: 4vw;
}
.hero .gallery-text > p { color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
.gallery.no-text { padding-top: clamp(8px, 1vw, 16px); }
@media (max-width: 699px) {
  .gallery-text > p { max-width: none; }
  .gallery-text.left { padding-inline: 16px; }
}

/* ---------- galleries (layouts match the original Squarespace pages) ---------- */
.photos {
  /* full-bleed: spacing is set per gallery in site.json (--pad, --gap) */
  margin-inline: calc(50% - 50vw);
  padding-inline: var(--pad);
  gap: var(--gap);
}
.tile { display: block; overflow: hidden; cursor: zoom-in; }
.tile picture, .tile img { width: 100%; height: 100%; }
.tile img { object-fit: cover; transition: transform .8s cubic-bezier(.19, 1, .22, 1); }
.tile:hover img { transform: scale(1.02); }

.photos-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.photos-grid .tile { aspect-ratio: 4 / 3; }
.photos-stack { display: grid; grid-template-columns: 1fr; }
.photos-stack .tile { aspect-ratio: 16 / 9; }
.photos-masonry { display: flex; align-items: flex-start; }
.photos-masonry .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.photos-masonry .tile { aspect-ratio: var(--r); }

@media (max-width: 699px) {
  .photos { padding-inline: min(var(--pad), 16px); gap: var(--mgap); }
  .photos-grid { grid-template-columns: 1fr; }
  .photos-stack .tile { aspect-ratio: 3 / 2; }
  /* one column in the original photo order */
  .photos-masonry { flex-direction: column; align-items: stretch; }
  .photos-masonry .col { display: contents; }
  .page-head { margin: 8px auto 32px; }
}

/* ---------- hero (full-bleed photo under the header) ---------- */
.hero { position: relative; height: max(var(--hh), 340px); overflow: hidden; margin-bottom: clamp(32px, 6vw, 96px); }
.hero picture, .hero img { width: 100%; height: 100%; }
.hero img { object-fit: cover; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 160px; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .35), transparent);
}
.has-hero .site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  color: #fff;
}
.has-hero .site-header .wordmark,
.has-hero .site-header .nav-toggle,
.has-hero .site-nav > a,
.has-hero .site-header .social a { color: rgba(255, 255, 255, .88); text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.has-hero .site-nav > a:hover, .has-hero .site-nav > a[aria-current], .has-hero .site-header .social a:hover { color: #fff; }
@media (max-width: 699px) {
  .has-hero .site-header:has(.site-nav.open) { background: var(--bg); }
  .has-hero .site-header:has(.site-nav.open) :is(.wordmark, .nav-toggle, .site-nav > a, .social a) { color: var(--fg); text-shadow: none; }
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 64px 0 24px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font: 400 22px/1.3 var(--serif);
}
.pager a span { display: block; font: 500 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.pager a[rel=next] { text-align: right; }
.pager a:hover { color: var(--accent); }

/* ---------- about / contact ---------- */
.split {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding: 16px 0 48px;
}
.split-img img { width: 100%; border-radius: 2px; }
.split-text p { font-size: 18px; color: var(--muted); max-width: 42ch; margin: 20px 0 0; }
.social.big { gap: 22px; margin-top: 28px; }
.social.big svg { width: 28px; height: 28px; }
@media (max-width: 899px) { .split { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--max);
  margin: 48px auto 0;
  padding: 32px var(--gutter) 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.site-footer p { margin: 0; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 10, .97);
  color: #eee;
  display: none;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.lb.open { display: block; }
.lb-stage { position: absolute; inset: 56px 0 56px; display: flex; align-items: center; justify-content: center; }
.lb-stage picture { max-width: calc(100vw - 32px); max-height: 100%; display: flex; }
.lb-stage img {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  width: auto; height: auto;
  object-fit: contain;
  transition: opacity .2s, transform .25s;
}
.lb button {
  position: absolute;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 14px;
  opacity: .75;
  transition: opacity .2s;
  font: inherit;
}
.lb button:hover { opacity: 1; }
.lb svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; }
.lb-close { top: 6px; right: 6px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 4px; }
.lb-next { right: 4px; }
.lb-count { position: absolute; top: 20px; left: 20px; font-size: 13px; letter-spacing: .08em; opacity: .7; }
@media (max-width: 699px) {
  .lb-prev, .lb-next { top: auto; bottom: 0; transform: none; }
  .lb-stage img { max-width: 100vw; }
  .lb-stage picture { max-width: 100vw; }
}
body.lb-lock { overflow: hidden; }

/* ---------- entrance animations (Squarespace "flex" style) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Images clip their child, not themselves: a fully clipped element never
     counts as visible to IntersectionObserver, so it would never reveal. */
  .js [data-reveal="text"], .js [data-reveal="img"] > * {
    --ease: cubic-bezier(.19, 1, .22, 1);
    transition: opacity .65s var(--ease), transform .65s var(--ease), clip-path .65s var(--ease);
    transition-delay: var(--delay, 0s);
  }
  .js [data-reveal="text"]:not(.in) { opacity: 0; transform: translateY(18px); }
  .js [data-reveal="img"] > * { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  .js [data-reveal="img"]:not(.in) > * { opacity: 0; clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
