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

:root {
  --bg: #0d0d0d;
  --sidebar: #111;
  --border: #222;
  --surface: #181818;
  --accent: #c8f542;
  --text: #e4e4e4;
  --muted: #a1a1a1;
  --sw: 220px;
}

html, body { height: 100%; overflow: auto; background: var(--bg); color: var(--text); font-family: 'DM Mono', monospace; }

.shell { display: flex; height: 100vh; }

/* ── sidebar ── */
aside {
  width: var(--sw);
  min-width: var(--sw);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .av {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.brand .text-group {
  display: flex;
  flex-direction: column;
}

.brand h1 { font-family: 'DM Serif Display', serif; font-size: 15px; font-weight: 400; color: var(--text); line-height: 1.3; margin: 0; }
.brand p  { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0; }

nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #bbb;
  padding: 14px 10px 5px;
  opacity: 0.85;
}

.nav-row {
  display: flex;
  align-items: center;
  border-radius: 5px;
  margin-bottom: 1px;
  transition: background 0.12s;
}
.nav-row:hover { background: #1d1d1d; }
.nav-row.active { background: rgba(200,245,66,0.07); }

.nav-row .main-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.03em;
  transition: color 0.12s, background 0.12s;
  min-width: 0;
}
.nav-row.active .main-btn { color: var(--accent); }
.nav-row:not(.active) .main-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-row .main-btn .nb-icon { font-size: 14px; flex-shrink: 0; }
.nav-row .main-btn .nb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.info-btn {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: 4px;
  color: #303030;
  font-size: 13px;
  cursor: pointer;
  margin-right: 5px;
  transition: color 0.12s, background 0.12s;
  font-family: 'DM Mono', monospace;
  line-height: 1;
}
.info-btn:hover { color: var(--text); background: #2a2a2a; }
.nav-row.active .info-btn { color: #444; }
.nav-row.active .info-btn:hover { color: var(--accent); background: rgba(200,245,66,0.08); }

/* ── mobile sidebar toggle ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: opacity 0.15s;
}
.sidebar-toggle:hover { opacity: 0.85; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}

@media (max-width: 640px) {
  .sidebar-toggle { display: flex; }

  aside {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  aside.open {
    transform: translateX(0);
  }
}


/* ── main ── */
main { flex: 1; display: flex; position: relative; overflow: hidden; }

.page { position: absolute; inset: 0; display: none; width: 100%; height: 100%; }
.page.active { display: flex; flex-direction: column; width: 100%; height: 100%; animation: fadeUp 0.2s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* home */
.home-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: clamp(2px, 5vw, 64px);
  overflow-y: auto;
}

/* Custom scrollbar for main content */
.home-wrap::-webkit-scrollbar {
  width: 6px;
}
.home-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.home-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
.home-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
.home-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.home-inner { max-width: 560px; }
.home-inner .ey {
  font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px;
}
.home-inner h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(36px, 4.5vw, 58px);
  font-weight: 400; line-height: 1.1; margin-bottom: 22px;
}
.home-inner h2 em { font-style: italic; color: var(--accent); }
.home-inner .bio {
  font-size: 12.5px; line-height: 1.85; color: #888; margin-bottom: 34px;
}
.btn-p {
  padding: 9px 22px; background: var(--accent); color: #000;
  border: none; border-radius: 4px; font-family: 'DM Mono', monospace;
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; cursor: pointer; transition: opacity 0.15s;
}
.btn-p:hover { opacity: 0.82; }

.browse-wrap { position: relative; display: inline-block; }

.dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  scrollbar-width: none;
}
.dropdown.open { display: block; }
.dropdown::-webkit-scrollbar { display: none; }

.drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  transition: background 0.1s;
}
.drop-item:hover { background: #1d1d1d; }
.drop-icon { font-size: 13px; flex-shrink: 0; }
.drop-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.social-buttons {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

@media (max-width: 320px) {
  .social-buttons{
    display:block;
  }
}

.btn-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: rgba(200, 245, 66, 0.12);
  color: #e4e4e4;
  border: 1px solid rgba(200, 245, 66, 0.2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-social:hover {
  background: rgba(200, 245, 66, 0.22);
  border-color: rgba(200, 245, 66, 0.35);
  color: #000;
}

/* project shadow host fills the page */
.project-frame-host { flex: 1; display: flex; overflow: hidden; width: 100%; height: 100%; }
.project-frame-host iframe { flex: 1; width: 100%; height: 100%; border: none; display: block; }

/* ── modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 28px 30px;
  width: 600px;
  max-width: 90vw;
  transform: translateY(10px);
  transition: transform 0.18s;
  position: relative;
  max-height: calc(100vh - 80px); /* viewport minus breathing room */
  display: flex;
  flex-direction: column;
}
.modal-backdrop.open .modal { transform: translateY(0); }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 3px 7px;
  border-radius: 3px; transition: color 0.12s, background 0.12s;
  font-family: 'DM Mono', monospace;
}
.modal-close:hover { color: var(--text); background: #222; }

.modal-emoji { font-size: 26px; margin-bottom: 12px; }
.modal h3 { font-family: 'DM Serif Display', serif; font-size: 20px; font-weight: 400; margin-bottom: 4px; color: var(--text); }
.modal-tag { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.modal p { font-size: 12px; line-height: 1.75; color: #888; margin-bottom: 18px; }
.modal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.modal-chip {
  font-size: 10px; background: #1e1e1e; border: 1px solid #2e2e2e;
  border-radius: 3px; padding: 3px 9px; color: var(--muted); letter-spacing: 0.04em;
}

#modal-readme {
  max-height: 400px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
  color: #ccc;
}

#modal-readme h1, #modal-readme h2, #modal-readme h3 {
  color: var(--text);
  margin-top: 20px;
  margin-bottom: 10px;
}

#modal-readme h1 { font-size: 18px; }
#modal-readme h2 { font-size: 16px; }
#modal-readme h3 { font-size: 14px; }

#modal-readme p { margin-bottom: 12px; }

#modal-readme code {
  background: #1e1e1e;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
}

#modal-readme pre {
  background: #1e1e1e;
  padding: 12px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 12px 0;
}

#modal-readme pre code {
  background: none;
  padding: 0;
}

#modal-readme ul, #modal-readme ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

#modal-readme li { margin-bottom: 4px; }

#modal-readme blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 12px 0;
  color: #aaa;
}

#modal-readme table {
  border-collapse: collapse;
  margin: 12px 0;
  width: 100%;
}

#modal-readme th, #modal-readme td {
  border: 1px solid #2e2e2e;
  padding: 6px 8px;
  text-align: left;
}

#modal-readme th {
  background: #1e1e1e;
  color: var(--text);
}

#modal-readme a {
  color: var(--accent);
  text-decoration: none;
}

#modal-readme a:hover {
  text-decoration: underline;
}

/* Custom scrollbar for modal-readme */
#modal-readme::-webkit-scrollbar {
  width: 6px;
}

#modal-readme::-webkit-scrollbar-track {
  background: #161616;
}

#modal-readme::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 3px;
}

#modal-readme::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}
