:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10;
  --text: #ece7df;
  --muted: #9f998f;
  --line: rgba(236, 231, 223, 0.12);
  --line-soft: rgba(236, 231, 223, 0.06);
  --accent: #d8b07a;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f2eb;
  --text: #171513;
  --muted: #6d655d;
  --line: rgba(23, 21, 19, 0.14);
  --line-soft: rgba(23, 21, 19, 0.08);
  --accent: #956438;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Manrope", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page-shell {
  width: min(1160px, calc(100% - 2.75rem));
  margin: 0 auto;
  padding: 1.85rem 0 3.5rem;
}

.site-header,
.site-footer,
.listing-hero,
.listing-stack,
.prose-shell {
  border-top: 1px solid var(--line);
}

.site-header,
.site-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.site-header {
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: baseline;
  min-width: 0;
}

.brand strong {
  font-size: 1rem;
  font-weight: 700;
}

.brand span {
  white-space: nowrap;
}

.brand span,
.site-nav a,
.footer-links a,
.intro-text,
.entry-row p,
.photo-note-inner p,
.prose-body,
.listing-hero p {
  color: var(--muted);
}

.site-nav,
.footer-links,
.links-line {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.theme-toggle {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.site-nav a,
.footer-links a,
.links-line a,
.section-heading a {
  font-size: 0.95rem;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: stretch;
  padding: 2.75rem 0 1.75rem;
}

.intro-copy {
  min-width: 0;
  display: grid;
  align-content: start;
}

.eyebrow,
.section-heading p,
.story-date,
.inline-meta,
.utility-item span,
.live-cluster-heading span {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-transform: uppercase;
}

.intro h1,
.listing-hero h1,
.prose-shell h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  max-width: 15ch;
}

.intro-text {
  max-width: 42rem;
  margin: 0.95rem 0 0;
  line-height: 1.6;
  font-size: 0.96rem;
}

.intro-mark-shell {
  height: 100%;
  width: auto;
  aspect-ratio: 1 / 1;
  min-width: 11.5rem;
  max-width: 12.5rem;
  align-self: stretch;
}

.intro-mark {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  object-fit: cover;
}

.links-line,
.home-status,
.listing-hero,
.prose-shell {
  padding: 1.3rem 0;
}

.links-line,
.home-status,
.home-grid {
  border-top: 1px solid var(--line-soft);
}

.home-status {
  display: grid;
  gap: 1.15rem;
}

.utility-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 2rem;
}

.utility-item {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.utility-item[hidden] {
  display: none;
}

.utility-item strong,
.entry-row strong,
.photo-note-inner strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.live-cluster {
  display: grid;
  gap: 0.95rem;
  align-items: start;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line-soft);
}

.live-cluster[hidden] {
  display: none;
}

.live-cluster-heading {
  display: flex;
  align-items: baseline;
}

.live-cluster-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.4rem;
  align-items: start;
}

.status-chip {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  align-content: start;
  padding-top: 0.1rem;
}

.status-chip[hidden] {
  display: none;
}

.status-chip span {
  margin: 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-chip strong {
  display: block;
  min-width: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.42;
  max-width: 34ch;
  text-wrap: pretty;
}

.status-chip-wide {
  grid-column: span 1;
}

.status-chip[data-rich-presence="true"] span {
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
}

.links-line {
  gap: 1.85rem;
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
}

.home-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.6rem 0;
  align-items: stretch;
}

.home-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.post-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-soft);
  align-content: start;
  min-height: 100%;
}

.post-card strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.post-card p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.photo-feature {
  padding: 1.3rem 0;
  border-top: 1px solid var(--line-soft);
}

.photo-feature-inner {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.photo-feature-inner img {
  width: 280px;
  height: 157px;
  object-fit: cover;
  object-position: center;
}

.photo-feature-meta {
  display: grid;
  gap: 0.25rem;
}

.home-section,
.listing-stack,
.prose-shell {
  min-width: 0;
}

.home-section {
  display: flex;
  flex-direction: column;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}

.section-heading a {
  margin-left: auto;
  text-align: right;
}

.entry-list {
  display: grid;
  flex: 1;
}

.entry-row {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line-soft);
  align-content: start;
  min-height: 100%;
}

