/* ================= VARIABLES ================= */
:root {
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --border: #e5e7eb;
  --card: #ffffff;
  --alt-bg: #f9fafb;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-lg: rgba(0, 0, 0, 0.15);
}

/* DARK MODE */
#theme-toggle:checked + .page {
  --bg: #0f172a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --border: #1e293b;
  --card: #1e293b;
  --alt-bg: #1a2332;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
}

.page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a { 
  color: inherit; 
  text-decoration: none;
  transition: all 0.3s ease;
}

/* ================= HEADER ================= */
.header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 100;
  box-shadow: 0 1px 3px var(--shadow);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
}

.logo { 
  font-weight: 700; 
  font-size: 20px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav {
  display: flex;
  gap: 8px;
}

nav a {
  padding: 8px 16px;
  color: var(--muted);
  border-radius: 8px;
  font-weight: 500;
}

nav a:hover { 
  color: var(--primary);
  background: var(--alt-bg);
}

/* Mobile Menu */
@media (max-width: 768px) {
  .nav {
    padding: 14px 0;
  }
  
  .logo {
    font-size: 18px;
  }
  
  nav {
    gap: 4px;
  }
  
  nav a {
    padding: 6px 10px;
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
  
  nav a {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* ================= TOGGLE ================= */
.theme-switch {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px var(--shadow);
  transition: all 0.3s ease;
}

.theme-switch:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px var(--shadow-lg);
}

.theme-switch::after { content: "🌙"; }
#theme-toggle:checked + .page .theme-switch::after { content: "☀️"; }

@media (max-width: 640px) {
  .theme-switch {
    right: 16px;
    bottom: 16px;
    width: 46px;
    height: 46px;
    font-size: 22px;
  }
}

/* ================= HERO ================= */
.hero { 
  padding: 100px 0 80px; 
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero h1 { 
  font-size: 52px; 
  margin-bottom: 12px;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h2 { 
  font-size: 26px; 
  color: var(--primary); 
  margin-bottom: 20px;
  font-weight: 600;
}

.hero-text {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 17px;
  margin-top: 16px;
}

.hero-buttons { 
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  margin-right: 0;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary { 
  background: var(--primary); 
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.secondary { 
  border: 2px solid var(--primary); 
  color: var(--primary);
  background: transparent;
}

.secondary:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn.small { 
  padding: 10px 18px; 
  font-size: 14px; 
}

.hero-meta {
  margin-top: 32px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 15px;
  color: var(--muted);
}

.hero-meta a {
  color: var(--primary);
  font-weight: 500;
}

.hero-meta a:hover {
  text-decoration: underline;
}

/* Mobile Hero */
@media (max-width: 768px) {
  .hero {
    padding: 60px 0;
    min-height: auto;
  }
  
  .hero h1 {
    font-size: 36px;
  }
  
  .hero h2 {
    font-size: 20px;
  }
  
  .hero-text {
    font-size: 16px;
  }
  
  .hero-buttons {
    margin-top: 24px;
  }
  
  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 28px;
  }
  
  .hero h2 {
    font-size: 18px;
  }
  
  .hero-text {
    font-size: 15px;
  }
  
  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
  }
  
  .hero-meta {
    gap: 12px;
    font-size: 14px;
  }
}

/* ================= SECTIONS ================= */
section { padding: 80px 0; }
.alt-bg { background: var(--alt-bg); }

.section-title {
  font-size: 36px;
  margin-bottom: 28px;
  font-weight: 700;
  position: relative;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.section-text {
  max-width: 800px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}

@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }
  
  .section-title {
    font-size: 28px;
    margin-bottom: 24px;
  }
  
  .section-text {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  section {
    padding: 50px 0;
  }
  
  .section-title {
    font-size: 24px;
    margin-bottom: 20px;
  }
}

/* ================= SKILLS ================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.skills-grid span {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px var(--shadow);
}

.skills-grid span:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--shadow-lg);
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
  }
  
  .skills-grid span {
    padding: 14px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .skills-grid span {
    padding: 12px;
    font-size: 14px;
  }
}

/* ================= PROJECTS ================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 26px;
  border-radius: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px var(--shadow-lg);
  border-color: var(--primary);
}

.project-card h4 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 700;
}

.project-card p { 
  color: var(--muted); 
  margin-bottom: 16px;
  line-height: 1.6;
  flex-grow: 1;
}

.tech {
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 16px;
  font-weight: 500;
  padding: 8px 12px;
  background: var(--alt-bg);
  border-radius: 8px;
  display: inline-block;
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }
  
  .project-card {
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  
  .project-card {
    padding: 20px;
  }
  
  .project-card h4 {
    font-size: 18px;
  }
}

/* ================= EDUCATION ================= */
.education-box {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 18px;
  line-height: 1.8;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px var(--shadow);
}

.education-box:hover {
  transform: translateX(8px);
  box-shadow: 0 6px 16px var(--shadow-lg);
  border-color: var(--primary);
}

.education-box strong {
  font-size: 18px;
  color: var(--text);
  display: block;
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .education-box {
    padding: 18px;
  }
  
  .education-box strong {
    font-size: 16px;
  }
}

/* ================= FORM ================= */
.contact-form { 
  max-width: 750px;
  margin: 0 auto;
  background: var(--card);
  padding: 40px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow);
}

.grid { 
  display: grid; 
  gap: 20px; 
}

.two-col { 
  grid-template-columns: 1fr 1fr; 
}

@media (max-width: 640px) {
  .two-col { 
    grid-template-columns: 1fr; 
  }
  
  .contact-form {
    padding: 30px 20px;
  }
}

input, textarea {
  width: 100%;
  padding: 18px 20px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--alt-bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  font-weight: 400;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

input:hover, textarea:hover {
  border-color: var(--primary);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

textarea { 
  min-height: 160px; 
  resize: vertical;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
}

button {
  padding: 16px 40px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

button:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

button:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.contact-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 768px) {
  button {
    padding: 14px 32px;
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  
  button {
    width: 100%;
    padding: 18px;
    font-size: 15px;
  }
  
  .contact-links {
    width: 100%;
    justify-content: center;
  }
}

/* ================= CHIPS ================= */
.chip {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
}

.chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ================= FOOTER ================= */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--alt-bg);
}

@media (max-width: 640px) {
  footer {
    padding: 24px 0;
    font-size: 13px;
  }
}
