*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: url('cursor.svg') 4 2, auto;
}

a, button { cursor: url('cursor.svg') 4 2, pointer; }

/* touch devices (iPhone, iPad) — no cursor needed */
@media (pointer: coarse) {
  *, *::before, *::after { cursor: auto !important; }
  a, button { cursor: auto !important; }
}

body {
  opacity: 0;
  transition: opacity 0.35s ease;
}
body.visible {
  opacity: 1;
}

:root {
  --cream: #F5DEC8;
  --brown: #3D2B1F;
  --terracotta: #C96A3A;
  --amber: #D4894A;
}

body {
  min-height: 100dvh;
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse at 15% 30%, rgba(210, 100, 60, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(190, 110, 60, 0.14) 0%, transparent 55%);
  font-family: 'Nunito', sans-serif;
  color: var(--brown);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 6vw;
}

.page-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.4rem;
}

/* ── Nav panel ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(61, 43, 31, 0.3);
  backdrop-filter: blur(2px);
  z-index: 200;
}
.nav-overlay.open { display: block; }

.nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100vh;
  background: var(--cream-dark, #F5E8D0);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.2rem;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 300;
  box-shadow: -4px 0 24px rgba(180, 100, 50, 0.12);
}
.nav-panel.open { transform: translateX(0); }

.nav-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
}
.nav-avatar span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 0.05em;
}

.nav-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: var(--brown);
  letter-spacing: 0.04em;
  margin-top: -0.4rem;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}
.nav-links a {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--brown);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(201, 106, 58, 0.15);
  display: block;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--terracotta); }

/* hamburger active state */
.menu-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.active span:nth-child(2) { opacity: 0; }
.menu-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Avatar ── */
.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 12px rgba(201, 106, 58, 0.3);
  margin-bottom: -0.4rem;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
}
.avatar span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: #fff;
  letter-spacing: 0.05em;
}

/* ── Bio ── */
.bio {
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: #9A7060;
  line-height: 1.6;
  margin-top: -0.6rem;
}

/* ── Name ── */
h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 400;
  color: var(--brown);
  line-height: 0.95;
  letter-spacing: 0.02em;
  position: relative;
  display: block;
}

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

.letter {
  display: inline-block;
  opacity: 0;
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes shimmerSweep {
  0%   { background-position: 0% center; }
  100% { background-position: 100% center; }
}

h1.shimmer {
  background: linear-gradient(
    90deg,
    var(--brown) 0%,
    var(--brown) 35%,
    var(--amber) 50%,
    var(--brown) 65%,
    var(--brown) 100%
  );
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerSweep 2.4s ease-in-out infinite alternate;
}

/* ── Menu button — fixed top right ── */
.menu-btn {
  position: fixed;
  top: 1.4rem;
  right: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 400;
}

.menu-btn span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--brown);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-btn:hover span { background: var(--terracotta); }

/* ── Blinking cursor ── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor {
  display: inline-block;
  color: var(--terracotta);
  -webkit-text-fill-color: var(--terracotta);
  animation: blink 0.8s step-start infinite;
  margin-left: 1px;
}

/* ── Icon row ── */
.icon-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
}

.icon-btn {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border: 2px solid var(--brown);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
  background: var(--brown);
  color: var(--cream);
  transform: translateY(-2px);
}

/* ── Resume group ── */
.resume-group {
  width: 46px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.resume-group .icon-btn {
  width: 46px;
  height: 46px;
}

.resume-annotation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.resume-arrow {
  font-size: 1rem;
  line-height: 1;
  color: var(--brown);
}

.resume-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  white-space: nowrap;
}

/* ── Now Playing widget ── */
.now-playing {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(253, 244, 231, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 106, 58, 0.2);
  border-radius: 999px;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  box-shadow: 0 4px 20px rgba(180, 100, 50, 0.12);
  white-space: nowrap;
}

.np-art-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.np-art-wrap img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

@keyframes barBounce {
  0%, 100% { transform: scaleY(0.4); }
  50%       { transform: scaleY(1); }
}

.np-bars {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 6px 5px;
}

.np-bars span {
  display: block;
  width: 3px;
  height: 100%;
  background: #fff;
  border-radius: 2px;
  transform-origin: bottom;
  animation: barBounce 0.8s ease-in-out infinite;
}

.np-bars span:nth-child(2) { animation-delay: 0.2s; }
.np-bars span:nth-child(3) { animation-delay: 0.4s; }

.np-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.np-info a {
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brown);
  text-decoration: none;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-info a:hover { color: var(--terracotta); }

.np-info span {
  font-family: 'Nunito', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  color: #9A7060;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Inner pages (about, projects) ── */
body.page-body {
  align-items: flex-start;
  padding-top: 5rem;
  padding-bottom: 4rem;
}

.inner-page {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.back-link {
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--terracotta);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.coming-soon {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #9A7060;
}

.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 400;
  color: var(--brown);
  letter-spacing: 0.03em;
  line-height: 1;
}

/* active nav link */
.nav-active {
  color: var(--terracotta) !important;
}

/* ── Projects grid ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.project-card {
  background: rgba(253, 244, 231, 0.6);
  border: 1.5px solid rgba(201, 106, 58, 0.22);
  border-radius: 12px;
  padding: 1.4rem 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  border-color: rgba(201, 106, 58, 0.5);
  box-shadow: 0 4px 20px rgba(180, 100, 50, 0.1);
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.project-name {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--brown);
}

.project-links {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.proj-link {
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(61, 43, 31, 0.25);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.proj-link:hover {
  background: var(--brown);
  color: var(--cream);
}

.project-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  color: #9A7060;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.tag {
  font-family: 'Nunito', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--terracotta);
  background: rgba(201, 106, 58, 0.1);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
}

/* ── About page ── */
.about-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
  padding-top: 2rem;
  width: 100%;
}

