:root {
  --bg: #f7f7f2;
  --paper: #ffffff;
  --ink: #17202a;
  --muted: #5c6670;
  --line: #d8ddd8;
  --accent: #167c80;
  --accent-strong: #0e5d61;
  --warm: #b84f39;
  --soft: #edf4f2;
  --shadow: 0 16px 44px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

img {
  display: block;
  height: auto;
  max-width: 100%;
}

.screen-reader-text,
.skip-link {
  position: absolute;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

.skip-link:focus {
  clip: auto;
  height: auto;
  width: auto;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  padding: 0.6rem 0.8rem;
  background: var(--paper);
  border: 1px solid var(--line);
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.narrow {
  width: min(820px, calc(100% - 32px));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
  border-bottom: 0;
}

.header-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: transparent;
  color: var(--accent-strong);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
}

.nav-toggle span:not(.screen-reader-text) {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.hero {
  min-height: 72vh;
  display: flex;
  align-items: center;
  background-position: center;
  background-size: cover;
  color: #ffffff;
}

.hero-content {
  padding: 96px 0;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 9vw, 6.8rem);
  line-height: 0.98;
}

.hero p {
  max-width: 560px;
  margin: 1.25rem 0 2rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.72rem 1rem;
  border-radius: 6px;
  background: var(--warm);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  background: #993f2d;
  color: #ffffff;
}

.section {
  padding: 80px 0;
}

.section.soft {
  background: var(--soft);
}

.section h2,
.page-heading h1,
.article-header h1 {
  margin: 0 0 1rem;
  line-height: 1.1;
}

.section h2 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.link-grid,
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.link-card,
.post-card {
  display: block;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.link-card span,
.post-card h2 {
  color: var(--ink);
  font-weight: 800;
}

.link-card p,
.post-card p {
  color: var(--muted);
}

.post-card h2 {
  margin: 0.35rem 0 0.75rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.post-card h2 a {
  color: inherit;
  text-decoration: none;
}

.archive-page .post-grid {
  grid-template-columns: 1fr;
}

.archive-page .post-card {
  width: 100%;
}

.archive-page .post-card h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

.callout {
  padding: 72px 0;
  background: var(--ink);
  color: #ffffff;
  text-align: center;
}

.callout h2 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
}

.page-heading {
  padding: 88px 0 40px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.page-heading h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.article {
  padding: 72px 0 96px;
}

.article-header {
  margin-bottom: 36px;
}

.article-header h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
}

.content-body h2,
.content-body h3,
.content-body h4 {
  margin: 2rem 0 0.75rem;
  line-height: 1.2;
}

.content-body p,
.content-body ul,
.content-body ol,
.content-body figure,
.content-body pre {
  margin: 1rem 0;
}

.content-body figure {
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
}

.content-body img {
  border-radius: 8px;
}

.content-body pre {
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: #101820;
  color: #eaf2f2;
  font-size: 0.9rem;
  line-height: 1.55;
}

.profile-body > figure:first-of-type img {
  width: min(300px, 100%);
  margin-bottom: 1.5rem;
}

.gallery-picker {
  display: grid;
  gap: 14px;
  margin-bottom: 40px;
}

.gallery-groups {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
}

.gallery-group {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;
}

.gallery-group span {
  margin-left: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.gallery-group:hover,
.gallery-group.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.gallery-group:hover span,
.gallery-group.is-active span {
  color: rgba(255, 255, 255, 0.72);
}

.gallery-group:focus-visible,
.gallery-destination:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.gallery-destinations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.gallery-destination {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 8px;
  background: #233437;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.1);
}

.gallery-destination::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 15, 18, 0.78), rgba(10, 15, 18, 0.08) 62%);
}

.gallery-destination img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.gallery-destination:hover img {
  transform: scale(1.05);
}

.gallery-destination-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 142px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 12px;
}

.gallery-destination-title {
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.18;
}

.gallery-destination-count {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 750;
}

.gallery-destination.is-empty {
  background: linear-gradient(135deg, #ffffff, #dcebe8 52%, #f2d8cc);
  color: var(--ink);
}

.gallery-destination.is-empty::after {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.16));
}

.gallery-destination.is-empty .gallery-destination-count {
  color: var(--muted);
}

.gallery-destination-initials {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-strong);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 850;
}

.gallery-destination.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 124, 128, 0.26), 0 16px 34px rgba(23, 32, 42, 0.13);
}

.gallery-section {
  margin-top: 0;
}

.gallery-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.gallery-section h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.gallery-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.gallery-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 42px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.gallery-item {
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 160ms ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(9, 13, 18, 0.88);
  cursor: zoom-out;
}

.lightbox img {
  max-width: 98vw;
  max-height: 94vh;
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.45);
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: none;
}

.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .header-inner {
    min-height: 64px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    display: none;
    padding: 10px 16px 16px;
    border-bottom: 0;
    background: transparent;
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav a {
    padding: 0.75rem;
  }

  .hero {
    min-height: 68vh;
  }

  .hero-content {
    padding: 72px 0;
  }

  .section,
  .article {
    padding: 56px 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .gallery-destinations {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  .gallery-destination,
  .gallery-destination-content {
    min-height: 128px;
  }
}
