:root {
  color-scheme: light;
  --page: #f7f8fb;
  --ink: #22262e;
  --muted: #6d7582;
  --green: #6a9444;
  --green-deep: #4f7532;
  --line: #e4e7ee;
  --chip: #f3f6f4;
  --shadow: 0 12px 34px rgba(36, 48, 64, 0.1);
  --wrap: 1080px;
  --sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.65;
}

img { max-width: 100%; }

a { color: inherit; }

.wrap {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: 640px;
  height: 78vh;
  max-height: 820px;
  overflow: hidden;
  background: #d5e3ea;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 42%;
}

.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10rem;
  background: linear-gradient(to bottom, rgba(247, 248, 251, 0), var(--page) 88%);
  z-index: 1;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding-top: 4.75rem;
  max-width: 38rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  color: #7d8694;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.7rem;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
}

h1, h2 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.55rem);
  color: #2a303a;
}

h1 span { color: var(--green); }

.lede {
  max-width: 36rem;
  margin: 1.05rem 0 0;
  color: #4e5662;
  font-size: 1.02rem;
  line-height: 1.55;
}

.dock {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: -2.6rem;
  padding: 0.55rem 0.75rem 0.55rem 1.15rem;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.prompt {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem 0.45rem 0.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dock-rule {
  width: 1px;
  align-self: stretch;
  margin: 0.45rem 0.45rem 0.45rem 0.2rem;
  background: var(--line);
}

.dock a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: #3e4654;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.dock a svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock a:hover { background: #f3f5f8; }

.dock a[aria-current="page"] {
  background: #e7f3e3;
  color: #2f4a28;
}

.dock a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.section {
  padding: 3.25rem 0 0.5rem;
  scroll-margin-top: 1.5rem;
}

.about {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  column-gap: 2.6rem;
  row-gap: 1rem;
  align-items: start;
  margin-top: 0.35rem;
}

.about-side { display: contents; }

.about-side h2 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.55rem);
}

.portrait {
  grid-column: 1;
  grid-row: 2;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4.4;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 16px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.about-copy { grid-column: 2; grid-row: 2; }

.about-copy p,
.prose p {
  margin: 0 0 1rem;
  color: #3a4150;
}

.about-copy p:last-child,
.prose p:last-child { margin-bottom: 0; }

.interests {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 0.85rem;
  margin-top: 1.75rem;
  padding-top: 0.4rem;
}

.interests-label {
  color: #9aa2ae;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.interests ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.8rem 0.32rem 0.5rem;
  border-radius: 999px;
  background: #f4f6f8;
  color: #3c4553;
  font-size: 0.92rem;
  font-weight: 600;
}

.chip svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: #5d6776;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chip--green {
  background: #e8f4e4;
}

.chip--green svg { stroke: var(--green-deep); }

.chip--blue {
  background: #e8f1fb;
}

.chip--blue svg { stroke: #3d6f9a; }

.prose { max-width: 44rem; }

.colophon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin: 0;
  padding: 2.5rem 0 2.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.colophon a { color: var(--green-deep); }

@media (max-width: 800px) {
  .wrap { width: min(var(--wrap), calc(100% - 1.5rem)); }

  .hero {
    min-height: 480px;
    height: 64vh;
  }

  .hero-img { object-position: 28% 78%; }

  .hero-copy { padding-top: 2.25rem; }

  h1 { font-size: 2.25rem; }

  .dock {
    flex-wrap: wrap;
    margin-top: -1.6rem;
    padding: 0.7rem;
  }

  .prompt { padding-right: 0.4rem; }

  .dock-rule { display: none; }

  .about { grid-template-columns: 1fr; }

  .about-side h2,
  .portrait,
  .about-copy { grid-column: 1; }

  .about-side h2 { grid-row: 1; }
  .portrait { grid-row: 2; max-width: 18rem; aspect-ratio: 1 / 1; }
  .about-copy { grid-row: 3; }
}

/* ---------- Gallery page ---------- */

.hero--short {
  min-height: 460px;
  height: 56vh;
  max-height: 600px;
}

.gallery { padding-top: 2.75rem; }

.gallery-cat { margin: 0 0 3rem; }
.gallery-cat:last-child { margin-bottom: 0; }

/* gallery-list.php always prints the fallback category; hide it when it has no pictures. */
.gallery-cat:not(:has(.gallery-item)) { display: none; }

.gallery-cat h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.gallery-cat h3::before {
  content: "";
  flex: 0 0 auto;
  width: 0.55rem;
  height: 1.6rem;
  border-radius: 3px;
  background: var(--green);
}

.gallery-cat-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.9rem;
}

.gallery-item {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
}