.entry-row:first-child {
  border-top: 0;
  padding-top: 0.35rem;
}

.entry-row p,
.photo-note-inner p,
.prose-body p,
.prose-body ul,
.prose-body ol,
.prose-body blockquote,
.list-entry p,
.gallery-caption p {
  margin: 0;
  line-height: 1.7;
}

.feature-row .inline-meta {
  margin-top: 0.15rem;
}

.photo-note-inner {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.photo-note-inner img {
  width: 144px;
  height: 144px;
  object-fit: cover;
}

.photo-note {
  padding-top: 1.35rem;
  padding-bottom: 1.35rem;
}

.photo-preview {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(6, 7, 9, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 40;
}

.photo-preview-frame {
  width: min(84vw, 1120px);
  max-height: min(84vh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(236, 231, 223, 0.14);
  background: rgba(10, 11, 14, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  transform: translateY(10px) scale(0.975);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-preview-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.photo-preview-meta {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.photo-preview-meta strong {
  font-size: 1rem;
  font-weight: 600;
}

.photo-preview-meta span {
  color: var(--muted);
  line-height: 1.55;
}

.photo-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.photo-preview-actions button,
.photo-preview-actions a {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.photo-preview-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

.photo-preview-viewport {
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 0;
  background: rgba(255, 255, 255, 0.02);
  touch-action: none;
}

.photo-preview-viewport img {
  width: auto;
  max-width: 100%;
  max-height: min(68vh, 760px);
  object-fit: contain;
  transform-origin: center center;
  cursor: zoom-in;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.photo-preview img {
  cursor: default;
}

.is-zoomed .photo-preview-viewport img,
.is-zoomed .photo-detail-viewport img {
  cursor: grab;
}

.is-panning .photo-preview-viewport img,
.is-panning .photo-detail-viewport img {
  cursor: grabbing;
}

[data-photo-viewer].is-photo-preview-visible .photo-preview {
  opacity: 1;
  pointer-events: auto;
}

[data-photo-viewer].is-photo-preview-visible .photo-preview-frame {
  transform: translateY(0) scale(1);
}

.photo-gallery {
  column-count: 3;
  column-gap: 1.25rem;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--line-soft);
}

.gallery-item {
  break-inside: avoid;
  margin: 0 0 1.5rem;
}

.gallery-link {
  display: block;
  position: relative;
  overflow: hidden;
}

.gallery-link img {
  width: 100%;
  height: auto;
}

.gallery-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 0.3rem;
  padding: 1rem 0.95rem 0.9rem;
  background: linear-gradient(180deg, rgba(11, 13, 16, 0) 0%, rgba(11, 13, 16, 0.86) 46%, rgba(11, 13, 16, 0.96) 100%);
  color: #f4efe8;
  opacity: 0;
  transition: opacity 180ms ease;
}

.gallery-link:hover .gallery-overlay,
.gallery-link:focus-visible .gallery-overlay {
  opacity: 1;
}

.gallery-overlay strong {
  font-size: 0.96rem;
  font-weight: 600;
}

.gallery-overlay span {
  font-size: 0.88rem;
  line-height: 1.55;
}

.gallery-overlay-meta {
  color: rgba(244, 239, 232, 0.72);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.photo-detail {
  border-top: 1px solid var(--line-soft);
  padding-top: 1rem;
}

.page-shell.page-photo-detail {
  padding-bottom: 1.25rem;
}

.page-photo-detail .site-header {
  padding-bottom: 0.75rem;
}

.photo-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 2rem;
  min-height: calc(100vh - 8.75rem);
  align-items: stretch;
}

.photo-detail-figure {
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.9rem;
  min-height: 0;
}

.photo-detail-viewer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.photo-detail-viewer-controls button,
.photo-detail-viewer-controls a {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.photo-detail-viewer-controls button:disabled {
  opacity: 0.45;
  cursor: default;
}

.photo-detail-viewport {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  touch-action: none;
}

.photo-detail-viewport img {
  width: 100%;
  max-height: calc(100vh - 13rem);
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  will-change: transform;
}

.photo-detail-sidebar {
  display: grid;
  align-content: center;
  gap: 1.25rem;
  min-height: 0;
  max-width: 24rem;
  margin: 0 auto;
}

.photo-detail-topline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line-soft);
}

.photo-detail-topline a {
  color: var(--muted);
  font-size: 0.95rem;
}

.photo-detail-header {
  display: grid;
  gap: 0.8rem;
}

.photo-detail-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.photo-detail-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.photo-detail-meta-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line-soft);
}

.photo-detail-meta-list dt {
  margin: 0 0 0.2rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
}

.photo-detail-meta-list dd {
  margin: 0;
  color: var(--text);
}

.photo-detail-nav {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line-soft);
  padding-top: 1rem;
}

.photo-detail-nav a {
  font-size: 0.95rem;
  color: var(--muted);
}

.listing-hero {
  padding-top: 2.6rem;
}

.listing-hero h1 {
  max-width: none;
}

.listing-stack {
  display: grid;
}

.list-entry {
  padding: 1.15rem 0;
  border-top: 1px solid var(--line-soft);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.tag {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.prose-shell {
  padding-top: 2.6rem;
}

.prose-body {
  margin-top: 1.25rem;
}

.prose-body p,
.prose-body ul,
.prose-body ol,
.prose-body blockquote {
  margin-bottom: 1rem;
}

.prose-body ul,
.prose-body ol {
  padding-left: 1.25rem;
}

.prose-body blockquote {
  border-left: 1px solid var(--line-soft);
  padding-left: 1rem;
}

.inline-separator {
  color: var(--muted);
  margin: 0 0.5rem;
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100% - 1.5rem, 980px);
  }

  .intro {
    gap: 1.5rem;
    padding-top: 2.2rem;
  }

  .intro-mark-shell {
    min-width: 9rem;
    max-width: 9.75rem;
  }

  .links-line {
    gap: 1.1rem 1.4rem;
  }

  .live-cluster {
    gap: 0.9rem;
  }

  .home-posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-feature-inner {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
  }

  .photo-feature-inner img {
    width: 220px;
    height: 148px;
  }

  .photo-detail-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .photo-detail-figure img {
    max-height: none;
  }

  .photo-detail-viewport img {
    max-height: 68vh;
  }

  .photo-detail-sidebar {
    max-width: none;
    margin: 0;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 1.25rem, 1080px);
  }

  .site-footer,
  .photo-note-inner {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .home-grid {
    align-items: stretch;
  }

  .home-posts-grid {
    grid-template-columns: 1fr;
  }

  .photo-feature-inner {
    grid-template-columns: 1fr;
  }

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

  .site-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    row-gap: 0.9rem;
    column-gap: 1rem;
  }

  .brand {
    display: grid;
    gap: 0.12rem;
    align-items: start;
  }

  .brand span {
    white-space: normal;
    line-height: 1.35;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 0.75rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line-soft);
  }

  .site-nav a,
  .theme-toggle {
    font-size: 0.92rem;
  }

  .utility-strip,
  .live-cluster-items {
    grid-template-columns: 1fr;
  }

  .home-status {
    gap: 1rem;
  }

  .utility-strip {
    gap: 0.85rem;
  }

  .utility-item {
    gap: 0.2rem;
  }

  .live-cluster {
    padding-top: 0.95rem;
  }

  .entry-list {
    grid-template-rows: none;
  }

  .theme-toggle {
    margin-left: 0;
    justify-self: start;
    align-self: start;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.6rem 0 1rem;
  }

  .intro h1,
  .listing-hero h1,
  .prose-shell h1 {
    font-size: clamp(1.8rem, 11vw, 2.8rem);
  }

  .intro-mark-shell {
    width: 6.25rem;
    height: 6.25rem;
    min-width: 0;
    max-width: none;
    align-self: start;
  }

  .links-line {
    gap: 0.85rem 1.15rem;
  }

  .photo-gallery {
    column-count: 2;
    column-gap: 1rem;
  }

  .photo-detail-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .photo-detail-figure img {
    max-height: none;
  }

  .photo-detail-viewport img {
    max-height: 70vh;
  }

  .photo-preview {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-nav {
    justify-content: flex-start;
    gap: 1rem;
  }

  .photo-preview-topline {
    grid-template-columns: 1fr;
    display: grid;
  }

  .photo-preview-actions {
    justify-content: flex-start;
  }

  .photo-gallery {
    column-count: 1;
  }
}
