:root {
  --bg-top: #d7ece8;
  --bg-mid: #eef5f2;
  --bg-bottom: #f7f4ef;
  --ink: #1c2b2a;
  --ink-soft: #4a5c5a;
  --brand: #0f3d3a;
  --accent: #2f7a72;
  --accent-deep: #1f5a54;
  --line: rgba(15, 61, 58, 0.14);
  --glow: rgba(47, 122, 114, 0.28);
  --font-brand: "Noto Serif TC", "Songti TC", serif;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  background:
    linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 42%, var(--bg-bottom) 100%);
  overflow-x: hidden;
}

/* —— Atmosphere —— */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.mist {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 18s var(--ease) infinite alternate;
}

.mist-a {
  width: min(70vw, 560px);
  height: min(70vw, 560px);
  top: -12%;
  right: -8%;
  background: radial-gradient(circle, rgba(47, 122, 114, 0.35), transparent 68%);
}

.mist-b {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  bottom: 8%;
  left: -10%;
  background: radial-gradient(circle, rgba(196, 160, 110, 0.22), transparent 70%);
  animation-delay: -6s;
  animation-duration: 22s;
}

.home-mark {
  position: absolute;
  right: max(4vw, 1rem);
  bottom: max(6vh, 2rem);
  width: min(52vw, 420px);
  color: rgba(15, 61, 58, 0.12);
  animation: rise-in 1.4s var(--ease) both, breathe 8s ease-in-out 1.4s infinite;
}

.home-mark .lamp {
  color: rgba(47, 122, 114, 0.35);
  animation: glow-pulse 3.2s ease-in-out infinite;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-3%, 4%) scale(1.06); }
}

@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* —— Hero —— */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem);
  max-width: 42rem;
}

.brand {
  margin: 0 0 1rem;
  font-family: var(--font-brand);
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand);
  line-height: 1.15;
  animation: fade-up 0.9s var(--ease) both;
}

.headline {
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-size: clamp(1.25rem, 3.2vw, 1.65rem);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
  animation: fade-up 0.9s var(--ease) 0.12s both;
}

.lede {
  margin: 0 0 2rem;
  max-width: 28rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
  animation: fade-up 0.9s var(--ease) 0.22s both;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  animation: fade-up 0.9s var(--ease) 0.34s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.4rem;
  border-radius: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary {
  background: var(--accent);
  color: #f7fffd;
  box-shadow: 0 10px 28px var(--glow);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-deep);
  transform: translateY(-2px);
}

.btn-ghost {
  color: var(--brand);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* —— Sub pages —— */
.page-top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 1.25rem clamp(2rem, 6vw, 5rem) 0.5rem;
  max-width: 52rem;
}

.page-brand {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand);
  text-decoration: none;
}

.page-brand:hover,
.page-brand:focus-visible {
  color: var(--accent-deep);
}

.page-back {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 90, 84, 0.28);
}

.page-back:hover,
.page-back:focus-visible {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.page-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-brand);
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand);
  line-height: 1.2;
}

.section.music {
  padding-top: 1.25rem;
}

.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(74, 92, 90, 0.35);
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* —— Sections —— */
main {
  position: relative;
  z-index: 1;
}

.section {
  padding: clamp(3rem, 8vw, 5.5rem) clamp(2rem, 6vw, 5rem);
  max-width: 52rem;
}

.section h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--brand);
}

.section-lede {
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
  max-width: 36rem;
}

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.service-link {
  display: grid;
  grid-template-columns: minmax(5rem, 7rem) 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1.15rem 0.15rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.25s var(--ease), background 0.25s ease;
}

.service-link:hover,
.service-link:focus-visible {
  padding-left: 0.65rem;
  background: linear-gradient(90deg, rgba(47, 122, 114, 0.08), transparent 70%);
}

.service-name {
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.04em;
}

.service-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.about {
  padding-bottom: 4rem;
}

.footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem clamp(2rem, 6vw, 5rem) 2.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

body.has-player .footer {
  padding-bottom: 7.5rem;
}

/* —— Music —— */
.music-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--accent-deep);
}

.music-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.music-search {
  width: min(100%, 22rem);
  margin: 0 0 1.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.music-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 122, 114, 0.18);
}

.music-shortcuts-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: -0.5rem 0 1.35rem;
}

.music-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.music-shortcut-chip {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.45);
}

