/* =========================
   DESIGN TOKENS (THEME)
   ========================= */

:root {
  /* Base blues */
  --blue-975: #050814;
  --blue-950: #070b1a;
  --blue-900: #0b1026;
  --blue-850: #0f1633;
  --blue-800: #131c40;

  --blue-300: #9fb2ff;
  --blue-200: #c7d1ff;
  --blue-100: #eef1ff;

  /* Accent blues */
  --accent-600: #3b5cff;
  --accent-500: #4a6cff;
  --accent-400: #6f88ff;

  /* Semantic tokens */
  --bg: var(--blue-950);
  --surface: var(--blue-900);
  --surface-muted: var(--blue-850);
  --border: rgba(199, 209, 255, 0.12);

  --text-primary: var(--blue-100);
  --text-secondary: var(--blue-200);
  --text-muted: #9aa6d6;

  --accent: var(--accent-500);
  --accent-soft: rgba(74, 108, 255, 0.18);

  /* Effects */
  --radius: 18px;
  --shadow: 0 10px 30px rgba(4, 8, 32, 0.6);

  /* Spacing */
  --gap: 18px;
}

:root[data-theme="light"] {
  --bg: #f6f8ff;
  --surface: #ffffff;
  --surface-muted: #f1f4ff;
  --border: rgba(11, 16, 38, 0.12);

  --text-primary: #0b1026;
  --text-secondary: #1e2a5a;
  --text-muted: #4b5aa3;

  --accent: #3b5cff;
  --accent-soft: rgba(59, 92, 255, 0.15);

  --shadow: 0 12px 28px rgba(11, 16, 38, 0.12);
}

/* =========================
   RESET & GLOBALS
   ========================= */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  line-height: 1.6;
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(74,108,255,.18), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(111,136,255,.12), transparent 55%),
    var(--bg);
  color: var(--text-primary);
}

/* Prevent “massive images” if a specific selector fails */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 4px;
}

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

/* =========================
   ACCESSIBILITY
   ========================= */

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 9999;
}

.skip-link:focus {
  left: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================
   LAYOUT
   ========================= */

.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

main {
  padding: 42px 0 70px;
}

section {
  margin: 26px 0;
  padding: 26px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* Headings + text */
h1, h2, h3, h4 {
  line-height: 1.2;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.4rem;
}

h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

p {
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* =========================
   HEADER / NAV
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav a {
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.site-nav a:hover,
.site-nav a.active {
  background: var(--accent-soft);
  outline: 1px solid rgba(74,108,255,0.35);
}

.nav-toggle,
.theme-toggle {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.nav-toggle {
  display: none;
}

/* =========================
   HERO
   ========================= */

#hero {
  padding: 42px 26px;
  text-align: center;
}

#hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin: 0 0 8px;
}

#hero p {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.hero-proof {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.hero-cta {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================
   BUTTONS / LINKS AS BUTTONS
   ========================= */

.btn,
.project-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}

.btn:hover,
.project-links a:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn:focus-visible,
.project-links a:focus-visible,
.site-nav a:focus-visible,
.nav-toggle:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn.primary {
  background: color-mix(in srgb, var(--accent) 88%, transparent);
  border-color: rgba(74,108,255,0.45);
}

/* =========================
   PROJECTS
   ========================= */

#projects h2 {
  margin-bottom: 16px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-content {
  padding: 18px;
}

.stack {
  margin: 6px 0 10px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.highlights {
  margin: 12px 0 0;
  padding-left: 18px;
}

.highlights li {
  margin: 8px 0;
  color: var(--text-muted);
}

.project-links {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* =========================
   SKILLS
   ========================= */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

@media (max-width: 900px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.skills-group h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.skills-group p {
  margin: 0;
  color: var(--text-secondary);
}

/* =========================
   CONTACT
   ========================= */

#contact p {
  color: var(--text-secondary);
}

#contact a {
  color: var(--text-primary);
  font-weight: 600;
}

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

/* subtle gradient */
#contact {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface) 82%, transparent),
    color-mix(in srgb, var(--surface-muted) 82%, transparent)
  );
}

/* =========================
   MOBILE NAV
   ========================= */

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    right: 4vw;
    top: 58px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: min(320px, 92vw);
    padding: 12px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
  }
}
