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

:root {
  --bg:        #0b0f14;
  --surface:   #111820;
  --surface2:  #161e28;
  --border:    #1e2d3d;
  --border2:   #243040;
  --text:      #c8d6e5;
  --muted:     #5a7a99;
  --label:     #3a8fc7;
  --green:     #00d96f;
  --green-dim: #00a854;
  --red:       #ff4d6a;
  --cyan:      #00c8d4;
  --amber:     #f0b429;
  --font-mono: 'Courier New', 'Lucida Console', monospace;
  --font-sans: 'Segoe UI', system-ui, sans-serif;
  --sidebar-w: 56px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  z-index: 100;
  gap: 4px;
}

.sidebar-logo {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 14px;
  color: var(--bg);
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.nav-item {
  width: 36px; height: 36px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  font-size: 15px;
}
.nav-item:hover, .nav-item.active {
  background: var(--surface2);
  color: var(--green);
}
.nav-item.active { color: var(--green); }

.nav-spacer { flex: 1; }

/* ─── Main ─── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

/* ─── Page header strip ─── */
.page-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.page-header-left { display: flex; flex-direction: column; gap: 2px; }
.page-title { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: #fff; }
.page-subtitle { font-size: 11px; color: var(--muted); }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  display: inline-block;
  margin-right: 8px;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.page-header-right {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

/* ─── Content ─── */
.content {
  padding: 32px;
  max-width: 1100px;
}

/* ─── Section wrappers ─── */
section { margin-bottom: 48px; }

.section-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--label);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 200px;
}

/* ─── Hero / About ─── */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
}

.hero-name {
  font-size: 32pt;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  line-height: 1.2;
}

.hero-name span { color: var(--green); }

.hero-role {
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 8px 0 16px;
}

.hero-bio {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
  max-width: 600px;
}

.hero-bio p + p { margin-top: 12px; }

.hero-links {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 7px 16px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--green); color: var(--green); }
.btn-primary { border-color: var(--green); color: var(--green); }
.btn-primary:hover { background: var(--green); color: var(--bg); }

/* ─── Stat cards ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}

.stat-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}

.stat-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

/* ─── Card ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}

.card-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-green { background: rgba(0,217,111,0.15); color: var(--green); border: 1px solid rgba(0,217,111,0.3); }
.badge-cyan  { background: rgba(0,200,212,0.12); color: var(--cyan);  border: 1px solid rgba(0,200,212,0.25); }
.badge-amber { background: rgba(240,180,41,0.12); color: var(--amber); border: 1px solid rgba(240,180,41,0.25); }
.badge-muted { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

.card-body { padding: 18px; }

/* ─── Project grid ─── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
  cursor: pointer;
}
.project-card:hover { border-color: var(--green); }

.project-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s;
}
.project-card:hover .project-thumb img { transform: scale(1.03); }

.project-thumb-placeholder {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  text-align: center;
  padding: 16px;
}

.project-thumb-placeholder .icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.4;
}

.project-meta { padding: 14px 16px 16px; }

.project-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.project-desc {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.project-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.project-link {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.project-link:hover { color: var(--green); }
.project-link + .project-link::before { content: '·'; margin-right: 10px; }

/* ─── Screenshot gallery ─── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.gallery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}
.gallery-item:hover { border-color: var(--cyan); }

.gallery-item img {
  width: 100%;
  display: block;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
}

.gallery-item-label {
  padding: 8px 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.gallery-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.gallery-placeholder span { font-size: 22px; opacity: 0.3; }
.gallery-placeholder small { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

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

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}

.skill-group-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
  margin-bottom: 12px;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.skill-name {
  font-size: 11px;
  color: var(--text);
}

.skill-bar-wrap {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.skill-bar { height: 100%; border-radius: 2px; background: var(--green); }
.skill-bar.cyan { background: var(--cyan); }
.skill-bar.amber { background: var(--amber); }

/* ─── Timeline / Experience ─── */
.timeline { display: flex; flex-direction: column; gap: 2px; }

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-date {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-top: 2px;
  line-height: 1.4;
}

.timeline-body-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}

.timeline-body-org {
  font-size: 11px;
  color: var(--cyan);
  margin: 2px 0 6px;
}

.timeline-body-desc {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}

/* ─── Contact ─── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-card:hover { border-color: var(--green); background: var(--surface2); }

.contact-card-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-card-value {
  font-size: 12px;
  color: var(--green);
}

/* ─── Inline HTML embed area ─── */
.embed-area {
  background: var(--surface2);
  border: 1px dashed var(--border2);
  border-radius: 6px;
  padding: 24px;
  min-height: 80px;
}

.embed-area-hint {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ─── Lightbox ─── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }

.lightbox-inner {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.lightbox-inner img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 4px;
  border: 1px solid var(--border2);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -36px;
  right: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: color 0.15s;
}
.lightbox-close:hover { color: #fff; }

.lightbox-caption {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  letter-spacing: 0.08em;
}

/* ─── Project Modals ─── */
.project-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.project-modal.open { display: flex; }

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}

.project-modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.project-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-top: 6px;
}

.project-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.project-modal-close:hover { color: #fff; }

.project-modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-modal-section-title {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
  margin-bottom: 10px;
}

.project-modal-desc {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  line-height: 1.75;
}

.project-modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.project-modal-images img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: border-color 0.15s;
  display: block;
}
.project-modal-images img:hover { border-color: var(--cyan); }

.project-modal-img-placeholder {
  aspect-ratio: 16/9;
  background: var(--surface2);
  border: 1px dashed var(--border2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.project-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── Rule ─── */
hr { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.footer span { color: var(--green); }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .content { padding: 20px 16px; }
  .page-header { padding: 10px 16px; }
  .hero { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
}
