/* ─── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
img { display: block; max-width: 100%; height: auto; }

/* ─── Tokens ─────────────────────────────────────── */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --color-bg:      #fafaf8;
  --color-surface: #f4f3f0;
  --color-text:    #1a1a18;
  --color-muted:   #6b6b66;
  --color-accent:  #2c5f4a;
  --color-accent-dk: #1e4234;
  --color-border:  #e0dfd8;
  --nav-h: 64px;
  --radius: 6px;
  --trans: 0.18s ease;
}

/* ─── Base ───────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-h);
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: normal; line-height: 1.25; }
p + p { margin-top: 1.25rem; }

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--trans), color var(--trans);
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: 2px; }

/* ─── Layout ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--narrow {
  max-width: 620px;
}
.container--wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

/* ─── Nav ────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.nav__name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.nav__name:hover { color: var(--color-accent); text-decoration: none; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--trans);
}
.nav__links a:hover,
.nav__links a.active { color: var(--color-accent); }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav__toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--color-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Hero ───────────────────────────────────────── */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: 6rem 0;
}
.hero__name {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}
.hero__tagline {
  font-size: 1.125rem;
  color: var(--color-muted);
  max-width: 500px;
  margin-bottom: 2.5rem;
}
.hero__links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.hero__cta {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--trans), gap var(--trans);
}
.hero__cta:hover { color: var(--color-accent-dk); text-decoration: none; }
.hero__cta--secondary { color: var(--color-muted); }
.hero__cta--secondary:hover { color: var(--color-text); }

/* ─── Page Header ────────────────────────────────── */
.page-header {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--color-border);
}
.page-header h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 0.75rem; }
.page-intro { color: var(--color-muted); max-width: 520px; font-size: 1.05rem; }

/* ─── Posts ──────────────────────────────────────── */
.posts { padding: 3rem 0 6rem; }
.posts__empty {
  color: var(--color-muted);
  font-style: italic;
  padding: 3rem 0;
}

.post-entry {
  display: block;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
}
.post-entry:first-child { border-top: 1px solid var(--color-border); }
.post-entry:hover .post-entry__title { color: var(--color-accent); }
.post-entry__meta {
  font-size: 0.8rem;
  color: var(--color-muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}
.post-entry__title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--color-text);
  transition: color var(--trans);
  margin-bottom: 0.5rem;
}
.post-entry__excerpt {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.6;
}
.post-entry__date {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}
.post-entry__title a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--trans);
}
.post-entry__title a:hover { color: var(--color-accent); }
.post-date {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 2.5rem;
  display: block;
}
.post-body { padding: 2.5rem 0 6rem; font-size: 1.0625rem; line-height: 1.8; }
.post-body p { margin-bottom: 1.25rem; }
.post-body h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
.post-body h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }

/* ─── Single Post ────────────────────────────────── */
.post-content {
  padding: 3rem 0 6rem;
}
.post-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
}
.post-content .post-date {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 2.5rem;
  display: block;
}
.post-body { font-size: 1.0625rem; line-height: 1.8; }
.post-body h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
.post-body h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
.post-body p + p { margin-top: 1.25rem; }
.post-body a { color: var(--color-accent); text-decoration-color: var(--color-accent); }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin: 1rem 0; }
.post-body li { margin-bottom: 0.4rem; }
.post-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-muted);
  font-style: italic;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--color-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color var(--trans);
}
.back-link:hover { color: var(--color-accent); text-decoration: none; }

/* ─── Bio ────────────────────────────────────────── */
.bio-content { padding: 3rem 0 6rem; }
.bio-contact {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--trans);
}
.contact-link:hover { color: var(--color-accent-dk); text-decoration: none; }

/* ─── Photos ─────────────────────────────────────── */
.photos-section { padding: 3rem 0 6rem; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.photo-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  position: relative;
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.photo-item:hover img { transform: scale(1.03); }
.photo-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  font-size: 0.75rem;
  padding: 1.5rem 0.65rem 0.5rem;
  text-align: center;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* Lightbox caption */
#lightboxInner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
#lightboxCaption {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-align: center;
}

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
#lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}
#lightboxClose {
  position: fixed;
  top: 1.25rem; right: 1.5rem;
  background: none; border: none;
  color: white; font-size: 2.5rem;
  cursor: pointer; line-height: 1;
  z-index: 201;
}
#lightboxPrev, #lightboxNext {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: white; font-size: 3rem;
  cursor: pointer; line-height: 1;
  padding: 0 1rem;
  z-index: 201;
  opacity: 0.7;
  transition: opacity 0.2s;
}
#lightboxPrev:hover, #lightboxNext:hover { opacity: 1; }
#lightboxPrev { left: 0.5rem; }
#lightboxNext { right: 0.5rem; }

/* ─── Footer ─────────────────────────────────────── */
footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
}
footer p { font-size: 0.78rem; color: var(--color-muted); }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 639px) {
  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem 1.5rem 1rem;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.6rem 0; font-size: 1rem; border-bottom: 1px solid var(--color-border); }
  .nav__links li:last-child a { border-bottom: none; }
  .nav__toggle { display: flex; }

  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 3rem 0; }
}

@media (max-width: 400px) {
  .photo-grid { grid-template-columns: 1fr; }
}
