/* CR Style Guide v1.1 ─────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Broadway';
  src: url('fonts/Broadway-Regular.woff2') format('woff2'),
       url('fonts/Broadway Regular.ttf')   format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --cr-deep-black:    #0d0d0d;
  --cr-dark-charcoal: #1a1a1a;
  --cr-mid-charcoal:  #2e2e2e;
  --cr-neutral-grey:  #4a4a4a;
  --cr-light-grey:    #c8c8c8;
  --cr-off-white:     #ebebeb;
  --cr-text-silver:   #e8e8e8;
  --cr-accent:        #5b7fa6;

  --ui-text-primary:   #e0e0e0;
  --ui-text-secondary: #a0a0a0;
  --ui-text-tertiary:  #6a6a6a;
  --ui-border-default: #383838;
  --ui-border-mid:     #555555;

  --card-bg:          #111111;
  --card-border:      #2a2a2a;
  --hover-bg:         #1e1e1e;
  --tag-bg:           #1c1c1c;

  --line-color:       #383838;
  --line-w:           1px;
  --marker-size:      56px;
  --card-w:           320px;
  --gap:              40px;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg: 12px;

  --font-brand: 'Broadway', Georgia, serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans:  system-ui, -apple-system, sans-serif;

  --transition: 180ms ease;
  --transition-slow: 320ms ease;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--cr-deep-black);
  color: var(--ui-text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--ui-text-secondary); text-decoration: none; }
a:hover { color: var(--cr-off-white); }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

/* Site header ─────────────────────────────────────────────────────────────── */
.site-header {
  text-align: center;
  padding: 80px 24px 24px;
}

.header-title {
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: normal;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cr-text-silver);
  margin-bottom: 14px;
  line-height: 1.1;
}

.header-sub {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: normal;
  color: var(--ui-text-tertiary);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Stats bar ───────────────────────────────────────────────────────────────── */
.stats-bar {
  text-align: center;
  padding: 8px 24px 56px;
}

#stats-line {
  font-family: var(--font-serif);
  font-size: 11px;
  color: var(--ui-text-secondary);
  letter-spacing: 0.06em;
}

/* Timeline container ──────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

/* Central vertical line */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: var(--line-w);
  background: var(--line-color);
  transform: translateX(-50%);
}

/* Year label ──────────────────────────────────────────────────────────────── */
.year-label {
  position: relative;
  text-align: center;
  margin: 52px 0 28px;
  z-index: 2;
}

.year-label span {
  display: inline-block;
  background: var(--cr-deep-black);
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: bold;
  color: var(--ui-text-secondary);
  padding: 0 16px;
  letter-spacing: normal;
  text-transform: none;
}

/* Month divider ───────────────────────────────────────────────────────────── */
.month-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.month-divider::before,
.month-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ui-border-default);
}

.month-divider-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ui-text-tertiary);
  white-space: nowrap;
}

/* Timeline item ───────────────────────────────────────────────────────────── */
.timeline-item {
  display: flex;
  align-items: flex-start;
  position: relative;
  margin-bottom: 36px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Left side (odd years: 2021, 2023, 2025) */
.timeline-item.left {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* Right side (even years: 2022, 2024, 2026) */
.timeline-item.right {
  flex-direction: row;
  justify-content: flex-end;
}

/* Marker ──────────────────────────────────────────────────────────────────── */
.marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: var(--marker-size);
  height: var(--marker-size);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--ui-border-default);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  z-index: 3;
  background: var(--cr-dark-charcoal);
}

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

.marker:hover,
.marker:focus {
  border-color: var(--ui-border-mid);
  transform: translateX(-50%) scale(1.08);
  box-shadow: 0 0 0 3px rgba(56,56,56,0.5);
  outline: none;
}

.marker.newest {
  border-color: var(--cr-accent);
  box-shadow: 0 0 0 2px rgba(91, 127, 166, 0.2);
}

.marker.newest:hover,
.marker.newest:focus {
  border-color: var(--cr-accent);
  box-shadow: 0 0 0 4px rgba(91, 127, 166, 0.25);
}


/* Card ────────────────────────────────────────────────────────────────────── */
.card {
  width: var(--card-w);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: default;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}

.card:hover {
  border-color: var(--ui-border-default);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.card.newest {
  border-color: var(--cr-accent);
}

.card.newest:hover {
  border-color: var(--cr-accent);
}

.card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.card:hover .card-cover img {
  transform: scale(1.03);
}

.card-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}

.type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: var(--ui-text-tertiary);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.06);
}

.newest-badge {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--cr-accent);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
}

.card.newest .newest-badge { display: block; }

.card-body {
  padding: 14px;
}

