@font-face {
  font-family: 'Lausanne';
  src: url('TWKLausanne-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lausanne';
  src: url('TWKLausanne-700.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'WastedYear';
  src: url('WastedYearRegular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

::selection {
  background: #b9ff66;
  color: #000;
}

:root {
  --font: 'Lausanne', sans-serif;
  --text-primary: #000;
  --text-muted: #a1a1aa;
  --bg: #fff;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ─── Page shell ─────────────────────────────────────────── */

.page {
  display: flex;
  justify-content: center;
  min-height: 100%;
}

.container {
  flex: 1;
  max-width: 544px;
  padding: 96px 32px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ─── Avatar ─────────────────────────────────────────────── */

.avatar {
  display: block;
  margin-bottom: 32px;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}

.avatar-video,
.avatar-img {
  width: 72px;
  height: auto;
  display: block;
  border-radius: 9999px;
}

.avatar-img { display: none; }

/* ─── Identity ───────────────────────────────────────────── */

.identity {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.identity-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--text-primary);
}

.identity-role {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--text-primary);
}

/* ─── Nav + panels wrapper ───────────────────────────────── */

.content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ─── Navigation tabs ────────────────────────────────────── */

.nav {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: -8px;
}

.nav-link {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  cursor: pointer;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  height: 2px;
  background: #eeeff2;
  border-radius: 1px;
}

/* ─── Tab panels ─────────────────────────────────────────── */

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* ─── Work tab: project list ─────────────────────────────── */

#panel-work {
  gap: 0;
}

.project-list {
  display: flex;
  flex-direction: column;
  list-style: none;
}

.project-item a {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 16px;
  margin-inline-start: -16px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.1s ease-out;
}

.project-item a:hover {
  background: #f4f4f5;
}

.project-title {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-position: from-font;
}

.project-year {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--text-muted);
}

/* ─── About tab ──────────────────────────────────────────── */

#panel-about {
  gap: 48px;
}

.about-bio {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about-bio p {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--text-primary);
  text-wrap: pretty;
}

.about-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-section--books {
  gap: 0;
}

.about-section-label {
  font-size: 15px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--text-primary);
}

.about-section-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  list-style: none;
}

.about-section-links a {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-position: from-font;
}

/* ─── Project list (about tab) ───────────────────────────── */

.proj-list {
  display: flex;
  flex-direction: column;
  padding-top: 0;
  width: 100%;
}

.proj-row {
  display: flex;
  align-items: center;
  height: 40px;
  text-decoration: none;
  border-radius: 6px;
  padding: 0 8px;
  margin-inline: -8px;
  width: calc(100% + 16px);
  box-sizing: border-box;
  transition: background 0.1s ease-out;
}

.proj-row:hover {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.07);
}

