/* ============================================================
   HUMBLE AUTEUR — Design System
   Black / Bone White / Deep Crimson
   CODE Thin / JetBrains Mono 300 (identity) + EB Garamond (prose)
   NOTE: CODE is a paid font by Fontfabric (fontfabric.com).
         JetBrains Mono 300 is the interim placeholder.
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Tokens --- */
:root {
  --black:   #000000;
  --bone:    #F5F5F2;
  --crimson: #8B0000;
  --bone-dim: rgba(245, 245, 242, 0.45);
  --bone-mid: rgba(245, 245, 242, 0.65);

  /* CODE = paid (fontfabric.com). JetBrains Mono 300 = interim placeholder. */
  --font-display: 'CODE', 'JetBrains Mono', 'Lucida Console', 'Courier New', monospace;
  --font-mono: 'Lucida Console', 'Space Mono', 'Courier New', monospace;
  --font-prose: 'EB Garamond', Georgia, serif;
  --font-thin: 'Cormorant Garamond', Georgia, serif;

  --nav-h: 60px;
  --margin-wide: clamp(6vw, 14vw, 220px);
  --content-max: 720px;
}

/* --- Base --- */
html {
  background: var(--black);
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  min-height: 100dvh;
}

a {
  color: var(--bone);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--crimson);
}

/* ============================================================
   NAVIGATION
   ============================================================ */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  padding: 0 var(--margin-wide);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--black);
  border-bottom: 1px solid var(--crimson);
}

.site-id {
  font-family: var(--font-prose);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--bone);
  text-decoration: none;
  transition: color 0.2s;
}

.site-id:hover {
  color: var(--crimson);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 36px;
}

.nav-links a {
  font-family: var(--font-prose);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--bone-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--bone);
}

.nav-links a.active {
  border-bottom: 1px solid var(--crimson);
  padding-bottom: 2px;
}

.nav-links li:last-child {
  margin-left: 16px;
  padding-left: 20px;
  border-left: 1px solid rgba(245, 245, 242, 0.15);
}

/* Hamburger toggle button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--bone);
  font-family: var(--font-prose);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.nav-toggle:hover {
  color: var(--crimson);
}

/* ============================================================
   MAIN — Shared
   ============================================================ */

main {
  padding-top: calc(var(--nav-h) + 72px);
  padding-left: var(--margin-wide);
  padding-right: var(--margin-wide);
  padding-bottom: 120px;
  max-width: calc(var(--content-max) + (var(--margin-wide) * 2));
  margin: 0 auto;
}

/* ============================================================
   PAGE HEADER — shared across Fiction / Music / Images
   ============================================================ */

.page-header {
  margin-bottom: 72px;
}

.page-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 12px;
}

.page-title {
  font-family: var(--font-thin);
  font-size: clamp(40px, 5.5vw, 62px);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--bone);
  line-height: 1.1;
  margin-bottom: 20px;
}

.header-rule {
  width: 48px;
  height: 1px;
  background: var(--crimson);
  margin-bottom: 20px;
}

.page-note {
  font-family: var(--font-prose);
  font-size: 18px;
  font-style: italic;
  color: var(--bone-mid);
  line-height: 1.6;
}

/* ============================================================
   PORTAL — Home
   ============================================================ */

.portal {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  justify-content: center;
  padding-top: var(--nav-h);
  padding-bottom: 80px;
}

.portal-center {
  padding-top: 80px;
  margin-bottom: 80px;
}

.portal-overline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(139, 0, 0, 0.45);
  margin-bottom: 28px;
}

.portal-name {
  font-family: var(--font-thin);
  font-size: clamp(72px, 13vw, 130px);
  font-weight: 300;
  letter-spacing: 0.03em;
  color: var(--bone);
  line-height: 0.92;
  margin-bottom: 28px;
}

.name-red  { color: var(--crimson); }
.name-white { color: var(--bone); }

.portal-rule {
  width: 64px;
  height: 1px;
  background: var(--crimson);
  margin-bottom: 40px;
}

.portal-descriptor {
  font-family: var(--font-prose);
  font-size: 22px;
  font-style: italic;
  color: var(--bone-mid);
  margin-bottom: 6px;
}

.portal-location {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

/* Portal Index — the three sections */
.portal-index {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 480px;
}

.portal-link {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: baseline;
  gap: 16px 20px;
  padding: 22px 0;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: none;
}

.portal-divider {
  height: 1px;
  background: rgba(245, 245, 242, 0.1);
}

.portal-link:hover .link-title {
  color: var(--crimson);
}

.portal-link:hover .link-label {
  color: var(--crimson);
  font-size: 12px;
}

/* Crimson rule above the portal index */
.portal-index-rule {
  width: 100%;
  height: 1px;
  background: var(--crimson);
  border: none;
  margin-bottom: 0;
}

.link-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--bone-dim);
  padding-top: 2px;
}