.music-shortcut-chip .music-shortcut {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.music-shortcut-remove {
  margin: 0;
  padding: 0 0.55rem;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(47, 122, 114, 0.22);
  touch-action: manipulation;
}

.music-shortcut-remove:hover,
.music-shortcut-remove:focus-visible {
  color: var(--brand);
  background: rgba(47, 122, 114, 0.1);
}

.music-shortcut-chip.is-active {
  border-color: var(--accent);
  background: rgba(47, 122, 114, 0.16);
}

.music-shortcut-chip.is-active .music-shortcut {
  color: var(--accent-deep);
}

.music-shortcut-add {
  border-style: dashed;
  color: var(--accent-deep);
}


.music-shortcut {
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.45);
  color: var(--brand);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(47, 122, 114, 0.22);
  touch-action: manipulation;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .music-shortcut:hover {
    border-color: var(--accent);
    background: rgba(47, 122, 114, 0.12);
    transform: translateY(-1px);
  }
}

.music-shortcut:focus-visible {
  border-color: var(--accent);
  background: rgba(47, 122, 114, 0.12);
}

.music-shortcut.is-active {
  border-color: var(--accent);
  background: rgba(47, 122, 114, 0.16);
  color: var(--accent-deep);
}

.music-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: stretch;
}

.music-subhead {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  text-transform: none;
}

.music-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.music-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

[hidden] {
  display: none !important;
}


.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(31, 90, 84, 0.35);
}

.text-btn:hover,
.text-btn:focus-visible {
  color: var(--brand);
  text-decoration-color: var(--brand);
}

.text-btn:disabled {
  color: var(--ink-soft);
  cursor: default;
  text-decoration: none;
  opacity: 0.55;
}

.soft-count {
  font-weight: 500;
  color: var(--ink-soft);
}

.album-artist-head {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 0.65rem 0.2rem 0.35rem;
  background: linear-gradient(180deg, rgba(238, 245, 242, 0.96), rgba(238, 245, 242, 0.88));
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-deep);
}

.album-artist-head:first-child {
  padding-top: 0.35rem;
}

.library-list {
  max-height: min(70vh, 36rem);
}

.library-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  min-width: 0;
}

.library-back {
  flex: 0 0 auto;
}

.library-back:not([hidden]) {
  display: inline;
}

.music-search:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.library-list,
.album-list,
.track-list,
.playlist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  max-height: 28rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.album-link,
.track-link {
  display: grid;
  width: 100%;
  gap: 0.15rem;
  padding: 0.85rem 0.2rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: padding-left 0.25s var(--ease), background 0.25s ease;
}

.album-link:hover,
.album-link:focus-visible,
.track-link:hover,
.track-link:focus-visible {
  padding-left: 0.55rem;
  background: linear-gradient(90deg, rgba(47, 122, 114, 0.08), transparent 70%);
}

.album-link.is-active,
.track-link.is-current {
  background: linear-gradient(90deg, rgba(47, 122, 114, 0.14), transparent 75%);
}

.album-title,
.track-title {
  font-weight: 600;
  color: var(--brand);
}

