/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0f;
  --surface:   #11111a;
  --surface2:  #18182a;
  --border:    rgba(180, 140, 255, 0.12);
  --border-hi: rgba(180, 140, 255, 0.45);
  --glow:      rgba(142, 107, 255, 0.18);
  --glow-hi:   rgba(142, 107, 255, 0.55);
  --accent:    #a78bfa;
  --accent2:   #7dd3fc;
  --text:      #e8e8f0;
  --muted:     #8888a8;
  --sidebar-w: 280px;
  --radius:    10px;
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Noise Texture Overlay ────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* ─── Splash Screen ─────────────────────────────────────────── */
#splash {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 80% 90%, #4c1d95 0%, #1e1040 35%, #0a0a0f 65%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#splash.hidden {
  opacity: 0;
  pointer-events: none;
}

#splash-text {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 400;
  color: #f0e8ff;
  opacity: 0;
  transition: opacity 0.2s ease;
  letter-spacing: 0.02em;
}

#splash-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 2.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Layout ────────────────────────────────────────────────── */
#main-content {
  display: none;
  min-height: 100vh;
}

#splash.hidden + #main-content { display: flex; }

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 1.5rem;
  z-index: 100;
  overflow: hidden;
  box-sizing: border-box;
}



.sidebar-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-hi);
  margin-bottom: 1.2rem;
  box-shadow: 0 0 24px var(--glow);
}

.sidebar-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--border-hi);
  margin-bottom: 0.9rem;
  box-shadow: 0 0 24px var(--glow);
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.sidebar h1 {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}

.sidebar-role {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent);
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.sidebar-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: 1rem;
}

nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
  position: relative;
}

nav a .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

nav a:hover, nav a.active {
  color: var(--text);
  background: var(--surface2);
}

nav a:hover .nav-icon, nav a.active .nav-icon { opacity: 1; }

nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.sidebar-socials {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.sidebar-socials a {
  color: var(--muted);
  transition: color 0.2s;
  display: flex;
}
.sidebar-socials a:hover { color: var(--accent); }

/* ─── Page Body ─────────────────────────────────────────────── */
.page-body {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 95% 100%, rgba(76,29,149,0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 5% 0%, rgba(125,211,252,0.08) 0%, transparent 45%),
    var(--bg);
  padding: 3rem 3rem 4rem;
}

/* ─── Page Header ───────────────────────────────────────────── */
.page-header {
  margin-bottom: 3rem;
  animation: fadeUp 0.5s ease both;
}

.page-header .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.page-header h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.15;
}

.page-header p {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1rem;
  max-width: 520px;
  line-height: 1.65;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

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

/* ─── Stat Cards (Home) ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  animation: fadeUp 0.5s 0.1s ease both;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.stat-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 30px var(--glow);
  transform: translateY(-3px);
}

.stat-number {
  font-family: var(--font-head);
  font-size: 2.8rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Two-col content grid ──────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  animation: fadeUp 0.5s 0.2s ease both;
}

.content-grid .card.wide { grid-column: 1 / -1; }

/* ─── Section Titles ────────────────────────────────────────── */
.section-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── About Me card text ────────────────────────────────────── */
.about-text p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0.9rem;
}
.about-text p:last-child { margin-bottom: 0; }

/* ─── Projects Page ─────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  animation: fadeUp 0.5s 0.1s ease both;
}

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

.project-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 32px var(--glow);
  transform: translateY(-4px);
}

.project-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
}

.project-card h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
}

.project-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.project-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}
.status-dot.wip { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }

.project-arrow {
  color: var(--muted);
  transition: color 0.2s, transform 0.2s;
}
.project-card:hover .project-arrow { color: var(--accent); transform: translateX(3px); }

/* ─── About Page ────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  animation: fadeUp 0.5s 0.1s ease both;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.3rem 0.75rem;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, color 0.2s;
}

.skill-tag:hover { border-color: var(--accent); color: var(--accent); }

.timeline { display: flex; flex-direction: column; gap: 1.2rem; }

.timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  align-items: start;
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  padding-top: 0.15rem;
  letter-spacing: 0.05em;
}

.timeline-content h4 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.timeline-content p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.cert-list { display: flex; flex-direction: column; gap: 0.75rem; }

.cert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.cert-item:hover { border-color: var(--border-hi); }

.cert-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(142,107,255,0.3), rgba(125,211,252,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.cert-info h4 { font-size: 0.9rem; color: var(--text); margin-bottom: 0.1rem; }
.cert-info p { font-size: 0.78rem; color: var(--muted); }

/* ─── Contact Page ──────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  animation: fadeUp 0.5s 0.1s ease both;
}

.contact-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-group input,
.form-group textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.1);
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(142,107,255,0.8), rgba(125,211,252,0.5));
  border: 1px solid rgba(167,139,250,0.4);
  border-radius: 7px;
  padding: 0.75rem 1.5rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.2s;
  align-self: flex-start;
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 0 20px rgba(142,107,255,0.4);
  transform: translateY(-1px);
}

.contact-methods { display: flex; flex-direction: column; gap: 0.75rem; }

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

.contact-method:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 20px var(--glow);
}

.contact-method-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(142,107,255,0.2), rgba(125,211,252,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-method-info h4 { font-size: 0.9rem; color: var(--text); margin-bottom: 0.15rem; }
.contact-method-info p { font-size: 0.8rem; color: var(--muted); }

/* ─── Availability Badge ────────────────────────────────────── */
.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: #4ade80;
  margin-top: 0.75rem;
}

