/*
  Maurice Frank — Design System & Styles
  Aesthetic: Swiss Minimalist UI + Structured Editorial UX
  Typography: Atkinson Hyperlegible
  Palette: Pure monochrome, crisp hairline geometry, high-density clarity
*/

@import url('tokens.css');

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-xl);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  color-scheme: light dark;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Layout Container */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 var(--space-lg);
}

@media (min-width: 900px) {
  .site-wrapper {
    flex-direction: row;
    padding: 0 var(--space-xl);
    gap: var(--space-3xl);
  }
}

/* Sticky Sidebar */
.site-sidebar {
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--border-hairline);
}

@media (min-width: 900px) {
  .site-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-bottom: none;
    border-right: 1px solid var(--border-hairline);
    padding: var(--space-3xl) var(--space-xl) var(--space-2xl) 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    scrollbar-width: none;
  }
  .site-sidebar::-webkit-scrollbar {
    display: none;
  }
}

.sidebar-header {
  margin-bottom: var(--space-xl);
}

.sidebar-portrait {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid var(--border-hairline);
  margin-bottom: var(--space-md);
  background: var(--bg-subtle);
}

.site-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: var(--space-xs);
}

.site-subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: var(--space-md);
}

.sidebar-bio {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: var(--space-xl);
}

/* Sidebar Nav */
.sidebar-nav {
  margin-bottom: var(--space-xl);
}

.nav-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: var(--space-sm);
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 2px;
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
  border-left: 2px solid var(--text-primary);
  padding-left: 8px;
}

/* Sidebar Footer & Links */
.sidebar-footer {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-hairline);
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.social-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.social-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Main Content Area */
.site-main {
  flex-grow: 1;
  max-width: var(--content-max-width);
  padding: var(--space-2xl) 0 var(--space-3xl);
}

@media (min-width: 900px) {
  .site-main {
    padding: var(--space-3xl) 0 var(--space-3xl);
  }
}

/* Content Sections */
.content-section {
  margin-bottom: var(--space-3xl);
  scroll-margin-top: var(--space-xl);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

/* Rule runs from the title to the right edge; an empty box sits on the text baseline. */
.section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--text-primary);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Lead & Intro */
.lead-intro {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

.intro-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-lg);
}

/* Dual Focus List */
.dual-focus-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  border-top: 1px solid var(--border-hairline);
  padding-top: var(--space-md);
}

@media (min-width: 600px) {
  .dual-focus-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.focus-col h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.focus-list {
  list-style: none;
}

.focus-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-hairline);
  display: flex;
  justify-content: space-between;
}

.focus-list li:last-child {
  border-bottom: none;
}

.focus-list .tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Generic Minimal Card Grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 600px) {
  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.cards-grid.single-col {
  grid-template-columns: 1fr;
}

.card-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

.card-item:hover {
  border-color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.card-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xs);
}

.card-item-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-item-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.card-item-logo.is-mark {
  width: 1.5rem;
  height: 1.5rem;
}

.card-item-logo.is-wordmark {
  height: 1.15rem;
  width: auto;
  max-width: 7.5rem;
}

.card-item-logo.is-wide {
  height: 1.7rem;
  max-width: 9.5rem;
}

@media (prefers-color-scheme: dark) {
  .card-item-logo.is-ink {
    filter: invert(1);
  }
}

.card-item-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-item-title a {
  color: inherit;
  text-decoration: none;
}

.card-item-title a:hover {
  text-decoration: underline;
}

a.card-item {
  color: inherit;
}

a.card-item:hover .card-item-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-item-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.card-item-role {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.card-item-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-sm);
  flex-grow: 1;
}

