/* ── CSS Variables ── */
:root {
  --bg:         #0a0e14;
  --surface:    #111820;
  --surface2:   #162028;
  --cyan:       #00e5ff;
  --cyan-dim:   #00b4cc;
  --text:       #e8f4f8;
  --text-muted: #8fb3bf;
  --border:     #1e3a40;
  --sidebar-w:  56px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Exo 2', system-ui, sans-serif;
  display: flex;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 229, 255, 0.018) 2px,
    rgba(0, 229, 255, 0.018) 3px
  );
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-dim); }

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

.sidebar-brand {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  width: 100%;
  display: flex;
  justify-content: center;
}

.sidebar-brand .initials {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(0,229,255,0.5);
}

#sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  width: 100%;
}

#sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 1rem;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

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

#sidebar nav a.active {
  border-left: 2px solid var(--cyan);
  box-shadow: inset 0 0 14px rgba(0, 229, 255, 0.12);
}

/* Tooltip on hover */
#sidebar nav a::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
}

#sidebar nav a:hover::after {
  opacity: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ── Mobile top bar ── */
#topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  height: 52px;
  align-items: center;
  padding: 0 1rem;
  justify-content: space-between;
}

#topbar .name { font-weight: 700; color: var(--cyan); font-size: 1rem; }

#burger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

#burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Offcanvas nav (mobile) ── */
#mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
}

#mobile-nav.open { display: flex; }

#mobile-nav .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

#mobile-nav .panel {
  position: relative;
  width: 220px;
  background: var(--surface);
  height: 100%;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow-y: auto;
}

#mobile-nav .panel a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

#mobile-nav .panel a:hover { background: var(--surface2); color: var(--cyan); }

/* ── Main Content ── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 3rem 2.5rem;
  max-width: 960px;
  margin-right: auto;
  margin-left: max(var(--sidebar-w), calc(var(--sidebar-w) + (100vw - var(--sidebar-w) - 960px) / 2));
}

section {
  margin-bottom: 4rem;
  scroll-margin-top: 2rem;
}

section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--cyan-dim);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
  box-shadow: 0 1px 0 0 rgba(0, 229, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ── About ── */
.about-name {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.6), 0 0 40px rgba(0, 229, 255, 0.25);
}

.about-title {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0.4rem 0 1rem;
}

.about-title::after {
  content: '|';
  color: var(--cyan);
  margin-left: 3px;
  animation: blink 1s step-start infinite;
}

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

.about-bio { line-height: 1.75; color: var(--text-muted); }

/* ── Stat strip ── */
.stat-strip {
  display: flex;
  justify-content: space-between;
  margin-top: 1.75rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, var(--surface) 0%, #0d1a22 100%);
  border: 1px solid var(--border);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.stat-strip .stat {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.stat-strip .stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
  text-shadow: 0 0 10px rgba(0,229,255,0.4);
  white-space: nowrap;
}

.stat-strip .stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.c-card {
  background: linear-gradient(135deg, var(--surface) 0%, #0d1a22 100%);
  border: 1px solid var(--border);
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.c-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(0,229,255,0.12), inset 0 0 30px rgba(0,229,255,0.03);
}

.c-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.c-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Timeline ── */
.timeline { position: relative; padding-left: 1.5rem; }

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

.tl-item {
  position: relative;
  margin-bottom: 2rem;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: calc(-1.5rem - 4px);
  top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0,229,255,0.5);
}

.tl-period {
  font-size: 0.72rem;
  color: var(--cyan-dim);
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.tl-role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.tl-company {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.tl-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Skills ── */
.skill-group { margin-bottom: 1.1rem; }

.skill-group-label {
  font-size: 0.72rem;
  color: var(--cyan-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.badge-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.badge-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
}

/* ── Open Source ── */
.os-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.os-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.os-card p  { font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; }

/* ── Contact ── */
.contact-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.contact-list li { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.contact-list .label { color: var(--text-muted); min-width: 80px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar  { display: none; }
  #topbar   { display: flex; }
  #main     { margin-left: 0; padding: 5rem 1.25rem 2rem; }
  .about-name { font-size: 1.7rem; }
}