.gallery-thumb {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #e9edf2;
  box-shadow: 0 4px 14px rgba(36, 48, 64, 0.08);
  cursor: zoom-in;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-thumb:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.gallery-thumb:hover img { transform: scale(1.04); }

.gallery-thumb:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.gallery-empty {
  margin: 0;
  padding: 2rem;
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  box-shadow: var(--shadow);
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 5rem;
  background: rgba(22, 26, 32, 0.9);
  backdrop-filter: blur(4px);
}

.lightbox[hidden] { display: none; }

.lightbox-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

.lightbox-frame img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 16rem);
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  max-width: min(42rem, 100%);
  margin: 1rem 0 0;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
}

.lightbox-caption[hidden] { display: none; }

.lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.lightbox-btn[hidden] { display: none; }

.lightbox-btn svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox-btn:hover { background: rgba(255, 255, 255, 0.26); }

.lightbox-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 800px) {
  .hero--short {
    min-height: 380px;
    height: 50vh;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.6rem;
  }

  .gallery-thumb { border-radius: 10px; }

  .lightbox { padding: 4rem 0.75rem 5rem; }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 1rem;
    transform: none;
  }

  .lightbox-prev { left: calc(50% - 3.4rem); }
  .lightbox-next { right: calc(50% - 3.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-thumb,
  .gallery-thumb img { transition: none; }
  .gallery-thumb:hover,
  .gallery-thumb:hover img { transform: none; }
}

/* ---------- Mobile polish ---------- */

/* Lightbox: never clip a tall picture + long caption; the frame scrolls
   while the buttons stay put. Swipes stay vertical-scroll friendly. */
.lightbox { touch-action: pan-y; }

.lightbox-frame {
  overflow-y: auto;
  overscroll-behavior: contain;
  justify-content: safe center;
  scrollbar-width: thin;
}

@media (max-width: 800px) {
  /* Nav: one row of four equal tap targets, icon above label. */
  .dock {
    flex-wrap: nowrap;
    gap: 0.2rem;
    padding: 0.4rem;
    border-radius: 16px;
  }

  .prompt,
  .dock-rule { display: none; }

  .dock a {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0.2rem 0.45rem;
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.2;
  }

  .dock a svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* Bigger tap areas for text links. */
  .colophon a {
    display: inline-block;
    padding: 0.6rem 0;
  }

  .colophon { padding-top: 1.75rem; }

  .lightbox-frame img { max-height: calc(100vh - 15rem); }
}

/* ---------- Find me elsewhere ---------- */

.elsewhere {
  display: flex;
  align-items: center;
  gap: 1.25rem 1.75rem;
  margin-top: 0.35rem;
  padding: 1.35rem 1.6rem;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.elsewhere-title {
  flex: 0 0 auto;
  margin: 0;
  padding-right: 1.75rem;
  border-right: 1px solid var(--line);
  color: var(--green-deep);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.elsewhere-list {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.elsewhere-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  height: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.elsewhere-item:hover { background: #f1f7ee; }

.elsewhere-item:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.elsewhere-icon {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: 0.05rem;
  fill: none;
  stroke: var(--green-deep);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.elsewhere-icon .fill {
  fill: var(--green-deep);
  stroke: none;
}

.elsewhere-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.elsewhere-name {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.elsewhere-item:hover .elsewhere-name { color: var(--green-deep); }

.elsewhere-note {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  overflow-wrap: break-word;
}

@media (max-width: 800px) {
  .elsewhere {
    flex-direction: column;
    align-items: stretch;
    padding: 1.1rem 0.9rem 0.9rem;
  }

  .elsewhere-title {
    padding: 0 0.6rem 0.9rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .elsewhere-title br { display: none; }

  .elsewhere-list { grid-template-columns: 1fr; gap: 0.15rem; }

  .elsewhere-item { min-height: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .elsewhere-item { transition: none; }
}

/* Drifting mist and birds over the hero image (hero-atmos.js). */
.hero-atmos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

/* Night hero (21-05 visitor time, set on <html data-phase> in <head>).
   A multiply layer darkens the picture; hero-atmos.js draws the stars and
   relights the planet on its canvas above it. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, #0e1a36 0%, #17264a 34%, #2e4068 58%, #26354f 100%);
  mix-blend-mode: multiply;
  opacity: 0;
}

.hero-atmos { z-index: 1; }

html[data-phase="night"] .hero { background: #141f38; }
html[data-phase="night"] .hero::after { opacity: 1; }
html[data-phase="night"] .hero-img { filter: saturate(0.7); }
html[data-phase="night"] .hero h1 { color: #eef2f8; }
html[data-phase="night"] .hero h1 span { color: #a9d27f; }
html[data-phase="night"] .hero .lede { color: #c4cddb; }
html[data-phase="night"] .hero .eyebrow { color: #96a3b6; }
