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

:root {
  --bg: #09090b;
  --surface: #18181b;
  --border: #27272a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --accent: #ffffff;
  --badge-bg: #27272a;
  --badge-text: #d4d4d8;
  --card-bg: #18181b;
  --link: #a1a1aa;
}

html.light {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --border: #e4e4e7;
  --text: #09090b;
  --muted: #71717a;
  --accent: #000000;
  --badge-bg: #f4f4f5;
  --badge-text: #52525b;
  --card-bg: #ffffff;
  --link: #52525b;
}

html { scroll-behavior: smooth; }

img, video {
  max-width: 100%;
  height: auto;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 1000;
  display: flex; gap: 4px; align-items: center;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 6px 12px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 9999px;
  transition: background 0.15s, color 0.15s;
}

nav a:hover { background: var(--surface); color: var(--text); }

.nav-theme {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 15px; padding: 5px 8px;
  border-radius: 9999px; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center;
}

.nav-theme:hover { background: var(--surface); }

/* ── BOTTOM NAV (persistent) ── */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex; gap: 8px; align-items: center;
  padding: 8px 8px; border-radius: 99px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(2,6,23,0.45);
}

.bottom-nav a, .bottom-nav .nav-theme {
  color: var(--muted);
  text-decoration: none; font-size: 13px;
  padding: 6px 10px; border-radius: 9999px; background: transparent;
  border: none; cursor: pointer; transition: background 0.15s, color 0.15s;
}

.bottom-nav a:hover, .bottom-nav .nav-theme:hover { background: var(--surface); color: var(--text); }

/* ── LAYOUT ── */
.page {
  max-width: 640px;
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 96px 24px 64px;
}

.hero-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-banner {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.18);
}

.hero-banner img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 5;
  object-fit: cover;
  object-position: center;
}

.hero { display: grid; grid-template-columns: 1fr 116px; align-items: center; gap: 16px; }

.hero-text h1 {
  font-family: 'Cal Sans', 'Inter', sans-serif;
  font-size: clamp(1rem, 4vw, 2rem); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-text p { color: var(--muted); max-width: 440px; margin-top: 8px; font-size: 14px; }

.hero-social { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }

.social-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  background: transparent;
}

.social-btn:hover { background: var(--surface); }

.avatar {
  width: 112px; height: 112px; border-radius: 9999px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden; border: 2px solid var(--border);
  position: relative;
  transform: translateX(-6px);
}

.hero-text { min-width: 0; }

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 80%;
  display: block;
  position: relative;
  z-index: 1;
}

.avatar::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  opacity: 0.9;
}

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9999px; padding: 4px 10px;
  font-size: 11px; color: var(--muted);
  margin-top: 12px;
}

.dot {
  width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── SECTIONS ── */
section { margin-top: 48px; }

.section-title {
  font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 20px;
  text-align: center;
}

p { color: var(--muted); font-size: 14px; line-height: 1.7; }
a { color: var(--text); }

/* WORK EXPERIENCE styles removed (unused) */

/* ── EDUCATION ── */
.edu-list { display: flex; flex-direction: column; gap: 0; }

.edu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--text);
  transition: background 0.15s;
}

.edu-item:hover { background: var(--surface); }

.edu-logo {
  width: 36px; border-radius: 8px;
  background: var(); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 800; color: var(--muted); flex-shrink: 0;
  overflow: hidden;
}

.edu-logo img { width: 100%; height: 100%; object-fit: contain; }

.edu-info { flex: 1; min-width: 0; }
.edu-name { font-size: 13px; font-weight: 500; }
.edu-degree { font-size: 12px; color: var(--muted); }
.edu-dates { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

/* moved from inline styles in index.html */
.hero-title { margin-top: 12px; }
.section-heading {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  text-align: center;
}

#about .section-heading,
#education .section-heading,
#skills .section-heading {
  text-align: left;
}

/* removed dotted separator above/below section headings per request */

