:root {
  --bg: #05070d;
  --bg-alt: #0a0f1a;
  --panel: rgba(18, 26, 41, 0.65);
  --border: rgba(0, 229, 255, 0.18);
  --accent: #00e5ff;
  --accent-2: #7c5cff;
  --accent-warm: #ff8a3d;
  --text: #e6f1ff;
  --text-dim: #8ea3bd;
  --sidebar-width: 380px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.6;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.55;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

.pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

/* LAYOUT */
.layout {
  display: flex;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 3rem 2.5rem;
}
.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sidebar-eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.sidebar-name {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
}
.sidebar-role {
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  background: linear-gradient(120deg, var(--text) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1.2rem;
}
.sidebar-desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  max-width: 320px;
}

.sidebar-nav ul { list-style: none; }
.sidebar-nav li { margin-bottom: 0.9rem; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.25s;
}
.nav-line {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--text-dim);
  transition: width 0.25s, background 0.25s;
}
.sidebar-nav a:hover, .sidebar-nav a.active { color: var(--accent); }
.sidebar-nav a:hover .nav-line, .sidebar-nav a.active .nav-line { width: 42px; background: var(--accent); }

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

.sidebar-socials {
  display: flex;
  gap: 1.4rem;
}
.sidebar-socials a {
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  transition: color 0.25s;
}
.sidebar-socials a:hover { color: var(--accent); }

.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.25s;
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-option { transition: color 0.25s; }
.lang-option.active { color: var(--accent); font-weight: 700; }
.lang-sep { opacity: 0.4; }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 3rem 3rem 1rem;
}

.btn {
  padding: 0.85rem 1.8rem;
  border-radius: 6px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: all 0.25s;
  display: inline-block;
}
.btn-primary {
  background: var(--accent);
  color: #04121a;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 0 32px rgba(0, 229, 255, 0.6); transform: translateY(-2px); }

/* SECTIONS */
.section {
  padding: 4.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.section:last-of-type { border-bottom: none; }
.section-head { margin-bottom: 2.5rem; }
.section-tag {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 3px;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0.6rem 0;
}
.section-sub { color: var(--text-dim); max-width: 640px; }

.about-text { color: var(--text-dim); margin-bottom: 1.2rem; font-size: 1.02rem; max-width: 680px; }
.about-text strong { color: var(--text); }

/* TIMELINE (EXPERIENCE) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  margin-bottom: 1.5rem;
}
.timeline-item {
  border-left: 2px solid var(--border);
  padding-left: 1.4rem;
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.timeline-period {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}
.timeline-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}
.timeline-org {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.9rem;
}
.education-line {
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* PROJECT GRID */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
}
.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.3s, border-color 0.3s;
  backdrop-filter: blur(8px);
}
.project-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.project-card-media { aspect-ratio: 16/10; overflow: hidden; }
.project-card-media img { width: 100%; height: 100%; object-fit: cover; }
.project-card-body { padding: 1.4rem; }
.project-card-body h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.project-card-body p { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 1rem; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--accent);
}

.project-card-placeholder {
  border-style: dashed;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.project-card-placeholder .project-card-body { text-align: center; }
.project-card-placeholder h3 { color: var(--text-dim); }
.project-card-placeholder p { font-size: 0.82rem; }

/* CASE STUDY */
.case-study { padding-top: 2rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 4rem;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, transform 0.3s;
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.stat-number {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}
.stat-label { color: var(--text-dim); font-size: 0.82rem; margin-top: 0.5rem; }

.showcase-block {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 4rem;
}
.showcase-block.reverse { grid-template-columns: 1.3fr 1fr; }
.showcase-block.reverse .showcase-text { order: 2; }
.showcase-block.reverse .showcase-media { order: 1; }
.showcase-text h3 { font-size: 1.35rem; margin-bottom: 1rem; color: var(--text); }
.showcase-text p { color: var(--text-dim); margin-bottom: 1rem; font-size: 0.95rem; }
.feature-list { list-style: none; }
.feature-list li {
  color: var(--text-dim);
  font-size: 0.88rem;
  padding-left: 1.4rem;
  position: relative;
  margin-bottom: 0.5rem;
}
.feature-list li::before {
  content: "▹";
  color: var(--accent);
  position: absolute;
  left: 0;
}
.showcase-media {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.08);
}
.showcase-media img { width: 100%; display: block; }

.dnbr-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.dnbr-gallery img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.disclaimer {
  font-size: 0.8rem;
  color: var(--text-dim);
  border-left: 2px solid var(--accent-warm);
  padding-left: 1rem;
  font-style: italic;
  margin-bottom: 2rem;
}

.back-to-projects {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.back-to-projects:hover { text-decoration: underline; }

/* STACK GRID */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}
.stack-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
  transition: transform 0.3s, border-color 0.3s;
}
.stack-card:hover { transform: translateY(-4px); border-color: var(--accent-2); }
.stack-icon { font-size: 1.8rem; }
.stack-card h4 { margin: 0.7rem 0 0.4rem; }
.stack-card p { color: var(--text-dim); font-size: 0.88rem; }

/* CONTACT */
.contact-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
}
.contact-box p { color: var(--text-dim); margin-bottom: 1.5rem; }

.footer {
  text-align: center;
  padding: 2.5rem 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 2rem 1.5rem 1rem;
  }
  .sidebar-inner { gap: 2rem; }
  .sidebar-nav { display: none; }
  .main-content { padding: 1rem 1.5rem 2rem; }
  .showcase-block, .showcase-block.reverse {
    grid-template-columns: 1fr;
  }
  .showcase-block.reverse .showcase-text,
  .showcase-block.reverse .showcase-media { order: initial; }
}
