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

:root {
  --white: #ffffff;
  --off-white: #f5f5f7;
  --light-gray: #d2d2d7;
  --mid-gray: #86868b;
  --dark: #1d1d1f;
  --accent: #0071e3;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── BG REVEAL CANVAS ─────────────────────────────────────── */
#bgRevealCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

nav {
  position: relative;
  z-index: 100;
}

/* ── NAV ──────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

.nav-logo {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--dark);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--mid-gray);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--dark); }

/* ── BURGER ────────────────────────────────────────────────── */
.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}

.burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--dark);
  margin: 4px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.mobile-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.mobile-overlay a {
  font-size: 28px;
  font-weight: 300;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}

.mobile-overlay a:hover { color: var(--mid-gray); }

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 64px 96px;
  overflow: hidden;
}

/* ── FACE REVEAL ──────────────────────────────────────────── */
.face-container {
  position: absolute;
  bottom: -8%;
  right: 5%;
  width: 95%;
  max-width: 1100px;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.face-container img {
  width: 100%;
  height: auto;
  display: block;
}

.face-colored {
  position: absolute;
  top: 0;
  left: 0;
}

.face-mask-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero:hover .face-container {
  pointer-events: auto;
}

.hero-location,
.hero-title,
.hero-bottom {
  position: relative;
  z-index: 1;
}

.hero-location {
  font-size: 12px;
  font-weight: 400;
  color: var(--mid-gray);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.1s;
}

.hero-title {
  font-size: clamp(48px, 7.5vw, 96px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--dark);
  max-width: 900px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.25s;
}

.hero-title em {
  font-style: normal;
  font-weight: 300;
  color: var(--mid-gray);
}

.hero-bottom {
  margin-top: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.5s;
}

.hero-desc {
  font-size: 17px;
  font-weight: 300;
  color: var(--mid-gray);
  line-height: 1.7;
  max-width: 400px;
}

.scroll-line {
  width: 0.5px;
  height: 48px;
  background: var(--light-gray);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

/* ── SECTIONS ─────────────────────────────────────────────── */
.section {
  padding: 120px 64px;
  border-top: 0.5px solid var(--light-gray);
  scroll-margin-top: 52px;
}

.section-inner { max-width: 1080px; margin: 0 auto; }

::selection { background: rgba(0, 113, 227, 0.15); color: var(--dark); }
::-moz-selection { background: rgba(0, 113, 227, 0.15); color: var(--dark); }

.label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid-gray);
  margin-bottom: 48px;
}

/* ── ABOUT ────────────────────────────────────────────────── */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-left h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 36px;
}

.about-left h2 em { font-style: italic; color: var(--mid-gray); }

.interests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 0.5px solid var(--light-gray);
  border-radius: 16px;
  overflow: hidden;
}

.interest-card {
  padding: 28px 22px;
  border-right: 0.5px solid var(--light-gray);
  border-bottom: 0.5px solid var(--light-gray);
}

.interest-card:nth-child(3n) { border-right: none; }
.interest-card:nth-last-child(-n+3) { border-bottom: none; }

.interest-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  margin-bottom: 12px;
  display: block;
}

.interest-name { font-size: 14px; font-weight: 500; color: var(--dark); margin-bottom: 4px; }
.interest-note { font-size: 12px; font-weight: 300; color: var(--mid-gray); line-height: 1.5; }

.about-body p {
  font-size: 16px;
  font-weight: 300;
  color: var(--dark);
  line-height: 1.85;
  margin-bottom: 18px;
  opacity: 0.9;
}

.about-body a { color: var(--accent); text-decoration: none; }

/* ── SKILLS ───────────────────────────────────────────────── */
.skills-bg { background: var(--off-white); }

.skills-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 80px;
  align-items: start;
}

.skills-intro h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.skills-intro p { font-size: 15px; font-weight: 300; color: var(--mid-gray); line-height: 1.7; }

.skill-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 17px 0;
  border-bottom: 0.5px solid var(--light-gray);
}

.skill-row:first-child { border-top: 0.5px solid var(--light-gray); }
.skill-name { font-size: 15px; font-weight: 400; color: var(--dark); }
.skill-level { font-size: 13px; font-weight: 300; color: var(--mid-gray); }

/* ── PROJECTS ─────────────────────────────────────────────── */
.project-row {
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  gap: 24px;
  align-items: start;
  padding: 40px 0;
  border-bottom: 0.5px solid var(--light-gray);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.project-row:first-child { border-top: 0.5px solid var(--light-gray); }
.project-row:hover { opacity: 0.55; }

.project-index { font-size: 13px; color: var(--mid-gray); font-weight: 300; padding-top: 3px; }

.project-title {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--dark);
  margin-bottom: 8px;
}

.project-desc-text {
  font-size: 15px;
  font-weight: 300;
  color: var(--mid-gray);
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 14px;
}

.project-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  color: var(--mid-gray);
  padding: 3px 10px;
  border: 0.5px solid var(--light-gray);
  border-radius: 980px;
  background: var(--off-white);
}

.project-arrow {
  font-size: 18px;
  color: var(--light-gray);
  transition: color 0.2s, transform 0.2s;
  padding-top: 3px;
}

.project-row:hover .project-arrow { color: var(--mid-gray); transform: translate(3px, -3px); }

/* ── NOW ──────────────────────────────────────────────────── */
.now-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--light-gray);
  border-radius: 16px;
  overflow: hidden;
}

.now-card { background: var(--white); padding: 36px 32px; }