/* background helpers */
.bg-dark { background: #1a1a2e; }
.bg-navy { background: #003865; }

/* padding helpers used for moved inline styles */
.pad-4 { padding: 4px !important; }

/* image filter helper */
.bright-10 { filter: brightness(10); }

/* ── SKILLS ── */
.skills-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

.skill-badge {
  background: var(--badge-bg); color: var(--badge-text);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; font-size: 12px;
  font-weight: 500; transition: background 0.15s;
}

.skill-badge:hover { background: var(--border); }

.skill-badge .skill-logo {
  width: 16px; height: 16px; object-fit: contain;
  vertical-align: middle; margin-right: 8px; display: inline-block;
  border-radius: 3px;
}

/* ── PROJECTS ── */
.projects-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

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

/* ── BLOGS ── */
.blog-status {
  min-height: 22px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.blog-status.is-error {
  color: #f87171;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr; /* single-column series layout */
  gap: 8px;
}

.blog-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-1px);
  border-color: var(--muted);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.24);
}

.blog-card__media {
  aspect-ratio: 16 / 9;
  background: var(--surface);
  overflow: hidden;
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.blog-card__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

/* Title-only card: force single-line title with ellipsis and add meta line */
.blog-card--title-only { padding: 12px; }
.blog-card--title-only .blog-card__title a {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blog-card--title-only .blog-card__meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.blog-card__date {
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.blog-card__excerpt {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  flex: 1;
}

.blog-card__actions {
  display: flex;
  margin-top: 4px;
}

/* Avatar size and alignment fallbacks for smaller screens */
@media (max-width: 520px) {
  .hero-banner img { aspect-ratio: 16 / 6; }
  .hero { grid-template-columns: 1fr 96px; gap: 12px; }
  .avatar { width: 96px; height: 96px; transform: translateX(-5px); }
  .hero-text h1 { font-size: clamp(0.95rem, 6vw, 1.6rem); }
}

@media (max-width: 360px) {
  .hero-banner img { aspect-ratio: 16 / 7; }
  .hero { grid-template-columns: 1fr 72px; }
  .avatar { width: 72px; height: 72px; transform: translateX(-3px); }
  .hero-text h1 { font-size: clamp(0.9rem, 7.5vw, 1.4rem); }
}

/* Keep avatar to the right and let the name scale responsively */
@media (max-width: 520px) {
  .hero-banner img { aspect-ratio: 16 / 6; }
  .hero { grid-template-columns: 1fr 80px; gap: 12px; }
  .avatar { width: 80px; height: 80px; }
  .hero-text h1 { font-size: clamp(0.95rem, 6vw, 1.6rem); }
}

@media (max-width: 360px) {
  .hero-banner img { aspect-ratio: 16 / 7; }
  .hero { grid-template-columns: 1fr 64px; }
  .avatar { width: 64px; height: 64px; }
  .hero-text h1 { font-size: clamp(0.9rem, 7.5vw, 1.4rem); }
}

.blog-read-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--badge-bg);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.blog-read-btn:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.blog-empty,
.blog-error,
.blog-skeleton {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.blog-empty,
.blog-error {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.blog-error {
  color: #f87171;
}

.blog-skeleton {
  overflow: hidden;
}

.blog-skeleton__media,
.blog-skeleton__line,
.blog-skeleton__button {
  background: linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 60%, var(--bg)) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: blogShimmer 1.4s ease-in-out infinite;
}

.blog-skeleton__media {
  aspect-ratio: 16 / 9;
}

.blog-skeleton__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blog-skeleton__line {
  height: 12px;
  border-radius: 9999px;
}

.blog-skeleton__line.is-short {
  width: 52%;
}

.blog-skeleton__line.is-medium {
  width: 78%;
}

.blog-skeleton__button {
  width: 110px;
  height: 28px;
  border-radius: 9999px;
}

.blog-footer-link {
  margin-top: 14px;
}

.blog-footer-link a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 13px;
}

@keyframes blogShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.project-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex; flex-direction: column;
}

.project-card:hover {
  border-color: var(--muted);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.project-media {
  aspect-ratio: 16 / 9; background: var(--surface);
  overflow: hidden; position: relative;
}

.project-media video { width: 100%; height: 100%; object-fit: cover; }

.project-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }

.project-links { display: flex; gap: 6px; margin-bottom: 8px; }

.project-link-btn {
  font-size: 11px; border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 8px; color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background 0.15s, color 0.15s;
  background: var(--badge-bg);
}

.project-link-btn:hover { color: var(--text); background: var(--surface); }

.project-name { font-size: 14px; font-weight: 600; }
.project-dates { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.project-desc { font-size: 12px; color: var(--muted); flex: 1; line-height: 1.5; }

.project-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }

.project-tag {
  font-size: 10px; background: var(--badge-bg); color: var(--badge-text);
  border-radius: 4px; padding: 2px 6px; border: 1px solid var(--border);
}

/* ── HACKATHONS ── */
.hack-intro { color: var(--muted); font-size: 14px; margin-bottom: 24px; line-height: 1.7; }

.hack-list { display: flex; flex-direction: column; gap: 0; }

.hack-item {
  display: flex; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  transition: background 0.15s;
}

.hack-item:hover { background: var(--surface); }

.hack-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 800; color: var(--muted);
  flex-shrink: 0; overflow: hidden;
}

