/* ==========================================================================
   editorial — Obscura theme
   Inspired by Foam magazine and LensCulture.
   The photography is the point. Everything else recedes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */

:root {
  /* Typography — system stacks that feel editorial, not generic */
  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-body: 'Helvetica Neue', Helvetica, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --font-size-xs: 0.6875rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.1875rem;
  --font-size-xl: 1.625rem;
  --font-size-2xl: 2.25rem;
  --font-size-3xl: 3rem;
  --line-height-tight: 1.2;
  --line-height-base: 1.65;
  --letter-spacing-tight: -0.015em;
  --letter-spacing-wide: 0.1em;

  /* Color — warm, high-contrast, ink-on-paper */
  --color-bg: #f8f7f4;
  --color-bg-subtle: #f0eeea;
  --color-surface: #ffffff;
  --color-text: #1c1b19;
  --color-text-secondary: #5c5850;
  --color-text-tertiary: #8a857b;
  --color-border: #ddd9d1;
  --color-border-subtle: #eae7e1;
  --color-accent: #1c1b19;
  --color-accent-hover: #3a3936;
  --color-link: #1c1b19;
  --color-link-hover: #5c5850;
  --color-overlay: rgba(28, 27, 25, 0.75);
  --color-overlay-light: rgba(28, 27, 25, 0.03);
  --color-highlight: #c45d3e;
  --color-highlight-muted: rgba(196, 93, 62, 0.25);
  --color-code-bg: var(--color-bg-subtle);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --content-width: 72rem;
  --content-narrow: 42rem;
  --header-height: 3.5rem;
  --grid-gap: 0.375rem;

  /* Transitions */
  --duration-fast: 150ms;
  --duration-base: 300ms;
  --duration-slow: 600ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-link-hover);
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border-subtle);
}

.site-title {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text);
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  margin-right: var(--space-xl);
  mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
}

.site-title a {
  color: inherit;
  display: block;
  white-space: nowrap;
}

.site-title a:hover {
  color: var(--color-text-secondary);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.site-nav a {
  font-size: var(--font-size-xs);
  font-weight: 400;
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-text);
  transition: width var(--duration-base) var(--ease-out);
}

.site-nav a:hover {
  color: var(--color-text);
}

.site-nav a:hover::after {
  width: 100%;
}

.site-nav a[aria-current="page"] {
  color: var(--color-text);
}

.site-nav a[aria-current="page"]::after {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Layout Containers
   -------------------------------------------------------------------------- */

.content {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.content--narrow {
  max-width: var(--content-narrow);
}

.content--full {
  max-width: none;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Page Headings
   -------------------------------------------------------------------------- */

.page-title {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--space-xl);
}

.page-subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  font-weight: 400;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-lg);
  line-height: var(--line-height-base);
}

.section-label {
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-lg);
}

.gallery-grid__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Gallery Grid
   -------------------------------------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap);
}

@media (min-width: 40em) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64em) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 90em) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Masonry layout variant — uses CSS Grid with JS-measured row spans */
.gallery-grid--masonry {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 4px;
  gap: var(--grid-gap);
}

@media (min-width: 40em) {
  .gallery-grid--masonry { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64em) {
  .gallery-grid--masonry { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 90em) {
  .gallery-grid--masonry { grid-template-columns: repeat(4, 1fr); }
}

.gallery-grid--masonry .gallery-item {
  aspect-ratio: auto;
  overflow: hidden;
  border-radius: 0;
  /* Fallback height until JS computes the real row span */
  grid-row-end: span 40;
}

.gallery-grid--masonry .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Layout toggle — minimal, borderless */
.gallery-layout-toggle {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.gallery-layout-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-border);
  padding: 2px;
  line-height: 1;
  transition: color var(--duration-fast) var(--ease-out);
}

.gallery-layout-toggle button:hover {
  color: var(--color-text-tertiary);
}

.gallery-layout-toggle button.is-active {
  color: var(--color-text-secondary);
}

.gallery-layout-toggle svg {
  width: 13px;
  height: 13px;
  display: block;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3 / 2;
  background-color: var(--color-bg-subtle);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out),
              filter var(--duration-slow) var(--ease-out);
}

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

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(28, 27, 25, 0.65) 0%,
    rgba(28, 27, 25, 0) 50%
  );
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-sm) var(--space-md);
  color: #ffffff;
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__title {
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.3;
}

.gallery-item__location {
  font-size: var(--font-size-xs);
  opacity: 0.65;
  margin-top: 1px;
}

