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

:root {
  --pink: #e07090;
  --green: #5aaa6a;
  --heading: #8b3a5a;
  --body: #4a3a42;
  --muted: #a09098;
  --pixel-label: #b05a7a;
  --pixel-label2: #c07090;
  --frosted-bg: rgba(255,255,255,0.42);
  --frosted-border: rgba(255,255,255,0.68);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: var(--body);
  line-height: 1.7;
}

body {
  background: linear-gradient(135deg, #a8e6a3 0%, #c9e8c5 25%, #e8ddd5 50%, #f2c4ce 75%, #f4a8b8 100%);
  display: flex;
  flex-direction: column;
}

/* ── SPARKLES ── */
.sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.sparkle {
  position: absolute;
  color: white;
  font-size: 14px;
  opacity: 0.6;
  user-select: none;
}

/* ── TOP BAR ── */
#topbar {
  position: relative;
  z-index: 100;
  width: 100%;
  height: 34px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  flex-shrink: 0;
}
#topbar-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--pixel-label);
  letter-spacing: 0.5px;
}
#topbar-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--muted);
  border: 1px solid rgba(160,144,152,0.35);
  padding: 3px 7px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
#topbar-btns {
  display: flex;
  gap: 4px;
}
.tb-btn {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(160,144,152,0.5);
  background: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  color: var(--muted);
  cursor: default;
  user-select: none;
  flex-shrink: 0;
}

/* ── MAIN LAYOUT ── */
#layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ── SIDEBAR ── */
#sidebar {
  width: 270px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.42);
  backdrop-filter: blur(12px);
  border-right: 2px solid rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 10;
}
#sidebar-header {
  padding: 16px 14px 14px;
  border-bottom: 2px solid rgba(255,255,255,0.55);
  flex-shrink: 0;
}
#sidebar-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--pixel-label);
  line-height: 1.7;
  margin-bottom: 7px;
}
#sidebar-sub {
  font-style: italic;
  font-size: 12px;
  color: #7a6b72;
  line-height: 1.5;
}
#sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(224,112,144,0.4) transparent;
}
#sidebar-nav::-webkit-scrollbar { width: 4px; }
#sidebar-nav::-webkit-scrollbar-track { background: transparent; }
#sidebar-nav::-webkit-scrollbar-thumb { background: rgba(224,112,144,0.35); border-radius: 2px; }

.nav-section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--pixel-label2);
  padding: 12px 14px 5px;
  letter-spacing: 0.5px;
  display: block;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: #5a4a52;
  border-left: 3px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  position: relative;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.5);
  border-left-color: var(--pink);
  color: #3a2a32;
}
.nav-item svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}
.nav-item-label { flex: 1; }

/* archive dropdown */
.nav-dropdown-body {
  display: none;
  background: rgba(255,255,255,0.25);
}
.nav-dropdown-body.open { display: block; }
.nav-sub-item {
  display: flex;
  align-items: center;
  padding: 6px 12px 6px 46px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-sub-item:hover { background: rgba(255,255,255,0.4); color: #5a4a52; }
.nav-arrow {
  font-size: 8px;
  color: var(--muted);
  transition: transform 0.2s;
  margin-left: 2px;
}
.nav-arrow.open { transform: rotate(90deg); }

/* ── MAIN AREA ── */
#main {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 12px;
}

/* ── PANELS ── */
.panel {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  width: calc(100% - 24px);
  height: 480px;
  background: var(--frosted-bg);
  backdrop-filter: blur(10px);
  border: 2px solid var(--frosted-border);
  flex-direction: column;
  user-select: none;
}
.panel.open { display: flex; }

/* pixel corners */
.panel::before, .panel::after,
.panel .pixel-corner-bl, .panel .pixel-corner-br {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  background: white;
  z-index: 2;
}
.panel::before { top: -2px; left: -2px; }
.panel::after  { top: -2px; right: -2px; }
.panel .pixel-corner-bl { bottom: -2px; left: -2px; }
.panel .pixel-corner-br { bottom: -2px; right: -2px; }

.panel-titlebar {
  height: 26px;
  background: rgba(255,255,255,0.55);
  border-bottom: 2px solid rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  cursor: grab;
  flex-shrink: 0;
  z-index: 1;
}
.panel-titlebar:active { cursor: grabbing; }
.panel-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--pixel-label);
  letter-spacing: 0.4px;
}
.panel-close {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(200,150,170,0.6);
  background: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s, border-color 0.1s;
}
.panel-close:hover { background: rgba(255,200,210,0.7); border-color: var(--pink); color: var(--heading); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(224,112,144,0.3) transparent;
}
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: rgba(224,112,144,0.3); border-radius: 2px; }