.hack-logo img { width: 100%; height: 100%; object-fit: contain; }

.hack-info { flex: 1; min-width: 0; }
.hack-name { font-size: 13px; font-weight: 500; }
.hack-date { font-size: 11px; color: var(--muted); }
.hack-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

.hack-links { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.hack-link {
  font-size: 11px; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--badge-bg);
  transition: background 0.15s, color 0.15s;
}

.hack-link:hover { color: var(--text); background: var(--surface); }

/* ── CONTACT ── */
.contact-text { color: var(--muted); font-size: 14px; line-height: 1.7; }
.contact-text a { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 0;
  align-items: flex-start;
  width: min(100%, 560px);
}
.contact-label { font-size: 13px; color: var(--muted); text-align: left; width: 100%; }
.contact-input, .contact-textarea {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
}
.contact-input:focus, .contact-textarea:focus { outline: none; border-color: var(--muted); }
.contact-textarea { min-height: 120px; resize: vertical; }
.contact-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; width: 100%; justify-content: center; }
.contact-actions .project-link-btn {
  font-size: 13px;
  padding: 8px 14px;
}
.contact-status { font-size: 13px; color: var(--muted); }
.contact-status.success { color: #34d399; }
.contact-status.error { color: #f87171; }

/* ── FOOTER ── */
footer {
  padding: 24px 0 0;
  margin-top: 48px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}

.footer-nav { display: flex; gap: 16px; }
.footer-nav a { font-size: 12px; color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--text); }

.footer-chat {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  width: 100%;
}

.footer-chat a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-social { display: flex; gap: 12px; }
.footer-social a { color: var(--muted); font-size: 13px; text-decoration: none; }
.footer-social a:hover { color: var(--text); }

/* ── ABOUT LINKS ── */
.about-text a { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

/* ── SCROLL FADE IN ── */
.fade-in { opacity: 0; transform: translateY(12px); transition: opacity 0.4s, transform 0.4s; }
.fade-in.visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .avatar {
    width: 132px;
    height: 132px;
    transform: none;
    margin-top: 8px;
  }

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

  .bottom-nav {
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 20px;
  }

  .bottom-nav a,
  .bottom-nav .nav-theme {
    padding: 6px 9px;
  }
}

@media (max-width: 700px) {
  .page {
    padding: 88px 16px 88px;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }

  .hero-text p,
  .projects-subtitle,
  .hack-intro,
  .contact-text {
    font-size: 13px;
  }

  .hero-social {
    gap: 8px;
  }

  .skill-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .contact-form {
    width: 100%;
  }

  footer {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .contact-form { width: 100%; }

  .page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .bottom-nav {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 8px;
    gap: 6px;
  }

  .bottom-nav a,
  .bottom-nav .nav-theme {
    font-size: 12px;
    padding: 5px 8px;
  }

  .section-heading {
    font-size: 1.45rem;
  }

  .edu-item,
  .hack-item {
    align-items: flex-start;
  }

  .edu-item,
  .hack-item,
  .project-body {
    padding-left: 10px;
    padding-right: 10px;
  }

  .contact-actions {
    flex-wrap: wrap;
  }
}