.link-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone);
  transition: color 0.2s;
}

.link-sub {
  font-family: var(--font-prose);
  font-size: 14px;
  font-style: italic;
  color: var(--bone-dim);
  grid-column: 2;
  margin-top: 2px;
}

/* ============================================================
   FICTION — Reading Room
   ============================================================ */

.featured-work {
  margin-bottom: 72px;
}

.work-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.work-year {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--bone-dim);
}

.work-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--crimson);
  border: 1px solid var(--crimson);
  padding: 2px 8px;
}

.work-title {
  font-family: var(--font-thin);
  font-size: clamp(26px, 3.5vw, 32px);
  font-weight: 400;
  font-style: italic;
  color: var(--bone);
  line-height: 1.2;
  margin-bottom: 8px;
}

.work-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--bone-dim);
  margin-bottom: 40px;
  text-transform: uppercase;
}

/* Prose — the heart of the reading room */
.excerpt {
  font-family: var(--font-prose);
  font-size: 20px;
  line-height: 1.85;
  color: var(--bone);
  margin-bottom: 40px;
}

.excerpt p {
  margin-bottom: 1.6em;
  max-width: 58ch;
}

.excerpt p:last-child {
  margin-bottom: 0;
}

.pull-quote {
  font-family: var(--font-prose);
  font-size: 24px;
  font-style: italic;
  color: var(--bone-mid);
  border-left: 1px solid var(--crimson);
  padding: 4px 0 4px 28px;
  margin: 40px 0;
  max-width: 52ch;
}

.work-cta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-mid);
  text-decoration: none;
  transition: color 0.2s;
  border-bottom: 1px solid rgba(245, 245, 242, 0.2);
  padding-bottom: 2px;
}

.work-cta:hover {
  color: var(--bone);
  border-bottom-color: var(--crimson);
}

/* Works Index */
.section-rule {
  width: 100%;
  height: 1px;
  background: rgba(245, 245, 242, 0.08);
  margin: 56px 0;
}

.index-heading {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 32px;
}

.work-entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(245, 245, 242, 0.07);
}

.entry-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.entry-year {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--bone-dim);
}

.entry-type {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--crimson);
}

.entry-title {
  font-family: var(--font-thin);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 400;
  font-style: italic;
  margin-bottom: 8px;
}

.entry-title a {
  color: var(--bone);
  text-decoration: none;
  transition: color 0.2s;
}

.entry-title a:hover {
  color: var(--crimson);
}

.entry-desc {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
  line-height: 1.7;
}

/* ============================================================
   MUSIC — Archival
   ============================================================ */

.release {
  margin-bottom: 72px;
}

.release-header {
  margin-bottom: 40px;
}

.release-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.release-year {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--bone-dim);
}

.release-format {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--crimson);
}

.release-title {
  font-family: var(--font-thin);
  font-size: clamp(26px, 3.5vw, 32px);
  font-weight: 400;
  font-style: italic;
  color: var(--bone);
  margin-bottom: 8px;
  line-height: 1.2;
}

.release-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--bone-dim);
  line-height: 1.7;
}

/* Track list */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.track {
  padding: 20px 0;
  border-bottom: 1px solid rgba(245, 245, 242, 0.07);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.track:first-child {
  border-top: 1px solid rgba(245, 245, 242, 0.07);
}

.track-info {
  display: flex;
  align-items: baseline;
  gap: 24px;
}

.track-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  min-width: 24px;
}

.track-details {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex: 1;
  gap: 16px;
}

.track-title {
  font-family: var(--font-prose);
  font-size: 18px;
  font-style: italic;
  color: var(--bone);
}

.track-duration {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  flex-shrink: 0;
}

/* Native audio — styled minimally */
.audio-player {
  width: 100%;
  height: 28px;
  accent-color: var(--crimson);
  background: transparent;
  border: none;
  outline: none;
  filter: invert(1) sepia(1) saturate(2) hue-rotate(300deg) brightness(0.6);
  opacity: 0.7;
  transition: opacity 0.2s;
}

.audio-player:hover {
  opacity: 1;
}

/* Archive index */
.archive-index {
  margin-bottom: 72px;
}

.archive-entry {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(245, 245, 242, 0.07);
}

.archive-year {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--bone-dim);
}

.archive-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive-title {
  font-family: var(--font-prose);
  font-size: 18px;
  font-style: italic;
  color: var(--bone);
}

.archive-format {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--crimson);
}