.card-item-tags {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Minimal CV Table */
.cv-compact-section {
  margin-top: var(--space-xl);
  border-top: 1px solid var(--border-hairline);
  padding-top: var(--space-lg);
}

.cv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.cv-table tr {
  border-bottom: 1px solid var(--border-hairline);
}

.cv-table td {
  padding: 0.6rem 0;
  vertical-align: baseline;
}

.cv-date-col {
  width: 125px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.cv-title-col {
  font-weight: 500;
  color: var(--text-primary);
}

.cv-title-col a {
  color: var(--text-primary);
  text-decoration: none;
}

.cv-title-col a:hover {
  text-decoration: underline;
}

.cv-detail-col {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  font-family: var(--font-mono);
}

@media (max-width: 550px) {
  .cv-table tr {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
  }
  .cv-table td {
    padding: 1px 0;
  }
  .cv-detail-col {
    text-align: left;
  }
}

/* Software & GitHub Items */
.software-list {
  display: flex;
  flex-direction: column;
}

.software-item {
  position: relative;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

@media (min-width: 600px) {
  .software-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }
}

.software-item:hover {
  background-color: var(--bg-subtle);
  padding-left: var(--space-sm);
  margin: 0 calc(-1 * var(--space-sm));
  padding-right: var(--space-sm);
}

.software-left {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  min-width: 0;
  column-gap: var(--space-md);
}

.software-left > :not(.software-icon) {
  grid-column: 2;
}

.software-icon {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--bg-subtle);
}

.software-icon--logo {
  object-fit: contain;
  padding: 4px;
}

@media (max-width: 599px) {
  .software-right {
    padding-left: calc(40px + var(--space-md));
    margin-top: var(--space-xs);
  }
}

@media (min-width: 600px) {
  .software-right {
    align-items: flex-end;
    padding-left: var(--space-md);
  }
}

@media (min-width: 600px) {
  .software-item {
    align-items: center;
  }
}

.software-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

/* The name's link covers the whole row; the badges sit above it as their own links. */
.software-name::after {
  content: "";
  position: absolute;
  inset: 0;
}

.software-item:hover .software-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.software-name:focus-visible {
  outline: none;
}

.software-item:has(.software-name:focus-visible) {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.software-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.software-links {
  display: flex;
  gap: 4px;
}

.gh-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.4;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.gh-pill svg {
  width: 11px;
  height: 11px;
}

.gh-pill:hover,
.gh-pill:focus-visible {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.software-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.software-tech {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.software-tech::before {
  content: " · ";
}

/* Playable Media & Audio Cards */
.media-subsection {
  margin-top: var(--space-xl);
}

.section-header + .media-subsection {
  margin-top: 0;
}

.media-subsection .nav-label {
  margin-bottom: var(--space-xs);
}

.media-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 600px) {
  .media-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.media-card,
.video-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.media-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xs);
}

.media-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.media-card-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.media-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.media-card-link {
  margin-bottom: var(--space-sm);
}

/* Horizontal media strips */
.media-scroller-wrap {
  position: relative;
  /* Lanes bleed past the column to the viewport edge; --bleed is set by script. */
  margin-right: calc(-1 * var(--bleed, 0px));
  container-type: inline-size;
  container-name: media-strip;
}

.media-scroller-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 56px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--bg-app));
}

.video-scroller::-webkit-scrollbar {
  display: none;
}

