:root {
  --bg: #0d0e0f;
  --surface: #18191b;
  --surface-raised: #201f1c;
  --walnut: #6b4a35;
  --walnut-light: #8a6448;
  --teal: #2f8f8a;
  --rust: #c1502e;
  --ink: #ede6da;
  --ink-muted: #948d80;
  --line: #302e2a;

  --display: 'Archivo Black', sans-serif;
  --mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  line-height: 1.5;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--teal); }

/* Header */
.site-head {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  position: sticky;
  top: 0;
  background: rgba(13, 14, 15, 0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.head-row { display: flex; justify-content: space-between; align-items: center; }
.brand {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.tape-count, .section-note {
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.site-nav { display: flex; gap: 20px; }
.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.site-nav a:hover { color: var(--teal); border-color: var(--teal); }

/* Section headers, shared by Journal and Catalog */
.section { padding: 8px 0 64px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 24px;
}
.section-head h2 {
  font-family: var(--display);
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.02em;
}

/* Journal entries */
.journal-list { display: flex; flex-direction: column; }
.entry {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px dashed var(--line);
  padding: 18px 0;
  font-family: inherit;
  color: inherit;
  cursor: default;
  position: relative;
}
button.entry { cursor: pointer; }
button.entry:hover .entry-title { color: var(--teal); }
.entry-date {
  font-size: 11px;
  color: var(--walnut-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.entry-title {
  font-family: var(--display);
  font-size: 16px;
  margin: 6px 0 6px;
  color: var(--ink);
}
.entry-body {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
}
.entry-delete {
  position: absolute;
  top: 16px;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--rust);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.entry-delete:hover { background: var(--rust); color: var(--ink); }

/* Hero */
.hero { padding: 64px 0 40px; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.hero-sub { color: var(--ink-muted); max-width: 46ch; margin: 0; font-size: 14px; }

/* Rack */
.rack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.empty-state { color: var(--ink-muted); grid-column: 1 / -1; }

.tape {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  text-align: left;
  color: inherit;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tape:hover, .tape:focus-visible {
  transform: translateY(-3px);
  border-color: var(--walnut-light);
  outline: none;
}

.tape-window {
  background: linear-gradient(180deg, #0a0a0b, #131313);
  border-radius: 4px;
  border: 1px solid var(--line);
  padding: 18px 10px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: relative;
}
.tape-number {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--walnut-light);
}
.reel {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--walnut-light);
  position: relative;
  background:
    radial-gradient(circle at center, var(--surface) 0 5px, transparent 5.5px),
    conic-gradient(var(--walnut) 0 90deg, transparent 0 180deg, var(--walnut) 0 270deg, transparent 0);
  transition: transform 0.6s linear;
}
.tape:hover .reel { transform: rotate(180deg); }
.tape:hover .reel.reel-b { transform: rotate(-160deg); }

.tape-label {
  border-top: 2px dashed var(--line);
  padding-top: 12px;
}
.tape-cat {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tape-title {
  font-family: var(--display);
  font-size: 16px;
  margin: 0 0 4px;
  color: var(--ink);
}
.tape-desc {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 20px 0 40px;
  color: var(--ink-muted);
  font-size: 12px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 7, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.lightbox[hidden] { display: none; }
.lightbox-inner {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
  z-index: 2;
}
.lightbox-media {
  aspect-ratio: 16 / 9;
  background: #000;
}
.lightbox-media iframe, .lightbox-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  display: block;
}
.lightbox-body { padding: 20px 24px 28px; }
.lightbox-cat {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--teal);
  text-transform: uppercase;
}
.lightbox-body h2 { font-family: var(--display); margin: 8px 0 12px; font-size: 22px; }
.lightbox-body p { color: var(--ink-muted); font-size: 13px; margin: 0; }
.lightbox-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.lightbox-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--line);
}
