@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Cormorant+SC:wght@300;400&family=Fragment+Mono:ital@0;1&display=swap');

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

:root {
  --void: #07070a;
  --surface: #0d0d12;
  --text: #dbd5c5;
  --text-dim: #8a8070;
  --text-faint: #3d3830;
  --gold: #b8965a;
  --gold-dim: #6e5830;
}

html {
  font-size: 18px;
  background: var(--void);
  color: var(--text);
}

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  line-height: 1.75;
  min-height: 100vh;
  background: var(--void);
  background-image: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  position: relative;
}

/* ─── GRAIN OVERLAY ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 100;
  opacity: 0.4;
}

/* ─── LAYOUT ─── */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── INDEX PAGE ─── */
.index-header {
  padding: 6rem 0 4rem;
  opacity: 0;
  animation: arrive 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.site-title {
  font-family: 'Cormorant SC', 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 5rem);
  letter-spacing: 0.18em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.6rem;
}

.site-title span {
  color: var(--gold);
}

.site-epigraph {
  font-style: italic;
  font-size: 1rem;
  color: var(--text-dim);
  margin-top: 1.4rem;
  max-width: 44ch;
  line-height: 1.6;
}

.site-epigraph cite {
  display: block;
  font-style: normal;
  font-family: 'Fragment Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-top: 0.5rem;
}

/* ─── DIVIDER ─── */
.rule {
  border: none;
  border-top: 1px solid var(--text-faint);
  margin: 0;
  opacity: 0;
  animation: arrive 1s ease 0.8s forwards;
}

/* ─── CABINET ─── */
.cabinet {
  padding: 3rem 0 8rem;
}

.cabinet-label {
  font-family: 'Fragment Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: arrive 1s ease 1s forwards;
}

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

.entry-item {
  opacity: 0;
  animation: arrive 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.entry-item:nth-child(1) { animation-delay: 1.1s; }
.entry-item:nth-child(2) { animation-delay: 1.25s; }
.entry-item:nth-child(3) { animation-delay: 1.4s; }
.entry-item:nth-child(4) { animation-delay: 1.55s; }
.entry-item:nth-child(5) { animation-delay: 1.7s; }

.entry-link {
  display: grid;
  grid-template-columns: 5ch 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--text-faint);
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.entry-link:hover {
  color: var(--gold);
}

.entry-link:hover .entry-num {
  color: var(--gold-dim);
}

.entry-num {
  font-family: 'Fragment Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-faint);
  transition: color 0.2s ease;
  padding-top: 0.15rem;
}

.entry-title {
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.entry-date {
  font-family: 'Fragment Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.entry-note {
  grid-column: 2 / 3;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: -0.4rem;
  padding-bottom: 0.4rem;
  line-height: 1.5;
}

/* ─── ESSAY PAGE ─── */
.essay-nav {
  padding: 2.5rem 0 0;
  opacity: 0;
  animation: arrive 1s ease 0.1s forwards;
}

.back-link {
  font-family: 'Fragment Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.essay-header {
  padding: 4rem 0 3rem;
  opacity: 0;
  animation: arrive 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.essay-num {
  font-family: 'Fragment Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  margin-bottom: 1rem;
}

.essay-title {
  font-family: 'Cormorant SC', serif;
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: 0.06em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1.2rem;
}

.essay-meta {
  font-family: 'Fragment Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

.essay-body {
  padding-bottom: 8rem;
  opacity: 0;
  animation: arrive 1s ease 0.7s forwards;
}

.essay-body p {
  font-size: 1.1rem;
  line-height: 1.85;
  margin-bottom: 1.6rem;
  color: var(--text);
  font-weight: 300;
}

.essay-body p:first-child::first-letter {
  font-size: 3.4rem;
  font-weight: 400;
  float: left;
  line-height: 0.82;
  margin-right: 0.08em;
  margin-top: 0.12em;
  color: var(--gold);
  font-family: 'Cormorant Garamond', serif;
}

.essay-body blockquote {
  border-left: 1px solid var(--gold-dim);
  margin: 2.5rem 0 2.5rem 1rem;
  padding-left: 1.5rem;
  font-style: italic;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.75;
}

.essay-body .aside {
  font-family: 'Fragment Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-faint);
  line-height: 1.6;
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--text-faint);
  border-bottom: 1px solid var(--text-faint);
}

.essay-footer {
  padding: 2rem 0 6rem;
  border-top: 1px solid var(--text-faint);
  opacity: 0;
  animation: arrive 1s ease 1s forwards;
}

.essay-footer-label {
  font-family: 'Fragment Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
}

/* ─── ANIMATIONS ─── */
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── SELECTION ─── */
::selection {
  background: var(--gold-dim);
  color: var(--text);
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--void);
}
::-webkit-scrollbar-thumb {
  background: var(--text-faint);
  border-radius: 3px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 560px) {
  .entry-link {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .entry-date {
    display: none;
  }
  .entry-note {
    grid-column: 1;
  }
}