.panel-resize {
  height: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 3px;
  border-top: 1px dashed rgba(160,144,152,0.35);
  user-select: none;
}

/* ── PANEL CONTENT TYPOGRAPHY ── */
.panel-heading {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--heading);
  margin-bottom: 3px;
  line-height: 1.3;
}
.panel-heading-large {
  font-size: 22px;
}
.panel-date {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--muted);
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}
.panel-date-spaced {
  margin-bottom: 14px;
}
.section-heading {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--pixel-label2);
  margin: 14px 0 7px;
  letter-spacing: 0.5px;
}
.bullet {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--body);
}
.bullet-dash { color: var(--pixel-label2); flex-shrink: 0; }
.dashed-divider {
  border: none;
  border-top: 1px dashed rgba(160,144,152,0.45);
  margin: 14px 0;
}
.panel-hint {
  font-style: italic;
  font-size: 11px;
  color: var(--muted);
}
.panel-note-date {
  font-style: italic;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
  opacity: 0.85;
}
.profile-photo {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  object-fit: cover;
}
.body-copy-tight {
  font-size: 12px;
  line-height: 1.75;
  color: var(--body);
}
.body-copy-compact {
  font-size: 13px;
  margin-bottom: 4px;
}
.panel-link-group {
  margin-top: 10px;
}
.pixel-btn {
  display: inline-block;
  padding: 5px 11px;
  margin: 3px 3px 0 0;
  font-size: 12px;
  color: #7a3a5a;
  background: rgba(255,255,255,0.6);
  border: 2px solid rgba(200,150,170,0.6);
  cursor: pointer;
  font-family: sans-serif;
  border-radius: 0;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}
.pixel-btn:hover {
  background: rgba(255,255,255,0.85);
  border-color: var(--pink);
}
.pixel-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: var(--pixel-label2);
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(192,112,144,0.4);
  padding: 3px 7px;
  display: inline-block;
  margin-bottom: 8px;
}
.project-placeholder {
  background: rgba(255,255,255,0.35);
  border: 1px dashed rgba(200,150,170,0.4);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin: 6px 0;
}
.work-section-intro {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.65;
}
.work-entry { margin-bottom: 10px; }
.work-entry-link {
  padding-left: 18px;
  margin-top: 3px;
}
.work-entry-link a {
  font-size: 11px;
  color: var(--pink);
  text-decoration: none;
  border-bottom: 1px solid rgba(224,112,144,0.35);
  transition: border-color 0.1s;
}
.work-entry-link a:hover { border-bottom-color: var(--pink); }
.work-video {
  display: block;
  max-width: 320px;
  width: 100%;
  margin: 8px auto 0;
  border: 1px solid rgba(200,150,170,0.35);
  border-radius: 3px;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  html, body { overflow: auto; }
  #layout { flex-direction: column; overflow: visible; }
  #main { display: none; overflow: visible; padding: 0; height: auto; }
  #sidebar { width: 100%; border-right: none; border-bottom: 2px solid rgba(255,255,255,0.6); overflow: visible; }
  #sidebar-nav { overflow: visible; }

  /* mobile: panel view */
  body.mobile-panel #sidebar { display: none; }
  body.mobile-panel #main { display: block; }
  body.mobile-panel #topbar-tag { display: none; }

  .panel {
    position: static !important;
    display: none;
    width: 100% !important;
    height: auto !important;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  .panel.open { display: flex; }
  .panel-titlebar { cursor: default; }
  .panel-resize { display: none; }
  .panel .pixel-corner-bl, .panel .pixel-corner-br { display: none; }

  #mobile-back {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    color: var(--pixel-label);
    background: rgba(255,255,255,0.5);
    border-bottom: 2px solid rgba(255,255,255,0.6);
    cursor: pointer;
    letter-spacing: 0.4px;
  }
  body.mobile-panel #mobile-back { display: flex; }
}
@media (min-width: 769px) {
  #mobile-back { display: none !important; }
}
