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

:root {
  /* ---------- Win95 core ---------- */
  --panel: #c0c0c0;
  --panel-shadow: #808080;
  --panel-light: #dfdfdf;
  --panel-dark: #404040;

  --title-active-a: #000080;
  --title-active-b: #1084d0;

  --text-dark: #000000;
  --text-dim: #404040;      
  --text-light: #ffffff;

  --field-bg: #ffffff;

  /* ---------- accents ---------- */
  --accent-blue: #1084d0;
  --accent-navy: #000080;
  --accent-cream: #e8e0c8;
}

html, body { height: 100%; }

body {
  background-color: #020508;
  font-family: 'MS Sans Serif', 'Tahoma', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.75rem;
  color: var(--text-dark);
  padding: 20px;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

/* ============================================================
   BACKGROUND
   ============================================================ */

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url('img/background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--field-bg);
  color: var(--accent-navy);
  padding: 6px 12px;
  border: 2px solid var(--panel-dark);
  font-weight: bold;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   WIN95 WINDOW CHROME
   ============================================================ */

.win95 {
  background: var(--panel);
  border-top: 2px solid var(--panel-light);
  border-left: 2px solid var(--panel-light);
  border-right: 2px solid var(--panel-dark);
  border-bottom: 2px solid var(--panel-dark);
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 var(--panel-shadow),
    0 4px 12px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 1;
}

.title-bar {
  background: linear-gradient(90deg, var(--title-active-a) 0%, var(--title-active-b) 100%);
  color: var(--text-light);
  font-weight: bold;
  font-size: 0.6875rem;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.3px;
  user-select: none;
}

.title-bar .title-text {
  display: flex;
  align-items: center;
  gap: 4px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}

.window-controls {
  display: flex;
  gap: 2px;
}

.window-controls span {
  width: 16px; height: 14px;
  background: var(--panel);
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid var(--panel-dark);
  border-bottom: 1px solid var(--panel-dark);
  font-family: 'MS Sans Serif', sans-serif;
  font-size: 0.5625rem;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */

.page {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 10px;
  align-items: start;
  position: relative;
  z-index: 1;
}

#sidebar {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

.sidebar-body {
  padding: 12px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.avatar {
  width: 100%;
  aspect-ratio: 1;
  background: var(--field-bg);
  border-top: 2px solid var(--panel-dark);
  border-left: 2px solid var(--panel-dark);
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  position: relative;
  overflow: hidden;
}

img.avatar { object-fit: cover; }

.identity h1 {
  font-family: 'MS Sans Serif', 'Tahoma', sans-serif;
  font-size: 0.875rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 2px;
  letter-spacing: 0.2px;
}

.identity .title {
  font-size: 0.6875rem;
  color: var(--text-dim);
  margin: 0;
}

.identity .availability {
  font-size: 0.6875rem;
  color: var(--text-dark);
  font-weight: bold;
  margin-top: 4px;
}

.divider {
  height: 2px;
  background: var(--panel-dark);
  border-bottom: 1px solid #ffffff;
  margin: 2px 0;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
  word-break: break-word;
}

.contact-list a {
  color: var(--text-dark);
  text-decoration: underline;
}

.contact-list a:hover { color: var(--accent-navy); }

.contact-list img.icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  /* Forces black/dark SVGs to match your navy text */
  filter: invert(9%) sepia(99%) saturate(7488%) hue-rotate(246deg) brightness(84%) contrast(117%);
  opacity: 0.9;
}

/* ---------- NAV (listbox) ---------- */

.nav-list {
  list-style: none;
  background: var(--field-bg);
  border-top: 2px solid var(--panel-dark);
  border-left: 2px solid var(--panel-dark);
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.6875rem;
  padding: 4px 6px;
  border: 1px solid transparent;
}

.nav-btn::before {
  content: '▸';
  font-size: 0.5625rem;
  color: var(--accent-navy);
}

.nav-btn:hover,
.nav-btn:focus-visible {
  background: var(--accent-navy);
  color: var(--text-light);
  outline: none;
}

.nav-btn:hover::before { color: var(--accent-cream); }

/* ---------- footer ---------- */

#sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.copyright {
  font-size: 0.625rem;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 4px;
  border-top: 1px solid var(--panel-shadow);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

#main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.main-window-body {
  padding: 20px 24px 28px;
  background: var(--panel);
}

/* ---------- CV sections ---------- */

.cv-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--panel-shadow);
}

.cv-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.cv-section h3 {
  font-family: 'MS Sans Serif', 'Tahoma', sans-serif;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--text-light);
  background: var(--accent-navy);
  display: inline-block;
  padding: 2px 10px 3px;
  margin-bottom: 12px;
  border-top: 1px solid var(--accent-blue);
  border-left: 1px solid var(--accent-blue);
  border-right: 1px solid var(--panel-dark);
  border-bottom: 1px solid var(--panel-dark);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.cv-section > p {
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--text-dark);
  max-width: 62ch;
  padding: 8px 10px;
  background: var(--field-bg);
  border-top: 1px solid var(--panel-dark);
  border-left: 1px solid var(--panel-dark);
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
}