.card-date {
  font-size: 0.68rem;
  color: var(--ui-text-tertiary);
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cr-off-white);
  line-height: 1.25;
  margin-bottom: 4px;
}


.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.tag {
  background: var(--tag-bg);
  border: 1px solid var(--ui-border-default);
  border-radius: 3px;
  font-size: 0.62rem;
  color: var(--ui-text-tertiary);
  padding: 1px 6px;
  letter-spacing: 0.03em;
}

.tag.cover-song {
  color: #9b8ecf;
  border-color: rgba(155,142,207,0.25);
  background: rgba(155,142,207,0.05);
}

.tag.collab {
  color: #7fbf9b;
  border-color: rgba(127,191,155,0.25);
  background: rgba(127,191,155,0.05);
}

.tag.debut {
  color: var(--ui-text-secondary);
  border-color: var(--ui-border-default);
}

/* Track tabs (multi-track singles) */
.track-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.track-tab {
  font-size: 0.65rem;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid var(--ui-border-default);
  color: var(--ui-text-tertiary);
  background: transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.track-tab:hover {
  border-color: var(--ui-border-mid);
  color: var(--ui-text-secondary);
}

.track-tab.active {
  border-color: var(--ui-border-mid);
  color: var(--ui-text-secondary);
  background: var(--hover-bg);
}

/* Spotify embed ─────────────────────────────────────────────────────────── */
.spotify-embed-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 80px;
}

.spotify-embed-wrap iframe {
  display: block;
  width: 100%;
  height: 80px;
  border: none;
}

.embed-placeholder {
  height: 80px;
  background: var(--tag-bg);
  border: 1px solid var(--ui-border-default);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-text-tertiary);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.embed-placeholder:hover {
  background: var(--hover-bg);
  border-color: var(--ui-border-mid);
  color: var(--ui-text-secondary);
}

.spotify-open-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  font-size: 0.65rem;
  color: var(--ui-text-tertiary);
  transition: color var(--transition);
}

.spotify-open-link:hover {
  color: var(--ui-text-secondary);
  text-decoration: none;
}

.spotify-open-link svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* Album tracklist toggle */
.tracklist-toggle {
  width: 100%;
  text-align: left;
  font-size: 0.65rem;
  color: var(--ui-text-tertiary);
  padding: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color var(--transition);
}

.tracklist-toggle:hover { color: var(--ui-text-secondary); }

.tracklist-toggle svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  transition: transform var(--transition);
}

.tracklist-toggle.open svg { transform: rotate(90deg); }

.tracklist {
  display: none;
  padding: 6px 0 0;
  list-style: none;
}

.tracklist.open { display: block; }

.tracklist li {
  font-size: 0.65rem;
  color: var(--ui-text-tertiary);
  padding: 3px 0;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  gap: 8px;
}

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

.tracklist li .track-num {
  color: var(--ui-text-tertiary);
  opacity: 0.4;
  flex-shrink: 0;
  width: 14px;
}

/* Overlay / bottom-sheet ──────────────────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  backdrop-filter: blur(2px);
}

.overlay.open { display: block; }

.bottom-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 60vh;
  background: var(--cr-dark-charcoal);
  border-top: 1px solid var(--ui-border-default);
  border-radius: 12px 12px 0 0;
  z-index: 101;
  overflow-y: auto;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.bottom-sheet.open {
  display: block;
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 32px;
  height: 3px;
  background: var(--ui-border-mid);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.bottom-sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--ui-text-tertiary);
  font-size: 1rem;
  line-height: 1;
  padding: 4px 8px;
}

/* Scroll-to-top ─────────────────────────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 36px;
  height: 36px;
  background: var(--cr-dark-charcoal);
  border: 1px solid var(--ui-border-default);
  border-radius: var(--radius-sm);
  color: var(--ui-text-tertiary);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: background var(--transition), color var(--transition);
}

.scroll-top.visible { display: flex; }

.scroll-top:hover {
  background: var(--ui-border-default);
  color: var(--cr-off-white);
}

/* Footer ──────────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--line-color);
  color: var(--ui-text-tertiary);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

footer a { color: var(--ui-text-tertiary); }
footer a:hover { color: var(--ui-text-secondary); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  :root {
    --card-w: calc(100vw - 96px);
    --marker-size: 44px;
    --gap: 12px;
  }

  .timeline::before { left: 30px; transform: none; }

  .timeline-item,
  .timeline-item.left,
  .timeline-item.right {
    flex-direction: row;
    justify-content: flex-start;
  }

  .marker {
    position: static;
    transform: none;
    flex-shrink: 0;
  }

  .marker:hover,
  .marker:focus { transform: scale(1.06); }


  .year-label { text-align: left; padding-left: 8px; }
  .year-label span { font-size: 22px; }

  .card { width: calc(100vw - 100px); }
}
