/* ── CSS VARIABLES ── */
:root {
  --bg: #008080;
  --browser-bg: #1a1a1a;
  --panel: #c0c0c0;
  --navy: #000080;
  --white: #ffffff;
  --black: #000000;
  --text: #000000;
  --dim: #444;
  --red: #cc0000;
  --link: #0000cc;
  --border-light: #ffffff;
  --border-mid: #c0c0c0;
  --border-dark: #808080;
  --border-darker: #404040;
  --titlebar-active: #000080;
  --titlebar-text: #ffffff;
  --sidebar-w: 76px;
  --btn-face: #c0c0c0;
  --mobile-nav-h: 56px;
  --taskbar-h: 28px;
}

body {
  background: var(--browser-bg);
  color: var(--text);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
  /* Centre the desktop frame */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scanline overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

a {
  color: var(--link);
}
a:hover,
a:active {
  color: var(--red);
}

/* ── LAYOUT ── */
.desktop {
  background: var(--bg);
  display: flex;
  /* Fixed desktop frame — centred by body flexbox */
  width: 1400px;
  max-width: 98vw;
  height: 1000px;
  max-height: 96dvh;
  position: relative;
  overflow: hidden;
  /* Win98-style raised outer border + shadow for depth */
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-darker);
  border-right: 2px solid var(--border-darker);
  box-shadow:
    6px 6px 0 rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* ════════════════════════════════
   SIDEBAR
════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 2px solid var(--border-darker);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 6px 0 4px;
  z-index: 100;
}
.sidebar-logo {
  text-align: center;
  padding: 6px 4px 10px;
  border-bottom: 2px solid var(--border-darker);
  margin-bottom: 6px;
}
.logo-text {
  font-family: "Libre Baskerville", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 3px solid var(--red);
  padding-bottom: 1px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 4px;
  cursor: pointer;
  font-size: 9px;
  gap: 3px;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover,
.nav-item.active {
  background: var(--navy);
  color: var(--white);
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  filter: brightness(10);
}
.nav-icon {
  font-size: 24px;
  line-height: 1;
}
.nav-label {
  text-align: center;
  line-height: 1.2;
}
.sidebar-spacer {
  flex: 1;
}
.sidebar-clock {
  font-size: 9px;
  text-align: center;
  padding: 4px 2px;
  border-top: 1px solid var(--border-dark);
  color: var(--dim);
}

/* ════════════════════════════════
   MAIN ABOUT PANEL
════════════════════════════════ */
.main-area {
  flex: 1;
  padding: 14px 14px 42px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.about-panel {
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-darker);
  border-right: 2px solid var(--border-darker);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Decorative title bar */
.about-titlebar {
  background: var(--titlebar-active);
  color: var(--titlebar-text);
  display: flex;
  align-items: center;
  padding: 3px 6px;
  gap: 4px;
  flex-shrink: 0;
}
.about-titlebar-icon {
  font-size: 14px;
}
.about-titlebar-title {
  flex: 1;
  font-family: "Libre Baskerville", serif;
  font-size: 12px;
  font-weight: 700;
}
.about-titlebar-btns {
  display: flex;
  gap: 2px;
}
.about-titlebar-btns span {
  background: var(--btn-face);
  border-top: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-darker);
  border-right: 1px solid var(--border-darker);
  width: 16px;
  height: 14px;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  user-select: none;
}

/* Menu bar */
.about-menubar {
  background: var(--panel);
  border-bottom: 1px solid var(--border-dark);
  padding: 2px 4px;
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.about-menu-item {
  padding: 1px 8px;
  font-size: 11px;
  cursor: default;
  color: var(--dim);
}

/* Ticker */
.about-ticker {
  background: var(--navy);
  color: #adf;
  font-size: 10px;
  padding: 3px 10px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.about-ticker span::before {
  content: "[ ";
}
.about-ticker span::after {
  content: " ]";
}
.ticker-on {
  color: #88ff88;
}

/* Scrollable body */
.about-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  user-select: text;
}
.about-body::-webkit-scrollbar {
  width: 16px;
}
.about-body::-webkit-scrollbar-track {
  background: var(--panel);
  border-left: 1px solid var(--border-dark);
}
.about-body::-webkit-scrollbar-thumb {
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-darker);
  border-right: 2px solid var(--border-darker);
}

/* Hero header — two columns */
.about-header {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0;
  background: var(--white);
  border: 2px solid;
  border-top-color: var(--border-darker);
  border-left-color: var(--border-darker);
  border-bottom-color: var(--border-light);
  border-right-color: var(--border-light);
  margin-bottom: 16px;
  overflow: hidden;
}
.about-header-left {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 2px solid var(--border-dark);
}
.about-hero-name {
  font-family: "Libre Baskerville", serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.05;
  margin-bottom: 6px;
}
.about-hero-role {
  font-size: 13px;
  color: var(--dim);
  font-style: italic;
  font-family: "Libre Baskerville", serif;
  margin-bottom: 10px;
}
.about-hero-meta {
  font-size: 11px;
  line-height: 2;
  color: var(--text);
  margin-bottom: 10px;
}
.about-hero-meta span::before {
  content: "▸ ";
  color: var(--navy);
}
.avail-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00aa00;
  margin-right: 4px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
.avail-badge {
  display: inline-block;
  background: #006600;
  color: #fff;
  font-size: 9px;
  padding: 2px 8px;
}

/* Photo column */
.about-header-photo {
  position: relative;
  background: var(--bg);
  overflow: hidden;
  min-height: 180px;
}
.about-header-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.photo-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 128, 0.75);
  color: #fff;
  font-size: 9px;
  text-align: center;
  padding: 3px 6px;
  font-family: "Share Tech Mono", monospace;
}

