/* General */
:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #1d1f2a;
  --muted: #5b6170;
  --accent: #0f62fe;
  --pill: #e9eefc;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --card: #111a2e;
  --text: #e6ebff;
  --muted: #9fb0d0;
  --accent: #78a4ff;
  --pill: #16233c;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
  z-index: 1;
  transition: background 0.35s ease, color 0.35s ease;
}

.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8f0ff, #fef9ff);
  z-index: -1;
  opacity: 0.7;
}

[data-theme="dark"] .bg-gradient {
  background: radial-gradient(120% 120% at 20% 20%, #182743 0%, #0b1220 60%);
  opacity: 0.55;
}

/* Layout */
.container {
  width: 92%;
  max-width: 900px;
  margin: auto;
}

/* Header */
header {
  text-align: center;
  padding: 80px 0 12px;
  position: relative;
}

.hero-content {
  margin: 32px 0 24px;
  padding: 0;
}

.name {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
}

.tagline {
  font-size: 1.1rem;
  margin-top: -5px;
  color: var(--muted);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.social a {
  margin: 0 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.glass-nav {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 900px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--card);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, background 0.35s ease;
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover {
  transform: translateY(-1px);
}

[data-theme="dark"] .glass-nav {
  background: rgba(17, 26, 46, 0.55);
  border: 1px solid rgba(120, 164, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.brand:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .brand:hover {
  background: rgba(120, 164, 255, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  transition: all 0.3s ease;
}

.nav-links a {
  position: relative;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  transition: color 0.2s ease, transform 0.2s ease, background 0.3s ease;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
}

.nav-links a::before {
  content: "";
  position: absolute;
  inset: -120% 0 auto 0;
  height: 200%;
  background: radial-gradient(120px at var(--mx, 50%) var(--my, 50%), rgba(120,164,255,0.25), transparent 55%);
  transition: all 0.35s ease;
}

.nav-links a:hover {
  transform: translateY(-2px);
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.nav-links a:hover::before {
  inset: -40% 0 auto 0;
}

[data-theme="dark"] .nav-links a {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

[data-theme="dark"] .nav-links a:hover {
  background: rgba(120, 164, 255, 0.16);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--card);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.35s ease, color 0.35s ease;
}

.theme-ready .theme-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* Card Sections */
.card {
  background: var(--card);
  padding: 25px;
  margin: 25px 0;
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: background 0.35s ease, box-shadow 0.35s ease, color 0.35s ease;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 15px;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Skills */
.skill-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.skill-columns h3 {
  font-size: 1rem;
  margin-bottom: 5px;
  color: var(--muted);
}

.skill-badges {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-badges li {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Timeline */
.timeline .item {
  margin-bottom: 18px;
}

.timeline h3 {
  margin: 0;
  font-size: 1.1rem;
}

.time {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.project {
  background: var(--pill);
  padding: 12px;
  border-radius: 10px;
  font-size: 0.95rem;
}

/* Medium Blog */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.post-card {
  background: var(--card);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: 0.25s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}

.post-card img {
  width: 100%;
  border-radius: 10px;
}

.post-card h3 {
  margin: 10px 0 5px;
  font-size: 1.05rem;
}

.post-card .date {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.post-card a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted);
}

[data-theme="dark"] .contact-form input,
[data-theme="dark"] .contact-form textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.contact-form button {
  padding: 14px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(15, 98, 254, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, color 0.3s ease;
}

.contact-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(15, 98, 254, 0.24);
}

[data-theme="dark"] .contact-form button {
  background: linear-gradient(135deg, #7fb2ff, #5f8bff);
  color: #0b1220;
  box-shadow: 0 14px 34px rgba(95, 139, 255, 0.35);
}

[data-theme="dark"] .contact-form button:hover {
  box-shadow: 0 18px 40px rgba(95, 139, 255, 0.45);
}

footer {
  text-align: center;
  padding: 30px 0;
  margin-top: 40px;
  font-size: 0.9rem;
  color: var(--muted);
}

.intro {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  align-items: center;
}

.portrait-wrap {
  display: flex;
  justify-content: center;
}

.portrait-wrap img {
  width: 100%;
  max-width: 240px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  object-fit: cover;
  min-height: 240px;
  background: var(--pill);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    width: 95%;
  }

  header {
    padding: 70px 0 8px;
  }

  .glass-nav {
    width: 95%;
    top: 6px;
  }

  .hero-content {
    margin: 24px 0 20px;
  }

  .name {
    font-size: 2rem;
  }

  .tagline {
    font-size: 0.95rem;
    padding: 0 10px;
  }

  .social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .social a {
    margin: 0 6px;
    font-size: 0.9rem;
  }

  .glass-nav {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }

  .menu-toggle {
    display: flex;
    order: 2;
  }

  .theme-toggle {
    order: 3;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .nav-links {
    display: none;
    width: 100%;
    order: 4;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  [data-theme="dark"] .nav-links {
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    text-align: center;
    padding: 10px;
  }

  .brand {
    order: 1;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .portrait-wrap {
    order: -1;
  }

  .portrait-wrap img {
    max-width: 200px;
    min-height: 200px;
  }

  .card {
    padding: 20px;
    margin: 20px 0;
  }

  h2 {
    font-size: 1.2rem;
  }

  .skill-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  header {
    padding: 65px 0 8px;
  }

  .glass-nav {
    width: 96%;
    top: 4px;
    padding: 8px 10px;
  }

  .name {
    font-size: 1.75rem;
  }

  .tagline {
    font-size: 0.9rem;
  }

  .card {
    padding: 16px;
    margin: 16px 0;
  }

  .social a {
    font-size: 0.85rem;
    margin: 0 4px;
  }
}
