:root {
  --bg: #1a1a1a;
  --text: #f5f5f5;
  --text-muted: rgba(245, 245, 245, 0.5);
  --text-soft: rgba(245, 245, 245, 0.8);
  --border: rgba(255, 255, 255, 0.1);
  --nav-bg: rgba(245, 245, 245, 0.2);
  --nav-btn-bg: #1a1a1a;
  --menu-panel-bg: rgba(45, 45, 45, 0.95);
  --menu-border: rgba(240, 238, 238, 0.2);
  --font-serif: 'Instrument Serif', serif;
  --font-slab: 'Hepta Slab', serif;
  --radius-sm: 12px;
  --radius-pill: 200px;
}

[data-theme="light"] {
  --bg: #f0eeeb;
  --text: #1a1a1a;
  --text-muted: rgba(26, 26, 26, 0.5);
  --text-soft: rgba(26, 26, 26, 0.7);
  --border: rgba(0, 0, 0, 0.1);
  --nav-bg: rgba(26, 26, 26, 0.1);
  --nav-btn-bg: #1a1a1a;
  --menu-panel-bg: rgba(255, 255, 255, 0.97);
  --menu-border: rgba(0, 0, 0, 0.1);
}

/* ── Text selection ─────────────────────────── */

::selection {
  background: #f5f5f5;
  color: #1a1a1a;
}

[data-theme="light"] ::selection {
  background: #1a1a1a;
  color: #f5f5f5;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-slab);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  animation: page-enter 0.2s ease both;
}

body.theme-ready {
  transition: background 0.3s ease, color 0.3s ease;
}

/* ── Skeleton shimmer ───────────────────────── */

@keyframes sk-shimmer {
  from {
    background-position: -200% 0;
  }

  to {
    background-position: 200% 0;
  }
}

.sk {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.05) 25%,
      rgba(255, 255, 255, 0.11) 50%,
      rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s infinite linear;
  border-radius: 4px;
}

[data-theme="light"] .sk {
  background: linear-gradient(90deg,
      rgba(0, 0, 0, 0.06) 25%,
      rgba(0, 0, 0, 0.12) 50%,
      rgba(0, 0, 0, 0.06) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s infinite linear;
}

@keyframes page-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes main-slide-in {
  from {
    opacity: 0;
    transform: translateY(48px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  animation: main-slide-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Main wrapper ───────────────────────────── */
.main-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 180px 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 100px;
}

/* ── Hero ────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: 520px;
}

.img-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

/* Back cards sit behind the main avatar div */
.avatar-card {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  object-fit: cover;
  border-radius: var(--radius-sm);
  z-index: 1;
  transform-origin: bottom center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Main image in its own clipped box — no corner bleed possible */
.hero-avatar {
  position: relative;
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 0 0 4px var(--bg);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-avatar-wrap:hover .avatar-card--left {
  transform: translateX(-32px) rotate(-18deg);
}

.hero-avatar-wrap:hover .avatar-card--right {
  transform: translateX(32px) rotate(18deg);
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 400;
  line-height: 1;
  color: var(--text);
}

.hero-heading .muted {
  color: var(--text-muted);
}

.hero-bio {
  font-size: clamp(0.8rem, 1.1vw, 1rem);
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 700px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-family: var(--font-slab);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  align-self: flex-start;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-arrow {
  width: 19px;
  height: 12px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(-5px);
}

[data-theme="light"] .btn-arrow {
  filter: invert(1);
}

/* ── Work Carousel (auto-scroll) ─────────────── */
.carousel-wrap {
  overflow: hidden;
  width: 100%;
  margin-top: 60px;
}

.carousel-track {
  display: flex;
  width: max-content;
  animation: marquee 70s linear infinite;
  will-change: transform;
}

.carousel-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.work-card {
  background: #fff;
  overflow: hidden;
  aspect-ratio: 846 / 700;
  width: calc(22vw - 9px);
  flex-shrink: 0;
  margin-right: 6px;
  cursor: pointer;
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .main-wrap {
    padding: 80px 24px 0;
  }

  .work-card {
    min-width: 240px;
  }
}

@media (max-width: 600px) {
  .main-wrap {
    padding: 140px 20px 0;
    gap: 64px;
  }

  .hero {
    gap: 32px;
  }

  .work-card {
    min-width: 200px;
  }
}