:root {
  --bg: #0b0d10;
  --surface: #12161b;
  --text: #e7edf3;
  --muted: #a4b0be;
  --primary: #5ab0ff;
  --ring: #79c0ff;
  --card: #0f1318;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --text: #0f1720;
    --muted: #3c4a59;
    --primary: #2563eb;
    --ring: #60a5fa;
    --card: #ffffff;
    --shadow: 0 10px 25px rgba(2, 6, 23, 0.08);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% -10%, rgba(90, 176, 255, 0.08), transparent 50%),
              radial-gradient(1000px 600px at 100% 20%, rgba(37, 99, 235, 0.07), transparent 50%),
              var(--bg);
  line-height: 1.6;
}

img { max-width: 100%; display: block; height: auto; }

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  outline: 2px solid var(--ring);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), color-mix(in oklab, var(--primary), white 30%));
  color: #fff;
  font-size: 14px;
}
.brand-text { letter-spacing: 0.2px; }

.nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
}
.nav a:hover { background: color-mix(in oklab, var(--text) 8%, transparent); }

.section {
  padding: 4rem 0 3.5rem;
}
.section-title {
  font-size: clamp(1.4rem, 0.9rem + 2vw, 2rem);
  margin: 0 0 1.5rem 0;
}

.section-hero {
  padding: 5rem 0 3rem;
}
.hero-content {
  max-width: 780px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: color-mix(in oklab, var(--text) 60%, transparent);
  margin: 0 0 0.6rem 0;
  font-size: 0.8rem;
}
.hero-title {
  margin: 0 0 0.6rem 0;
  font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem);
  line-height: 1.15;
}
.highlight {
  background: linear-gradient(90deg, color-mix(in oklab, var(--primary), #fff 25%), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-subtitle { margin: 0 0 1.2rem 0; color: var(--muted); }
.hero-cta { display: flex; gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 0.95rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in oklab, var(--primary) 20%, transparent);
}
.btn-primary {
  background: color-mix(in oklab, var(--primary) 18%, transparent);
  color: var(--text);
  border-color: color-mix(in oklab, var(--primary) 50%, transparent);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
}

.skills-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.skill {
  display: flex;
  gap: 0.8rem;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 14px;
  transition: transform 180ms ease, box-shadow 220ms ease, border-color 200ms ease, background-color 200ms ease;
  transform-origin: center;
}
.skill-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--primary) 18%, transparent);
  border-radius: 10px;
  font-size: 18px;
}
.skill h3 { margin: 0 0 0.2rem 0; font-size: 1rem; }
.skill p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Skill hover animations */
.skill:hover {
  transform: translateY(-2px) scale(1.02) rotate(0.5deg);
  box-shadow: var(--shadow);
  border-color: color-mix(in oklab, var(--primary) 45%, transparent);
}
.skill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}
.skill-icon { transition: transform 200ms ease, background-color 200ms ease; }
.skill:hover .skill-icon { transform: rotate(-6deg) scale(1.05); background: color-mix(in oklab, var(--primary) 30%, transparent); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
.project-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: 16px;
  overflow: hidden;
  transform-origin: center;
  transition: transform 180ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.project-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}
.project-card:hover {
  transform: scale(1.02) rotate(2deg);
  box-shadow: var(--shadow);
  border-color: color-mix(in oklab, var(--primary) 45%, transparent);
}
.project-card:hover .project-media img { transform: scale(1.06) rotate(-1deg); }
.project-card:hover .project-content { transform: translateY(-2px); }
.project-media { overflow: hidden; }
.project-media img { width: 100%; height: auto; display: block; transition: transform 400ms ease; transform-origin: center; }
.project-content { padding: 0.9rem 1rem 1.1rem; transition: transform 200ms ease; }
.project-title { margin: 0 0 0.3rem 0; font-size: 1.05rem; }
.project-desc { margin: 0; color: var(--muted); }

.section-contact .contact-text { color: var(--muted); margin-bottom: 1rem; }
.contact-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.socials { display: inline-flex; gap: 0.5rem; }
.social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  color: var(--text); text-decoration: none;
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.social:hover { background: color-mix(in oklab, var(--primary) 18%, transparent); transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in oklab, var(--primary) 20%, transparent); }

.site-footer { border-top: 1px solid color-mix(in oklab, var(--text) 10%, transparent); }
.site-footer .container { padding: 2rem 0; }
.site-footer p { margin: 0; color: var(--muted); font-size: 0.95rem; text-align: center; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-visible { opacity: 1; transform: translateY(0); transition: opacity 600ms ease, transform 600ms ease; }

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .project-card:hover { transform: none; }
  .reveal { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .skills-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .section { padding: 3rem 0 2.5rem; }
  .skills-list { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0.7rem 0; }
  .hero-cta { flex-wrap: wrap; }
}