/* Content grid */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.about-grid-full {
  grid-column: span 2;
}

.about-section {
  border: 2px solid;
  border-top-color: var(--border-light);
  border-left-color: var(--border-light);
  border-bottom-color: var(--border-darker);
  border-right-color: var(--border-darker);
}
.about-section-head {
  background: var(--navy);
  color: var(--white);
  padding: 3px 10px;
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  font-size: 11px;
}
.about-section-body {
  padding: 10px;
  font-size: 12px;
  line-height: 1.7;
  background: var(--panel);
}
.about-section-body b {
  color: var(--navy);
}
.about-section-body p {
  margin-bottom: 8px;
}
.about-section-body p:last-child {
  margin-bottom: 0;
}

/* System info list */
.sysinfo {
  list-style: none;
  font-size: 11px;
  line-height: 2.1;
}
.sysinfo li::before {
  content: "▸ ";
  color: var(--navy);
}

/* Nav hint */
.nav-hint {
  margin-top: 14px;
  padding: 10px 12px;
  background: #e8e8f0;
  border: 2px solid;
  border-top-color: var(--border-darker);
  border-left-color: var(--border-darker);
  border-bottom-color: var(--border-light);
  border-right-color: var(--border-light);
  font-size: 11px;
  color: var(--dim);
  text-align: center;
  font-family: "Libre Baskerville", serif;
  font-style: italic;
}

/* Status bar */
.about-statusbar {
  background: var(--panel);
  border-top: 1px solid var(--border-dark);
  padding: 2px 8px;
  font-size: 10px;
  color: var(--dim);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.about-statusbar span {
  border-top: 1px solid var(--border-dark);
  border-left: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  padding: 1px 6px;
}

.currently-body {
  padding: 0;
}

.currently-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: "Share Tech Mono", monospace;
}

.currently-table thead tr {
  background: var(--navy);
}