/* --------------------------------------------------------------------------
   Gallery Index (list of galleries)
   -------------------------------------------------------------------------- */

.gallery-index-content.page-body {
  margin-bottom: var(--space-xl);
  max-width: none;
}

.gallery-content.page-body {
  max-width: none;
  margin-bottom: var(--space-lg);
}

.gallery-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 48em) {
  .gallery-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gallery-card {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: var(--color-bg-subtle);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.gallery-card:hover img {
  transform: scale(1.02);
}

.gallery-card__info {
  position: absolute;
  bottom: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(0, 0, 0, 0.65);
  color: #f0eeea;
}

.gallery-card__title {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: 2px;
}

.gallery-card__count {
  font-size: var(--font-size-xs);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  opacity: 0.7;
  padding-top: var(--space-xs);
  border-top: 1.5px solid var(--color-highlight);
}

/* --------------------------------------------------------------------------
   Photo Permalink Page
   -------------------------------------------------------------------------- */

.photo-detail {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
}

.photo-detail__image {
  margin-bottom: var(--space-xl);
}

.photo-detail__image img {
  width: 100%;
  height: auto;
}

.photo-detail__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: var(--content-narrow);
}

@media (min-width: 48em) {
  .photo-detail__body {
    grid-template-columns: 3fr 2fr;
    grid-template-rows: auto 1fr;
    max-width: none;
  }

  .photo-detail__title {
    grid-column: 1;
    grid-row: 1;
  }

  .photo-detail__caption {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }

  .photo-meta {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
  }

  .photo-detail__body > .photo-backlinks {
    grid-column: 1;
  }

  .photo-detail__back {
    grid-column: 1 / -1;
  }
}

.photo-detail__title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 700;
  line-height: var(--line-height-tight);
}

.photo-detail__caption {
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: var(--line-height-base);
}

.photo-meta {
  list-style: none;
  font-size: var(--font-size-sm);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.photo-meta li {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.photo-meta__label {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

.photo-meta__value {
  color: var(--color-text);
  text-align: right;
  min-width: 0;
}

.photo-meta__value a:not(.tag) {
  color: var(--color-highlight);
  border-bottom: none;
  background-image: linear-gradient(var(--color-highlight), var(--color-highlight));
  background-size: 0% 1px;
  background-position: left bottom;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition:
    background-size 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    color 0.25s var(--ease-out);
}

.photo-meta__value a:not(.tag):hover {
  color: var(--color-highlight);
  background-size: 100% 1px;
}

.photo-meta__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0;
}

/* Back-links */

.photo-backlinks {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.photo-backlinks__title {
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-md);
}

.photo-backlinks__list {
  list-style: none;
}

.photo-backlinks__list li {
  margin-bottom: var(--space-sm);
}

.photo-backlinks__list a {
  font-size: var(--font-size-sm);
  color: var(--color-highlight);
  border-bottom: none;
  background-image: linear-gradient(var(--color-highlight), var(--color-highlight));
  background-size: 0% 1px;
  background-position: left bottom;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition:
    background-size 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    color 0.25s var(--ease-out);
}

.photo-backlinks__list a:hover {
  color: var(--color-highlight);
  background-size: 100% 1px;
}

.photo-detail__back {
  grid-column: 1 / -1;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-subtle);
}

.photo-detail__back a {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.photo-detail__back a:hover {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Photo Card (shortcode embed in blog posts)
   -------------------------------------------------------------------------- */

.photo-card {
  margin: var(--space-xl) 0;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow: hidden;
}

.photo-card a {
  display: block;
  text-decoration: none;
  border-bottom: none;
}

.photo-card a:hover {
  border-bottom: none;
}

.photo-card__image {
  overflow: hidden;
  background: var(--color-bg-subtle);
}

.photo-card__image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out);
}

.photo-card:hover .photo-card__image img {
  transform: scale(1.02);
}

.photo-card__info {
  padding: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
}

.photo-card__title {
  font-family: var(--font-display);
  font-size: var(--font-size-base);
  font-weight: 600;
}

.photo-card__meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Blog
   -------------------------------------------------------------------------- */

/* Blog index */

.post-list {
  list-style: none;
  max-width: var(--content-narrow);
}

.post-list__item {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.post-list__item:first-child {
  padding-top: 0;
}

.post-list__date {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.post-list__title {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 700;
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-sm);
}

.post-list__title a {
  color: var(--color-text);
}

.post-list__title a:hover {
  color: var(--color-text-secondary);
}

.post-list__summary {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-base);
}

.post-list__tags {
  margin-top: var(--space-sm);
}

.tag {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

.tag + .tag::before {
  content: ' · ';
  color: var(--color-border);
}

/* Blog post body */

.post-header {
  max-width: var(--content-narrow);
  margin-bottom: var(--space-2xl);
}

.post-header__date {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.post-header__title {
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

.post-body {
  max-width: var(--content-narrow);
}

.post-body h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 700;
  line-height: var(--line-height-tight);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.post-body h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.post-body p {
  margin-bottom: var(--space-md);
  line-height: var(--line-height-base);
}

.post-body blockquote,
.page-body blockquote {
  border-left: 2px solid var(--color-text);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.post-body pre {
  background: var(--color-code-bg);
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  margin: var(--space-lg) 0;
  border: 1px solid var(--color-border-subtle);
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-code-bg);
  padding: 0.125rem 0.375rem;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body a,
.page-body a {
  color: var(--color-highlight);
  border-bottom: none;
  background-image: linear-gradient(var(--color-highlight), var(--color-highlight));
  background-size: 0% 1px;
  background-position: left bottom, left bottom;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition:
    background-size 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    color 0.25s var(--ease-out);
}

.post-body a:hover,
.page-body a:hover {
  color: var(--color-highlight);
  background-size: 100% 1px;
}

.post-body ul,
.post-body ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.post-body li {
  margin-bottom: var(--space-sm);
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-2xl) 0;
}

/* Photo cards inside post body break out of narrow width */
.post-body .photo-card,
.page-body .photo-card {
  max-width: 56rem;
}

.post-body .photo-card a,
.post-body .photo-card a:hover,
.page-body .photo-card a,
.page-body .photo-card a:hover {
  border-bottom: none;
  background-image: none;
  color: inherit;
}

/* --------------------------------------------------------------------------
   Simple Pages (About, Contact)
   -------------------------------------------------------------------------- */

.page-body {
  max-width: var(--content-narrow);
}

.page-body h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.page-body p {
  margin-bottom: var(--space-md);
  line-height: var(--line-height-base);
}

.page-body ul,
.page-body ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.page-body li {
  margin-bottom: var(--space-sm);
}

.page-body pre {
  background: var(--color-code-bg);
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  margin: var(--space-lg) 0;
  border: 1px solid var(--color-border-subtle);
}

.page-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-code-bg);
  padding: 0.125rem 0.375rem;
}

.page-body pre code {
  background: none;
  padding: 0;
}

/* page-body a styles merged with .post-body a above */

/* --------------------------------------------------------------------------
   Tag Pages
   -------------------------------------------------------------------------- */

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-sm);
}