.proj-name {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.proj-line {
  flex: 1;
  height: 1px;
  margin: 0 8px;
  min-width: 0;
}

.proj-year {
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: #87836d;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── ──────────────────────────────────────────────────────── */

.about-book-note {
  font-size: 13px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: -0.1px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─── Bookshelf ──────────────────────────────────────────── */

.book-item {
  display: block;
  text-decoration: none;
}

.bookshelf {
  display: grid;
  grid-template-columns: 1fr 0.95fr 1fr 1.4fr;
  gap: 16px;
  align-items: end;
}

.book-cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Resting tilts */
.book-cover[alt="I Know Why the Caged Bird Sings"]       { transform: rotate(-2deg); }
.book-cover[alt="Born Lucky"]                             { transform: rotate(1.5deg); }
.book-cover[alt="Man's Search for Meaning"]               { transform: rotate(-1.5deg); }
.book-cover[alt="The Art of Learning"]                    { transform: rotate(2deg); }
.book-cover[alt="How to Win Friends and Influence People"]{ transform: rotate(-0.5deg); }
.book-cover[alt="Shoe Dog"]                               { transform: rotate(1deg); }
.book-cover[alt="Thinking in Bets"]                       { transform: rotate(-2deg); }
.book-cover[alt="The Elements of Style"]                  { transform: rotate(1.5deg); }
.book-cover[alt="Elements of Type"]                       { transform: rotate(-1deg); }
.book-cover[alt="The Body Keeps the Score"]               { transform: rotate(2deg); }
.book-cover[alt="Why We Sleep"]                           { transform: rotate(-1.5deg); }
.book-cover[alt="Grid Systems"]                           { transform: rotate(2.5deg); }

/* Secondary row — independent flex row, same scale as row above */
.bookshelf--secondary {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: 16px;
}

.bookshelf--secondary .book-item { flex: 1; }

/* Row 2 tilts */
.book-cover[alt="Man's Search for Meaning"]               { transform: rotate(3deg); }
.book-cover[alt="The Body Keeps the Score"]               { transform: rotate(-4deg); }
.book-cover[alt="How to Win Friends and Influence People"] { transform: rotate(1.5deg); }
.book-cover[alt="Why We Sleep"]                           { transform: rotate(-2.5deg); }

/* Hover: straighten + lift with spring — must come after tilt rules */
.bookshelf .book-item .book-cover:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.book-cover--placeholder {
  aspect-ratio: 2 / 3;
  background-size: cover;
  background-position: center;
  background-color: #e4e4e7;
}


/* ─── MD Vinyl player ────────────────────────────────────── */

.vp-player {
  position: relative;
  width: 100%;
  height: 170px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  /* iOS dark glass */
  background: rgba(22, 22, 24, 0.88);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.07);
}

.vp-left {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 0 22px 22px;
  min-width: 0;
}

.vp-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vp-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vp-artist {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vp-btns {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vp-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.vp-btn:hover { opacity: 0.7; }

.vp-ph {
  font-size: 20px;
  color: white;
  line-height: 1;
  display: block;
}

.vp-btn-svg {
  width: 32px;
  height: 32px;
  display: block;
}

/* Right: vinyl + tonearm */
.vp-right {
  position: relative;
  z-index: 1;
  width: 190px;
  flex-shrink: 0;
}

/* Vinyl disc — sized to fit inside card with 16px clearance on all sides */
.vp-vinyl {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 138px;
  height: 138px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7);
}

@keyframes vp-spin {
  from { transform: translateY(-50%) rotate(0deg); }
  to   { transform: translateY(-50%) rotate(360deg); }
}
.vp-vinyl.is-spinning {
  animation: vp-spin 4.5s linear infinite;
}

.vp-disc-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Album art in center label area */
.vp-art {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  z-index: 1;
}


/* Spindle hole for light player (sits on top of album art) */
.vp2-spindle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.18);
  z-index: 2;
  pointer-events: none;
}


/* Shimmer overlay — same position as .vp-vinyl but does not spin */
.vp-shimmer {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 138px;
  height: 138px;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

/* Tonearm — Figma node 496-11314, pivot = large circle at top-right (86%, 9%) */
.vp-tonearm-svg {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 56px;
  height: auto;
  z-index: 3;
  transform-origin: 86% 9%;
  transform: rotate(-14deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vp-tonearm-svg.arm-play {
  transform: rotate(3deg);
}

/* ─── Site preview ───────────────────────────────────────── */

.site-preview {
  position: fixed;
  width: 320px;
  height: 200px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  pointer-events: none;
  z-index: 9999;
  background: #f4f4f5;
  opacity: 0;
  transform: scale(0.88) translateY(10px);
  transform-origin: top center;
  transition: opacity 0.12s ease, transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.site-preview.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0px);
}


/* ─── Album grid ─────────────────────────────────────────── */

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.album-placeholder {
  aspect-ratio: 1;
  background: #f4f4f5;
  border-radius: 4px;
}

/* ─── Skin toggle button ─────────────────────────────────── */

.vp-skin-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  padding: 2px 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.vp-skin-btn:hover { opacity: 1; }

/* ─── Light player (vp2) ─────────────────────────────────── */

.vp2-wrap {
  position: relative;
  height: 160px;
}

.vp2-vinyl {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.08);
  animation: vp-spin 4.5s linear infinite;
  animation-play-state: paused;
}

.vp2-vinyl.is-spinning {
  animation-play-state: running;
}

.vp2-shimmer {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.vp2-card {
  position: absolute;
  left: 80px;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 144px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.05);
  padding: 16px 32px 16px 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1;
}

.vp2-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.vp2-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.vp2-title {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  line-height: 24px;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vp2-artist {
  font-size: 15px;
  font-weight: 400;
  color: #87836d;
  line-height: 24px;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vp2-mute {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
  margin-top: 1px;
}
.vp2-mute:focus,
.vp2-mute:focus-visible { outline: none; }
.vp2-mute:hover { opacity: 0.8; }

.vp2-progress-track {
  height: 5px;
  background: #e4e4e7;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}

.vp2-progress-fill {
  height: 100%;
  background: #e11d48; /* overridden by JS color sampling */
  border-radius: 3px;
}

.vp2-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vp2-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #18181b;
  transition: opacity 0.15s;
}
.vp2-btn:focus,
.vp2-btn:focus-visible { outline: none; }
.vp2-btn:hover { opacity: 0.5; }

.vp2-next-btn {
  background: none;
  padding: 0;
}

/* ─── Page load stagger ──────────────────────────────────── */

@keyframes page-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

.animate-enter {
  animation: page-fade-up 1000ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation-delay: var(--delay, 0ms);
}

/* Project items stagger in after the nav */
.project-list .project-item {
  animation: page-fade-up 1000ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.project-list .project-item:nth-child(1)      { animation-delay: 550ms; }
.project-list .project-item:nth-child(2)      { animation-delay: 650ms; }
.project-list .project-item:nth-child(3)      { animation-delay: 730ms; }
.project-list .project-item:nth-child(4)      { animation-delay: 800ms; }
.project-list .project-item:nth-child(n+5)    { animation-delay: 860ms; }

@media (prefers-reduced-motion: reduce) {
  .animate-enter,
  .project-list .project-item {
    animation: none;
  }
}

/* ─── Mobile ─────────────────────────────────────────────── */

@media (max-width: 767px) {
  .avatar-video { display: none; }
  .avatar-img   { display: block; }
  .container    { padding: 64px 24px; }


  /* Music player — fluid */
  .vp2-wrap { height: clamp(112px, 35vw, 160px); }
  .vp2-vinyl,
  .vp2-shimmer {
    width:  clamp(112px, 35vw, 160px);
    height: clamp(112px, 35vw, 160px);
  }
  .vp2-card {
    left:    clamp(56px, 17.5vw, 80px);
    height:  clamp(96px, 30vw, 144px);
    padding: 8px 16px 16px clamp(72px, 21vw, 96px);
  }
  #vp2-art {
    width:  clamp(54px, 17vw, 98px) !important;
    height: clamp(54px, 17vw, 98px) !important;
  }
}

/* ─── Background lines ───────────────────────────────────── */