.avail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  animation: pulse 2s infinite;
}

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

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

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(180,140,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(180,140,255,0.3); }

/* Mobile footer — hidden on desktop */
.mobile-footer { display: none; }

/* Mobile topbar — hidden on desktop */
.mobile-topbar { display: none; }

/* ─── Mobile ────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Fix main-content layout for mobile */
  #main-content {
    flex-direction: column;
  }

  /* Hide desktop sidebar entirely */
  .sidebar { display: none; }

  /* Page body takes full width */
  .page-body {
    margin-left: 0;
    padding: 0;
    min-height: 100vh;
  }

  /* Fixed top bar */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 300;
    background: rgba(17, 17, 26, 0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.25rem;
  }

  .mobile-topbar-name {
    font-family: var(--font-head);
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: 0.01em;
  }

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

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

  .hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--accent);
  }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--accent);
  }

  /* Drawer overlay */
  .drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 400;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .drawer-overlay.open { display: block; opacity: 1; }

  /* Slide-in drawer */
  .mobile-drawer {
    position: fixed;
    top: 0; left: 0;
    width: 75vw;
    max-width: 300px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 500;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-sizing: border-box;
  }
  .mobile-drawer.open { transform: translateX(0); }

  .drawer-name {
    font-family: var(--font-head);
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 0.2rem;
  }

  .drawer-role {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
  }

  .drawer-divider {
    width: 100%; height: 1px;
    background: var(--border);
    margin-bottom: 1.25rem;
  }

  .drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .drawer-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
    position: relative;
  }

  .drawer-nav a .nav-icon {
    width: 18px; height: 18px;
    opacity: 0.6; flex-shrink: 0;
    transition: opacity 0.2s;
  }

  .drawer-nav a:hover,
  .drawer-nav a.active {
    color: var(--text);
    background: var(--surface2);
  }

  .drawer-nav a.active .nav-icon { opacity: 1; }

  .drawer-nav a.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%;
    height: 60%; width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
  }

  .drawer-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
  }

  .drawer-socials {
    display: flex;
    gap: 1.25rem;
    align-items: center;
  }

  .drawer-socials a {
    color: var(--muted);
    transition: color 0.2s;
    display: flex;
  }
  .drawer-socials a:hover { color: var(--accent); }

  .drawer-hub-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: color 0.2s, border-color 0.2s;
    width: 100%;
  }
  .drawer-hub-back:hover { color: var(--accent); border-color: var(--accent); }
  .drawer-hub-back svg { transition: transform 0.2s; }
  .drawer-hub-back:hover svg { transform: translateX(-2px); }

  /* Page content padding */
  .page-content-inner { padding: 1.5rem 1.1rem 3rem; }

  .page-header { margin-bottom: 1.5rem; }
  .page-header h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .page-header p { font-size: 0.92rem; }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.25rem;
  }

  .stat-card { padding: 1rem 0.5rem; }
  .stat-number { font-size: 1.9rem; }
  .stat-label { font-size: 0.62rem; }

  .content-grid,
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .content-grid .card.wide { grid-column: 1; }
  .projects-grid { grid-template-columns: 1fr; }

  .timeline-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .timeline-year { font-size: 0.7rem; padding-top: 0; }

  .card { padding: 1.25rem; }
  .project-card { padding: 1.25rem; }
}

@media (max-width: 400px) {
  .page-content-inner { padding: 1.25rem 0.9rem 3rem; }
  .mobile-topbar-name { font-size: 0.95rem; }
}