.tag-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--color-surface);
  border-radius: 2px;
}

.tag-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tag-card:hover .tag-card__image {
  transform: scale(1.04);
}

.tag-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-md);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.1) 50%, transparent 100%);
  transition: background 0.3s ease;
}

.tag-card:hover .tag-card__overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 50%, transparent 100%);
}

.tag-card__name {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: #f0eeea;
  line-height: 1.2;
}

.tag-card__count {
  font-size: var(--font-size-xs);
  color: rgba(240, 238, 234, 0.7);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  margin-top: 0.15em;
}

.tag-page__header {
  margin-bottom: var(--space-lg);
}

.tag-page__count {
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-text-tertiary);
  margin-left: var(--space-xs);
  white-space: nowrap;
}

.tag-page__back {
  margin-top: var(--space-xl);
}

.tag-page__back a {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.tag-page__back a:hover {
  color: var(--color-text);
}

/* Tags as links */
a.tag {
  text-decoration: none;
  color: var(--color-text-tertiary);
  transition: color var(--duration-fast) var(--ease-out);
}

a.tag:hover {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Homepage — Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-height));
  min-height: 400px;
  overflow: hidden;
  margin-bottom: var(--space-2xl);
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.15) 40%,
    transparent 70%
  );
  pointer-events: none;
}

.hero__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-2xl) var(--space-lg);
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.25) 60%,
    transparent 100%
  );
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Thin accent rule — a warm editorial mark */
.hero__rule {
  width: 2.5rem;
  height: 2px;
  background: var(--color-highlight);
  margin-bottom: var(--space-sm);
  animation: hero-rule-draw 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

@keyframes hero-rule-draw {
  from { width: 0; opacity: 0; }
  to { width: 2.5rem; opacity: 1; }
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  font-style: italic;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  color: #f0eeea;
  margin: 0;
  animation: hero-fade-up 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.35s both;
}

@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 48em) {
  .hero {
    height: calc(100vh - var(--header-height));
  }
}

