/* ===========================
   Design tokens — dark (default)
=========================== */
:root {
  --bg:       #060c1a;
  --bg2:      #0b1225;
  --bg3:      #101c34;
  --card:     #0f1929;
  --border:   #1a2847;
  --blue:     #7ab8ff;
  --cyan:     #34e0f7;
  --green:    #34d399;
  --purple:   #c4b5fd;
  --gold:     #fbbf24;
  --text:     #dde8ff;
  --text2:    #7a90b8;
  --text3:    #3d5070;
  --grad:     linear-gradient(135deg, #7cb9ff, #34e0f7);
  --glow:     0 0 24px rgba(124,185,255,0.2);
  --radius:   12px;
}

/* ===========================
   Light mode tokens
=========================== */
[data-theme="light"] {
  --bg:       #f4f7ff;
  --bg2:      #eaeff9;
  --bg3:      #dde5f5;
  --card:     #ffffff;
  --border:   #cdd7ed;
  --blue:     #1a56db;
  --cyan:     #0e7490;
  --green:    #047857;
  --purple:   #6d28d9;
  --gold:     #b45309;
  --text:     #0f172a;
  --text2:    #475569;
  --text3:    #94a3b8;
  --grad:     linear-gradient(135deg, #1a56db, #0e7490);
  --glow:     0 0 24px rgba(26,86,219,0.12);
}

/* ===========================
   Reset & base
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a { color: inherit; text-decoration: none; }

/* ===========================
   Navigation
=========================== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6,12,26,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

[data-theme="light"] nav {
  background: rgba(244,247,255,0.9);
}

.nav-logo {
  font-size: 1rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text2);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(74,138,244,0.08);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.55rem;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--blue);
  color: var(--text);
  background: rgba(124,185,255,0.08);
}
[data-theme="light"] .theme-toggle:hover {
  background: rgba(26,86,219,0.08);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===========================
   Page wrapper (push below nav)
=========================== */
.page {
  padding-top: 60px;
}

/* ===========================
   Hero (index)
=========================== */
.hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  padding: 4rem 2rem;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(74,138,244,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(34,211,238,0.05) 0%, transparent 50%);
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  background: rgba(74,138,244,0.1);
  border: 1px solid rgba(74,138,244,0.25);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--blue);
  margin-bottom: 1.5rem;
}

.hero-name {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-name .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text2);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.hero-loc {
  font-size: 0.88rem;
  color: var(--text3);
  margin-bottom: 2.5rem;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 4rem;
}

/* Navigation cards on index */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.nav-card:hover {
  border-color: var(--blue);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}

.nav-card-icon { font-size: 1.6rem; }
.nav-card-title { font-size: 0.95rem; font-weight: 600; }
.nav-card-desc { font-size: 0.8rem; color: var(--text2); }

/* ===========================
   Buttons
=========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(74,138,244,0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--text);
  background: rgba(74,138,244,0.07);
}

/* ===========================
   Page header (inner pages)
=========================== */
.page-header {
  padding: 3.5rem 2rem 2.5rem;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(74,138,244,0.06) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.page-header .section-label { margin-bottom: 0.5rem; }

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-title .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  margin-top: 0.75rem;
  color: var(--text2);
  font-size: 1rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ===========================
   Section utilities
=========================== */
section { padding: 3.5rem 2rem; }
section.alt { background: var(--bg2); }
.container { max-width: 900px; margin: 0 auto; }

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

/* ===========================
   Timeline
=========================== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-dot {
  position: absolute;
  left: -2.37rem;
  top: 0.45rem;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(74,138,244,0.5);
}

.tcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color 0.2s;
}
.tcard:hover { border-color: var(--blue); }

.tcard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.tcard-title { font-size: 1rem; font-weight: 600; }

.tcard-date {
  font-size: 0.78rem;
  color: var(--blue);
  background: rgba(74,138,244,0.1);
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.tcard-org {
  font-size: 0.87rem;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.tcard-body {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.75;
}

.tcard-body ul { padding-left: 1.1rem; }
.tcard-body li { margin-bottom: 0.25rem; }

.tcard-quote {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--border);
  font-size: 0.83rem;
  color: var(--text3);
  font-style: italic;
  line-height: 1.6;
}

/* ===========================
   Tags
=========================== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.18rem 0.6rem;
  border-radius: 4px;
}

.tag-blue   { background: rgba(74,138,244,0.12); color: var(--blue); }
.tag-cyan   { background: rgba(34,211,238,0.1);  color: var(--cyan); }
.tag-green  { background: rgba(16,185,129,0.1);  color: var(--green); }
.tag-purple { background: rgba(167,139,250,0.1); color: var(--purple); }
.tag-gold   { background: rgba(245,158,11,0.1);  color: var(--gold); }

/* ===========================
   Skills grid
=========================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.skill-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.skill-block h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
  margin-bottom: 0.85rem;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  padding: 0.28rem 0.7rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.pill:hover { border-color: var(--blue); color: var(--blue); }

/* ===========================
   Languages
=========================== */
.lang-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.lang-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
}