.video-scroller {
  display: flex;
  align-items: stretch;
  gap: var(--space-md);
  padding-right: var(--bleed, 0px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.video-card {
  flex: 0 0 min(78%, 34rem);
  padding: 0;
  overflow: hidden;
  justify-content: flex-start;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.video-overlay .media-card-desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: oklch(1 0 0 / 0.9);
  text-shadow: 0 1px 3px oklch(0 0 0 / 0.65);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Poster fills the tile; title, year, length and description sit over it until playback starts. */
.video-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  background: oklch(0 0 0);
  cursor: pointer;
}

.video-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: oklch(0 0 0);
}

.video-card.is-floating video {
  position: fixed;
  right: var(--space-lg);
  bottom: var(--space-lg);
  z-index: 50;
  width: min(640px, calc(100vw - 2.5rem));
  height: auto;
  border-radius: 4px;
  box-shadow: 0 8px 30px oklch(0 0 0 / 0.35);
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.65rem 0.8rem;
  background: linear-gradient(180deg, oklch(0 0 0 / 0.6) 0, transparent 35%, transparent 45%, oklch(0 0 0 / 0.8) 100%);
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.video-card.is-playing .video-overlay {
  opacity: 0;
}

.video-card.is-playing .video-play {
  pointer-events: none;
}

.video-overlay-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.video-overlay .media-card-title {
  color: oklch(1 0 0);
  text-shadow: 0 1px 3px oklch(0 0 0 / 0.65);
}

.video-overlay-meta {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: oklch(1 0 0 / 0.85);
  text-shadow: 0 1px 3px oklch(0 0 0 / 0.65);
}

/* Year and length share the top-right corner as "2023 · 3:12". */
.video-overlay-meta + .video-overlay-meta {
  margin-left: 0;
}

.video-overlay-meta + .video-overlay-meta:empty {
  display: none;
}

.video-overlay-meta + .video-overlay-meta::before {
  content: "·";
  margin-right: 10px;
}

.video-play {
  align-self: center;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: oklch(0 0 0 / 0.55);
  color: oklch(1 0 0);
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  transition: background 0.15s ease, color 0.15s ease;
}

.video-play svg {
  width: 18px;
  height: 18px;
}

.video-play:hover,
.video-play:focus-visible {
  background: oklch(1 0 0);
  color: oklch(0 0 0);
}

.video-play:focus-visible {
  outline: 2px solid oklch(1 0 0);
  outline-offset: 2px;
}

/* Photography: equal-gap mosaic rows, each scrolling sideways on its own */
.photo-scroller {
  --photo-h: 10rem;
  --photo-gap: 6px;
  display: flex;
  flex-direction: column;
  gap: var(--photo-gap);
}

.photo-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--photo-gap);
  height: var(--photo-h);
  padding-right: var(--bleed, 0px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.photo-row::-webkit-scrollbar {
  display: none;
}

.photo-item {
  flex: 0 0 auto;
  width: max-content;
  max-height: var(--photo-h);
  scroll-snap-align: start;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--tone, var(--bg-subtle));
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  line-height: 0;
  color: inherit;
}

.photo-item:hover img,
.photo-item:focus-visible img {
  opacity: 0.9;
}

.photo-item:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.photo-item img {
  display: block;
  height: var(--photo-h);
  width: auto;
  object-fit: cover;
  transition: opacity 0.15s ease;
}

/* Custom audio controls */
.audio-player {
  --audio-progress: 0%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--space-xs);
  min-height: 2.25rem;
}

.audio-player audio {
  display: none;
}

.audio-player-play {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border-medium);
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
}

.audio-player-play:hover,
.audio-player-play:focus-visible {
  border-color: var(--text-primary);
}

.audio-player.is-playing .audio-player-play {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-app);
}

.audio-player-play:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.audio-player-play svg {
  width: 12px;
  height: 12px;
}

.audio-icon-pause,
.is-playing .audio-icon-play {
  display: none;
}

.is-playing .audio-icon-pause {
  display: block;
}

/* One bar at the bottom of the window, saying what is playing and stopping it. */
body:has(.playback-bar:not([hidden])) {
  padding-bottom: 5rem;
}

.playback-bar {
  position: fixed;
  left: 50%;
  bottom: var(--space-md);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: min(560px, calc(100vw - 2rem));
  transform: translateX(-50%);
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  background: var(--bg-surface);
  box-shadow: 0 6px 24px oklch(0 0 0 / 0.14);
}

.playback-bar[hidden] {
  display: none;
}

:where(.playback-bar button) {
  appearance: none;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.playback-bar button:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.playback-bar-toggle {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--bg-app);
}

.playback-bar-toggle svg {
  width: 13px;
  height: 13px;
}

.playback-bar-info {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.playback-bar-title {
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.playback-bar-meta {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.playback-bar-show {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-underline-offset: 4px;
}

.playback-bar-show:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.playback-bar-stop {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--text-muted);
}

.playback-bar-stop:hover {
  color: var(--text-primary);
}

.playback-bar-stop svg {
  width: 13px;
  height: 13px;
}

.audio-player-seek {
  flex: 1 1 auto;
  min-width: 0;
  height: 1.25rem;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(
    to right,
    var(--text-primary) 0 var(--audio-progress),
    var(--border-hairline) var(--audio-progress) 100%
  );
  background-size: 100% 2px;
  background-position: center;
  background-repeat: no-repeat;
  accent-color: var(--text-primary);
  cursor: pointer;
}

.audio-player-seek:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}

.audio-player-seek::-webkit-slider-runnable-track {
  height: 2px;
  background: transparent;
}

.audio-player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 50%;
  background: var(--text-primary);
}