/* --------------------------------------------------------------------------
   Homepage — Intro Text
   -------------------------------------------------------------------------- */

.homepage-intro {
  max-width: 50rem;
  margin: 0 auto var(--space-2xl);
  padding: 0 var(--space-lg);
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  line-height: 1.6;
  color: var(--color-text);
  text-align: justify;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 6 3 2;
  letter-spacing: var(--letter-spacing-tight);
}

.homepage-intro p {
  margin-bottom: var(--space-lg);
}

.homepage-intro p:last-child {
  margin-bottom: 0;
}

@media (min-width: 48em) {
  .homepage-intro {
    font-size: 1.3125rem;
    line-height: 1.55;
  }
}

/* --------------------------------------------------------------------------
   Homepage — Recent Shots
   -------------------------------------------------------------------------- */

/* Prose highlight underlines — used via <u> in Markdown content */
.prose u {
  text-decoration: none;
  background-image:
    linear-gradient(var(--color-highlight), var(--color-highlight)),
    linear-gradient(var(--color-highlight-muted), var(--color-highlight-muted));
  background-size: 0% 2px, 100% 2px;
  background-repeat: no-repeat;
  background-position: bottom left, bottom left;
  padding-bottom: 2px;
  animation: underline-draw 0.8s var(--ease-out) forwards;
  animation-delay: 0.3s;
}

@keyframes underline-draw {
  to {
    background-size: 100% 2px, 100% 2px;
  }
}

/* Also enable prose styling on page bodies */
.page-body u,
.post-body u {
  text-decoration: none;
  background-image: linear-gradient(var(--color-highlight), var(--color-highlight));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: bottom left;
  padding-bottom: 2px;
}

.recent-shots__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.recent-shots__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.recent-shots__link {
  font-size: var(--font-size-xs);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.recent-shots__link:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-xl) var(--space-lg);
  margin-top: auto;
}

.site-footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  text-align: center;
}

.site-footer a {
  color: var(--color-text-tertiary);
}

.site-footer a:hover {
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   404 Page
   -------------------------------------------------------------------------- */

.error-page {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.error-page__code {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-border);
  margin-bottom: var(--space-md);
}

.error-page__message {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

.error-page__links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  font-size: var(--font-size-sm);
}

.error-page__links a {
  border-bottom: 1px solid var(--color-border);
}

.error-page__links a:hover {
  border-color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Dark Mode
   -------------------------------------------------------------------------- */

/* System preference — applies when no manual override is set */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #121211;
    --color-bg-subtle: #1b1b19;
    --color-surface: #1f1f1d;
    --color-text: #e5e3de;
    --color-text-secondary: #908b82;
    --color-text-tertiary: #605c55;
    --color-border: #2c2c28;
    --color-border-subtle: #232320;
    --color-accent: #e5e3de;
    --color-accent-hover: #c5c3be;
    --color-link: #e0906e;
    --color-link-hover: #d4745a;
    --color-overlay: rgba(18, 18, 17, 0.85);
    --color-overlay-light: rgba(229, 227, 222, 0.04);
    --color-highlight: #d4745a;
    --color-highlight-muted: rgba(212, 116, 90, 0.3);
    --color-code-bg: #262622;
  }
}

/* Manual dark override */
:root[data-theme="dark"] {
  --color-bg: #121211;
  --color-bg-subtle: #1b1b19;
  --color-surface: #1f1f1d;
  --color-text: #e5e3de;
  --color-text-secondary: #908b82;
  --color-text-tertiary: #605c55;
  --color-border: #2c2c28;
  --color-border-subtle: #232320;
  --color-accent: #e5e3de;
  --color-accent-hover: #c5c3be;
  --color-link: #d4a898;
  --color-link-hover: #d4745a;
  --color-overlay: rgba(18, 18, 17, 0.85);
  --color-highlight: #d4745a;
  --color-highlight-muted: rgba(212, 116, 90, 0.3);
  --color-overlay-light: rgba(229, 227, 222, 0.04);
  --color-code-bg: #262622;
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: var(--space-xs);
  line-height: 1;
  transition: color var(--duration-fast) var(--ease-out);
}

.theme-toggle:hover {
  color: var(--color-text);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

/* Show sun in dark mode, moon in light mode */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
}

/* --------------------------------------------------------------------------
   Mobile Navigation — The Dark Curtain
   -------------------------------------------------------------------------- */

.nav-toggle {
  display: none;
}

