@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #f7f3ee;
  --text: #1a1a1a;
  --muted: #666;
  --accent: #2d6a4f;
  --link: #2d6a4f;
  --border: #e0d9d0;
  --max-width: 900px;
  --sidebar-width: 180px;
  --gap: 64px;
  --link-green: #5a9a7a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

html {
  font-size: 130%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  padding: 0 24px;
}

/* ── Layout: sidebar + main ── */
.site-wrapper {
  max-width: calc(var(--sidebar-width) + var(--gap) + var(--max-width));
  margin: 0 auto;
  padding: 64px 0 96px;
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

/* ── Sticky Sidebar Nav ── */
.site-nav {
  position: sticky;
  top: 48px;
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 0 28px 0 0;
  border-right: 1px solid var(--border);
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 0;
  display: block;
  transition: color 0.2s, transform 0.2s;
  position: relative;
}

.site-nav a:hover {
  color: var(--accent);
  transform: translateX(4px);
}

.site-nav a.active {
  color: var(--accent);
}

.site-nav a.active::after {
  content: '';
  position: absolute;
  right: -28px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: all 0.2s;
}

.site-nav a + a::before { content: none; }

/* Main Content */
.site-main {
  flex: 1;
  min-width: 0;
  max-width: var(--max-width);
}

/* Header */
.site-header { margin-bottom: 48px; }

.site-header h1 {
  font-family: 'Fraunces', serif;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.site-header .email {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  font-style: italic;
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}

.site-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.site-links a:hover { color: var(--accent); }

.site-links .sep {
  color: var(--border);
  margin: 0 10px;
  font-weight: 300;
}

/* Sections */
section {
  margin-bottom: 64px;
  scroll-margin-top: 32px;
}

section h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

/* About */
.about-content p {
  margin-bottom: 14px;
  font-size: 0.97rem;
}
.about-content p:last-child { margin-bottom: 0; }

.about-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s, text-decoration-color 0.15s;
  text-decoration-thickness: 2px;
  color: var(--link-green);
  text-decoration-color: var(--link-green);
}
.about-content a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Publications */
.pub-list { list-style: none; }

.pub-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:first-child { border-top: 1px solid var(--border); }

.pub-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  transition: color 0.15s;
}
a.pub-title:hover { color: var(--accent); }

.pub-authors {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.pub-venue {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  font-style: italic;
}

/* Works */
.project-list { list-style: none; }

.project-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.project-item:first-child { border-top: 1px solid var(--border); }

.project-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 5px;
}
.project-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.project-title a:hover { color: var(--accent); }

.project-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Personal Section */
.personal-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.personal-cta {
  margin-top: 40px;
  font-size: 0.97rem;
}
.personal-cta a {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--link-green);
  text-decoration-color: var(--link-green);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.personal-cta a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Tabs */
.media-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.media-tab {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.03em;
}
.media-tab:hover { color: var(--text); }
.media-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.media-panel { display: none; }
.media-panel.active { display: block; }

.hint-text {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
  font-style: italic;
  opacity: 0.7;
}

/* ── Vinyl Crate ── */
.crate-container { position: relative; }
.crate {
  background:
    repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(0,0,0,0.015) 30px, rgba(0,0,0,0.015) 31px),
    repeating-linear-gradient(90deg, transparent, transparent 67px, rgba(0,0,0,0.01) 67px, rgba(0,0,0,0.01) 68px),
    linear-gradient(180deg, #c8b99a 0%, #b5a484 40%, #a89474 100%);
  border-radius: 6px;
  position: relative;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.2),
    inset 0 -3px 6px rgba(0,0,0,0.1),
    0 4px 0 #9a8a6e,
    0 6px 0 #8d7d62,
    0 10px 30px rgba(0,0,0,0.12);
  overflow-x: hidden;
  overflow-y: visible;
}
.crate::before {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 8px, rgba(0,0,0,0.02) 8px, rgba(0,0,0,0.02) 9px);
  pointer-events: none;
  border-radius: 6px;
}
/* Front lip */
.crate::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: linear-gradient(180deg, #b5a484 0%, #a89474 100%);
  border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
  z-index: 20;
  border-radius: 0 0 6px 6px;
}

.vinyl-track {
  display: flex;
  align-items: flex-end;
  padding: 60px 16px 32px;
  min-height: 300px;
  overflow: visible;
  gap: 3px;
}

.vinyl-slot {
  flex-shrink: 0;
  width: 10px;
  height: 185px;
  position: relative;
  cursor: pointer;
  transition: width 0.4s cubic-bezier(0.25,1,0.5,1), margin 0.3s ease;
  z-index: 1;
}

