/* --- Variables --- */
:root {
  --bg: #0f0f0f;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-muted: #888888;
  --text-dim: #555555;
  --accent: #4ade80;
  --danger: #f43f5e;
  --warn: #fbbf24;
  --font: 'JetBrains Mono', 'Courier New', monospace;
  --nav-height: 48px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* --- Blinking cursor animation (shared) --- */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- Navbar --- */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
}
.nav-logo {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--text-muted);
  font-size: 12px;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

/* --- Sections base --- */
main { padding-top: var(--nav-height); }
section {
  padding: 80px 32px;
  border-bottom: 1px solid var(--border);
  max-width: 720px;
  margin: 0 auto;
}
.section-prompt {
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Hero --- */
#hero { padding-top: 120px; padding-bottom: 100px; }
.hero-prompt { color: var(--accent); font-size: 13px; margin-bottom: 12px; }
h1 {
  font-size: clamp(28px, 6vw, 52px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 12px;
}
.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
.hero-cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent);
  color: #0f0f0f;
  padding: 10px 22px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  border-radius: 3px;
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 22px;
  font-family: var(--font);
  font-size: 12px;
  border-radius: 3px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

/* --- About --- */
#about .section-content {
  color: var(--text-muted);
  line-height: 1.9;
  max-width: 560px;
}

/* --- Hobbies --- */
.hobbies-list {
  display: grid;
  gap: 12px;
  max-width: 360px;
}
.hobby-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}
.hobby-icon {
  width: 20px;
  text-align: center;
  color: var(--accent);
  flex-shrink: 0;
}
.hobby-label {
  color: var(--text);
}

/* --- Skills --- */
.skills-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 3px;
  transition: border-color 0.2s;
}
.skill-tag:hover { border-color: var(--accent); }

/* --- Projects --- */
.project-card {
  display: block;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px 20px;
  transition: border-color 0.2s;
}
.project-card:hover { border-color: var(--accent); }
.project-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.project-title { color: var(--text); font-weight: 700; font-size: 13px; }
.project-desc { color: var(--text-muted); font-size: 12px; margin-bottom: 10px; line-height: 1.7; }
.project-link { color: var(--accent); font-size: 11px; }

/* --- Contact --- */
.contact-links { display: flex; flex-direction: column; gap: 14px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  transition: color 0.2s;
}
.contact-item:hover { color: var(--text); }

/* --- Boot overlay --- */
#boot-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}
#boot-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
#boot-terminal {
  max-width: 560px;
  width: 90%;
  padding: 24px;
}
#boot-lines {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 2.1;
}
#boot-lines .line { display: block; }
#boot-lines .ok { color: var(--accent); }
#boot-skip {
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 16px;
  animation: blink 1.5s step-end infinite;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 12px;
  max-width: 720px;
  margin: 0 auto;
}
.footer-cursor { animation: blink 1s step-end infinite; }

/* --- Desktop overlay --- */
#desktop-overlay {
  position: fixed;
  inset: 0;
  background: #0d1117;
  z-index: 500;
  display: none;
  flex-direction: column;
  font-family: var(--font);
}
#desktop-overlay.active { display: flex; }

/* Top bar */
#desktop-topbar {
  height: 32px;
  background: #111;
  border-bottom: 1px solid #1e2e1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  user-select: none;
}
.topbar-left { display: flex; align-items: center; }
.topbar-brand { color: var(--accent); font-weight: 700; font-size: 12px; margin-right: 20px; }
.topbar-menu-item { color: var(--text-dim); font-size: 11px; margin-right: 14px; cursor: default; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
#desktop-clock { color: var(--text-muted); font-size: 11px; }
.topbar-user { color: var(--accent); font-size: 11px; }

/* Desktop area */
#desktop-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(circle, #1a2a1a 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Desktop icons */
.desktop-icons {
  position: absolute;
  left: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 6px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.15s;
  user-select: none;
}
.desktop-icon:hover { background: rgba(74, 222, 128, 0.08); }
.desktop-icon-emoji { font-size: 26px; line-height: 1; }
.desktop-icon-label {
  color: #ccc;
  font-size: 10px;
  margin-top: 5px;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 1px 4px;
  border-radius: 2px;
  word-break: break-all;
}

/* Taskbar */
#desktop-taskbar {
  height: 36px;
  background: #111;
  border-top: 1px solid #1e2e1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}
#taskbar-items { display: flex; gap: 6px; align-items: center; }
.taskbar-item {
  background: #1a2a1a;
  border: 1px solid #2a3a2a;
  color: var(--text-muted);
  padding: 3px 12px;
  font-size: 10px;
  font-family: var(--font);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}
.taskbar-item:hover { background: #2a3a2a; color: var(--text); }
.taskbar-item.minimized { opacity: 0.5; }
.taskbar-right { display: flex; align-items: center; }
#close-desktop {
  background: none;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
#close-desktop:hover { border-color: var(--danger); color: var(--danger); }

/* --- Floating toggle button --- */
#desktop-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 200;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#desktop-toggle:hover { border-color: var(--accent); transform: scale(1.1); }

/* --- Windows --- */
.window {
  position: absolute;
  min-width: 280px;
  max-width: 480px;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  user-select: none;
}
.window.minimized { display: none; }
.window-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: #1a1a1a;
  border-bottom: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  cursor: move;
  flex-shrink: 0;
}
.win-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.win-btn-close    { background: var(--danger); }
.win-btn-minimize { background: var(--warn); }
.window-title {
  color: var(--text-dim);
  font-size: 10px;
  font-family: var(--font);
  margin-left: 4px;
}
.window-body {
  padding: 14px 16px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.9;
  overflow-y: auto;
  max-height: 300px;
  user-select: text;
}

/* --- Terminal window --- */
.terminal-window { min-width: 380px; }
.terminal-window .window-body {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  padding: 10px 12px;
}
.terminal-output {
  flex: 1;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-wrap;
  margin-bottom: 6px;
}
.terminal-output .t-prompt { color: var(--accent); }
.terminal-output .t-cmd    { color: #fff; }
.terminal-output .t-resp   { color: var(--text-muted); }
.terminal-output .t-err    { color: var(--danger); }
.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.terminal-prompt-label {
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}
.terminal-input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font);
  font-size: 11px;
  flex: 1;
  caret-color: var(--accent);
}

/* --- Mobile --- */
@media (max-width: 640px) {
  #navbar { padding: 0 20px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 11px; }
  section { padding: 60px 20px; }
  h1 { font-size: 28px; letter-spacing: -0.5px; }
  .hero-subtitle { font-size: 12px; }
  .hero-cta { gap: 8px; }
  #desktop-toggle { display: none; }
}
