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

:root {
  --bg-desktop: #0d0f14;
  --bg-window: #161a22;
  --bg-titlebar: #1e232e;
  --border: #2a3142;
  --text: #e4e8ef;
  --text-muted: #8b92a5;
  --accent: #7c9eff;
  --accent-dim: #5a73cc;
  --danger: #e06c75;
  --radius: 8px;
  --radius-sm: 4px;
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.desktop {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

.wallpaper {
  position: absolute;
  inset: 0;
  background: var(--bg-desktop);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(124, 158, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(100, 120, 200, 0.05) 0%, transparent 50%);
}

.wallpaper-noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.icons {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 72px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  transition: background 0.15s, transform 0.15s, filter 0.15s;
}

.icon:hover, .icon:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  outline: none;
}

.icon-img {
  font-size: 32px;
  line-height: 1;
}

.windows {
  position: absolute;
  inset: 0;
  bottom: 40px;
  pointer-events: none;
}

.windows > * {
  pointer-events: auto;
}

.window {
  position: absolute;
  min-width: 320px;
  max-width: 90vw;
  width: 560px;
  min-height: 280px;
  max-height: 75vh;
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: windowOpen 0.2s ease-out;
}

.window.focused {
  border-color: rgba(124, 158, 255, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(124, 158, 255, 0.15);
}

.window.minimized {
  display: none;
}

@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.06) 50%);
  border-radius: 0 0 var(--radius) 0;
}

.resize-handle:hover {
  background: linear-gradient(135deg, transparent 50%, rgba(124, 158, 255, 0.2) 50%);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-titlebar);
  border-bottom: 1px solid var(--border);
  cursor: move;
  user-select: none;
}

.titlebar-icon {
  font-size: 14px;
}

.titlebar-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.titlebar-actions {
  display: flex;
  gap: 6px;
}

.titlebar-actions button {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-size: 0;
  transition: background 0.15s;
}

.btn-minimize {
  background: rgba(255, 193, 7, 0.2);
}

.btn-minimize:hover {
  background: rgba(255, 193, 7, 0.4);
}

.btn-close {
  background: rgba(224, 108, 117, 0.2);
}

.btn-close:hover {
  background: var(--danger);
  color: #fff;
}

.window-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.window-body h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

.window-body h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text-muted);
}

.window-body .lead {
  color: var(--text-muted);
  margin: 0 0 20px;
}

.window-body p {
  margin: 0 0 12px;
}

.window-body ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.window-body blockquote {
  margin: 20px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(124, 158, 255, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}

.window-body a {
  color: var(--accent);
  text-decoration: none;
}

.window-body a:hover {
  text-decoration: underline;
}

.cards {
  list-style: none;
  padding-left: 0;
}

.cards li {
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.project-list, .microtools {
  list-style: none;
  padding-left: 0;
}

.project-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.project-list li:last-child {
  border-bottom: none;
}

.project-list .name {
  font-weight: 600;
  margin-bottom: 4px;
}

.project-list .desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.project-list .tags, .cv-job .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.project-list .tags span, .cv-job .tags span {
  padding: 2px 8px;
  background: rgba(124, 158, 255, 0.15);
  border-radius: 4px;
  color: var(--accent-dim);
}

.microtools li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-muted);
}

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

.cv-job:last-child {
  border-bottom: none;
}

.cv-job .org {
  font-weight: 600;
  margin-bottom: 2px;
}

.cv-job .role-period {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cv-job ul {
  margin: 8px 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.skills-grid .skill-cat {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.skills-grid .skill-cat strong {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.skills-grid .skill-cat span {
  font-size: 12px;
  color: var(--text);
}

.contact-details {
  margin: 16px 0;
}

.contact-details p {
  margin-bottom: 8px;
}

.contact-form-wrap {
  margin-top: 20px;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form p {
  margin-bottom: 14px;
}

.contact-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.contact-form .required {
  color: var(--danger);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 158, 255, 0.2);
}

.contact-form textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  margin-top: 18px;
  margin-bottom: 0;
}

.form-actions .btn-primary {
  margin: 0;
  border: none;
  cursor: pointer;
  font: inherit;
}

.form-actions .btn-primary:disabled,
.contact-form[aria-busy="true"] .form-actions .btn-primary {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-feedback {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.form-success {
  background: rgba(80, 200, 120, 0.15);
  border: 1px solid rgba(80, 200, 120, 0.3);
  color: #7dd39c;
}

.form-error {
  background: rgba(224, 108, 117, 0.15);
  border: 1px solid rgba(224, 108, 117, 0.3);
  color: #e06c75;
}

.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 500;
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--accent-dim);
  text-decoration: none;
}

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(22, 26, 34, 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.start {
  padding: 0 16px;
  height: 28px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.start:hover {
  background: rgba(124, 158, 255, 0.15);
}

.taskbar-items {
  flex: 1;
  display: flex;
  gap: 4px;
  min-width: 0;
}

.taskbar-item {
  padding: 0 12px;
  height: 28px;
  max-width: 160px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-sans);
}

.taskbar-item:hover, .taskbar-item.active {
  background: rgba(124, 158, 255, 0.2);
  color: var(--text);
}

.clock-wrap {
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: default;
}

.clock-wrap:hover {
  background: rgba(255, 255, 255, 0.06);
}

.clock {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.start-menu {
  position: fixed;
  bottom: 44px;
  left: 12px;
  min-width: 200px;
  padding: 8px 0;
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
}

.start-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.start-menu-header {
  padding: 8px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.start-menu-item:hover {
  background: rgba(124, 158, 255, 0.15);
}

.start-menu-icon {
  font-size: 18px;
}

.context-menu {
  position: fixed;
  min-width: 160px;
  padding: 6px 0;
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s, visibility 0.1s;
}

.context-menu.visible {
  opacity: 1;
  visibility: visible;
}

.context-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.context-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.desktop .icons { padding-top: 48px; }

@media (max-width: 640px) {
  .window {
    width: calc(100vw - 24px);
    max-width: none;
    left: 12px !important;
    right: 12px !important;
  }
}