.audio-player-seek::slider-track {
  background: transparent;
  height: 2px;
}

.audio-player-seek::slider-fill {
  background: var(--text-primary);
  height: 2px;
}

.audio-player-seek::slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: var(--text-primary);
}

.audio-player-time {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  min-width: 5.6em;
  text-align: right;
}

.audio-player-sep {
  margin: 0 0.2em;
  color: var(--text-faint);
}

/* Full-screen photo lightbox — edge-to-edge, chrome over the image */
html:has(.photo-lightbox.is-open) {
  overflow: hidden;
}

.photo-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: oklch(0 0 0);
  color: oklch(1 0 0);
  overflow: hidden;
}

.photo-lightbox.is-open {
  display: block;
}

.photo-lightbox[hidden] {
  display: none !important;
}

.photo-lightbox-stage {
  position: absolute;
  inset: 0;
}

.photo-lightbox-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: contain;
  background: oklch(0 0 0);
  border: none;
  border-radius: 0;
}

.photo-lightbox-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 72px;
  background: linear-gradient(
    to bottom,
    oklch(0 0 0 / 0.78) 0%,
    oklch(0 0 0 / 0.36) 52%,
    transparent 100%
  );
  pointer-events: none;
}

.photo-lightbox-hud-start,
.photo-lightbox-hud-end {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  pointer-events: auto;
}

.photo-lightbox-hud-end {
  flex-shrink: 0;
}

.photo-lightbox-caption {
  margin: 0;
  padding: 0 8px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: oklch(1 0 0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-lightbox-desc {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 72px 28px calc(22px + env(safe-area-inset-bottom, 0px));
  font-size: 0.92rem;
  line-height: 1.45;
  color: oklch(1 0 0 / 0.9);
  background: linear-gradient(to top, oklch(0 0 0 / 0.72) 0%, oklch(0 0 0 / 0.3) 55%, transparent 100%);
  pointer-events: none;
}

.photo-lightbox-desc:empty {
  display: none;
}

.photo-lightbox-index {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(1 0 0 / 0.58);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.photo-lightbox-btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid oklch(1 0 0 / 0.45);
  border-radius: 4px;
  background: oklch(0 0 0 / 0.45);
  color: oklch(1 0 0);
  cursor: pointer;
  backdrop-filter: blur(16px) saturate(1.4);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.photo-lightbox-btn svg {
  width: 18px;
  height: 18px;
  stroke-linecap: square;
}

.photo-lightbox-btn:hover,
.photo-lightbox-btn:focus-visible {
  background: oklch(1 0 0 / 0.16);
  border-color: oklch(1 0 0);
}

.photo-lightbox-btn:focus-visible {
  outline: 2px solid oklch(1 0 0);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .photo-lightbox-hud {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 48px;
    gap: 8px;
  }
  .photo-lightbox-caption {
    font-size: 0.82rem;
  }
  .photo-lightbox-index {
    display: none;
  }
}

/* Colophon */
.colophon-section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-3xl);
  border-top: 1px solid var(--border-hairline);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.colophon-legal {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

@media (min-width: 600px) {
  .colophon-legal {
    grid-template-columns: 1fr 1fr;
  }
}

.colophon-block {
  padding: var(--space-sm) 0;
  border-bottom: 1px dashed var(--border-hairline);
}

.colophon-block dt {
  color: var(--text-faint);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.colophon-block dd {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Print */
@media print {
  :root {
    color-scheme: light;
    --bg-app: oklch(1 0 0);
    --bg-subtle: oklch(0.982 0.0017 248);
    --bg-surface: oklch(1 0 0);
    --text-primary: oklch(0.178 0 0);
    --text-secondary: oklch(0.409 0 0);
    --text-muted: oklch(0.566 0 0);
    --border-hairline: oklch(0.928 0.0058 265);
    --border-strong: oklch(0.178 0 0);
  }
  body {
    background: oklch(1 0 0);
    color: oklch(0 0 0);
  }
  .site-sidebar {
    position: static;
    height: auto;
    border-right: none;
  }
}
