:root {
  --bg: #0b0f17;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #a1a1aa;
  --link: #7dd3fc;
  --border: #1f2937;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 18px;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(11,15,23,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  gap: 14px;
}
.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

/* ── Desktop Nav ── */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 10px;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav a:hover { color: var(--text); }

/* ── Hamburger ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Typography ── */
h1 { font-size: 2.2rem; margin: 18px 0 8px; }
h2 { font-size: 1.4rem; margin: 22px 0 10px; }
h3 { font-size: 1.15rem; margin: 18px 0 8px; }
p { margin: 10px 0; }
a { color: var(--link); }
a:hover { text-decoration: underline; }
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 12px 0;
}
code, pre {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
}
pre { padding: 12px; overflow: auto; }
blockquote {
  margin: 14px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--border);
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}

/* ── Profile pic ── */
.profile-pic {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 8%;
  float: right;
  margin: 2rem 0 1rem 2rem;
  display: block;
  max-width: unset !important;
}

/* ── CTA button ── */
.cta-btn {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.6rem 1.4rem;
  background: #4f8ef7;
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none !important;
  font-weight: 600;
}
.cta-btn:hover { background: #3b7de8; }

/* ── Contact links ── */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.contact-links a {
  color: var(--link);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.contact-links a:hover { text-decoration: underline; }
.contact-links .location {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Technical Stack ── */
.tech-stack p {
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left !important;
}
.tech-stack p:last-child { border-bottom: none; }

/* ── Project cards ── */
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.project-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.project-card .tags {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 4px 0 6px;
  line-height: 1.6;
  text-align: left !important;
}
.project-card p { margin: 4px 0; }
.project-card .meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 6px;
  text-align: left !important;
}

/* ── All images ── */
img {
  max-width: 60%;
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 6px;
}
.container img {
  max-width: min(100%, 700px) !important;
  height: auto !important;
}

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
th { background: var(--card); color: var(--text); padding: 8px 12px; text-align: left; border-bottom: 2px solid var(--border); }
td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--muted); }
tr:last-child td { border-bottom: none; }

/* ── RL gait grid ── */
.gait-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.gait-grid div p { text-align: center !important; font-weight: bold; margin-bottom: 0.3rem; color: var(--muted); }
.gait-grid img { width: 100% !important; max-width: 100% !important; margin: 0; border-radius: 4px; }

/* ── Justify all body paragraphs globally ── */
.container p { text-align: justify; }
/* Exceptions — always left */
.tags, .meta, .tech-stack p, .bio { text-align: left !important; }

/* ════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════ */

/* ── Tablet (≤768px) ── */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.05rem; }
  .container { padding: 20px 16px; }

  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(11,15,23,0.98);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 18px;
    gap: 0;
  }
  .nav.open { display: flex; }
  .nav a {
    margin-left: 0;
    padding: 10px 0;
    font-size: 1rem;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
  .nav a:last-child { border-bottom: none; }

  .profile-pic { width: 110px; height: 110px; margin: 0 0 1rem 1.2rem; }
  .contact-links { gap: 10px 16px; font-size: 0.9rem; }
  .container img { max-width: 90% !important; }
}

/* ── Mobile (≤480px) ── */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.15rem; }
  .container { padding: 16px 14px; }
  container p:not(.bio):not(.tags):not(.meta) { text-align: justify; }

  /* Subtitle smaller so it doesn't wrap word by word */
  strong { font-size: 0.9rem; }

  /* Pic stacks centered on top */
  .profile-pic {
    float: none;
    display: block;
    margin: 0 auto 1.2rem auto;
    width: 110px;
    height: 110px;
  }

  /* Bio left-aligned on mobile, project page paragraphs stay justified */
  .bio { text-align: left !important; }

  .contact-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .tech-stack p { font-size: 0.88rem; padding: 8px 0; }
  .project-card { padding: 14px; }
  .project-card h3 { font-size: 0.98rem; }
  .project-card .tags { font-size: 0.82rem; }
  .project-card .meta { font-size: 0.8rem; }

  .container img { max-width: 100% !important; }
  .gait-grid { grid-template-columns: 1fr; }
}