.lang-chip .flag { font-size: 1.4rem; }
.lang-chip .lang-name { font-weight: 600; font-size: 0.92rem; }
.lang-chip .lang-level { font-size: 0.78rem; color: var(--text2); }

/* ===========================
   Project cards (tech)
=========================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--blue);
  color: var(--text);
  background: rgba(74,138,244,0.1);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.proj-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  opacity: 0;
  transform: translateY(16px);
}

.proj-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.proj-card:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.proj-card.hidden { display: none; }

.proj-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.proj-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.proj-date { font-size: 0.78rem; color: var(--text3); }
.proj-title { font-size: 0.98rem; font-weight: 600; }

.proj-desc {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.65;
  flex: 1;
}

.proj-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.proj-link {
  font-size: 0.82rem;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
}
.proj-link:hover { color: var(--cyan); }

.proj-org { font-size: 0.78rem; color: var(--text3); }

/* ===========================
   Creations page
=========================== */
.creation-section { margin-bottom: 3.5rem; }

.creation-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.creation-section-desc {
  font-size: 0.88rem;
  color: var(--text2);
  margin-bottom: 1.5rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.2s;
}

.gallery-item.visible {
  opacity: 1;
  transform: scale(1);
}

.gallery-item:hover {
  border-color: var(--blue);
  transform: scale(1.02);
}

.gallery-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Placeholder when no image */
.gallery-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text3);
  font-size: 2rem;
  border-bottom: 1px solid var(--border);
}

.gallery-img-placeholder span {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gallery-caption {
  padding: 0.75rem 1rem;
}

.gallery-caption-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.gallery-caption-desc {
  font-size: 0.78rem;
  color: var(--text2);
  line-height: 1.5;
}

/* ===========================
   Info/highlight box
=========================== */
.info-box {
  background: rgba(74,138,244,0.06);
  border: 1px solid rgba(74,138,244,0.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--text2);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.info-box .info-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }

/* ===========================
   Publication card
=========================== */
.pub-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pub-title { font-size: 0.98rem; font-weight: 600; font-style: italic; }
.pub-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--gold);
}

/* ===========================
   Contact
=========================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-item:hover {
  border-color: var(--blue);
  box-shadow: var(--glow);
}

.contact-icon { font-size: 1.4rem; flex-shrink: 0; }
.contact-label { font-size: 0.78rem; color: var(--text2); }
.contact-value { font-size: 0.9rem; font-weight: 500; word-break: break-all; }

/* ===========================
   Footer
=========================== */
footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text3);
  border-top: 1px solid var(--border);
}

/* ===========================
   Animations
=========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-inner > * {
  opacity: 0;
  animation: fadeUp 0.55s ease forwards;
}
.hero-inner > *:nth-child(1) { animation-delay: 0.08s; }
.hero-inner > *:nth-child(2) { animation-delay: 0.18s; }
.hero-inner > *:nth-child(3) { animation-delay: 0.28s; }
.hero-inner > *:nth-child(4) { animation-delay: 0.36s; }
.hero-inner > *:nth-child(5) { animation-delay: 0.44s; }
.hero-inner > *:nth-child(6) { animation-delay: 0.52s; }

/* ===========================
   Responsive
=========================== */
@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: rgba(6,12,26,0.97);
    backdrop-filter: blur(16px);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
  }
  .nav-hamburger { display: flex; }
  section { padding: 2.5rem 1.25rem; }
  .timeline { padding-left: 1.5rem; }
  .timeline-dot { left: -1.9rem; }
  .hero { padding: 2rem 1.25rem; }
  .page-header { padding: 2.5rem 1.25rem 2rem; }
}