.archive-link {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.archive-link:hover {
  color: var(--bone);
}

/* ============================================================
   IMAGES — Gallery
   ============================================================ */

.series {
  margin-bottom: 72px;
}

.series-header {
  margin-bottom: 36px;
}

.series-year {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--bone-dim);
  margin-bottom: 10px;
}

.series-title {
  font-family: var(--font-thin);
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 400;
  font-style: italic;
  color: var(--bone);
  margin-bottom: 8px;
}

.series-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--bone-dim);
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-item.wide {
  grid-column: 1 / -1;
}

/* Image placeholder (replace with <img> tags for real images) */
.img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0a0a0a;
  border: 1px solid rgba(245, 245, 242, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(245, 245, 242, 0.15);
  cursor: pointer;
  transition: border-color 0.2s;
}

.img-placeholder:hover {
  border-color: rgba(245, 245, 242, 0.15);
}

.img-placeholder.portrait {
  aspect-ratio: 3 / 4;
}

.img-placeholder.wide-img {
  aspect-ratio: 8 / 3;
}

figcaption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 20px;
}

.fig-title {
  font-family: var(--font-prose);
  font-size: 14px;
  font-style: italic;
  color: var(--bone-mid);
}

.fig-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

/* Real images in gallery */
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid rgba(245, 245, 242, 0.06);
  transition: opacity 0.25s ease, border-color 0.25s ease;
}

.gallery-item img:hover {
  opacity: 0.88;
  border-color: rgba(245, 245, 242, 0.15);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.96);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  padding: 40px;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: var(--bone-dim);
  font-family: var(--font-mono);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 8px;
}

.lightbox-close:hover {
  color: var(--bone);
}

#lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  font-family: var(--font-prose);
  font-size: 16px;
  font-style: italic;
  color: var(--bone-mid);
  text-align: center;
}

/* ============================================================
   FOOTER — shared
   ============================================================ */

.site-footer {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid rgba(245, 245, 242, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--bone-dim);
}

.footer-sep {
  color: var(--crimson);
}

.site-footer a {
  color: var(--bone-dim);
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--bone);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --margin-wide: 24px;
  }

  nav {
    padding: 0 24px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--black);
    border-bottom: 1px solid var(--crimson);
    flex-direction: column;
    padding: 28px 24px;
    gap: 22px;
    z-index: 99;
  }

  nav.open .nav-links {
    display: flex;
  }

  .nav-links li:last-child {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }

  .work-entry {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .entry-meta {
    flex-direction: row;
    gap: 12px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .archive-entry {
    grid-template-columns: 50px 1fr;
    gap: 12px;
  }

  .archive-link {
    grid-column: 2;
  }
}

@media (max-width: 480px) {
  .site-id {
    font-size: 11px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .portal-name {
    font-size: clamp(52px, 14vw, 80px);
  }

  /* Portal index — stacked, centred, touch-friendly */
  .portal-index {
    max-width: 100%;
    width: 100%;
  }

  .portal-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 56px;
    padding: 16px 0;
    gap: 4px;
    grid-template-columns: unset;
  }

  .link-sub {
    grid-column: unset;
    margin-top: 0;
  }

  .portal-center {
    text-align: center;
  }

  .portal-rule {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================================
   MUSIC — Liner Notes
   ============================================================ */

.liner-notes {
  margin-bottom: 0;
}

.liner-header {
  margin-bottom: 40px;
}

.liner-title {
  font-family: var(--font-thin);
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 300;
  font-style: italic;
  color: var(--bone);
  line-height: 1.2;
  margin-bottom: 20px;
  max-width: 550px;
}

.liner-body {
  font-family: var(--font-prose);
  font-size: 20px;
  line-height: 1.85;
  color: var(--bone);
  max-width: 550px;
}

.liner-body p {
  margin-bottom: 1.6em;
}

.liner-body p:last-child {
  margin-bottom: 0;
}

.liner-open {
  font-style: italic;
}

/* ============================================================
   MUSIC — Embed + Streaming
   ============================================================ */

.embed-block {
  margin: 40px 0 48px;
}

.embed-placeholder {
  width: 100%;
  height: 166px;
  border: 1px solid rgba(245, 245, 242, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 242, 0.03);
}

.embed-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--bone-dim);
}

.embed-placeholder iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.embed-caption {
  font-family: var(--font-prose);
  font-size: 15px;
  font-style: italic;
  color: var(--bone-dim);
  margin-top: 14px;
}

.streaming-links {
  margin-bottom: 48px;
}

.streaming-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 10px;
}

.streaming-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.streaming-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--bone-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.streaming-link:hover {
  color: var(--crimson);
}

.streaming-sep {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--bone-dim);
}

.streaming-release-note {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(245, 245, 242, 0.28);
  margin-top: 10px;
  font-style: italic;
}