/* Spine */
.vinyl-spine {
  width: 100%; height: 100%;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--spine-color, #333) 0%, color-mix(in srgb, var(--spine-color, #333), #fff 20%) 50%, var(--spine-color, #333) 100%);
  box-shadow: 1px 0 2px rgba(0,0,0,0.3), -1px 0 1px rgba(0,0,0,0.15);
  transition: transform 0.4s cubic-bezier(0.25,1,0.5,1), opacity 0.3s;
  position: relative;
  overflow: hidden;
}
.vinyl-spine::after {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.05) 100%);
}

/* Cover reveal */
.vinyl-cover-wrap {
  position: absolute;
  bottom: 0; left: 0;
  width: 180px; height: 180px;
  pointer-events: none;
  opacity: 0;
  transform: rotateY(-30deg) translateX(-10px);
  transform-origin: left center;
  transition: all 0.45s cubic-bezier(0.25,1,0.5,1);
  z-index: 30;
}
.vinyl-cover {
  width: 100%; height: 100%;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.25), 1px 1px 4px rgba(0,0,0,0.15);
}
.vinyl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Vinyl record */
.vinyl-record {
  position: absolute;
  width: 150px; height: 150px;
  border-radius: 50%;
  top: -50px; left: 14px;
  background:
    radial-gradient(circle at center,
      #555 0%, #555 8%, transparent 8.5%, transparent 9.5%,
      #333 10%, #1a1a1a 18%, #222 19%, #181818 30%,
      #1f1f1f 31%, #161616 42%, #1a1a1a 43%, #141414 54%,
      #181818 55%, #111 66%, #151515 67%, #0e0e0e 78%,
      #121212 79%, #0a0a0a 100%);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s 0.1s, transform 0.4s 0.1s cubic-bezier(0.25,1,0.5,1);
  z-index: 29;
}
.vinyl-record::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle, #888 0%, #888 15%, var(--accent) 16%, var(--accent) 85%, #666 86%);
}
.vinyl-record::before {
  content: '';
  position: absolute; inset: 10px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg, rgba(255,255,255,0.03) 10deg,
    transparent 20deg, rgba(255,255,255,0.02) 90deg,
    transparent 100deg, rgba(255,255,255,0.04) 180deg,
    transparent 200deg, rgba(255,255,255,0.02) 270deg,
    transparent 280deg, rgba(255,255,255,0.03) 350deg,
    transparent 360deg);
}

/* Active vinyl */
.vinyl-slot.active {
  width: 190px;
  margin: 0 4px;
  z-index: 30;
}
.vinyl-slot.active .vinyl-spine { opacity: 0; transform: scaleX(0); }
.vinyl-slot.active .vinyl-cover-wrap {
  opacity: 1;
  transform: rotateY(0deg) translateX(0);
  pointer-events: auto;
}
.vinyl-slot.active .vinyl-record { opacity: 1; transform: translateY(0); }

/* Hover lean */
.vinyl-slot:not(.active):hover { width: 14px; }
.vinyl-slot:not(.active):hover .vinyl-spine {
  transform: rotateZ(-3deg);
  box-shadow: 2px 0 4px rgba(0,0,0,0.3);
}

.vinyl-info-bar {
  min-height: 52px;
  padding: 12px 0 0;
}
.vinyl-info-row {
  display: flex;
  gap: 24px;
}
.vinyl-info-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 170px;
}
.vinyl-info-bar .album-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vinyl-info-bar .artist-name {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vinyl-info-bar .item-note {
  font-size: 0.72rem;
  color: var(--accent);
  font-style: italic;
  margin-top: 2px;
}

.crate-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-70%);
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  z-index: 30;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.crate-nav:hover { border-color: var(--accent); color: var(--accent); }
.crate-nav.disabled { opacity: 0.3; pointer-events: none; }
.crate-nav.prev { left: -14px; }
.crate-nav.next { right: -14px; }

.vinyl-info-bar .album-counter {
  font-size: 0.65rem;
  color: var(--border);
  margin-top: 4px;
  letter-spacing: 0.03em;
}

/* ── Poster Wall – Bedroom wall ── */
.poster-wall {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.08) 0%, transparent 60%),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(0,0,0,0.008) 40px, rgba(0,0,0,0.008) 41px),
    linear-gradient(180deg, #e8ddd0 0%, #ddd0c0 100%);
  border-radius: 8px;
  padding: 32px 24px 24px;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.04),
    0 2px 8px rgba(0,0,0,0.04);
}
.poster-wall::-webkit-scrollbar { display: none; }

.poster-card {
  flex-shrink: 0;
  width: 140px;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.25,1,0.5,1);
}
.poster-card:hover {
  transform: translateY(-6px) rotate(0deg) !important;
  z-index: 5;
}

.poster-frame {
  width: 140px; height: 200px;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.12),
    0 4px 12px rgba(0,0,0,0.08),
    2px 2px 0 rgba(0,0,0,0.03);
  border: 3px solid #f5f0e8;
}
.poster-frame img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.5s ease;
}
.poster-card:hover .poster-frame img { transform: scale(1.03); }