.now-card-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid-gray);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.now-card-content {
  font-size: 15px;
  font-weight: 300;
  color: var(--dark);
  line-height: 1.75;
  transition: opacity 0.3s ease;
}

.now-card-content strong { font-weight: 500; }

/* Live indicator */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #34C759;
  border-radius: 50%;
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* ── LOAD MORE ───────────────────────────────────────────── */
.projects-extra { display: none; }
.projects-extra.visible { display: block; }

.load-more-btn {
  display: inline-block;
  margin-top: 28px;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--accent);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: opacity 0.2s;
  text-align: left;
  padding: 0;
}

.load-more-btn:hover { opacity: 0.7; }
.load-more-btn.hidden { display: none; }

/* ── SPOTIFY CAROUSEL ─────────────────────────────────────── */
.spotify-carousel {
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}

.spotify-track {
  display: none;
}

.spotify-track.active {
  display: block;
  animation: spotifySlide 0.3s ease;
}

@keyframes spotifySlide {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}

.spotify-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.spotify-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mid-gray);
  font-size: 16px;
  padding: 4px 6px;
  font-family: inherit;
  transition: color 0.2s;
  -webkit-appearance: none;
}

.spotify-btn:hover { color: var(--dark); }

.spotify-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.spotify-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--light-gray);
  transition: background 0.2s;
}

.spotify-dot.active { background: var(--dark); }

/* ── MUSIC PLAYER ─────────────────────────────────────────── */
.now-player-widget { margin-top: 2px; }

.now-player-top {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
}

.now-player-meta { flex: 1; min-width: 0; }

.now-player-title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.25s ease;
}

.now-player-artist {
  font-size: 12px;
  font-weight: 400;
  color: var(--mid-gray);
  margin-top: 3px;
  transition: opacity 0.25s ease;
}

.now-progress-bar {
  height: 2px;
  background: var(--light-gray);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 14px;
}

.now-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  width: 0%;
}

.now-player-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.now-player-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mid-gray);
  font-size: 18px;
  line-height: 1;
  padding: 4px 2px;
  font-family: inherit;
  transition: color 0.2s;
  -webkit-appearance: none;
}

.now-player-btn:hover { color: var(--dark); }

/* Equalizer bars */
.eq-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.eq-bar {
  width: 2.5px;
  background: var(--accent);
  border-radius: 1.5px;
  animation: eqAnim 0.8s ease-in-out infinite;
}

.eq-bar:nth-child(1) { animation-duration: 0.72s; animation-delay: 0s; }
.eq-bar:nth-child(2) { animation-duration: 0.95s; animation-delay: 0.18s; }
.eq-bar:nth-child(3) { animation-duration: 0.77s; animation-delay: 0.07s; }
.eq-bar:nth-child(4) { animation-duration: 0.88s; animation-delay: 0.29s; }

@keyframes eqAnim {
  0%, 100% { height: 3px; }
  50%       { height: 16px; }
}

/* ── CONTACT ──────────────────────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-left h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.contact-left p { font-size: 15px; font-weight: 300; color: var(--mid-gray); line-height: 1.75; }

.contact-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 0.5px solid var(--light-gray);
  text-decoration: none;
  color: var(--dark);
  transition: opacity 0.2s;
}

.contact-link-row:first-child { border-top: 0.5px solid var(--light-gray); }
.contact-link-row:hover { opacity: 0.5; }
.contact-link-name { font-size: 16px; font-weight: 400; }
.contact-link-handle { font-size: 13px; font-weight: 300; color: var(--mid-gray); }

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
  padding: 32px 64px;
  border-top: 0.5px solid var(--light-gray);
  background: var(--off-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy { font-size: 13px; color: var(--mid-gray); font-weight: 300; }

/* ── REVEAL ───────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.75s ease, transform 0.75s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; transform: none; }
  .hero-location, .hero-title, .hero-bottom { animation: none; opacity: 1; }
  .scroll-line { animation: none; }
  .live-dot { animation: none; }
  .eq-bar { animation: none; height: 8px; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; }
  .burger { display: block; }
  .hero {
    padding: 0 24px 72px;
    justify-content: flex-start;
    padding-top: 100px;
  }
  .section { padding: 80px 24px; }
  .about-layout,
  .skills-layout,
  .contact-layout { grid-template-columns: 1fr; gap: 48px; }
  .interests-grid { grid-template-columns: 1fr 1fr; }
  .interest-card:nth-child(3n) { border-right: 0.5px solid var(--light-gray); }
  .interest-card:nth-child(2n) { border-right: none; }
  .now-grid { grid-template-columns: 1fr; }
  .project-row { grid-template-columns: 32px 1fr 20px; gap: 14px; }
  footer { padding: 28px 24px; flex-direction: column; gap: 8px; text-align: center; }
  .hero-bottom { flex-direction: column; align-items: flex-start; gap: 32px; }

  .face-container {
    width: 140%;
    right: -20%;
    bottom: -5%;
    max-width: none;
  }
}

/* ── LAPTOP / SMALL DESKTOP ──────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .face-container {
    width: 62%;
    max-width: none;
    right: -2%;
    bottom: -6%;
  }

  .hero-title {
    font-size: clamp(36px, 5.5vw, 64px);
  }
}

@media (min-width: 1025px) and (max-width: 1440px) {
  .face-container {
    width: 72%;
    max-width: 850px;
    right: -1%;
    bottom: -6%;
  }

  .hero-title {
    font-size: clamp(42px, 6vw, 80px);
  }
}