.album-meta {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.track-row,
.playlist-row {
  display: grid;
  grid-template-columns: 1.25rem 1fr 2rem;
  gap: 0.35rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.playlist-row {
  grid-template-columns: 1.35rem 1fr 2rem;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: -0.12em;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.drag-handle:hover,
.drag-handle:focus-visible {
  color: var(--brand);
  background: rgba(47, 122, 114, 0.1);
}

.playlist-row.is-dragging {
  opacity: 0.55;
  background: rgba(47, 122, 114, 0.08);
  pointer-events: none;
}

.playlist-row.is-dragging .drag-handle {
  cursor: grabbing;
}

.playlist-list.is-reordering {
  cursor: grabbing;
}

.playlist-list.is-reordering .playlist-row:not(.is-dragging) {
  transition: transform 0.12s var(--ease);
}

.track-row .track-link,
.playlist-row .track-link {
  border-bottom: 0;
  min-width: 0;
}

.track-check {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.track-link {
  grid-template-columns: 2.2rem 1fr;
  align-items: baseline;
  gap: 0.65rem;
}

.playlist-row .track-link {
  grid-template-columns: 2.2rem minmax(0, 1fr);
  grid-template-areas:
    "num title"
    "num meta";
  align-items: start;
  column-gap: 0.65rem;
  row-gap: 0.1rem;
}

.playlist-row .track-num {
  grid-area: num;
  padding-top: 0.15rem;
}

.playlist-row .track-title {
  grid-area: title;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-row .album-meta {
  grid-area: meta;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-num {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.track-add {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.45);
  color: var(--accent-deep);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.track-add:hover,
.track-add:focus-visible {
  border-color: var(--accent);
  background: rgba(47, 122, 114, 0.12);
}

.track-add.is-added {
  color: var(--accent);
  border-color: rgba(47, 122, 114, 0.35);
  cursor: default;
}

.track-add:disabled {
  opacity: 0.7;
}

.track-remove {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.music-empty {
  padding: 1rem 0;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}

/* —— Sticky player —— */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  gap: 0.65rem 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2rem) calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: rgba(247, 244, 239, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 -10px 30px rgba(28, 43, 42, 0.08);
}

@media (min-width: 720px) {
  .player {
    grid-template-columns: minmax(10rem, 1.2fr) auto minmax(12rem, 1fr);
    align-items: center;
  }
}

.player-now {
  min-width: 0;
}

.now-title,
.now-artist {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-title {
  font-weight: 700;
  color: var(--brand);
}

.now-artist {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.player-controls {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.player-btn {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.5);
  color: var(--brand);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}

.player-btn:hover,
.player-btn:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.player-repeat[data-mode="off"] {
  color: var(--ink-soft);
}

.player-repeat[data-mode="all"],
.player-repeat[data-mode="one"] {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: rgba(47, 122, 114, 0.12);
}

.player-repeat[data-mode="one"] {
  font-weight: 700;
}

.player-btn-main {
  background: var(--accent);
  border-color: var(--accent);
  color: #f7fffd;
}

.player.is-playing .player-btn-main {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.player-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
}

.progress {
  width: 100%;
  accent-color: var(--accent);
}

.time {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* —— Reveal on scroll —— */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .home-mark {
    width: min(78vw, 300px);
    opacity: 0.85;
    bottom: 2rem;
    right: -4vw;
  }

  .service-link {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* —— Photos —— */
.section.photos {
  max-width: 64rem;
  padding-top: 1.25rem;
}

.photos-panel {
  margin-top: 0.5rem;
}

.photos-album-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.85rem;
  align-items: center;
}

.photos-thumb {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.45rem;
  background: rgba(47, 122, 114, 0.12) center / cover no-repeat;
  border: 1px solid var(--line);
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.5rem;
  max-height: min(70vh, 40rem);
  overflow: auto;
  padding: 0.25rem 0;
}

.photos-cell {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  overflow: hidden;
  cursor: pointer;
  background: rgba(47, 122, 114, 0.08);
}

.photos-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photos-video-badge {
  position: absolute;
  left: 0.35rem;
  top: 0.35rem;
  z-index: 1;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
}

.photos-place-badge {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  z-index: 1;
  max-width: calc(100% - 0.7rem);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photos-places {
  margin-top: 0;
}

.section.photos .music-shortcuts-wrap {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.music-shortcuts-label {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(18, 24, 23, 0.58);
  letter-spacing: 0.04em;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(18, 24, 23, 0.92);
}

.lightbox-dialog {
  display: flex;
  flex-direction: column;
  width: min(96vw, 72rem);
  max-height: 96vh;
  gap: 0.5rem;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.5rem;
}

.lightbox-counter {
  margin: 0;
  color: rgba(244, 248, 247, 0.82);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.lightbox-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 0;
}

.lightbox-stage {
  min-width: 0;
  display: grid;
  place-items: center;
  max-height: min(68vh, 40rem);
}

.lightbox-img,
.lightbox-video {
  max-width: 100%;
  max-height: min(68vh, 40rem);
  border-radius: 0.35rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}

.lightbox-footer {
  display: grid;
  gap: 0.65rem;
}

.lightbox-caption {
  margin: 0;
  color: #f4f8f7;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-line;
}

.lightbox-actions {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.lightbox-action,
.lightbox-close,
.lightbox-side {
  border: 0;
  cursor: pointer;
  border-radius: 0.45rem;
  font: inherit;
}

.lightbox-close {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox-side {
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.lightbox-action {
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.9rem;
}

.lightbox-close:hover,
.lightbox-side:hover,
.lightbox-action:hover {
  background: rgba(255, 255, 255, 0.2);
}

body.lightbox-open {
  overflow: hidden;
}

.upload-section {
  max-width: 40rem;
}

.upload-panel {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

.upload-label {
  font-weight: 500;
  color: var(--ink-soft);
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.upload-submit {
  width: 100%;
}

.upload-list ul,
.upload-file-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.upload-progress-wrap {
  width: 100%;
}

.upload-progress {
  width: 100%;
  height: 0.65rem;
}

.upload-status {
  margin: 0;
  min-height: 1.4em;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.upload-status--ok {
  color: var(--accent-deep);
}

.upload-status--error {
  color: #9b2c2c;
}

.upload-status--warn {
  color: #8a6d1d;
}

.upload-notes {
  margin-top: 1.5rem;
}

.upload-notes ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.upload-notes code {
  font-size: 0.88em;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 0.5rem;
  }

  .lightbox-body {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .lightbox-side {
    display: none;
  }

  .lightbox-actions {
    display: grid;
  }

  .lightbox-stage {
    max-height: min(58vh, 32rem);
  }

  .lightbox-img,
  .lightbox-video {
    max-height: min(58vh, 32rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mist,
  .home-mark,
  .home-mark .lamp,
  .brand,
  .headline,
  .lede,
  .cta-group {
    animation: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