/* Tape strip */
.poster-frame::before {
  content: '';
  position: absolute;
  top: -4px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 14px;
  background: rgba(255,248,220,0.75);
  border: 1px solid rgba(200,180,140,0.3);
  z-index: 10;
  border-radius: 1px;
}
.poster-frame::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 70%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}

.poster-info { margin-top: 10px; text-align: center; }
.poster-info .poster-title {
  font-size: 0.78rem; font-weight: 600;
  color: var(--text); line-height: 1.3;
}
.poster-info .poster-meta {
  font-size: 0.68rem; color: var(--muted); margin-top: 1px;
}
.poster-info .item-note {
  font-size: 0.65rem; color: var(--accent); font-style: italic; margin-top: 3px;
  opacity: 0; max-height: 0; overflow: hidden;
  transition: opacity 0.3s, max-height 0.4s ease;
}
.poster-card.active .item-note { opacity: 1; max-height: 60px; }

/* ── Bookshelf – Wall + shelf ── */
.bookshelf {
  position: relative;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(255,255,255,0.06) 0%, transparent 60%),
    linear-gradient(180deg, #e8ddd0 0%, #ddd0c0 100%);
  border-radius: 8px;
  padding: 20px 0 0;
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.04),
    0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}

.book-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 20px;
  min-height: 180px;
  overflow-x: auto;
  scrollbar-width: none;
}
.book-row::-webkit-scrollbar { display: none; }

.shelf-plank {
  height: 14px;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(0,0,0,0.01) 30px, rgba(0,0,0,0.01) 31px),
    linear-gradient(180deg, #c4b9a8 0%, #b8ad9c 40%, #a89b8a 100%);
  box-shadow:
    0 4px 8px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.25);
  position: relative;
  z-index: 5;
}
.shelf-plank::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 8px; right: 8px;
  height: 6px;
  background: rgba(0,0,0,0.05);
  border-radius: 0 0 6px 6px;
}

.shelf-info-area {
  min-height: 48px;
  padding: 10px 20px 14px;
  background: var(--bg);
  border-radius: 0 0 8px 8px;
}
.shelf-info-area .book-info-active { display: none; }
.shelf-info-area .book-info-active.visible { display: block; }
.shelf-info-area .book-title {
  font-size: 0.78rem; font-weight: 600;
  color: var(--text); line-height: 1.3;
}
.shelf-info-area .book-author {
  font-size: 0.7rem; color: var(--muted);
}
.shelf-info-area .item-note {
  font-size: 0.65rem; color: var(--accent);
  font-style: italic; margin-top: 2px;
}
.shelf-info-area .shelf-hint {
  font-size: 0.68rem; color: var(--muted);
  font-style: italic; opacity: 0.6;
}

.book-item {
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.25,1,0.5,1);
  position: relative;
}
.book-item:hover { transform: translateY(-10px); }
.book-item.active { transform: translateY(-14px) rotateZ(-1.5deg); }

.book-cover {
  width: 105px; height: 155px;
  border-radius: 2px 4px 4px 2px;
  overflow: hidden; position: relative;
  box-shadow:
    3px 2px 8px rgba(0,0,0,0.18),
    -1px 0 2px rgba(0,0,0,0.06);
}
.book-cover::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 6px;
  background: linear-gradient(90deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.03) 100%);
  z-index: 2;
}
.book-cover::after {
  content: ''; position: absolute;
  right: -3px; top: 4px; bottom: 4px; width: 3px;
  background: repeating-linear-gradient(180deg, #f0ece4 0px, #f0ece4 1px, #e8e4dc 1px, #e8e4dc 2px);
  border-radius: 0 1px 1px 0;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

strong, b {
  font-weight: 800;
}

/* Footer */
.site-footer {
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Mobile: sidebar collapses to sticky top bar ── */
@media (max-width: 800px) {
  .site-wrapper {
    flex-direction: column;
    gap: 0;
    padding: 40px 0 72px;
  }

  .site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    margin-bottom: 40px;
    background: var(--bg);
  }

  .site-nav a {
    padding: 4px 12px 4px 0;
  }
  .site-nav a:hover { transform: none; }
  .site-nav a.active::after { display: none; }

  .site-nav a + a::before {
    content: "·";
    margin-right: 10px;
    color: var(--border);
  }

  .site-header h1 { font-size: 2rem; }
  body { padding: 0 20px; }

  .vinyl-slot.active { width: 155px; }
  .vinyl-cover-wrap { width: 150px; height: 150px; }
  .vinyl-record { width: 125px; height: 125px; top: -40px; }
  .vinyl-slot { height: 155px; }
  .poster-card { width: 120px; }
  .poster-frame { width: 120px; height: 170px; }
  .book-cover { width: 90px; height: 130px; }
  .crate-nav.prev { left: -10px; }
  .crate-nav.next { right: -10px; }
}