.currently-table thead th {
  color: var(--white);
  padding: 3px 8px;
  text-align: left;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.05em;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.currently-table thead th:last-child {
  border-right: none;
}

.currently-col-a {
  width: 38%;
}

.currently-col-b {
  width: 62%;
}

.currently-table tbody tr:nth-child(odd) td {
  background: #f0f0f8;
}

.currently-table tbody tr:nth-child(even) td {
  background: var(--white);
}

.currently-table tbody tr:hover td {
  background: #dde0f0;
}

.currently-table tbody td {
  padding: 4px 8px;
  border-right: 1px solid #d0d0d8;
  border-bottom: 1px solid #d0d0d8;
  color: var(--text);
}

.currently-table tbody td:last-child {
  border-right: none;
}

.currently-table tbody td:first-child {
  color: var(--navy);
  font-weight: 700;
}

/* Row numbers — spreadsheet feel */
.currently-table tbody tr {
  counter-increment: row-num;
}

.currently-table tbody td:first-child::before {
  content: counter(row-num) "  ";
  color: var(--border-dark);
  font-size: 9px;
  user-select: none;
}

.currently-table {
  counter-reset: row-num;
}

/* popup windows */
.win-window {
  position: absolute;
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-darker);
  border-right: 2px solid var(--border-darker);
  width: 500px;
  max-width: calc(100% - 90px);
  display: none;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  animation: winOpen 0.12s ease-out;
  top: 60px;
  left: 120px;
}
@keyframes winOpen {
  from {
    transform: scale(0.87);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.win-window.open {
  display: flex;
}
.win-window.minimized {
  display: none !important;
}

#win-projects,
#win-skills,
#win-contact {
  left: 120px;
  top: 60px;
}

.win-titlebar {
  background: var(--titlebar-active);
  color: var(--titlebar-text);
  display: flex;
  align-items: center;
  padding: 3px 4px 3px 6px;
  gap: 4px;
  flex-shrink: 0;
  user-select: none;
  cursor: default;
}
.win-titlebar-icon {
  font-size: 14px;
}
.win-titlebar-title {
  flex: 1;
  font-family: "Libre Baskerville", serif;
  font-size: 12px;
  font-weight: 700;
}
.win-titlebar-btns {
  display: flex;
  gap: 2px;
}
.win-titlebar-btns button {
  background: var(--btn-face);
  border-top: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-darker);
  border-right: 1px solid var(--border-darker);
  width: 16px;
  height: 14px;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  padding: 0;
  line-height: 1;
  font-family: "Share Tech Mono", monospace;
  -webkit-tap-highlight-color: transparent;
}
.win-titlebar-btns button:active {
  border-top: 1px solid var(--border-darker);
  border-left: 1px solid var(--border-darker);
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

.win-menubar {
  background: var(--panel);
  border-bottom: 1px solid var(--border-dark);
  padding: 2px 4px;
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.win-menu-item {
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
}
.win-menu-item:hover {
  background: var(--navy);
  color: var(--white);
}

.win-body {
  padding: 10px 12px;
  overflow-y: auto;
  max-height: 440px;
  flex: 1;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  user-select: text;
  -webkit-overflow-scrolling: touch;
}
.win-body::-webkit-scrollbar {
  width: 16px;
}
.win-body::-webkit-scrollbar-track {
  background: var(--panel);
  border-left: 1px solid var(--border-dark);
}
.win-body::-webkit-scrollbar-thumb {
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-darker);
  border-right: 2px solid var(--border-darker);
}

.win-statusbar {
  background: var(--panel);
  border-top: 1px solid var(--border-dark);
  padding: 2px 8px;
  font-size: 10px;
  color: var(--dim);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.win-statusbar span {
  border-top: 1px solid var(--border-dark);
  border-left: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  padding: 1px 6px;
}

/* window content helpers */
.wc-section {
  margin-bottom: 14px;
}
.wc-label {
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  color: var(--navy);
  font-size: 13px;
  border-bottom: 2px solid var(--border-dark);
  margin-bottom: 6px;
  padding-bottom: 2px;
}
.wc-p {
  margin-bottom: 6px;
  font-size: 12px;
}
.wc-p b {
  color: var(--navy);
}

/* Projects */
.proj-win-entry {
  padding: 8px;
  margin-bottom: 8px;
  background: var(--white);
  border: 2px solid;
  border-top-color: var(--border-darker);
  border-left-color: var(--border-darker);
  border-bottom-color: var(--border-light);
  border-right-color: var(--border-light);
}
.proj-win-title {
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 3px;
}
.proj-win-tech {
  font-size: 9px;
  color: var(--dim);
  margin-bottom: 4px;
}
.proj-win-desc {
  font-size: 11px;
  margin-bottom: 6px;
}
.proj-win-links a {
  font-size: 11px;
  margin-right: 10px;
}

/* Skills */
.skills-win-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 10px;
}
.skills-win-table th {
  background: var(--navy);
  color: var(--white);
  padding: 3px 8px;
  text-align: left;
  font-family: "Libre Baskerville", serif;
  font-size: 11px;
}
.skills-win-table td {
  padding: 3px 8px;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
}
.skills-win-table tr:nth-child(even) td {
  background: #e8e8f0;
}
.skills-win-table td:first-child {
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

/* Contact */
.contact-win-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--white);
  border: 2px solid;
  border-top-color: var(--border-darker);
  border-left-color: var(--border-darker);
  border-bottom-color: var(--border-light);
  border-right-color: var(--border-light);
  margin-bottom: 8px;
}
.contact-win-icon {
  font-size: 24px;
}
.contact-win-label {
  font-family: "Libre Baskerville", serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--navy);
}
.contact-win-val {
  font-size: 11px;
}