.entry { margin-bottom: 16px; }
.entry:last-child { margin-bottom: 0; }

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 4px;
  padding: 3px 6px;
  background: var(--accent-navy);
  color: var(--text-light);
  border-top: 1px solid var(--accent-blue);
  border-left: 1px solid var(--accent-blue);
  border-right: 1px solid var(--panel-dark);
  border-bottom: 1px solid var(--panel-dark);
}

.entry-title { font-weight: bold; font-size: 0.6875rem; }
.entry-org { color: rgba(255,255,255,0.88); font-weight: normal; }

.entry-dates {
  font-size: 0.625rem;
  color: var(--text-dark);
  background: var(--field-bg);
  padding: 1px 5px;
  border: 1px solid var(--panel-shadow);
  white-space: nowrap;
}

.entry ul {
  margin: 6px 0 0;
  padding-left: 22px;
  color: var(--text-dark);
  font-size: 0.75rem;
  line-height: 1.65;
}

.entry ul li {
  margin-bottom: 2px;
  list-style: square;
}

.entry ul li::marker { color: var(--accent-navy); }

/* ---------- tags ---------- */

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-list li {
  font-size: 0.6875rem;
  color: var(--text-dark);
  background: var(--panel);
  padding: 2px 8px;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid var(--panel-dark);
  border-bottom: 1px solid var(--panel-dark);
  box-shadow: inset -1px -1px 0 var(--panel-shadow);
}

.skill-group { margin-bottom: 14px; }
.skill-group:last-child { margin-bottom: 0; }

.skill-group-label {
  font-size: 0.6875rem;
  font-weight: bold;
  color: var(--accent-navy);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

/* ---------- Projects ---------- */

.project {
  padding: 12px;
  margin-bottom: 10px;
  background: var(--field-bg);
  border-top: 2px solid var(--panel-dark);
  border-left: 2px solid var(--panel-dark);
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.project:last-child { margin-bottom: 0; }

.project h3 {
  font-family: 'MS Sans Serif', 'Tahoma', sans-serif;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--accent-navy);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.project p {
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--text-dark);
}

.project ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.project ul li {
  margin-bottom: 4px;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--text-dark);
  list-style: square;
}

.project ul li::marker {
  color: var(--accent-navy);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 860px) {
  body { padding: 10px; }
  .page { grid-template-columns: 1fr; gap: 8px; }
  #sidebar { position: static; max-height: none; }
  .sidebar-body {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 16px;
  }
  .avatar { width: 80px; flex: 0 0 80px; }
  .identity { flex: 1 1 140px; }
  .contact-list { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
  .nav-list { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; }
  .nav-btn { flex: 1 1 auto; }
  #sidebar-footer { flex: 1 1 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .copyright { border-top: none; }
  .main-window-body { padding: 16px; }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  @page {
    margin: 15mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 11pt;
  }

  .bg-layer { display: none !important; }

  .win95 {
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }
  .title-bar,
  .window-controls,
  .divider,
  .skip-link,
  .nav-list,
  #sidebar-footer {
    display: none !important;
  }

  .page {
    display: block !important;
    max-width: 100% !important;
  }

  #sidebar {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
  }
  .sidebar-body {
    padding: 0 !important;
    background: #ffffff !important;
    display: block !important;
    margin-bottom: 15pt;
  }
  .avatar {
    display: none !important;
  }
  .identity h1 {
    font-size: 20pt;
    margin-bottom: 4pt;
  }
  .identity .title {
    font-size: 11pt;
    color: #000 !important;
  }
  .identity .availability {
    font-size: 11pt;
    color: #000 !important;
  }

  .contact-list li {
    padding: 0 !important;
    color: #000 !important;
    font-size: 11pt;
  }
  .contact-list a {
    color: #000 !important;
    text-decoration: none;
  }
  .contact-list svg { display: none !important; }

  #main {
    display: block !important;
  }
  .main-window-body {
    padding: 0 !important;
    background: #ffffff !important;
  }

  .cv-section h3, .project h3 {
    background: none !important;
    color: #000 !important;
    border: none !important;
    border-bottom: 1pt solid #000 !important;
    padding: 0 0 2pt !important;
    font-size: 13pt;
    margin-bottom: 8pt;
    break-after: avoid;
    display: block !important;
  }
  .cv-section > p, .entry ul, .project p, .tag-list li {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: #000 !important;
    font-size: 11pt;
    font-family: inherit;
  }

  .entry-head {
    background: none !important;
    color: #000 !important;
    border: none !important;
    border-bottom: 0.5pt solid #888 !important;
    padding: 2pt 0 !important;
    margin-top: 10pt;
  }
  .entry-title { font-size: 11pt; }
  .entry-org { color: #000 !important; }
  .entry-dates {
    background: none !important;
    border: none !important;
    color: #000 !important;
    font-size: 10pt;
  }
  .entry ul { color: #000 !important; }
  .entry ul li::marker { color: #000 !important; }

  .project {
    background: none !important;
    border: none !important;
    border-bottom: 0.5pt solid #888 !important;
    padding: 6pt 0 !important;
  }
  .project h3 { color: #000 !important; }
  .project h3::before { display: none !important; }

  .tag-list li {
    background: none !important;
    border: 0.5pt solid #888 !important;
    box-shadow: none !important;
    color: #000 !important;
    font-size: 11pt;
  }

  a { color: #000 !important; text-decoration: underline; }

  .entry { page-break-inside: avoid; }
}