@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@300;400;500&display=swap');

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

:root {
  --bg-deep: #0a0a14;
  --bg-card: #12121f;
  --bg-card-hover: #1a1a2e;
  --gold: #c9a84c;
  --gold-light: #e8d48b;
  --gold-dim: #8a7332;
  --text: #e0ddd5;
  --text-muted: #9a978f;
  --border: #2a2a3e;
  --glow: rgba(201, 168, 76, 0.15);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Typography ── */

h1, h2, h3, h4 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-weight: 600;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--gold-light);
}

/* ── Layout ── */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Site Header ── */

.site-header {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  position: relative;
}

.site-header::after {
  content: '';
  display: block;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 2rem auto 0;
}

.site-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.site-header .subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-header .intro {
  max-width: 620px;
  margin: 2.5rem auto 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-muted);
  font-weight: 300;
}

/* ── Angel Cards Grid (Index) ── */

.angel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2rem 0 5rem;
}

.angel-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.angel-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-dim);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 24px var(--glow);
}

.angel-card a.card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.angel-card .card-image,
.angel-card .card-body {
  pointer-events: none;
}

.angel-card .card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #16162a 0%, #1e1e36 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Shimmer loading state */
.angel-card .card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201, 168, 76, 0.04) 40%,
    rgba(201, 168, 76, 0.08) 50%,
    rgba(201, 168, 76, 0.04) 60%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
  z-index: 0;
}

.angel-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.angel-card .card-image .placeholder-icon {
  font-size: 3rem;
  opacity: 0.15;
}

.angel-card .card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.angel-card .card-body h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.angel-card .card-body .tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.angel-card .card-body .reference {
  font-size: 0.8rem;
  color: var(--gold-dim);
  margin-top: auto;
  letter-spacing: 0.04em;
}

/* Featured card -- spans 3 columns on last row for 9 items */
.angel-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
  max-height: 280px;
}

.angel-card.featured .card-image {
  width: 40%;
  min-width: 40%;
  aspect-ratio: auto;
}

.angel-card.featured .card-body {
  justify-content: center;
  padding: 2rem 2.5rem;
}

.angel-card.featured .card-body h3 {
  font-size: 1.5rem;
}

.angel-card.featured .card-body .tagline {
  font-size: 0.95rem;
}

/* ── Detail Page ── */

.detail-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  padding: 0.5rem 1rem;
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  -webkit-tap-highlight-color: rgba(201, 168, 76, 0.2);
}

.back-link:hover,
.back-link:active {
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold-light);
  border-color: var(--gold);
}

.detail-hero {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #16162a 0%, #1e1e36 100%);
  position: relative;
}

/* Gradient fade at bottom of hero image */
.detail-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(to top, var(--bg-deep) 0%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero .placeholder-hero {
  padding: 6rem 0;
  font-size: 5rem;
  opacity: 0.1;
}

.detail-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.5rem 3rem;
}

.detail-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 0.25rem;
}

.detail-content .angel-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2rem;
}

/* ── Passage Section ── */

.passage {
  margin: 2.5rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.passage:first-of-type {
  border-top: none;
  padding-top: 0;
}

.passage h2 {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
}

.passage .scene-image {
  width: 100%;
  max-width: 420px;
  float: right;
  margin: 0 0 1rem 1.5rem;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.passage .scene-image img {
  width: 100%;
  height: auto;
  display: block;
}

.passage .quote-block {
  border-left: 3px solid var(--gold-dim);
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.5rem;
  background: rgba(201, 168, 76, 0.04);
  border-radius: 0 6px 6px 0;
}

.passage .quote-block p {
  font-style: italic;
  line-height: 1.8;
  color: var(--text);
}

.passage .quote-block cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--gold-dim);
  font-style: normal;
}

.passage::after {
  content: '';
  display: table;
  clear: both;
}

/* ── Further Reading ── */

.further-reading {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.further-reading h3 {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.further-reading ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.further-reading li {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.03em;
}

.detail-content .description {
  margin: 2rem 0;
  line-height: 1.85;
  color: var(--text);
}

.detail-content .description p + p {
  margin-top: 1rem;
}

/* ── Prev/Next Navigation ── */

.angel-nav {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
}

.angel-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.3s ease, background 0.3s ease;
  min-width: 0;
  flex: 1;
  -webkit-tap-highlight-color: rgba(201, 168, 76, 0.2);
}

.angel-nav a:hover,
.angel-nav a:active {
  border-color: var(--gold-dim);
  background: rgba(201, 168, 76, 0.06);
}

.angel-nav a.next {
  text-align: right;
  align-items: flex-end;
}

.angel-nav .nav-direction {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.angel-nav .nav-name {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--gold);
}

/* ── Footer ── */

.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.site-footer .footer-nav {
  margin-bottom: 1rem;
}

.site-footer .footer-nav a {
  color: var(--gold-dim);
  padding: 0.25rem 0.5rem;
  transition: color 0.3s ease;
}

.site-footer .footer-nav a:hover {
  color: var(--gold-light);
}

.site-footer .footer-nav .sep {
  color: var(--border);
  margin: 0 0.25rem;
}

/* ── Animations ── */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.angel-card {
  animation: fadeInUp 0.6s ease both;
}

.angel-card:nth-child(1) { animation-delay: 0.05s; }
.angel-card:nth-child(2) { animation-delay: 0.10s; }
.angel-card:nth-child(3) { animation-delay: 0.15s; }
.angel-card:nth-child(4) { animation-delay: 0.20s; }
.angel-card:nth-child(5) { animation-delay: 0.25s; }
.angel-card:nth-child(6) { animation-delay: 0.30s; }
.angel-card:nth-child(7) { animation-delay: 0.35s; }
.angel-card:nth-child(8) { animation-delay: 0.40s; }
.angel-card:nth-child(9) { animation-delay: 0.45s; }

.detail-content {
  animation: fadeInUp 0.5s ease both;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .angel-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* On 2-col, the featured card still spans full width */
  .angel-card.featured {
    grid-column: 1 / -1;
  }

  .angel-nav .nav-name {
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .passage .scene-image {
    float: none;
    max-width: 100%;
    margin: 0 0 1.25rem 0;
  }
}

@media (max-width: 640px) {
  .angel-grid {
    grid-template-columns: 1fr;
  }

  .angel-card.featured {
    flex-direction: column;
    max-height: none;
  }

  .angel-card.featured .card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .angel-card.featured .card-body {
    padding: 1.25rem 1.5rem 1.5rem;
  }

  .angel-card.featured .card-body h3 {
    font-size: 1.25rem;
  }

  .site-header {
    padding: 3rem 1.5rem 2rem;
  }

  .site-header .intro {
    font-size: 0.9rem;
  }

  .angel-nav {
    flex-direction: column;
  }

  .angel-nav a.next {
    text-align: left;
    align-items: flex-start;
  }

  .detail-hero {
    max-height: 300px;
  }
}
