:root,
[data-theme="dark"] {
  --bg: #08080a;
  --bg-elevated: #101013;
  --bg-card-hover: #16161a;
  --text: #ededeb;
  --text-secondary: #a3a09c;
  --text-muted: #5c5a57;
  --accent: #c9a24e;
  --accent-glow: rgba(201, 162, 78, 0.12);
  --glow-color: rgba(201, 162, 78, 0.06);
  --border: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(201, 162, 78, 0.25);
  --shadow: rgba(0, 0, 0, 0.6);
  --radius: 16px;
}

[data-theme="light"] {
  --bg: #f8f7f4;
  --bg-elevated: #ffffff;
  --bg-card-hover: #f5f4f1;
  --text: #1a1917;
  --text-secondary: #5c5a57;
  --text-muted: #8b8986;
  --accent: #a67c2e;
  --accent-glow: rgba(166, 124, 46, 0.08);
  --glow-color: rgba(166, 124, 46, 0.04);
  --border: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(166, 124, 46, 0.35);
  --shadow: rgba(0, 0, 0, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Radial glow behind hero */
.glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--glow-color) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Noise texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
  z-index: 9999;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.25s; }
.delay-3 { animation-delay: 0.4s; }
.delay-4 { animation-delay: 0.55s; }
.delay-5 { animation-delay: 0.7s; }
.delay-6 { animation-delay: 0.85s; }

/* ---- Hero ---- */
header {
  padding: clamp(48px, 8vh, 72px) 0 clamp(80px, 12vh, 120px);
  text-align: center;
}

.logo {
  font-family: 'Josefin Sans', sans-serif;
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--text);
}

.divider {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 24px auto;
}

.tagline {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.hero-description {
  margin-top: 56px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.hero-description strong {
  color: var(--text);
  font-weight: 500;
}

@media (max-width: 768px) {
  .desktop-break { display: none; }
}

/* ---- Section ---- */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Projects ---- */
section.projects-section {
  padding-bottom: 120px;
}

.projects {
  display: grid;
  gap: 16px;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 28px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px var(--border-hover),
    0 24px 48px -16px var(--shadow),
    0 0 64px -16px var(--accent-glow);
}

.project-info { min-width: 0; }

.project-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.project-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.project-card:hover .project-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  transform: translateX(2px);
}

.project-card--wip {
  pointer-events: none;
  cursor: default;
}

.project-card--wip .project-info h3 {
  color: var(--text-muted);
}

.project-card--wip .project-info p {
  color: var(--text-muted);
}

.project-card--wip .project-card__wip-badge {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.project-card--wip .wip-short { display: none; }

@media (max-width: 768px) {
  .project-card--wip .wip-full { display: none; }
  .project-card--wip .wip-short { display: inline; }
}

.projects-note {
  margin-top: 48px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ---- Footer ---- */
footer {
  padding: 48px 0 40px;
  text-align: center;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover { color: var(--accent); }

.footer-name {
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-block;
  transition: color 0.2s;
  user-select: none;
}

.footer-name:hover { color: var(--accent); }

.footer-name.clicked {
  animation: footer-name-wiggle 0.5s ease-in-out;
}

@keyframes footer-name-wiggle {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(8deg); }
  60% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
}

/* ---- Theme toggle ---- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 56px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 1px 3px var(--shadow);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(20, 20, 22, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.theme-toggle .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s;
}

.theme-toggle .icon svg {
  display: block;
}

.theme-toggle .icon.active { color: var(--accent); }

.theme-switch {
  position: relative;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch .track {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.2s;
}

.theme-switch:hover .track {
  border-color: var(--border-hover);
}

.theme-switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-switch input:checked ~ .thumb {
  transform: translateX(18px);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .container { padding: 0 20px; }

  header {
    padding: clamp(36px, 6vh, 56px) 0 clamp(56px, 8vh, 80px);
  }

  .logo {
    letter-spacing: 0.2em;
    text-indent: 0.2em;
  }

  .hero-description {
    margin-top: 40px;
    font-size: 1rem;
  }

  section.projects-section { padding-bottom: 80px; }
  .section-header { margin-bottom: 28px; }

  .project-card { padding: 22px 24px; }

  .project-arrow { width: 32px; height: 32px; }

  .projects-note { margin-top: 36px; }

  footer { padding: 36px 0 32px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }

  .logo {
    font-size: clamp(2rem, 12vw, 3rem);
    letter-spacing: 0.15em;
    text-indent: 0.15em;
  }

  .divider { margin: 16px auto; }
  .tagline { font-size: 0.75rem; letter-spacing: 0.2em; }

  .hero-description {
    margin-top: 32px;
    font-size: 0.9375rem;
    line-height: 1.7;
  }

  .project-card { padding: 20px; gap: 12px; }
  .project-card h3 { font-size: 1rem; }
  .project-card p { font-size: 0.8125rem; }

  .projects-note { font-size: 0.8125rem; }
}