/* Taskbar */
.taskbar {
  position: absolute;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--taskbar-h);
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 4px;
  z-index: 500;
}
.taskbar-btn {
  height: 20px;
  padding: 0 8px;
  font-size: 10px;
  font-family: "Share Tech Mono", monospace;
  background: var(--panel);
  border-top: 2px solid var(--border-light);
  border-left: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-darker);
  border-right: 2px solid var(--border-darker);
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.taskbar-btn.visible {
  display: flex;
}
.taskbar-btn.focused {
  border-top: 2px solid var(--border-darker);
  border-left: 2px solid var(--border-darker);
  border-bottom: 2px solid var(--border-light);
  border-right: 2px solid var(--border-light);
  background: #b0b0b0;
}
.taskbar-clock {
  margin-left: auto;
  font-size: 10px;
  padding: 0 8px;
  height: 20px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-dark);
  border-left: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

/* Mobile only events */
.mobile-topbar {
  display: none;
}
.mobile-nav {
  display: none;
}

/* mobile */
@media (max-width: 640px) {
  body {
    display: block;
  }
  .desktop {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: none;
    box-shadow: none;
  }

  .sidebar {
    display: none;
  }
  .taskbar {
    display: none;
  }

  /* Top bar */
  .mobile-topbar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: var(--panel);
    border-bottom: 2px solid var(--border-darker);
    align-items: center;
    padding: 0 10px;
    gap: 8px;
    z-index: 500;
  }
  .mobile-topbar .logo-text {
    font-size: 18px;
  }
  .mobile-topbar-title {
    font-family: "Libre Baskerville", serif;
    font-size: 12px;
    color: var(--dim);
    font-style: italic;
    flex: 1;
  }
  .mobile-topbar-clock {
    font-size: 11px;
  }

  /* Bottom nav */
  .mobile-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-h);
    background: var(--panel);
    border-top: 2px solid var(--border-light);
    z-index: 500;
    justify-content: space-around;
    align-items: stretch;
  }
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 8px;
    cursor: pointer;
    color: var(--text);
    border-right: 1px solid var(--border-dark);
    -webkit-tap-highlight-color: transparent;
    padding: 4px 2px;
  }
  .mobile-nav-item:last-child {
    border-right: none;
  }
  .mobile-nav-item:active,
  .mobile-nav-item.active {
    background: var(--navy);
    color: var(--white);
  }
  .mobile-nav-item:active .mnav-icon,
  .mobile-nav-item.active .mnav-icon {
    filter: brightness(10);
  }
  .mnav-icon {
    font-size: 22px;
    line-height: 1;
  }

  /* Main content area */
  .main-area {
    padding: calc(36px + 10px) 8px calc(var(--mobile-nav-h) + 8px);
    height: 100dvh;
  }
  .about-panel {
    height: auto;
    min-height: 100%;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-grid-full {
    grid-column: unset;
  }
  .about-header {
    grid-template-columns: 1fr;
  }
  .about-header-photo {
    min-height: 160px;
    border-right: none;
    border-top: 2px solid var(--border-dark);
  }
  .about-hero-name {
    font-size: 22px;
  }

  .win-window {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: var(--mobile-nav-h) !important;
    top: 36px !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 2px solid var(--border-light) !important;
    border-bottom: none !important;
    animation: sheetUp 0.2s ease-out !important;
    z-index: 800 !important;
  }
  @keyframes sheetUp {
    from {
      transform: translateY(100%);
      opacity: 0.6;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  .btn-max {
    display: none !important;
  }
  .win-titlebar-btns button {
    width: 28px !important;
    height: 24px !important;
    font-size: 14px !important;
  }
  .win-titlebar {
    padding: 6px 8px !important;
  }
  .win-body {
    max-height: none !important;
    flex: 1;
  }
  .win-menubar {
    display: none;
  }
}