.about-photo-lg {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 24px rgba(201, 106, 58, 0.25);
  flex-shrink: 0;
}

.about-photo-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
}

.about-photo-lg span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: #fff;
  letter-spacing: 0.05em;
}

.about-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 400;
  color: var(--brown);
  letter-spacing: 0.04em;
  line-height: 1;
}

.about-bio {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #9A7060;
  line-height: 1.75;
  max-width: 400px;
}

body.dark .about-bio { color: #A08070; }

/* ── Now section ── */
.now-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: -0.4rem;
}

.now-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
}

.now-emoji { font-size: 0.9rem; line-height: 1; }

.now-label {
  font-weight: 600;
  color: var(--terracotta);
  opacity: 0.85;
  min-width: 52px;
}

.now-val {
  font-weight: 400;
  color: #9A7060;
}

/* ── Theme toggle button ── */
.theme-btn {
  margin-top: auto;
  background: none;
  border: 1.5px solid rgba(201, 106, 58, 0.2);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brown);
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.theme-btn:hover {
  background: rgba(201, 106, 58, 0.08);
  border-color: rgba(201, 106, 58, 0.4);
}

/* ── Easter egg ── */
.easter-emoji {
  position: fixed;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  animation: easterBurst 0.9s ease-out forwards;
}

@keyframes easterBurst {
  0%   { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) scale(0.5); }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(1.3); }
}

/* ── Grain overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px;
}

/* ── Background blobs ── */
.blob-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
}

.blob-1 {
  width: 45vw; height: 45vw;
  background: rgba(210, 100, 60, 0.13);
  top: -12%; left: -8%;
  animation: blobFloat 20s ease-in-out infinite alternate;
}

.blob-2 {
  width: 38vw; height: 38vw;
  background: rgba(190, 120, 55, 0.10);
  bottom: -8%; right: -6%;
  animation: blobFloat 25s ease-in-out infinite alternate-reverse;
}

.blob-3 {
  width: 28vw; height: 28vw;
  background: rgba(230, 145, 75, 0.09);
  top: 35%; left: 55%;
  animation: blobFloat 18s ease-in-out infinite alternate;
  animation-delay: -6s;
}

@keyframes blobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(3vw, -5vh) scale(1.06); }
  66%  { transform: translate(-2vw, 4vh) scale(0.96); }
  100% { transform: translate(5vw, -2vh) scale(1.03); }
}

/* ── Corner ornaments ── */
.corners {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.corner {
  position: absolute;
  width: 18px;
  height: 18px;
  opacity: 0.3;
}

.corner::before,
.corner::after {
  content: '';
  position: absolute;
  background: var(--terracotta);
  border-radius: 2px;
}

.corner::before { width: 2px; height: 100%; left: 0; top: 0; }
.corner::after  { width: 100%; height: 2px; left: 0; top: 0; }

.corner.tl { top: 1.4rem; left: 1.4rem; }
.corner.tr { top: 1.4rem; right: 1.4rem; transform: scaleX(-1); }
.corner.bl { bottom: 1.4rem; left: 1.4rem; transform: scaleY(-1); }
.corner.br { bottom: 1.4rem; right: 1.4rem; transform: scale(-1); }

body.dark .blob-1 { background: rgba(200, 90, 50, 0.16); }
body.dark .blob-2 { background: rgba(175, 100, 45, 0.13); }
body.dark .blob-3 { background: rgba(220, 130, 65, 0.11); }
body.dark .corner { opacity: 0.15; }
body.dark::after  { opacity: 0.025; }

/* ── Dark mode ── */
body.dark {
  --cream: #1C1208;
  --brown: #EDD5B0;
  --terracotta: #D97848;
  --amber: #E09858;
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse at 15% 30%, rgba(180, 80, 40, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(150, 85, 35, 0.11) 0%, transparent 55%);
  color: var(--brown);
}

body.dark .nav-panel { background: #2A1A0E; }
body.dark .nav-links a { color: var(--brown); }

body.dark .bio,
body.dark .now-val,
body.dark .project-desc,
body.dark .coming-soon,
body.dark .np-info span { color: #A08070; }

body.dark .about-text p { color: #C0967A; }

body.dark .now-playing {
  background: rgba(28, 18, 8, 0.88);
  border-color: rgba(180, 90, 50, 0.2);
}

body.dark .project-card {
  background: rgba(35, 22, 12, 0.7);
  border-color: rgba(180, 90, 50, 0.22);
}

body.dark .menu-btn span { background: var(--brown); }

/* ── iPhone ── */
@media (max-width: 500px) {
  body {
    padding: 0 7vw;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.page-body {
    padding-top: 4rem;
  }
  .menu-btn {
    top: max(1.4rem, env(safe-area-inset-top));
    right: max(1.6rem, env(safe-area-inset-right));
  }
  .icon-btn { width: 44px; height: 44px; }
  .icon-row { gap: 0.55rem; }
  .now-playing {
    max-width: calc(100vw - 2rem);
    bottom: max(1.6rem, env(safe-area-inset-bottom));
  }
  .np-info a,
  .np-info span { max-width: 120px; }
  .nav-panel { width: min(100vw, 300px); }
  .about-wrap { flex-direction: column; }
  .project-grid { grid-template-columns: 1fr; }
}

/* ── iPad ── */
@media (min-width: 501px) and (max-width: 1024px) {
  body { padding: 0 8vw; }
  body.page-body { padding-top: 5rem; }
  .inner-page { max-width: 100%; }
  .project-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
