@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ─────────────────────────────────────────────
   CSS VARIABLES — Light (default)
───────────────────────────────────────────── */
:root {
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --background:    40 20% 98%;
  --foreground:    220 20% 12%;
  --primary:       24 92% 52%;
  --primary-fg:    0 0% 100%;
  --secondary:     220 14% 94%;
  --muted:         220 14% 96%;
  --muted-fg:      220 10% 46%;
  --border:        220 14% 90%;
  --destructive:   0 84% 60%;
  --ring:          24 92% 52%;
  --radius:        0.75rem;

  --surface-1:     0 0% 100%;
  --surface-2:     220 14% 97%;
  --surface-3:     220 14% 94%;
  --win-border:    220 14% 88%;
  --text-sys:      220 10% 46%;
  --dot-grid:      hsla(220, 14%, 80%, 0.3);
  --desktop:       40 20% 94%;
  --taskbar:       0 0% 100%;

  --win-shadow:    0 8px 32px -4px hsla(220,20%,12%,0.08),
                   0 4px 12px -2px hsla(220,20%,12%,0.04);
  --glow:          0 0 40px hsla(24,92%,52%,0.15);
}

/* ─────────────────────────────────────────────
   CSS VARIABLES — Website Dark
───────────────────────────────────────────── */
.website-dark {
  --background:    230 18% 10%;
  --foreground:    220 14% 90%;
  --secondary:     230 14% 16%;
  --muted:         230 14% 16%;
  --muted-fg:      220 10% 55%;
  --border:        230 14% 20%;
  --surface-1:     230 16% 13%;
  --surface-2:     230 16% 11%;
  --surface-3:     230 14% 17%;
  --win-border:    230 14% 22%;
  --text-sys:      220 10% 52%;
  --dot-grid:      hsla(230,14%,22%,0.4);
  --desktop:       230 18% 8%;
  --taskbar:       230 16% 11%;
  --win-shadow:    0 8px 32px -4px hsla(0,0%,0%,0.3),
                   0 4px 12px -2px hsla(0,0%,0%,0.15);
  --glow:          0 0 50px hsla(24,92%,52%,0.18);
}

/* ─────────────────────────────────────────────
   CSS VARIABLES — System (deep dark)
───────────────────────────────────────────── */
.system-mode {
  --background:    225 25% 6%;
  --foreground:    220 14% 92%;
  --secondary:     225 18% 14%;
  --muted:         225 18% 14%;
  --muted-fg:      220 10% 55%;
  --border:        225 18% 16%;
  --surface-1:     225 20% 10%;
  --surface-2:     225 20% 8%;
  --surface-3:     225 18% 14%;
  --win-border:    225 18% 18%;
  --text-sys:      220 10% 50%;
  --dot-grid:      hsla(225,18%,20%,0.5);
  --desktop:       225 25% 4%;
  --taskbar:       225 20% 8%;
  --win-shadow:    0 8px 32px -4px hsla(0,0%,0%,0.4),
                   0 4px 12px -2px hsla(0,0%,0%,0.2);
  --glow:          0 0 60px hsla(24,92%,52%,0.2);
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ─────────────────────────────────────────────
   UTILITY CLASSES
───────────────────────────────────────────── */
.bg-desktop  { background-color: hsl(var(--desktop)); }
.bg-taskbar  { background-color: hsl(var(--taskbar)); }
.bg-surface-1 { background-color: hsl(var(--surface-1)); }
.bg-surface-2 { background-color: hsl(var(--surface-2)); }
.bg-surface-3 { background-color: hsl(var(--surface-3)); }

.text-fg      { color: hsl(var(--foreground)); }
.text-muted   { color: hsl(var(--muted-fg)); }
.text-primary { color: hsl(var(--primary)); }

.border-win   { border-color: hsl(var(--win-border)); }
.border-std   { border-color: hsl(var(--border)); }

.os-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--text-sys));
}

.os-window {
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--win-border));
  border-radius: var(--radius);
  box-shadow: var(--win-shadow);
}

