/* Base */
:root {
  --bg: #030712;
  --bg-alt: #111827;
  --text: #f9fafb;
  --text-muted: #9ca3af;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --card: #1f2937;
  --card-hover: #374151;
  --border: #374151;
  --gradient: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
  --glass: rgba(17, 24, 39, 0.75);
}

:root.light {
  --bg: #f9fafb;
  --bg-alt: #ffffff;
  --text: #111827;
  --text-muted: #4b5563;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --card: #ffffff;
  --card-hover: #f3f4f6;
  --border: #e5e7eb;
  --gradient: linear-gradient(135deg, #2563eb, #7c3aed, #db2777);
  --glass: rgba(255, 255, 255, 0.75);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

.section {
  padding: 72px 0;
}

.section.alt {
  background: var(--bg-alt);
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
}

.lead {
  font-size: clamp(1.125rem, 2vw, 1.35rem);
  color: var(--text-muted);
  max-width: 60ch;
}

.small { font-size: 0.875rem; }
.muted { color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  border-color: var(--text-muted);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn.primary {
  background: var(--gradient);
  border: none;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4), 0 4px 6px -2px rgba(59, 130, 246, 0.2);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 1000;
}
.skip-link:focus {
  left: 8px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: all 0.3s ease;
}

html[data-scroll="true"] .site-header {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease;
}

.brand:hover {
  transform: scale(1.02);
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient);
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.brand-text {
  font-weight: 700;
}

.nav {
  position: relative;
}
.nav-menu {
  display: flex;
  gap: 16px;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-menu a, .nav-menu button.theme-toggle {
  color: var(--text);
  text-decoration: none;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.nav-menu a:hover, .nav-menu button.theme-toggle:hover {
  background: rgba(255,255,255,0.06);
}
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.hamburger, .hamburger::before, .hamburger::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  position: relative;
  border-radius: 2px;
}
.hamburger::before, .hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}
.hamburger::before { top: -6px; }
.hamburger::after  { top:  6px; }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 60px;
  position: relative;
  overflow: hidden;
}

/* Abstract Background Shapes */
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.5;
  animation: float 20s infinite alternate ease-in-out;
}

.hero::before {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -100px;
  left: -200px;
}

.hero::after {
  width: 500px;
  height: 500px;
  background: #ec4899;
  bottom: -100px;
  right: -100px;
  animation-delay: -10s;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 40px;
}

.hero-text {
  animation: slideUp 0.8s ease-out forwards;
}

.hero-text h1 {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-ctas {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-art {
  display: flex;
  justify-content: center;
  position: relative;
  animation: fadeInRight 1s ease-out forwards;
}

.hero-art::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: var(--gradient);
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.3;
  z-index: -1;
  animation: pulse 4s infinite alternate;
}

.hero-photo {
  width: 100%;
  max-width: 400px;
  height: auto;
  aspect-ratio: 4/5;
  border-radius: 24px;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-photo:hover {
  transform: scale(1.02) rotate(-1deg);
}

/* Cards and grids */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--primary);
  background: var(--card-hover);
}

.card h3 {
  margin-bottom: 0.5rem;
}

.skills-grid, .projects-grid, .contact-grid {
  display: grid;
  gap: 16px;
}
.skills-grid {
  grid-template-columns: repeat(4, 1fr);
}
.projects-grid {
  grid-template-columns: repeat(3, 1fr);
}
.contact-grid {
  grid-template-columns: 1.2fr .8fr;
  align-items: start;
}

.links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.links a {
  color: var(--text);
  text-decoration: none;
}
.links a:hover {
  text-decoration: underline;
}

/* Forms */
form {
  background: var(--card);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

form label {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: var(--bg-alt);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 32px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Utilities */
.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;
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes pulse {
  from { opacity: 0.2; transform: scale(0.95); }
  to { opacity: 0.4; transform: scale(1.05); }
}

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

/* Responsive */
@media (max-width: 920px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-ctas { justify-content: center; }
  .hero-photo { max-width: 300px; margin: 0 auto; }
}

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 16px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: none;
    flex-direction: column;
    min-width: 200px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  }
  .nav-menu.open { display: flex; animation: slideUp 0.2s ease-out; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2.5rem; }
  .section { padding: 48px 0; }
}