@media (max-width: 47.999em) {
  /* Hamburger button */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 2rem;
    height: var(--header-height);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 201;
    padding: 0;
  }

  .nav-toggle__line {
    display: block;
    width: 1.25rem;
    height: 1.5px;
    background: var(--color-text);
    transition: transform var(--duration-base) var(--ease-out),
                opacity var(--duration-fast) var(--ease-out);
    transform-origin: center;
  }

  /* X state — invert color to contrast against curtain */
  .nav-toggle[aria-expanded="true"] .nav-toggle__line {
    background: var(--color-bg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__line:first-child {
    transform: translateY(3.75px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__line:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
  }

  :root[data-theme="dark"] .nav-toggle[aria-expanded="true"] .nav-toggle__line {
    background: var(--color-text);
  }

  /* Overlay nav */
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    background: var(--color-text);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-slow) var(--ease-out),
                visibility 0s linear var(--duration-slow);
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--duration-slow) var(--ease-out),
                visibility 0s linear 0s;
  }

  /* Nav links — larger, serif, cinematic */
  .site-nav a {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    text-transform: none;
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-bg);
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
  }

  .site-nav.is-open a {
    opacity: 1;
    transform: translateY(0);
  }

  /* Staggered entrance */
  .site-nav.is-open a:nth-child(1) { transition-delay: 150ms; }
  .site-nav.is-open a:nth-child(2) { transition-delay: 200ms; }
  .site-nav.is-open a:nth-child(3) { transition-delay: 250ms; }
  .site-nav.is-open a:nth-child(4) { transition-delay: 300ms; }

  .site-nav a:hover,
  .site-nav a:focus-visible {
    color: var(--color-bg-subtle);
  }

  .site-nav a::after {
    display: none;
  }

  .site-nav a[aria-current="page"] {
    color: var(--color-bg);
    opacity: 1;
  }

  .site-nav a[aria-current="page"]::before {
    content: '';
    position: absolute;
    left: -1.25rem;
    top: 50%;
    width: 0.5rem;
    height: 1.5px;
    background: var(--color-bg);
    transform: translateY(-50%);
  }

  /* Theme toggle repositioned inside overlay */
  .site-nav .theme-toggle {
    margin-top: var(--space-lg);
    color: var(--color-bg);
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
  }

  .site-nav.is-open .theme-toggle {
    opacity: 0.6;
    transform: translateY(0);
    transition-delay: 350ms;
  }

  .site-nav.is-open .theme-toggle:hover {
    opacity: 1;
  }

  /* Dark mode: invert the curtain to light */
  :root[data-theme="dark"] .site-nav {
    background: var(--color-bg);
  }

  :root[data-theme="dark"] .site-nav a {
    color: var(--color-text);
  }

  :root[data-theme="dark"] .site-nav a:hover,
  :root[data-theme="dark"] .site-nav a:focus-visible {
    color: var(--color-text-secondary);
  }

  :root[data-theme="dark"] .site-nav a[aria-current="page"] {
    color: var(--color-text);
  }

  :root[data-theme="dark"] .site-nav a[aria-current="page"]::before {
    background: var(--color-text);
  }

  :root[data-theme="dark"] .site-nav .theme-toggle {
    color: var(--color-text);
  }

  /* System dark when no explicit theme */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .site-nav {
      background: var(--color-bg);
    }

    :root:not([data-theme="light"]) .site-nav a {
      color: var(--color-text);
    }

    :root:not([data-theme="light"]) .site-nav a:hover,
    :root:not([data-theme="light"]) .site-nav a:focus-visible {
      color: var(--color-text-secondary);
    }

    :root:not([data-theme="light"]) .site-nav a[aria-current="page"] {
      color: var(--color-text);
    }

    :root:not([data-theme="light"]) .site-nav a[aria-current="page"]::before {
      background: var(--color-text);
    }

    :root:not([data-theme="light"]) .site-nav .theme-toggle {
      color: var(--color-text);
    }

    :root:not([data-theme="light"]) .nav-toggle[aria-expanded="true"] .nav-toggle__line {
      background: var(--color-text);
    }
  }

  /* Prevent body scroll when menu is open */
  html.nav-open {
    overflow: hidden;
  }
}

/* --------------------------------------------------------------------------
   Social Links
   -------------------------------------------------------------------------- */

.social-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xs);
}

.social-links__link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  transition: color var(--duration-fast) var(--ease-out);
}

.social-links__link:hover {
  color: var(--color-text);
}

.social-links__icon {
  width: 1rem;
  height: 1rem;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
