:root {
  --bg: #f5f6fb;
  --text: #141414;
  --text-inverse: #f0f0f5;
  --muted: #4f5667;
  --accent: #5b7bff;
  --card: #ffffff;
  --border: #e5e7ef;
  --shadow: 0 20px 60px rgba(20, 20, 20, 0.08);
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
}

[data-theme='dark'] {
  --bg: #121218;
  --text: #f0f0f5;
  --text-inverse: #141414;
  --muted: #a0a4b8;
  --accent: #7b9bff;
  --card: #ffffff09;
  --border: #ffffff1e;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.ai-instructions {
  display: none;
}

/* Animated Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.spotlight {
  position: absolute;
  bottom: -60%;
  left: 50%;
  width: 120vw;
  height: 140%;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.2;
  mix-blend-mode: screen;
  will-change: transform;
}

[data-theme='dark'] .spotlight {
  opacity: 0.1;
}

.spotlight-1 {
  background: radial-gradient(ellipse at center bottom, #00ffff 0%, #00e5ff 50%, transparent 100%);
  animation: spotlight-move-1 45s ease-in-out infinite;
}

.spotlight-2 {
  background: radial-gradient(ellipse at center bottom, #5b7bff 0%, #7b9bff 50%, transparent 100%);
  animation: spotlight-move-2 42s ease-in-out infinite;
}

.spotlight-3 {
  background: radial-gradient(ellipse at center bottom, #ff00ff 0%, #e040fb 50%, transparent 100%);
  animation: spotlight-move-3 47s ease-in-out infinite;
}

@keyframes spotlight-move-1 {

  0%,
  100% {
    transform: translateX(-100%) scale(1);
  }

  25% {
    transform: translateX(-25%) scale(1.15);
  }

  50% {
    transform: translateX(50%) scale(1.1);
  }

  75% {
    transform: translateX(-50%) scale(1.2);
  }
}

@keyframes spotlight-move-2 {

  0%,
  100% {
    transform: translateX(25%) scale(1.1);
  }

  25% {
    transform: translateX(-75%) scale(1);
  }

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

  75% {
    transform: translateX(0%) scale(1.05);
  }
}

@keyframes spotlight-move-3 {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }

  25% {
    transform: translateX(50%) scale(1.1);
  }

  50% {
    transform: translateX(0%) scale(1.2);
  }

  75% {
    transform: translateX(100%) scale(1.05);
  }
}

[data-theme='dark'] .spotlight-1 {
  animation-name: spotlight-move-1;
}

[data-theme='dark'] .spotlight-2 {
  animation-name: spotlight-move-2;
}

[data-theme='dark'] .spotlight-3 {
  animation-name: spotlight-move-3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

.hero {
  min-height: 90vh;
  display: grid;
  place-items: center;
  padding: 4rem 1.5rem;
  background: transparent;
  text-align: center;
  position: relative;
}

[data-theme='dark'] .hero {
  background: transparent;
}

.hero-content {
  max-width: 720px;
  display: grid;
  gap: 2.5rem;
  justify-items: center;
}

.hero-text {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
}

.hero h1 {
  font-size: clamp(3rem, 4vw, 6.2rem);
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0;
}

.headshot {
  height: 160px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.socials {
  display: flex;
  gap: 0rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.scroll-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: 200ms ease;
}

a.scroll-link {
  color: var(--text-inverse);
}

.scroll-link:hover {
  background: var(--muted);
  text-decoration: none;
}

.projects-section {
  padding: 3rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.about-section {
  padding: 3rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2rem;
  display: grid;
  gap: 0.75rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

[data-theme='light'] .project-card {
  border: 0px;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 80px rgba(20, 20, 20, 0.12);
  cursor: pointer;
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.project-content {
  padding: 1.25rem;
  display: grid;
  gap: 0.35rem;
  height: 100%;
}

.project-content h3 {
  margin: 0;
  font-size: 1.25rem;
}

.project-content p {
  margin: 0;
  color: var(--muted);
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border);
  line-height: 1;
  white-space: nowrap;
}

.chip--design {
  background: #ffe8f3;
  color: var(--text);
}

.chip--development {
  background: #e5ecff;
  color: var(--text);
}

.chip--research {
  background: #eef2ff;
  color: #3730a3;
}

.chip--business {
  background: #ffffff;
  color: var(--text);
}

.chip--default {
  background: #ffffff;
  color: var(--text);
}

[data-theme='dark'] .chip--design {
  background: #3a2a3a;
}

[data-theme='dark'] .chip--development {
  background: #2a2a44;
}

[data-theme='dark'] .chip--research {
  background: #2a2a44;
  color: #a0b0ff;
}

[data-theme='dark'] .chip--business,
[data-theme='dark'] .chip--default {
  background: var(--card);
}

.card-divider {
  width: 100%;
  height: 0;
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0.9rem 0 0.75rem;
}

.site-footer {
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 0.5rem;
}

.heart-link {
  text-decoration: none;
}

.heart-link:hover {
  text-decoration: none;
}

.back-to-top,
.back-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.logo-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: 200ms ease;
}

.logo-mark img {
  width: inherit;
  height: inherit;
}

.logo-mark .icon-dark {
  display: none;
}

[data-theme='dark'] .logo-mark .icon-light {
  display: none;
}

[data-theme='dark'] .logo-mark .icon-dark {
  display: block;
}

.logo-mark:hover {
  text-decoration: none;
  opacity: 0.7;
}

.theme-toggle {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 1000;
  width: 56px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #d0dcff 0%, #ffd7ea 100%);
  cursor: pointer;
  padding: 3px;
  transition: background 300ms ease;
}

.theme-toggle::before {
  content: '☀️';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 300ms ease, background 300ms ease;
  transform: translateX(0);
  font-size: 12px;
  line-height: 1;
}

[data-theme='dark'] .theme-toggle {
  background: linear-gradient(135deg, #3d3d5c 0%, #5a4a5a 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme='dark'] .theme-toggle::before {
  content: '🌙';
  transform: translateX(28px);
  background: #1a1a24;
}

.detail-page {
  background: linear-gradient(180deg, #f5f6fb 0%, #ffffff 40%);
}

[data-theme='dark'] .detail-page {
  background: linear-gradient(180deg, #18181f 0%, #121218 40%);
}

.project-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  display: grid;
  gap: 2rem;
}

.project-hero img {
  width: 100%;
  margin-top: 1rem;
  max-height: 320px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.project-hero h1 {
  margin: 0.25rem 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.project-blurb {
  color: var(--muted);
  margin: 0 0 1rem;
}

.project-body {
  display: grid;
  gap: 1.5rem;
}

.project-body h2 {
  color: var(--text);
}

.project-ctas {
  justify-content: flex-start;
}

.project-description {
  background: var(--card);
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 1rem;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.project-gallery figure {
  margin: 0;
}

.project-gallery img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  object-fit: cover;
  min-height: 200px;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.project-gallery img:hover {
  transform: scale(1.02);
  box-shadow: 0 25px 70px rgba(20, 20, 20, 0.15);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms ease, transform 200ms ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.empty-state,
.error-state {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--accent);
  transition: transform 160ms ease, opacity 160ms ease;
}

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

.social-icon-btn:hover {
  transform: translateY(-1px) scale(1.05);
  opacity: 0.85;
}

@media (max-width: 720px) {
  .page-header {
    padding: 1rem;
  }

  .project-detail {
    padding: 1rem;
  }
}