
/* ─── Light mode (default) ────────────────────────────── */
:root {
  --bg: #FAFAFA;
  --bg-raised: #FFFFFF;
  --bg-active: #FDECEA;
  --text: #1A1714;
  --text-dim: #8C8680;
  --text-mid: #C0BAB2;
  --accent: #E72B1E;
  --accent-dim: rgba(229, 77, 46, 0.09);
  --border: #E5E0D8;
  --border-light: #EDEBE6;
  --shadow-card: 0 2px 14px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --radius-card: 12px;
  --radius: 10px;
  --player-footer-h: 80px;
}

/* ─── Dark mode ───────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #141412;
  --bg-raised: #1E1D1A;
  --bg-active: #2D1C17;
  --text: #EDE9E1;
  --text-dim: #726C64;
  --text-mid: #4A4540;
  --accent: #E72B1E;
  --accent-dim: rgba(241, 107, 82, 0.12);
  --border: #2C2A26;
  --border-light: #232220;
  --shadow-card: 0 2px 14px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.2);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

.display-font { font-weight: 600; }

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

/* ─── Page shell ─────────────────────────────────────── */

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

.page.has-footer {
  padding-bottom: calc(var(--player-footer-h) + 32px);
}

/* ─── Site header ─────────────────────────────────────── */

.site-header {
  /* background: var(--bg-raised); */
  /* border-radius: var(--radius-card); */
  padding: 16px 22px;
  margin-bottom: 20px;
  /* box-shadow: var(--shadow-card); */
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wordmark {
  font-size: 1.6rem;
  font-weight: 700;
  /* letter-spacing: -0.02em; */
  line-height: 1;
  color: var(--text);
}

.wordmark-small {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.wordmark-dot { color: var(--accent); }

.site-tagline {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-top: 5px;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-archives-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  transition: color 0.15s, border-color 0.15s;
}

.header-archives-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Page date ───────────────────────────────────────── */

.page-date {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 20px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  position: relative;
}

.page-date::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin: 8px auto 0;
}

/* ─── Theme toggle ────────────────────────────────────── */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover { background: var(--border-light); }

.theme-toggle::before { content: '☾'; }
[data-theme="dark"] .theme-toggle::before { content: '☀'; color: #E72B1E; }

/* ─── Main two-column grid ────────────────────────────── */

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 580px) {
  .main-grid {
    grid-template-columns: 290px 1fr;
    gap: 20px;
  }
}

/* ─── Player card ─────────────────────────────────────── */

.player-card {
  background: var(--bg-raised);
  border-radius: var(--radius-card);
  padding: 22px 20px 18px;
  box-shadow: var(--shadow-card);
}

.player-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.player-tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-mid);
  display: inline-block;
}

.np-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 20px;
}

.np-title.empty {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 1rem;
}

/* Progress */

.progress-wrap { margin-bottom: 16px; }

.progress-bar {
  width: 100%;
  height: 5px;
  background: var(--border-light);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  margin-bottom: 8px;
}

.progress-bar::before {
  content: '';
  position: absolute;
  inset: -10px 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.25s linear;
  pointer-events: none;
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Controls */

.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 4px 0;
}

.ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  touch-action: manipulation;
  user-select: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
}

.ctrl:active { transform: scale(0.92); }

.ctrl-play {
  width: 62px;
  height: 62px;
  font-size: 1.2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(229, 77, 46, 0.35);
}

.ctrl-play:hover { filter: brightness(1.06); }

[data-theme="dark"] .ctrl-play {
  box-shadow: 0 4px 16px rgba(241, 107, 82, 0.3);
}

.ctrl-skip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 0.7rem;
}

.ctrl-skip:hover { background: var(--border-light); }

.ctrl-speed {
  /* hidden in card — shown in bottom bar */
  display: none;
}

/* Player bottom bar */

.player-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.player-bottom-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
  touch-action: manipulation;
}

.player-bottom-btn:hover { color: var(--text); }

.player-bottom-btn.speed-active { color: var(--accent); }

/* ─── Segment list (right column) ────────────────────── */

.list-heading {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  padding: 0 4px;
}

.segment-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.segment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px 12px 16px;
  background: var(--bg-raised);
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
  touch-action: manipulation;
  min-height: 64px;
  box-shadow: var(--shadow-sm);
}

.segment-item:hover { background: var(--bg-raised); filter: brightness(0.97); }

.segment-item.active {
  background: var(--bg-active);
  box-shadow: var(--shadow-sm);
}

.seg-info { flex: 1; min-width: 0; }

.seg-title {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  transition: color 0.12s;
}

.segment-item.active .seg-title { color: var(--accent); }

.seg-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.seg-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-left: 12px;
  transition: background 0.12s, color 0.12s;
}

.segment-item.active .seg-play-btn {
  background: var(--accent);
  color: #fff;
}

/* ─── Status messages ─────────────────────────────────── */

.status-msg {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 48px 0;
}

/* ─── Archives title ──────────────────────────────────── */

.archives-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 20px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  position: relative;
}

.archives-title::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin: 8px auto 0;
}

/* ─── Archives date list ──────────────────────────────── */

.archives-body {
  background: var(--bg-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.date-group {
  margin-bottom: 32px;
}

.date-group:last-child { margin-bottom: 0; }

.date-heading {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.date-segments {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-segments .segment-item {
  box-shadow: none;
  border-radius: 8px;
}

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

.footer-nav {
  margin-top: 32px;
  text-align: center;
}

.archives-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.15s;
}

.archives-link:hover { color: var(--accent); }

/* ─── Fixed footer player (archives) ─────────────────── */

.player-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-footer-h);
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.25s ease, background 0.2s;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

[data-theme="dark"] .player-footer {
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.player-footer.visible { transform: translateY(0); }

.fp-info { flex: 1; min-width: 0; }

.fp-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.fp-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border-light);
  border-radius: 2px;
  cursor: pointer;
}

.fp-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.25s linear;
  pointer-events: none;
}

.fp-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.fp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
  transition: background 0.12s;
}

.fp-btn-play {
  width: 44px;
  height: 44px;
  font-size: 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
}

.fp-btn-play:hover { filter: brightness(1.06); }

.fp-btn-skip {
  width: 44px;
  height: 44px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: 50%;
}

.fp-btn-skip:hover { background: var(--bg); }

.fp-btn-speed {
  width: 44px;
  height: 34px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: 17px;
  border: 1px solid var(--border);
}

.fp-btn-speed:hover { background: var(--bg); }

/* ─── Utility ─────────────────────────────────────────── */

.hidden { display: none !important; }

@media (min-width: 480px) {
  .page { padding: 24px 28px 48px; }
}
