/* Lens Wide Shut — styles carried over from the Family Photo Site design canvas. */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --bg-deep: #050505;
  --fg: #e8e6e1;
  --muted: #9a9892;
  --faint: #8f8d87;
  --body: #b3b0a9;
  --line: #262522;
  --accent: #c9a46a;
  --pill: rgba(232, 230, 225, 0.28);
  --field: rgba(232, 230, 225, 0.06);
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1328px;
  --row-h: 300px;
  --tile-gap: 12px;
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--fg);
  text-decoration: none;
}
a:hover {
  color: #fff;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}

.caps {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.kicker {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.muted {
  color: var(--muted);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Header ─────────────────────────────────────────── */

.site-header {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: calc(28px + env(safe-area-inset-top, 0px)) var(--gutter) 28px;
}
.site-header.over-hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 300;
  font-size: 26px;
  letter-spacing: 0.01em;
}
.brand svg {
  flex: none;
  width: 0.95em;
  height: 0.95em;
  color: var(--accent);
  transition: transform 0.6s ease;
}
a.brand:hover svg {
  transform: rotate(60deg);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
}
.nav a {
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--pill);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.nav a.pill {
  padding: 12px 18px;
}
.menu-btn,
.icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 999px;
}
.icon-btn {
  display: flex;
}

/* ── Hero ───────────────────────────────────────────── */

/* Full-window hero that stays put while the rest of the page glides up over it. */
.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: 100svh;
  min-height: 480px;
  overflow: hidden;
  background: #121110;
}
/* The section that scrolls up over the hero. Its top is a fade (part of this box, so it starts
   below the hero and dims nothing until you scroll): the photo dissolves into the albums
   instead of meeting them at a hard edge. Eased stops avoid a band where the fade ends. */
.glide {
  --fade: clamp(160px, 30vh, 300px);
  position: relative;
  z-index: 1;
  background:
    linear-gradient(
        to bottom,
        rgba(11, 11, 11, 0) 0,
        rgba(11, 11, 11, 0.04) calc(var(--fade) * 0.14),
        rgba(11, 11, 11, 0.14) calc(var(--fade) * 0.28),
        rgba(11, 11, 11, 0.3) calc(var(--fade) * 0.42),
        rgba(11, 11, 11, 0.5) calc(var(--fade) * 0.56),
        rgba(11, 11, 11, 0.7) calc(var(--fade) * 0.7),
        rgba(11, 11, 11, 0.86) calc(var(--fade) * 0.82),
        rgba(11, 11, 11, 0.96) calc(var(--fade) * 0.92),
        var(--bg) var(--fade)
      )
      top / 100% var(--fade) no-repeat,
    linear-gradient(var(--bg), var(--bg)) 0 var(--fade) / 100% 100% no-repeat;
}
.glide::before {
  content: '';
  display: block;
  height: var(--fade);
}
/* The fade already gives the albums room; less padding keeps them where they were. */
.glide > .albums {
  padding-top: 24px;
}
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(232, 230, 225, 0.7);
}
.scroll-cue svg {
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue {
  50% {
    transform: translateY(6px);
  }
}

/* While the albums glide in, the hero dims and drifts slightly (where supported). */
@supports (animation-timeline: scroll()) {
  .hero > img,
  .hero-content,
  .scroll-cue {
    animation: hero-recede linear both;
    animation-timeline: scroll(root);
    animation-range: 0 100svh;
  }
  .scroll-cue {
    animation-name: hero-fade;
  }
  .hero-content {
    animation-name: hero-fade;
  }
}
@keyframes hero-recede {
  to {
    transform: scale(1.06);
    filter: brightness(0.45);
  }
}
@keyframes hero-fade {
  to {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero > img,
  .hero-content,
  .scroll-cue,
  .scroll-cue svg {
    animation: none !important;
  }
}
.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 45%;
}
.hero-shade-top {
  position: absolute;
  inset: 0 0 auto;
  height: 200px;
  background: linear-gradient(to bottom, rgba(11, 11, 11, 0.55), transparent);
}
.hero-shade-bottom {
  position: absolute;
  inset: auto 0 0;
  height: 460px;
  background: linear-gradient(to top, var(--bg) 8%, rgba(11, 11, 11, 0.6) 45%, transparent);
}
.hero-content {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-end;
}
.hero-title {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.display {
  margin: 0;
  font-weight: 300;
  font-size: clamp(64px, 10vw, 148px);
  line-height: 0.92;
  letter-spacing: -0.04em;
}
.hero-meta {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a19e97;
  text-align: right;
  line-height: 1.8;
}

/* ── Sections ───────────────────────────────────────── */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}
.h2 {
  margin: 0;
  font-weight: 300;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}
.tabs a {
  color: var(--muted);
  padding: 12px 0;
  border-bottom: 1px solid transparent;
}
.tabs a[aria-current='page'] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.albums {
  padding-block: 120px 40px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 48px 32px;
}
.album-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cover {
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  overflow: hidden;
  background: linear-gradient(170deg, #3d4a52, #1a2024);
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
}
.album-card:hover .cover img {
  transform: scale(1.02);
}
.album-card-text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.album-card-title {
  font-weight: 300;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.album-card-meta {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.lock-badge {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
  color: var(--muted);
}

.empty {
  padding: 48px 0;
  color: var(--muted);
}

/* ── About ──────────────────────────────────────────── */

.about {
  padding-top: 160px;
  display: flex;
  flex-wrap: wrap;
  gap: 72px;
  align-items: center;
}
.about-portrait {
  flex: 0 1 480px;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  overflow: hidden;
  background: linear-gradient(170deg, #4b4234, #1f1b16);
}
.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.about-text {
  flex: 1 1 480px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.about-headline {
  margin: 0;
  font-weight: 300;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.lead {
  margin: 0;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  font-weight: 300;
}
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fact dt {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.fact dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.fact a {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(232, 230, 225, 0.35);
}

/* ── Footer ─────────────────────────────────────────── */

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px var(--gutter) calc(56px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.site-footer a {
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Album page ─────────────────────────────────────── */

.album-intro {
  padding-block: 96px 80px;
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  justify-content: space-between;
  align-items: flex-end;
}
.album-intro-title {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 1 520px;
}
.album-h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.album-desc {
  margin: 0;
  flex: 0 1 420px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  font-weight: 300;
}

/* Justified rows: each tile grows in proportion to its aspect ratio, so every row has one height. */
.justified {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tile-gap);
}
.justified::after {
  content: '';
  flex: 999 1 0;
}
.tile {
  display: block;
  flex: var(--ar) 1 calc(var(--ar) * var(--row-h));
  aspect-ratio: var(--ar);
  min-width: 0;
  border-radius: 2px;
  overflow: hidden;
  background: #1a1918;
  cursor: zoom-in;
  padding: 0;
  border: 0;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-foot {
  padding-top: 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}
.next-album {
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.next-album small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline-month {
  padding-top: 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.timeline-month h2 {
  margin: 0;
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

/* ── Places ─────────────────────────────────────────── */

.place-country {
  padding-top: 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.place-country h2 {
  margin: 0;
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.place-country h2,
.place-country h2 a {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.place-country h2 a {
  display: inline-flex;
}
.place-country h2 small {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.album-intro + .place-country {
  padding-top: 8px;
}
.place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 36px 24px;
}
.place-card {
  gap: 12px;
}
.place-card .album-card-text {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.place-card .cover {
  aspect-ratio: 1;
}
.place-card .album-card-title {
  font-size: 17px;
}
.place-crumbs a {
  color: inherit;
  /* Faint underline so it reads as a link on touch screens too. */
  border-bottom: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}
.place-crumbs a:hover {
  border-bottom-color: currentColor;
}
.place-towns {
  margin-top: 8px;
}
.attribution {
  padding-block: 56px 0;
}
.attribution a,
.admin-upload-hint a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lb-info a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 720px) {
  .place-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 12px;
  }
  .place-country {
    padding-top: 48px;
  }
  .place-country h2 {
    font-size: 24px;
  }
}

/* ── Lightbox ───────────────────────────────────────── */

.lb {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
.lb-top {
  height: 76px;
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
}
.lb-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lb-actions .icon-btn {
  border: 1px solid transparent;
}
.lb-actions .icon-btn[aria-pressed='true'] {
  border-color: rgba(232, 230, 225, 0.5);
}
.lb-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}
.lb-nav {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 999px;
  border: none;
  background: rgba(232, 230, 225, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lb-nav:hover {
  background: rgba(232, 230, 225, 0.12);
}
.lb-stage {
  flex: 1 1 auto;
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.lb-img {
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  object-fit: contain;
  border-radius: 2px;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-info {
  width: 240px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-size: 13px;
  margin: 0;
}
.lb-info div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lb-info dt {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.lb-info dd {
  margin: 0;
}
.lb-bottom {
  min-height: 88px;
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 112px;
}
.lb-caption {
  font-weight: 300;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.lb-exif {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Share link ─────────────────────────────────────── */

.share-lock {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.share-lock-bg {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  max-width: none;
  object-fit: cover;
  filter: blur(28px) brightness(0.55);
}
.share-lock-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 30%, rgba(11, 11, 11, 0.35));
}
.share-lock-brand {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  letter-spacing: -0.03em;
}
.share-form {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.share-h1 {
  margin: 0;
  font-weight: 300;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.045em;
}
.label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.input {
  height: 52px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(232, 230, 225, 0.22);
  background: var(--field);
  font-size: 16px;
  outline: none;
  width: 100%;
}
.input:focus {
  border-color: rgba(232, 230, 225, 0.5);
}
textarea.input {
  height: auto;
  min-height: 96px;
  padding: 14px 18px;
  line-height: 1.5;
}
select.input {
  appearance: none;
}
.btn-primary {
  height: 52px;
  border: none;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-primary:hover {
  background: #fff;
  color: var(--bg);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
}
.form-error {
  margin: 0;
  color: #e8a598;
  font-size: 14px;
}
.fine {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--faint);
  text-align: center;
}

.share-head {
  padding-block: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Admin ──────────────────────────────────────────── */

.admin {
  padding-block: 40px 0;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.admin h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.admin h2 {
  margin: 0;
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.03em;
}
.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field.wide {
  grid-column: 1 / -1;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.add-photos {
  position: relative;
  min-height: 160px;
  border: 1px dashed var(--pill);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-align: center;
  padding: 24px;
}
.add-photos.dragover {
  border-color: var(--accent);
  background: var(--field);
}
.add-photos input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.add-photos strong {
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.03em;
}
.upload-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upload-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 4px 14px;
  align-items: center;
}
.upload-item img,
.upload-item .ph {
  grid-row: span 2;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: #1a1918;
}
.upload-item .name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-item .status {
  font-size: 12px;
  color: var(--muted);
}
.upload-item progress {
  width: 100%;
  height: 4px;
  appearance: none;
  border: none;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.upload-item progress::-webkit-progress-bar {
  background: var(--line);
}
.upload-item progress::-webkit-progress-value {
  background: var(--accent);
}
.upload-item progress::-moz-progress-bar {
  background: var(--accent);
}
.upload-item.done .status {
  color: #a9c99a;
}
.upload-item.failed .status {
  color: #e8a598;
}

.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  text-align: left;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--pill);
  color: var(--muted);
}
.badge.public {
  color: var(--accent);
  border-color: rgba(201, 164, 106, 0.5);
}

.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 16px;
}
.manage-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.manage-card .thumb {
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1918;
  position: relative;
}
.manage-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.manage-card .thumb .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(11, 11, 11, 0.7);
}
.manage-card .input {
  height: 40px;
  font-size: 14px;
  padding: 0 12px;
  border-radius: 8px;
}
.manage-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.btn-small {
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--pill);
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-small:hover {
  border-color: var(--fg);
}
.btn-small.danger:hover {
  border-color: #e8a598;
  color: #e8a598;
}
.btn-small[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
}
.share-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  background: var(--fg);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  max-width: calc(100% - 32px);
}

/* ── Phone ──────────────────────────────────────────── */

@media (max-width: 720px) {
  :root {
    --row-h: 150px;
    --tile-gap: 6px;
  }
  body {
    font-size: 15px;
  }
  .site-header {
    padding: env(safe-area-inset-top, 0px) 16px 0 20px;
    min-height: 72px;
    flex-wrap: nowrap;
  }
  .brand {
    font-size: 19px;
    font-weight: 400;
    letter-spacing: -0.03em;
  }
  .menu-btn {
    display: flex;
  }
  .nav {
    display: none;
    position: absolute;
    top: calc(72px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 24px;
    background: rgba(11, 11, 11, 0.96);
    border-bottom: 1px solid var(--line);
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
  .nav a.pill {
    margin-top: 16px;
    justify-content: center;
    border: 1px solid var(--pill);
    padding: 14px 18px;
  }

  .hide-phone {
    display: none;
  }
  .nav.album-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
  }
  .nav.album-nav a,
  .nav.album-nav .pill {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 0;
    justify-content: center;
  }
  .nav.album-nav svg {
    width: 20px;
    height: 20px;
  }

  .hero > img {
    object-position: 58% 50%;
  }
  .hero-shade-top {
    height: 140px;
  }
  .hero-shade-bottom {
    height: 360px;
    background: linear-gradient(to top, var(--bg) 6%, rgba(11, 11, 11, 0.6) 50%, transparent);
  }
  .hero-content {
    left: 20px;
    right: 20px;
    /* Clear of the scroll arrow below it. */
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .hero-title {
    gap: 14px;
  }
  .kicker {
    font-size: 11px;
  }
  .display {
    font-size: 60px;
    line-height: 0.95;
    letter-spacing: -0.045em;
  }
  .hero-meta {
    font-size: 11px;
    text-align: left;
  }

  .albums {
    padding-block: 56px 0;
    gap: 32px;
  }
  .section-head {
    padding-bottom: 18px;
    align-items: baseline;
  }
  .h2 {
    font-size: 40px;
    letter-spacing: -0.04em;
  }
  .tabs {
    gap: 20px;
    width: 100%;
  }
  .album-grid {
    gap: 32px;
  }
  .album-card {
    gap: 14px;
  }
  .album-card-title {
    font-size: 24px;
  }
  .album-card-meta {
    font-size: 10px;
  }

  .about {
    padding-top: 88px;
    gap: 24px;
    flex-direction: column;
    align-items: stretch;
  }
  .about-portrait {
    flex: none;
    order: 2;
  }
  .about-text {
    display: contents;
  }
  .about-text > .kicker {
    order: 0;
  }
  .about-headline {
    order: 1;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.035em;
  }
  .about-text > .lead {
    order: 3;
    font-size: 15px;
    line-height: 1.65;
  }
  .facts {
    order: 4;
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 0;
  }
  .fact {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
  .fact dd br {
    display: none;
  }
  /* One line on phones: show the ", " that is otherwise only for screen readers. */
  .fact dd .visually-hidden {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
  }

  .site-footer {
    padding: 64px 20px calc(40px + env(safe-area-inset-bottom, 0px));
    font-size: 11px;
  }

  .album-intro {
    padding-block: 40px;
    gap: 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .album-intro-title {
    flex: none;
    gap: 16px;
  }
  .album-h1 {
    font-size: 48px;
    line-height: 0.98;
    letter-spacing: -0.045em;
  }
  .album-desc {
    flex: none;
    font-size: 15px;
    line-height: 1.6;
  }
  .album-foot {
    padding-top: 48px;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  .next-album {
    justify-content: space-between;
    padding: 20px 0;
    border-block: 1px solid var(--line);
    font-size: 24px;
  }

  .lb-top {
    padding: 0 12px 0 20px;
  }
  .lb-main {
    padding: 0;
  }
  .lb-nav {
    display: none;
  }
  .lb-stage {
    flex-direction: column;
    gap: 16px;
  }
  .lb-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    background: rgba(5, 5, 5, 0.94);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .lb-bottom {
    padding: 12px 20px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .lb-caption {
    font-size: 17px;
  }
  .lb-exif {
    font-size: 11px;
  }
}

/* ── Footer links ───────────────────────────────────── */

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
.footer-links a:hover,
.site-footer a:hover {
  color: var(--fg);
}

/* ── Play button (slideshow) ────────────────────────── */

.play-btn {
  align-self: flex-start;
  padding: 10px 16px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--fg);
}
.play-btn:hover {
  border-color: var(--fg);
}

/* ── Home: Selected strip ───────────────────────────── */

.home-selected {
  padding-block: 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.view-all {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.view-all:hover {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

/* ── Places: List / Map tabs and the map ────────────── */

.places-tabs {
  align-self: flex-end;
}
.map-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.map {
  position: relative;
  aspect-ratio: 1000 / 520;
  max-width: 100%;
  background: #0d0f10;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.map svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
.map svg:active {
  cursor: grabbing;
}
.map-fallback {
  margin: 0;
  padding: 24px;
}
.map-land {
  fill: #25292c;
}
.map-borders {
  fill: none;
  stroke: #3d4246;
  stroke-width: calc(var(--stroke, 1) * 0.8px);
  vector-effect: non-scaling-stroke;
}
.map-dot circle {
  fill: var(--accent);
  fill-opacity: 0.85;
  stroke: #0b0b0b;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  transition: fill-opacity 160ms;
}
.map-dot:hover circle,
.map-dot:focus-visible circle {
  fill-opacity: 1;
  stroke: var(--fg);
}
.map-dot:focus-visible {
  outline: none;
}
.map-card {
  position: absolute;
  transform: translate(-50%, calc(-100% - 14px));
  width: 168px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px 10px;
  background: rgba(11, 11, 11, 0.94);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  z-index: 2;
}
.map-card.below {
  transform: translate(-50%, 14px);
}
.map-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 6px;
}
.map-card strong {
  font-weight: 400;
  font-size: 15px;
  color: var(--fg);
}
.map-card span {
  font-size: 12px;
  color: var(--muted);
}
.map-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-controls .icon-btn {
  width: 36px;
  height: 36px;
  background: rgba(11, 11, 11, 0.85);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 18px;
  line-height: 1;
}
.map-controls .icon-btn:hover {
  border-color: var(--fg);
}
.map-note {
  text-align: left;
}
.map-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 14px;
}
.map-list a:hover {
  color: var(--accent);
}

/* ── Lightbox: Selected star, slideshow ─────────────── */

.star-btn[aria-pressed='true'] svg {
  fill: var(--accent);
  stroke: var(--accent);
}
.lb-actions .star-btn[aria-pressed='true'] {
  border-color: transparent;
}
.lb-chip {
  height: 32px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(232, 230, 225, 0.3);
  background: transparent;
  color: var(--fg);
  font-size: 11px;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.lb-img {
  transition: opacity 350ms ease;
}
.lb-img.lb-fading {
  opacity: 0;
}
/* While playing, the controls fade out until the pointer moves or the screen is tapped. */
.lb-top,
.lb-bottom,
.lb-nav {
  transition: opacity 400ms ease;
}
.lb.lb-playing:not(.lb-chrome) .lb-top,
.lb.lb-playing:not(.lb-chrome) .lb-bottom,
.lb.lb-playing:not(.lb-chrome) .lb-nav {
  opacity: 0;
}
.lb.lb-playing:not(.lb-chrome) {
  cursor: none;
}
.lb:fullscreen {
  background: #000;
}

/* ── Manage page: buttons with icons, visitors, problems ─ */

.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-small[aria-pressed='true'] svg {
  fill: currentColor;
}
.chart-wrap {
  overflow-x: auto;
}
.views-chart {
  display: block;
  width: 100%;
  min-width: 420px;
  height: auto;
}
.views-chart .bar {
  fill: var(--accent);
  fill-opacity: 0.45;
}
.views-chart .bar.today {
  fill-opacity: 1;
}
.views-chart .grid {
  stroke: var(--line);
  stroke-dasharray: 2 4;
}
.views-chart .base {
  stroke: var(--line);
}
.views-chart .axis {
  fill: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.top-list li {
  display: grid;
  grid-template-columns: 1fr auto 48px;
  gap: 16px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.top-list .caps {
  font-size: 10px;
  letter-spacing: 0.16em;
}
.top-list .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.error-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}
.error-list li {
  border-left: 2px solid #e8a598;
  padding-left: 12px;
}

/* ── Legal pages ────────────────────────────────────── */

.legal {
  padding-block: 96px 0;
  max-width: 72ch;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--body);
  line-height: 1.65;
}
.legal h1 {
  margin-bottom: 16px;
}
.legal h2 {
  margin: 24px 0 0;
  font-weight: 400;
  font-size: 19px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.legal p {
  margin: 0;
}
.legal a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-en {
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

@media (max-width: 720px) {
  .home-selected {
    padding-block: 24px;
    gap: 24px;
  }
  .places-tabs {
    align-self: flex-start;
  }
  .map {
    aspect-ratio: 4 / 5;
  }
  .lb-actions {
    gap: 2px;
  }
  .lb-actions .icon-btn {
    width: 40px;
    height: 40px;
  }
  .legal {
    padding-block: 56px 0;
  }
}

/* ── ASCII mode ─────────────────────────────────────────
   Retro terminal look, switched with the footer toggle or ?ascii=1 (src/client/mode.ts).
   Photos are drawn as coloured characters by src/client/ascii.ts; the lightbox keeps the real photo. */

.ascii-toggle {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--faint);
  cursor: pointer;
}
.ascii-toggle:hover {
  color: var(--fg);
}

html.ascii {
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --fg: #4dff7a;
  --muted: #2fcf5a;
  --faint: #27b04c;
  --body: #3ee86a;
  --line: #134d22;
  --accent: #b8ffc8;
  --pill: rgba(77, 255, 122, 0.45);
  --field: rgba(77, 255, 122, 0.07);
}
html.ascii body {
  font-family: var(--mono);
  font-size: 14px;
  text-shadow: 0 0 6px rgba(77, 255, 122, 0.35);
  -webkit-font-smoothing: auto;
}
html.ascii *,
html.ascii *::before,
html.ascii *::after {
  border-radius: 0 !important;
}
html.ascii a:hover {
  color: var(--accent);
}
html.ascii .display,
html.ascii .h2,
html.ascii .album-card-title {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0;
}
html.ascii .display::before {
  content: '> ';
  color: var(--muted);
}
html.ascii .display::after {
  content: '_';
  animation: ascii-blink 1.1s steps(1) infinite;
}
@keyframes ascii-blink {
  50% {
    opacity: 0;
  }
}
html.ascii .h2::before {
  content: '# ';
  color: var(--muted);
}

/* Boxes drawn with lines, like a text UI. */
html.ascii .pill,
html.ascii .btn-small,
html.ascii .tabs a {
  border: 1px solid var(--pill);
}
html.ascii .nav a:hover,
html.ascii .footer-links a:hover,
html.ascii .site-footer a:hover,
html.ascii .ascii-toggle:hover {
  background: var(--fg);
  color: var(--bg);
  text-shadow: none;
}
html.ascii .ascii-toggle[aria-pressed='true'] {
  color: var(--fg);
}
html.ascii .ascii-toggle[aria-pressed='true']::before {
  content: '[x] ';
}
html.ascii .ascii-toggle[aria-pressed='true']::after {
  content: ' on';
}
html.ascii .cover,
html.ascii .tile,
html.ascii .about-portrait {
  position: relative;
  background: var(--bg);
  outline: 1px dashed var(--line);
  outline-offset: -1px;
}

/* Photos as characters, painted on a canvas by ascii.ts. */
.ascii-art {
  display: none;
}
html.ascii .ascii-art {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
html.ascii img.ascii-hidden {
  visibility: hidden;
}
html.ascii .hero-shade-top,
html.ascii .hero-shade-bottom,
html.ascii .hero-content {
  z-index: 1;
}

html.ascii .map-land {
  fill: #0d2614;
}
html.ascii .map-borders {
  stroke: var(--line);
}

/* Scanlines and a soft vignette over everything. */
html.ascii body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.45));
}
@media (prefers-reduced-motion: reduce) {
  html.ascii .display::after {
    animation: none;
  }
}