.os-dot-grid {
  background-image: radial-gradient(var(--dot-grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

.text-gradient {
  background: linear-gradient(135deg, hsl(24,92%,52%), hsl(32,95%,58%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-primary { box-shadow: var(--glow); }

.font-mono { font-family: var(--font-mono) !important; }

.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ─────────────────────────────────────────────
   SCROLLBAR (document window)
───────────────────────────────────────────── */
.scroll-area::-webkit-scrollbar { width: 6px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb {
  background: hsl(var(--win-border));
  border-radius: 3px;
}
.scroll-area::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-fg));
}

/* ─────────────────────────────────────────────
   TASKBAR
───────────────────────────────────────────── */
#taskbar {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background-color: hsl(var(--taskbar));
  border-bottom: 1px solid hsl(var(--win-border));
  flex-shrink: 0;
  z-index: 50;
  font-size: 12px;
}

#taskbar button {
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--muted-fg));
  font-size: 12px;
  font-family: var(--font-sans);
  padding: 0 4px;
  transition: color 0.15s;
}
#taskbar button:hover { color: hsl(var(--foreground)); }

/* ─────────────────────────────────────────────
   DOCK (left sidebar & right shortcuts)
───────────────────────────────────────────── */
.dock-sidebar {
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 4px;
  gap: 4px;
  flex-shrink: 0;
  overflow-y: auto;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  background: none;
  border: none;
  text-align: center;
}
.dock-item:hover { background: hsl(var(--surface-3) / 0.8); }

.dock-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--win-border));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.05);
  color: hsl(var(--muted-fg));
}
.dock-item:hover .dock-icon {
  border-color: hsl(var(--primary) / 0.3);
  color: hsl(var(--foreground));
}

.dock-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: hsl(var(--muted-fg));
  line-height: 1.2;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-sep {
  width: 40px;
  height: 1px;
  background: hsl(var(--win-border));
  margin: 8px auto;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   DOCUMENT WINDOW (main window)
───────────────────────────────────────────── */
#main-window {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  flex: 1;
  max-width: 1100px;
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--win-border));
  box-shadow: var(--win-shadow);
}

#main-window.maximized {
  position: fixed;
  inset: 0;
  max-width: none;
  border-radius: 0;
  z-index: 200;
}

.win-titlebar {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid hsl(var(--win-border));
  background: hsl(var(--surface-2) / 0.8);
  flex-shrink: 0;
}

.win-toolbar {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid hsl(var(--win-border));
  background: hsl(var(--surface-2) / 0.4);
  flex-shrink: 0;
  overflow-x: auto;
}

.toolbar-sep {
  width: 1px;
  height: 16px;
  background: hsl(var(--win-border));
  margin: 0 4px;
  flex-shrink: 0;
}

.toolbar-btn {
  padding: 6px;
  border-radius: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: hsl(var(--muted-fg));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
  font-family: var(--font-mono);
  font-size: 10px;
}
.toolbar-btn:hover {
  background: hsl(var(--surface-3));
  color: hsl(var(--foreground));
}

.toolbar-cta {
  display: none;
  margin-left: 8px;
  padding: 4px 12px;
  border-radius: 6px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-fg));
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.toolbar-cta:hover { opacity: 0.9; }
@media (min-width: 640px) { .toolbar-cta { display: inline-flex; } }

/* ─────────────────────────────────────────────
   TRAFFIC LIGHTS
───────────────────────────────────────────── */
.tl-group { display: flex; gap: 6px; align-items: center; }

.tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: filter 0.15s;
}
.tl:hover { filter: brightness(1.1); }
.tl svg { opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.tl:hover svg { opacity: 1; }
.tl-close { background: #ff5f57; }
.tl-min   { background: #febc2e; }
.tl-max   { background: #28c840; }

/* ─────────────────────────────────────────────
   FLOATING WINDOWS
───────────────────────────────────────────── */
#windows-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

.float-win {
  position: absolute;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--win-border));
  box-shadow: var(--win-shadow);
  pointer-events: all;
  animation: winIn 0.28s cubic-bezier(0.22,1,0.36,1) both;
}

.float-win.maximized {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}

.float-titlebar {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid hsl(var(--win-border));
  background: hsl(var(--surface-2) / 0.8);
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}
.float-titlebar:active { cursor: grabbing; }

.float-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: hsl(var(--muted-fg));
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.float-body {
  flex: 1;
  overflow-y: auto;
}

/* Resize handles */
.float-win .rh { position: absolute; }
.float-win .rh-n  { top:0; left:0; right:0; height:4px; cursor:n-resize; }
.float-win .rh-s  { bottom:0; left:0; right:0; height:4px; cursor:s-resize; }
.float-win .rh-w  { top:0; bottom:0; left:0; width:4px; cursor:w-resize; }
.float-win .rh-e  { top:0; bottom:0; right:0; width:4px; cursor:e-resize; }
.float-win .rh-nw { top:0; left:0; width:12px; height:12px; cursor:nw-resize; }
.float-win .rh-ne { top:0; right:0; width:12px; height:12px; cursor:ne-resize; }
.float-win .rh-sw { bottom:0; left:0; width:12px; height:12px; cursor:sw-resize; }
.float-win .rh-se { bottom:0; right:0; width:12px; height:12px; cursor:se-resize; }

/* ─────────────────────────────────────────────
   OS WINDOW CARD (used inside sections)
───────────────────────────────────────────── */
.card {
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--win-border));
  border-radius: var(--radius);
  box-shadow: var(--win-shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid hsl(var(--win-border));
}
.card-header.compact { padding: 8px 12px; }
.card-header.normal  { padding: 12px 16px; }

.card-dots { display: flex; gap: 6px; align-items: center; }
.dot-r { width:10px; height:10px; border-radius:50%; background: hsl(var(--destructive) / 0.6); }
.dot-y { width:10px; height:10px; border-radius:50%; background: hsl(var(--primary) / 0.4); }
.dot-g { width:10px; height:10px; border-radius:50%; background: hsl(var(--muted-fg) / 0.3); }

.card-body.compact { padding: 12px; }
.card-body.normal  { padding: 20px; }

/* ─────────────────────────────────────────────
   FORM ELEMENTS
───────────────────────────────────────────── */
input, textarea, select {
  width: 100%;
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--win-border));
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 2px);
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
input:focus, textarea:focus, select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}
textarea { resize: none; }

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, hsl(var(--muted-fg)) 50%),
    linear-gradient(135deg, hsl(var(--muted-fg)) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

select option {
  background: hsl(var(--surface-1));
  color: hsl(var(--foreground));
}

select:invalid {
  color: hsl(var(--muted-fg));
}

/* ─────────────────────────────────────────────
   MOBILE HEADER
───────────────────────────────────────────── */
#mobile-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background-color: hsl(var(--taskbar));
  border-bottom: 1px solid hsl(var(--win-border));
  flex-shrink: 0;
}

#mobile-nav {
  background: hsl(var(--surface-1));
  border-bottom: 1px solid hsl(var(--win-border));
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}
#mobile-nav.open {
  max-height: 400px;
  opacity: 1;
}
#mobile-nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: hsl(var(--muted-fg));
  font-family: var(--font-sans);
  transition: background 0.1s, color 0.1s;
}
#mobile-nav button:hover {
  background: hsl(var(--surface-3));
  color: hsl(var(--foreground));
}

/* ─────────────────────────────────────────────
   MINIMIZED TRAY
───────────────────────────────────────────── */
.tray-btn {
  padding: 2px 8px;
  border-radius: 4px;
  background: hsl(var(--surface-3));
  border: 1px solid hsl(var(--win-border));
  font-family: var(--font-mono);
  font-size: 10px;
  color: hsl(var(--muted-fg));
  cursor: pointer;
  transition: background 0.1s;
}
.tray-btn:hover { background: hsl(var(--primary) / 0.15); }

/* ─────────────────────────────────────────────
   SECTION UTILITIES
───────────────────────────────────────────── */
.section-border { border-top: 1px solid hsl(var(--win-border)); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  background: hsl(var(--primary));
  color: hsl(var(--primary-fg));
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  box-shadow: var(--glow);
}
.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--surface-2));
  color: hsl(var(--foreground));
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: hsl(var(--surface-3)); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--primary));
  font-size: 14px;
  font-family: var(--font-sans);
  padding: 0;
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.tech-tag {
  padding: 6px 12px;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--surface-2));
  border: 1px solid hsl(var(--border));
  font-family: var(--font-mono);
  font-size: 12px;
  color: hsl(var(--foreground));
}

.skill-tag {
  padding: 2px 8px;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--surface-3));
  border: 1px solid hsl(var(--win-border));
  font-family: var(--font-mono);
  font-size: 10px;
  color: hsl(var(--muted-fg));
}

/* ─────────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────────── */
@keyframes winIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
