/* =========================================
   Ben Cronin Portfolio — Design System
   ========================================= */

/* --- Custom Properties --- */
:root {
  --bg: #FAF8F5;
  --text: #1A1A1A;
  --coral: #FF5733;
  --violet: #7B2FBE;
  --teal: #00C9A7;
  --muted: #A8A29E;
  --font-display: 'Syne', sans-serif;
  --font-ui: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --ease-bounce: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --beat: 0;
  --bg-playing: #F5F0E8;
}

/* --- Dark Mode (default) --- */
body:not(.light) {
  background: #111 !important;
  color: #e8e4df;
}

body:not(.light) .project-card { background: #1a1a1a; }
body:not(.light) .card-desc { color: #999; }
body:not(.light) .card-title { color: #e8e4df; }
body:not(.light) .about-text p { color: #999; }
body:not(.light) .nav.scrolled { background: rgba(17, 17, 17, 0.85); }
body:not(.light) .filter-pill { border-color: #333; color: #ccc; }
body:not(.light) .filter-pill:hover { border-color: var(--coral); color: var(--coral); }
body:not(.light) .section-title { color: #e8e4df; }
body:not(.light) .footer p { color: #555; }
body:not(.light) .social-link { color: #999; }
body:not(.light) .timeline-item { border-left-color: #333; }
body:not(.light) .timeline-year { color: #555; }
body:not(.light) .timeline-label { color: #ccc; }
body:not(.light) .info-tray-inner,
body:not(.light) .tray-card-preview,
body:not(.light) .info-tray .info-tray-content { background: #1a1a1a; }
body:not(.light) .info-tray .tray-title { color: #e8e4df; }
body:not(.light) .info-tray .tray-desc { color: #999; }
body:not(.light) .info-tray .tray-sub { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: #ccc; }
body:not(.light) .info-tray a.tray-sub { color: var(--coral); }
body:not(.light) .info-tray .tray-card-desc { color: #777; }
body:not(.light) .info-tray .info-tray-content { border-left-color: rgba(255,255,255,0.05); }
body:not(.light) .info-tray::before { background: rgba(0,0,0,0.6); }
body:not(.light) .info-tray-close { color: #ccc; background: rgba(255,255,255,0.05); }
body:not(.light) .audio-player { background: rgba(255,255,255,0.03); border-top-color: rgba(255,255,255,0.05); }
body:not(.light) .progress-container { background: rgba(255,255,255,0.08); }
body:not(.light) .excerpt-text { color: #ccc; }
body:not(.light) .hero-tagline { color: #666; }
body:not(.light) .hero-name { color: #e8e4df; }
body:not(.light) .mobile-menu { background: #111; }
body:not(.light) .hamburger span { background: #e8e4df; }
body:not(.light) .cassette-body,
body:not(.light) .cassette-controls { background: #1a1a1a; border-color: #333; }
body:not(.light) .cassette-track-name { color: #666; }
body:not(.light) .cassette.playing .cassette-track-name { color: #ccc; }
body:not(.light) .cassette-controls button { color: #666; }
body:not(.light) .cassette-controls button:hover { color: #ccc; }
body:not(.light) .reel { border-color: var(--coral); }
body:not(.light) .cassette-tape-window { border-bottom-color: #333; }
body:not(.light) .secret-section { background: rgba(0,0,0,0.95); }
body:not(.light) .writing-thumb { background: linear-gradient(135deg, #00C9A7 0%, #1a1a1a 100%) !important; }

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  cursor: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: none;
  color: inherit;
}

/* --- Custom Cursor --- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--coral);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: width 0.3s var(--ease-bounce),
              height 0.3s var(--ease-bounce),
              background 0.3s,
              border 0.3s,
              transform 0.3s var(--ease-bounce);
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

.cursor-dot.hover {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 2px solid var(--coral);
  mix-blend-mode: normal;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 4vw;
  transition: background 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Dark mode toggle */
.dark-toggle {
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 8px;
  transition: transform 0.3s var(--ease-bounce);
  cursor: pointer;
}

.dark-toggle:hover {
  transform: scale(1.2);
}

.dark-toggle-icon {
  display: block;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-link {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-bounce);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 110;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease-bounce), opacity 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3rem);
  transition: color 0.3s;
}

.mobile-link:hover {
  color: var(--coral);
}

/* --- Hero Section (Compact) --- */
.hero {
  position: relative;
  min-height: 40vh;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 8vw 3rem;
  overflow: hidden;
}

.hero-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  will-change: transform;
}

.blob-1 {
  width: 280px;
  height: 280px;
  background: var(--coral);
  top: 10%;
  right: 15%;
}

.blob-2 {
  width: 240px;
  height: 240px;
  background: var(--violet);
  bottom: 10%;
  left: 10%;
}

.blob-3 {
  width: 200px;
  height: 200px;
  background: var(--teal);
  top: 40%;
  right: 45%;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: clamp(0.9rem, 1.5vw, 1.15rem);
  color: var(--muted);
  margin-top: 0.6rem;
}

.hero-rule {
  width: 48px;
  height: 3px;
  background: var(--coral);
  margin-top: 1rem;
  border-radius: 2px;
}

/* --- Projects Section --- */
.projects {
  padding: 3rem 4vw 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.projects .section-title::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--violet);
  flex-shrink: 0;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-pill {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  border: 1.5px solid var(--muted);
  background: transparent;
  color: var(--text);
  transition: all 0.3s var(--ease-bounce);
}

.filter-pill:hover {
  border-color: var(--coral);
  color: var(--coral);
}

.filter-pill.active {
  background: var(--coral);
  border-color: var(--coral);
  color: white;
}

/* Projects Grid → Horizontal Scroll */
.projects-grid {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 0.5rem 4vw 2rem;
  margin: 0 -4vw;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.projects-grid::-webkit-scrollbar { display: none; }

/* Projects scroll wrapper with side arrows */
.projects-scroll-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.scroll-arrow {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #888;
  transition: all 0.25s var(--ease-bounce);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.scroll-arrow:hover {
  background: var(--coral);
  border-color: var(--coral);
  color: white;
  transform: scale(1.08);
}

.scroll-arrow-left {
  margin-right: -8px;
}

.scroll-arrow-right {
  margin-left: -8px;
}

body.light .scroll-arrow {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--muted);
}

body.light .scroll-arrow:hover {
  background: var(--coral);
  border-color: var(--coral);
  color: white;
}

/* --- Project Cards --- */
.project-card {
  position: relative;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.4s var(--ease-bounce);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  animation: cardFloat 3s ease-in-out infinite;
  flex-shrink: 0;
  width: 280px;
  scroll-snap-align: start;
}

/* Stagger float animation for organic feel */
.project-card:nth-child(1) { animation-delay: 0s; }
.project-card:nth-child(2) { animation-delay: -0.7s; }
.project-card:nth-child(3) { animation-delay: -1.4s; }
.project-card:nth-child(4) { animation-delay: -0.3s; }
.project-card:nth-child(5) { animation-delay: -1.1s; }
.project-card:nth-child(6) { animation-delay: -2.0s; }

@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-0.3deg); }
  75% { transform: translateY(3px) rotate(0.3deg); }
}

.project-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  animation-play-state: paused;
}

/* Sound-reactive whole card bounce */
.project-card.audio-active {
  animation: none;
  transform: scale(calc(1 + var(--beat) * 0.015)) translateY(calc(var(--beat) * -4px));
}

.project-card.hidden {
  display: none;
}

.card-media {
  position: relative;
  overflow: hidden;
}

.card-thumbnail {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0a0a0a;
  padding: 12px;
}

body.light .card-thumbnail {
  background: #f0ede8;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s var(--ease-bounce);
}

.project-card:hover .card-thumbnail img {
  transform: scale(1.03);
}

/* Video thumbnail (scape.radio) */
.card-video-thumb {
  position: relative;
  background: #1A1A1A;
}

.card-video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.thumbnail-text-overlay {
  position: relative;
  z-index: 1;
}

/* Thumbnail hover zoom (no pulse animation - card floats instead) */

.thumbnail-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* (pulse120 removed — cards use cardFloat instead) */

/* Writing thumbnails */
.writing-thumb {
  padding: 2rem;
  align-items: flex-start;
}

.excerpt-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  opacity: 0.8;
}

/* Video play button */
.video-thumb {
  position: relative;
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s var(--ease-bounce), opacity 0.3s;
  opacity: 0.85;
}

.video-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 1;
}

/* Video iframe container */
.video-container {
  position: relative;
  aspect-ratio: 16 / 10;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Audio Player --- */
.audio-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(26, 26, 26, 0.03);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-bounce), background 0.2s;
}

.play-btn:hover {
  transform: scale(1.1);
}

.play-btn:active {
  transform: scale(0.95);
}

.play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent white;
  margin-left: 2px;
  transition: all 0.2s;
}

.play-btn.playing .play-icon {
  border-width: 0;
  width: 8px;
  height: 10px;
  border-left: 2.5px solid white;
  border-right: 2.5px solid white;
  margin-left: 0;
}

.progress-container {
  flex: 1;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: var(--coral);
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s linear;
}

.audio-time {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 32px;
  text-align: right;
}

/* --- Card Body --- */
.card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.card-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.25rem;
}

.card-desc {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
  line-height: 1.6;
}

.card-link {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--coral);
  margin-top: 1rem;
  transition: letter-spacing 0.3s var(--ease-bounce);
}

.card-link:hover {
  letter-spacing: 0.03em;
}

.card-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.card-link-secondary {
  color: var(--violet);
}

/* --- Info Button (colored, sketchy, per-card) --- */
.info-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 12px 10px 14px 11px;
  background: var(--violet);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.info-btn:hover {
  transform: scale(1.2) rotate(5deg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Per-card info button colors */
.info-violet { background: var(--violet); }
.info-teal { background: var(--teal); }
.info-coral { background: var(--coral); }
.info-gradient { background: linear-gradient(135deg, var(--coral), var(--violet)); }
.info-orange { background: #FFAB40; }
.info-dark { background: var(--text); }

/* --- Info Tray (card slides left + panel expands right) --- */
.info-tray {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.info-tray.open {
  pointer-events: auto;
}

/* Blurred backdrop */
.info-tray::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(250, 248, 245, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.4s;
}

.info-tray.open::before {
  opacity: 1;
}

.info-tray-inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: auto;
  max-height: 80vh;
  margin: 0 4vw;
  opacity: 0;
  transition: opacity 0.3s 0.1s;
}

.info-tray.open .info-tray-inner {
  opacity: 1;
}

/* Left side: the card clone/thumbnail */
.tray-card-preview {
  width: 320px;
  min-width: 320px;
  background: white;
  border-radius: 16px 0 0 16px;
  overflow: hidden;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.06);
  transform: translateX(100px);
  opacity: 0;
  transition: transform 0.5s var(--ease-bounce), opacity 0.3s;
}

.info-tray.open .tray-card-preview {
  transform: translateX(0);
  opacity: 1;
}

.tray-card-preview img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.tray-card-preview .tray-card-gradient {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tray-card-info {
  padding: 1.25rem 1.5rem;
}

.tray-card-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.tray-card-desc {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.5;
}

/* Right side: the expanded info panel */
.info-tray-content {
  flex: 1;
  background: white;
  border-radius: 0 16px 16px 0;
  padding: 2.5rem 3rem;
  overflow-y: auto;
  border-left: 1px solid rgba(0, 0, 0, 0.05);
  transform: translateX(-30px);
  opacity: 0;
  transition: transform 0.5s var(--ease-bounce) 0.1s, opacity 0.3s 0.15s;
}

.info-tray.open .info-tray-content {
  transform: translateX(0);
  opacity: 1;
}

.info-tray-close {
  position: absolute;
  top: 16px;
  right: calc(4vw + 20px);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  font-size: 1.4rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s var(--ease-bounce);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s 0.2s, background 0.2s, transform 0.2s var(--ease-bounce);
}

.info-tray.open .info-tray-close {
  opacity: 1;
}

.info-tray-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: rotate(90deg);
}

/* Tray content layout */
.tray-header {
  margin-bottom: 1.5rem;
  padding-right: 2.5rem;
}

.tray-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.15;
}

.tray-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #555;
  margin-top: 0.75rem;
  max-width: 700px;
}

.tray-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.tray-sub {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 10px 8px 12px 9px;
  background: rgba(0, 0, 0, 0.04);
  border: 1.5px dashed rgba(0, 0, 0, 0.1);
  color: var(--text);
  transition: background 0.2s, transform 0.2s var(--ease-bounce);
}

.tray-sub:hover {
  background: rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

a.tray-sub {
  text-decoration: none;
  color: var(--coral);
  border-color: rgba(255, 87, 51, 0.2);
}

.tray-credits {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tray-credits-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  width: 100%;
  margin-bottom: 0.25rem;
}

.tray-credit {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 400;
  color: #888;
}

a.tray-credit {
  color: var(--violet);
  text-decoration: none;
  transition: opacity 0.2s;
}

a.tray-credit:hover {
  opacity: 0.7;
}

.tray-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.tray-links a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--coral);
  transition: letter-spacing 0.2s;
}

.tray-links a:hover {
  letter-spacing: 0.02em;
}

/* Essay content (Two Songs) */
.tray-essay {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed rgba(255,255,255,0.1);
}

body.light .tray-essay {
  border-top-color: rgba(0,0,0,0.08);
}

.tray-essay h5 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.tray-essay-intro {
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #888;
  margin-bottom: 1.25rem;
}

.tray-essay-track {
  margin-bottom: 1rem;
}

.tray-essay-track strong {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.3rem;
  color: var(--coral);
}

.tray-essay-track p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #999;
}

.tray-essay-note {
  font-size: 0.8rem;
  line-height: 1.7;
  color: #666;
  font-style: italic;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}

body.light .tray-essay-note {
  background: rgba(0,0,0,0.03);
}

.tray-credits-list {
  list-style: none;
  padding: 0;
}

.tray-credits-list li {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #ccc;
}

body.light .tray-credits-list li {
  border-bottom-color: rgba(0,0,0,0.06);
  color: var(--text);
}

.tray-credits-list li em {
  color: var(--coral);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 500;
}

/* --- About Section --- */
.about {
  padding: 6rem 4vw;
  max-width: 1100px;
  margin: 0 auto;
}

.about-inner {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 4rem;
  align-items: center;
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--coral) 0%, var(--violet) 100%);
  border-radius: 16px;
  transform: rotate(-2deg);
  transition: transform 0.4s var(--ease-bounce);
  overflow: hidden;
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder:hover {
  transform: rotate(0deg) scale(1.02);
}

.about-text .section-title {
  margin-bottom: 1.5rem;
}

.about-text .section-title::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.about-text p {
  margin-bottom: 1rem;
  line-height: 1.75;
  color: #444;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* --- Contact Section --- */
.contact {
  padding: 6rem 4vw;
  text-align: center;
}

.contact-inner {
  max-width: 600px;
  margin: 0 auto;
}

.contact .section-title {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.contact .section-title::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
  flex-shrink: 0;
}

.contact-email {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--coral);
  display: inline-block;
  transition: letter-spacing 0.3s var(--ease-bounce);
}

.contact-email:hover {
  letter-spacing: 0.02em;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.social-link {
  color: var(--text);
  transition: color 0.3s, transform 0.3s var(--ease-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.social-link:hover {
  color: var(--coral);
  transform: translateY(-3px);
}

/* --- Card Social Icons --- */
.card-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.card-social-link {
  color: var(--muted);
  transition: color 0.2s, transform 0.2s var(--ease-bounce);
  display: flex;
}

.card-social-link:hover {
  color: var(--text);
  transform: scale(1.15);
}

/* --- Listening Link Icons --- */
.listening-link {
  display: inline-flex !important;
  align-items: center;
  color: var(--muted);
  margin-top: 1rem;
  transition: color 0.2s, transform 0.2s var(--ease-bounce);
}

.listening-link:hover {
  color: var(--text);
  transform: scale(1.15);
  letter-spacing: 0;
}

/* --- Scribble Canvas --- */
#scribble-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* --- Cassette Player (sketchy/hand-drawn) --- */
.cassette {
  transform: rotate(-1.5deg);
  transition: box-shadow 0.3s var(--ease-bounce);
}

.cassette:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.cassette-body {
  width: 160px;
  background: var(--bg);
  border-radius: 14px 12px 16px 13px;
  padding: 14px 14px 8px;
  border: 2px dashed var(--muted);
  position: relative;
}

.cassette-reels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  margin-bottom: 8px;
}

.reel {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 2px dashed var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-hub {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.cassette.playing .reel {
  animation: reelSpin 1.2s linear infinite;
}

@keyframes reelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cassette-tape-window {
  flex: 1;
  height: 8px;
  margin: 0 8px;
  background: transparent;
  border-bottom: 2px dashed var(--muted);
}

.cassette-track-name {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 4px 0;
  letter-spacing: 0.02em;
}

.cassette.playing .cassette-track-name {
  color: var(--text);
}

.cassette-controls {
  display: flex;
  justify-content: center;
  gap: 0;
  border-radius: 0 0 14px 14px;
  border: 2px dashed var(--muted);
  border-top: none;
  background: var(--bg);
}

.cassette-controls button {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 5px 14px;
  transition: color 0.2s;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 700;
}

.cassette-controls button:hover {
  color: var(--text);
}

.cassette-play {
  color: var(--coral) !important;
  font-size: 0.85rem !important;
}

.cassette.playing .cassette-play {
  color: var(--teal) !important;
}

/* Player float container (cassette + Spotify married) */
.player-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  cursor: grab;
  user-select: none;
}

.player-float:active {
  cursor: grabbing;
}

.spotify-panel {
  width: 300px;
  opacity: 0;
  transform: translateX(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-bounce);
}

.spotify-panel.open {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

/* Cassette is now inside player-float, not fixed */
.cassette {
  position: relative;
  bottom: auto;
  right: auto;
}

/* --- Secret Section --- */
.secret-section {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-smooth);
  overflow-y: auto;
}

.secret-section.revealed {
  opacity: 1;
  pointer-events: auto;
}

.secret-inner {
  max-width: 560px;
  padding: 3rem 2rem;
  text-align: center;
  color: white;
  transform: translateY(20px);
  transition: transform 0.6s var(--ease-bounce);
}

.secret-section.revealed .secret-inner {
  transform: translateY(0);
}

.secret-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  animation: secretBounce 0.6s var(--ease-bounce);
}

@keyframes secretBounce {
  0% { transform: scale(0) rotate(-20deg); }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.secret-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.secret-subtitle {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2.5rem;
}

.secret-playlist-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--coral);
  margin-bottom: 1rem;
}

.secret-tracklist {
  text-align: left;
  padding-left: 0;
  list-style: none;
  counter-reset: track;
  max-height: 50vh;
  overflow-y: auto;
}

.secret-tracklist li {
  counter-increment: track;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.secret-tracklist li::before {
  content: counter(track, decimal-leading-zero);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  min-width: 22px;
  font-variant-numeric: tabular-nums;
}

.secret-tracklist li span {
  font-weight: 400;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
  flex-shrink: 0;
}

.secret-close {
  margin-top: 2.5rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.secret-close:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Circle detection hint - subtle pulsing dot */
.circle-hint {
  position: fixed;
  bottom: 56px;
  right: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  opacity: 0.3;
  z-index: 91;
  animation: hintPulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.5); }
}

/* --- Footer --- */
.footer {
  padding: 2rem 4vw 4rem;
  text-align: center;
}

.footer p {
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- "Now Playing" Mode --- */
body {
  transition: background 1s ease;
}

body:not(.light).now-playing {
  background: #1a1510 !important;
}

body.light.now-playing {
  background: var(--bg-playing) !important;
}

body.now-playing .blob {
  opacity: 0.25;
  transition: opacity 1s ease, width 1s ease, height 1s ease;
}

body.now-playing .blob-1 { width: 350px; height: 350px; }
body.now-playing .blob-2 { width: 300px; height: 300px; }
body.now-playing .blob-3 { width: 260px; height: 260px; }

body.now-playing .project-card {
  animation-duration: 2s;
}

body.now-playing .hero-tagline {
  color: var(--coral);
  transition: color 0.6s ease;
}

body.now-playing .cassette-body {
  border-color: var(--coral);
  transition: border-color 0.6s ease;
}

/* --- Timeline --- */
.timeline {
  padding: 3rem 0;
  overflow: hidden;
}

.timeline .section-title {
  padding-left: 4vw;
  margin-bottom: 2rem;
}

.timeline .section-title::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
  flex-shrink: 0;
}

.timeline-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 1rem 4vw 2rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.timeline-track::-webkit-scrollbar { display: none; }

.timeline-item {
  flex-shrink: 0;
  width: 160px;
  padding: 1.25rem 1rem;
  border-left: 2px dashed var(--muted);
  position: relative;
  scroll-snap-align: start;
  transition: border-color 0.3s;
}

.timeline-item:hover {
  border-left-color: var(--coral);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 1.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s, transform 0.3s var(--ease-bounce);
}

.timeline-item:hover::before {
  background: var(--coral);
  transform: scale(1.3);
}

.timeline-item.highlight::before {
  background: var(--coral);
}

.timeline-year {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.4rem;
}

.timeline-label {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.35;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-smooth),
              transform 0.7s var(--ease-bounce);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger cards */
.project-card.reveal:nth-child(2) { transition-delay: 0.08s; }
.project-card.reveal:nth-child(3) { transition-delay: 0.16s; }
.project-card.reveal:nth-child(4) { transition-delay: 0.08s; }
.project-card.reveal:nth-child(5) { transition-delay: 0.16s; }
.project-card.reveal:nth-child(6) { transition-delay: 0.24s; }

/* =========================================
   Responsive
   ========================================= */

/* Tablet */
@media (max-width: 1024px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .photo-placeholder {
    max-width: 300px;
    margin: 0 auto;
  }
}

/* Mobile */
@media (max-width: 600px) {
  body {
    cursor: auto;
  }

  button {
    cursor: pointer;
  }

  .cursor-dot {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    padding: 5rem 6vw 2rem;
    min-height: auto;
    max-height: none;
  }

  #scribble-canvas {
    display: none;
  }

  .project-card {
    animation: none;
  }

  .projects-grid {
    flex-wrap: wrap;
    overflow-x: visible;
    padding: 0 4vw 1rem;
    margin: 0;
  }

  .project-card {
    width: 100%;
    flex-shrink: 1;
  }

  .scroll-arrow {
    display: none;
  }

  .projects-scroll-wrap {
    display: block;
  }

  /* Tray stacks vertically on mobile */
  .info-tray-inner {
    flex-direction: column;
    margin: 2vh 3vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .tray-card-preview {
    width: 100%;
    min-width: 100%;
    border-radius: 16px 16px 0 0;
  }

  .info-tray-content {
    border-radius: 0 0 16px 16px;
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
  }

  .blob {
    opacity: 0.08;
  }

  .blob-1 { width: 180px; height: 180px; }
  .blob-2 { width: 150px; height: 150px; }
  .blob-3 { width: 130px; height: 130px; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .project-card {
    animation: none !important;
  }

  .cursor-dot {
    display: none;
  }

  body {
    cursor: auto;
  }

  button {
    cursor: pointer;
  }
}
