:root, [data-theme="dark"] {
  --bg: #0a0c12;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-hover: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f1f3f8;
  --muted: #9aa3b5;
  --accent: #7c8cff;
  --accent2: #2dd4bf;
  --accent-ink: #0a0c12;
  --nav-bg: rgba(10, 12, 18, 0.7);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --blob: 0.28;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-hover: #ffffff;
  --line: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: #5b6477;
  --accent: #4f46e5;
  --accent2: #0d9488;
  --accent-ink: #ffffff;
  --nav-bg: rgba(246, 247, 251, 0.75);
  --shadow: 0 24px 60px rgba(30, 41, 90, 0.16);
  --blob: 0.18;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--blob);
  animation: drift 22s ease-in-out infinite alternate;
}

.b1 { background: var(--accent); top: -25vmax; left: -15vmax; }
.b2 { background: var(--accent2); bottom: -30vmax; right: -20vmax; animation-delay: -9s; }

@keyframes drift {
  to { transform: translate3d(6vmax, 4vmax, 0) scale(1.1); }
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(16px, 5vw, 56px);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 18px; margin-right: auto; white-space: nowrap; }

.nav nav { display: flex; gap: 6px; }

.nav nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.nav nav a:hover { color: var(--text); background: var(--panel-hover); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.25s, background 0.2s;
}

.theme-toggle:hover { background: var(--panel-hover); transform: rotate(18deg); }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: clamp(28px, 6vw, 80px);
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 120px) clamp(16px, 5vw, 32px) clamp(40px, 8vw, 90px);
}

.hello {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: pulse 2s infinite; }

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(38px, 6.4vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
}

.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 520px; margin: 0 0 30px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions.center { justify-content: center; }

.btn {
  display: inline-block;
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.btn:hover { transform: translateY(-2px); background: var(--panel-hover); }

.btn.primary {
  color: var(--accent-ink);
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
}

.hero-photo { position: relative; justify-self: end; width: 100%; max-width: 400px; }

.hero-photo::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 34px;
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  opacity: 0.7;
  filter: blur(22px);
}

.hero-photo img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 30px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-8px); }
}

.section { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 7vw, 80px) clamp(16px, 5vw, 32px); }

.section-head { margin-bottom: 34px; }

h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 10px;
}

.section-head p { color: var(--muted); margin: 0; max-width: 560px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  transition: transform 0.25s, background 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.card:hover {
  transform: translateY(-6px);
  background: var(--panel-hover);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow);
}

.thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s; }

.card:hover .thumb img { transform: scale(1.06); }

.play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-35%, -50%);
  border-left: 11px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }

.card h3 { font-family: "Space Grotesk", sans-serif; font-size: 18px; line-height: 1.3; margin: 0; }

.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

.repo-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.stars { font-size: 13px; color: var(--muted); white-space: nowrap; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }

.tag {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--line);
}

.tag.accent {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.projects .card-body { padding: 22px; }

.more { margin: 26px 0 0; }

.more a { color: var(--accent); font-weight: 600; font-size: 15px; }

.more a:hover { text-decoration: underline; text-underline-offset: 4px; }

.contact {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  max-width: 1056px;
}

.contact p { color: var(--muted); margin: 0 0 26px; }

footer { text-align: center; padding: 36px 16px 48px; color: var(--muted); font-size: 14px; }

footer p { margin: 0; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-photo { order: -1; justify-self: start; max-width: 220px; }
  .hero-photo img, .hero-photo::before { border-radius: 24px; }
  .nav { gap: 8px; }
  .brand { font-size: 16px; }
  .nav nav { gap: 0; }
  .nav nav a { padding: 7px 8px; font-size: 13px; }
  .grid { grid-template-columns: 1fr; }
  .btn { flex: 1 1 calc(33% - 10px); text-align: center; padding: 11px 12px; }
  .btn.primary { flex: 1 1 100%; }
  .contact { border-radius: 22px; margin-left: 16px; margin-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
