/* ── Custom Properties ─────────────────────────────────── */

:root {
  --color-bg: #FAFAFA;
  --color-fg: #111111;
  --color-muted: #555555;
  --color-rule: #D0D0D0;
  --color-accent: #C0392B;

  --font-serif: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif;
  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --space-xs: 0.5rem;   /*  8px */
  --space-sm: 1rem;     /* 16px */
  --space-md: 1.5rem;   /* 24px */
  --space-lg: 2.5rem;   /* 40px */
  --space-xl: 4rem;     /* 64px */
}

/* ── Reset ────────────────────────────────────────────── */

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

::selection {
  background: var(--color-accent);
  color: #fff;
}

/* ── Accent Line ──────────────────────────────────────── */

.accent-rule {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-accent);
  z-index: 10;
  transform-origin: left;
  animation: rule-draw 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rule-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Layout ───────────────────────────────────────────── */

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.card {
  text-align: center;
  padding: var(--space-lg);
  animation: card-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Portrait ─────────────────────────────────────────── */

.portrait {
  display: block;
  width: 160px;
  height: auto;
  margin: 0 auto var(--space-md);
  filter: grayscale(100%) contrast(1.1);
}

/* ── Name ─────────────────────────────────────────────── */

.name {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--color-fg);
  line-height: 1.1;
}

/* ── Hairline Rule ────────────────────────────────────── */

.divider {
  width: 40px;
  height: 0;
  border: none;
  border-top: 1px solid var(--color-rule);
  margin: var(--space-md) auto;
}

/* ── Social Links ─────────────────────────────────────── */

.social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-xs) 0;
  list-style: none;
}

.social li {
  display: flex;
  align-items: center;
}

/* Middot separators */
.social li + li::before {
  content: '\00B7';
  display: inline-block;
  margin: 0 0.85em;
  color: var(--color-rule);
  font-size: 15px;
  line-height: 1;
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-muted);
  position: relative;
  transition: color 0.2s ease;
}

/* Underline that slides in from the left on hover */
.social a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.social a:hover {
  color: var(--color-fg);
}

.social a:hover::after {
  transform: scaleX(1);
}

/* Focus — visible ring for keyboard nav */
.social a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.social svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 480px) {
  .card {
    padding: var(--space-md);
  }

  .portrait {
    width: 120px;
  }

  .name {
    font-size: 1.625rem;
  }

  .social li + li::before {
    margin: 0 0.6em;
  }

  .social a {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .social svg {
    width: 12px;
    height: 12px;
  }

  .post {
    padding: var(--space-lg) var(--space-md) var(--space-lg);
  }

  .post-title {
    font-size: 1.625rem;
  }

  .album-list li {
    grid-template-columns: 2rem 44px 1fr;
  }

  .cover {
    width: 44px;
    height: 44px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  }

  .artist,
  .album {
    font-size: 0.95rem;
  }

  .post-index a {
    font-size: 1.05rem;
  }
}

/* ── Post Pages ──────────────────────────────────────── */

.post-page {
  align-items: flex-start;
  justify-content: center;
}

.post {
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
  padding: 3.5rem var(--space-lg) var(--space-xl);
  animation: card-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.back-link {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--color-fg);
}

.back-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

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

.post-header {
  margin-bottom: var(--space-lg);
}

.post-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-fg);
  line-height: 1.15;
}

.post-header .divider {
  margin: var(--space-md) 0;
}

/* ── Album List (Top 10) ─────────────────────────────── */

.album-list {
  list-style: none;
  counter-reset: rank;
  margin-bottom: var(--space-xl);
}

.album-list li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 2.5rem 56px 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 0.75rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--color-rule);
  animation: item-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.album-list li:first-child {
  border-top: 1px solid var(--color-rule);
}

/* Staggered entrance */
.album-list li:nth-child(1)  { animation-delay: 0.35s; }
.album-list li:nth-child(2)  { animation-delay: 0.40s; }
.album-list li:nth-child(3)  { animation-delay: 0.45s; }
.album-list li:nth-child(4)  { animation-delay: 0.50s; }
.album-list li:nth-child(5)  { animation-delay: 0.55s; }
.album-list li:nth-child(6)  { animation-delay: 0.60s; }
.album-list li:nth-child(7)  { animation-delay: 0.65s; }
.album-list li:nth-child(8)  { animation-delay: 0.70s; }
.album-list li:nth-child(9)  { animation-delay: 0.75s; }
.album-list li:nth-child(10) { animation-delay: 0.80s; }

@keyframes item-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.album-list li::before {
  content: counter(rank);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-accent);
  grid-row: 1 / -1;
  align-self: center;
}

.cover {
  grid-row: 1 / -1;
  align-self: center;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.album-list li:hover .cover {
  transform: scale(1.04);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

.artist {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-fg);
  line-height: 1.3;
}

.album {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
  color: var(--color-fg);
}

.artist::after {
  content: ' — ';
  font-weight: 400;
}

.album-list .label {
  display: block;
  grid-column: 3;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 0.15rem;
}

/* ── Honorable Mentions ──────────────────────────────── */

.mentions {
  animation: card-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.9s both;
}

.mentions-heading {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

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

.mentions-list li {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--color-fg);
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
}

.mentions-list cite {
  font-style: italic;
}

.mentions-list .label {
  display: inline;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0;
  color: var(--color-rule);
}

.aside {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--color-muted);
}

/* ── Post Index ──────────────────────────────────────── */

.post-index {
  list-style: none;
}

.post-index li {
  border-bottom: 1px solid var(--color-rule);
}

.post-index li:first-child {
  border-top: 1px solid var(--color-rule);
}

.post-index a {
  display: block;
  padding: 1rem 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--color-fg);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-index a:hover {
  color: var(--color-accent);
}

.post-index a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* ── Print ────────────────────────────────────────────── */

@media print {
  .accent-rule {
    display: none;
  }

  body {
    min-height: auto;
    display: block;
    padding: 2rem;
    background: #fff;
  }

  .card {
    animation: none;
    opacity: 1;
  }

  .social a {
    color: var(--color-fg);
  }

  .social a::after {
    display: none;
  }

  .post {
    animation: none;
    opacity: 1;
  }

  .album-list li {
    animation: none;
    opacity: 1;
    grid-template-columns: 2.5rem 1fr;
  }

  .cover {
    display: none;
  }

  .album-list .label {
    grid-column: 2;
  }

  .mentions {
    animation: none;
    opacity: 1;
  }

  .back-link {
    display: none;
  }
}
