/* ═══════════════════════════════════════════════════════════════
   JAZ.OS — DESIGN TOKEN SYSTEM → CSS CUSTOM PROPERTIES
   Single source of truth for all visual decisions.
   No magic values. All rules reference tokens.
   ════════════════════════════════════════════════════════════════ */

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

:root {
  /* ── Color tokens ─────────────────────────────────────────── */
  --color-bg:             #121212;
  --color-fg:             #e8e6e1;
  --color-fg-muted:       #6b6963;
  --color-fg-dim:         #414141;
  --color-border:         rgba(255,255,255,0.12);
  --color-border-bright:  rgba(255,255,255,0.26);
  --color-accent:         #c8ff00;
  --color-accent-dim:     rgba(200,255,0,0.08);
  --color-accent-border:  rgba(200,255,0,0.32);
  --color-win-bg:         rgba(16,16,16,0.08);
  --color-titlebar:       rgba(255,255,255,0.02);
  --color-sysbar-bg:      rgba(10,10,10,0.92);
  --color-dock-bg:        rgba(14,14,14,0.82);
  --color-ctx-bg:         rgba(18,18,18,0.97);
  --color-boot-bg:        #070707;
  --color-warn:           #ff4f3b;
  --color-warn-border:    rgba(255,80,60,0.7);
  --color-warn-fill:      rgba(255,80,60,0.55);
  --color-warn-hover:     rgba(255,80,60,0.15);
  --color-star:           #f5c842;
  --color-linkedin:       #4da6ff;
  --color-linkedin-dim:   rgba(77,166,255,0.2);
  --color-adplist-dim:    rgba(200,255,0,0.2);
  --color-verified:       #3ecf8e;
  --color-win-shadow:     rgba(0,0,0,0.52);
  --color-win-inner:      rgba(255,255,255,0.055);
  --color-overlay:        rgba(0,0,0,0.25);

  /* ── Typography tokens ────────────────────────────────────── */
  --font-sans:   'Space Grotesk', sans-serif;
  --font-mono:   'Space Mono', monospace;

  /* ── Spacing tokens ───────────────────────────────────────── */
  --space-xs:    4px;
  --space-sm:    8px;
  --space-md:    12px;
  --space-lg:    16px;
  --space-xl:    22px;
  --space-2xl:   28px;

  /* ── Radius tokens ────────────────────────────────────────── */
  --radius-none: 2px;
  --radius-sm:   3px;
  --radius-md:   4px;
  --radius-lg:   9px;
  --radius-xl:   14px;
  --radius-full: 50%;
  --radius-dock: 16px;

  /* ── Z-index tokens ───────────────────────────────────────── */
  --z-desktop:   1;
  --z-window:    100;
  --z-sheet:     8500;
  --z-dock:      8000;
  --z-notif:     89000;
  --z-ctx:       90000;
  --z-boot:      99999;
  --z-grain:     9999;

  /* ── Layout tokens ────────────────────────────────────────── */
  --dock-h:      66px;
  --sysbar-h:    28px;
  --titlebar-h:  33px;
  --win-min-w:   260px;
  --win-min-h:   180px;

  /* ── Motion tokens ────────────────────────────────────────── */
  --duration-fast:   0.11s;
  --duration-base:   0.18s;
  --duration-slow:   0.28s;
  --duration-slower: 0.42s;
}

/* ── Base ─────────────────────────────────────────────────────── */
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Film grain canvas (isolated visual layer) ─────────────────── */
#grain-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: var(--z-grain);
  opacity: 0.036;
  mix-blend-mode: screen;
  will-change: contents;
}

/* ── Desktop dot-grid ──────────────────────────────────────────── */
#desktop {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  background-image: radial-gradient(circle, rgba(255,255,255,0.085) 1px, transparent 1px);
  background-size: var(--space-2xl) var(--space-2xl);
  overflow: hidden;
}

/* ── System Bar ────────────────────────────────────────────────── */
#sysbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--sysbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-sysbar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(24px);
  z-index: var(--z-dock);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--color-fg-muted);
}
#sysbar .sb-left { display: flex; gap: var(--space-lg); align-items: center; }
#sysbar .sb-right { display: flex; gap: 14px; align-items: center; }
.sysbar-logo { color: var(--color-fg); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; cursor: pointer; transition: color 0.15s ease, text-shadow 0.15s ease; display: inline-flex; align-items: center; }
.sysbar-logo:hover { color: var(--color-accent); text-shadow: 0 0 8px rgba(200,255,0,0.3); }
.sysbar-hostname { color: var(--color-fg-dim); font-family: var(--font-mono); font-size: 10px; }
.sysbar-status { font-family: var(--font-mono); font-size: 10px; }
.sysbar-cpu { font-family: var(--font-mono); font-size: 10px; color: var(--color-fg-muted); }
.sysbar-cpu-val { color: var(--color-fg); }

.status-dot {
  width: 5px; height: 5px; border-radius: var(--radius-full);
  background: var(--color-accent); display: inline-block; margin-right: 5px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.28; } }
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

#clock { color: var(--color-fg); font-family: var(--font-mono); font-size: 10px; }

/* ── Jazelle sysbar toggle ───────────────────────────────────── */
#jazbot-toggle {
  display: flex; align-items: center;
  cursor: pointer; font-size: 11px;
  color: var(--color-accent);
  padding: 2px 6px; margin-right: 2px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-base) ease, opacity var(--duration-base) ease;
  line-height: 1;
}
#jazbot-toggle:hover { background: var(--color-accent-dim); }
#jazbot-toggle.hidden { opacity: 0.3; }
#jazbot-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--duration-base) ease;
}
#jazbot-toggle-icon svg {
  display: block;
}
#jazbot-toggle.hidden #jazbot-toggle-icon {
  opacity: 0.3;
}
#jazbot-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── Jazelle pulse-ring animation ─────────────────────────────── */
@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 8px rgba(200,255,0,0.2), 0 0 0 1px rgba(200,255,0,0.08); }
  50%      { box-shadow: 0 0 22px rgba(200,255,0,0.35), 0 0 0 2px rgba(200,255,0,0.15); }
}
.pulse-ring {
  animation: pulseRing 0.6s ease-out;
}

/* ── Battery ───────────────────────────────────────────────────── */
#battery-wrap {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px;
  cursor: pointer;
  padding: 2px var(--space-xs);
  border-radius: var(--radius-sm);
  transition: background var(--duration-base) ease;
}
#battery-wrap:hover { background: var(--color-warn-hover); }
#battery-icon {
  position: relative; width: 22px; height: 11px;
  border: 1px solid var(--color-warn-border); border-radius: var(--radius-none);
}
#battery-icon::after {
  content: '';
  position: absolute; right: -4px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 5px;
  background: var(--color-warn-fill); border-radius: 0 1px 1px 0;
}
#battery-fill {
  position: absolute; left: 1px; top: 1px; bottom: 1px;
  width: 3%;
  background: var(--color-warn);
  border-radius: 1px;
  animation: battflicker 3s ease-in-out infinite;
}
@keyframes battflicker { 0%,90%,100% { opacity: 1; } 94% { opacity: 0.45; } 97% { opacity: 1; } }
#battery-pct { color: var(--color-warn); letter-spacing: 0.06em; }

/* ── Dock ──────────────────────────────────────────────────────── */
#dock {
  position: fixed; bottom: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 7px; align-items: flex-end;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  background: var(--color-dock-bg);
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  border-radius: var(--radius-dock);
  z-index: var(--z-dock);
  white-space: nowrap;
}
.dock-item {
  width: 40px; height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.038);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform var(--duration-base) ease, background var(--duration-base) ease, color var(--duration-base) ease;
  color: var(--color-fg-muted);
  position: relative;
  flex-shrink: 0;
}
.dock-item:hover {
  transform: translateY(-7px) scale(1.14);
  background: rgba(255,255,255,0.08);
  color: var(--color-fg);
}
.dock-item:active { transform: translateY(-3px) scale(1.05); }
.dock-item svg { width: 17px; height: 17px; stroke: currentColor; fill: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dock-label {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  background: rgba(24,24,24,0.97); border: 1px solid var(--color-border-bright);
  padding: 3px 9px; border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: 9px; white-space: nowrap;
  color: var(--color-fg); pointer-events: none;
  opacity: 0; transition: opacity 0.14s ease;
}
.dock-item:hover .dock-label { opacity: 1; }
.dock-divider { width: 1px; height: 22px; background: var(--color-border); margin: 0 var(--radius-sm); align-self: center; flex-shrink: 0; }
.dock-dot {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: var(--radius-full);
  background: var(--color-accent); display: none;
}
.dock-item.is-open .dock-dot { display: block; }

/* ── Window Base ───────────────────────────────────────────────── */
.window {
  position: absolute;
  background: var(--color-win-bg);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-radius: var(--radius-none);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow:
    0 0 0 1px var(--color-overlay),
    0 24px 80px var(--color-win-shadow),
    inset 0 1px 0 var(--color-win-inner);
  will-change: transform;
  min-width: var(--win-min-w);
  min-height: var(--win-min-h);
}
.window.focused { border-color: var(--color-border-bright); }

/* ── Title Bar ─────────────────────────────────────────────────── */
.titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px;
  height: var(--titlebar-h);
  background: var(--color-titlebar);
  border-bottom: 1px solid var(--color-border);
  cursor: grab;
  flex-shrink: 0;
}
.titlebar:active { cursor: grabbing; }
.titlebar-left { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.win-controls { display: flex; gap: 6px; flex-shrink: 0; }
.win-btn {
  width: 11px; height: 11px; border-radius: var(--radius-full);
  cursor: pointer; flex-shrink: 0;
  border: 1px solid var(--color-overlay);
  transition: filter var(--duration-fast) ease, transform var(--duration-fast) ease;
  position: relative;
}
.win-btn:hover { filter: brightness(1.4); transform: scale(1.18); }
.win-btn.close    { background: #ff5f57; }
.win-btn.minimize { background: #ffbd2e; }
.win-btn.maximize { background: #28c840; }
.win-btn::after {
  content: '';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; font-size: 7px; line-height: 1;
  transition: opacity 0.1s;
  color: #000;
}
.win-btn:hover::after { opacity: 0.55; }
.win-btn.close:hover::after    { content: '✕'; }
.win-btn.minimize:hover::after { content: '—'; }
.win-btn.maximize:hover::after { content: '+'; }

.titlebar-title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--color-fg-muted);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.titlebar-title-accent { color: var(--color-accent); }
.win-path {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-fg-dim);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Window Body ───────────────────────────────────────────────── */
.win-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-fg-dim) transparent;
  -webkit-overflow-scrolling: touch;
}
.win-body::-webkit-scrollbar { width: 3px; }
.win-body::-webkit-scrollbar-thumb { background: var(--color-fg-dim); border-radius: var(--radius-none); }

/* ── Profile Window ────────────────────────────────────────────── */
.win-profile { width: 380px; height: 580px; }
.profile-body { padding: 18px var(--space-lg); display: flex; flex-direction: column; gap: var(--space-lg); }
.profile-header { display: flex; gap: var(--space-md); align-items: flex-start; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: var(--radius-full);
  border: 1px solid var(--color-border-bright);
  background: var(--color-accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0; color: var(--color-accent);
}
.profile-info h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.profile-role {
  font-family: var(--font-mono); font-size: 9px; color: var(--color-accent);
  letter-spacing: 0.1em; margin-top: 5px; text-transform: uppercase;
}
.profile-tagline { font-size: 13px; color: var(--color-fg-muted); line-height: 1.6; font-style: italic; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.stat-cell {
  border: 1px solid var(--color-border); padding: 10px var(--space-md); border-radius: var(--radius-none);
  display: flex; flex-direction: column; gap: 3px;
}
.stat-val { font-size: 16px; font-weight: 700; letter-spacing: -0.03em; }
.stat-val-accent { color: var(--color-accent); font-weight: 600; }
.stat-label { font-family: var(--font-mono); font-size: 8.5px; color: var(--color-fg-muted); letter-spacing: 0.08em; text-transform: uppercase; }

.profile-experiences { display: flex; flex-direction: column; gap: 10px; }
.exp-row { display: flex; flex-direction: column; gap: 6px; }
.exp-label { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.12em; color: var(--color-fg-dim); text-transform: uppercase; font-weight: 600; }
.exp-tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.exp-tag {
  font-family: var(--font-mono); font-size: 8.5px; padding: var(--space-xs) 7px;
  border: 1px solid var(--color-border); border-radius: var(--radius-none);
  color: var(--color-fg); letter-spacing: 0.04em;
  transition: border-color 0.14s, background 0.14s;
}
.exp-tag:hover { border-color: var(--color-border-bright); background: rgba(255,255,255,0.04); }

.cta-row { display: flex; gap: var(--space-sm); }
.cta-btn {
  flex: 1; padding: 10px var(--space-sm);
  border: 1px solid var(--color-border); border-radius: var(--radius-none);
  background: transparent; color: var(--color-fg-muted);
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-align: center;
}
.cta-btn:hover { background: var(--color-accent-dim); border-color: var(--color-accent-border); color: var(--color-accent); }
.cta-btn:active { transform: scale(0.97); }
.cta-btn.primary { background: var(--color-accent); border-color: var(--color-accent); color: #080808; font-weight: 700; }
.cta-btn.primary:hover { background: #d4ff1a; border-color: #d4ff1a; }

.win-contact { width: 420px; height: 550px; }
.contact-body { padding: 18px var(--space-lg); display: flex; flex-direction: column; gap: var(--space-lg); }
.contact-form { display: flex; flex-direction: column; gap: var(--space-md); width: 100%; }
.contact-field { display: flex; flex-direction: column; gap: 8px; }
.contact-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-fg-muted); }
.contact-input,
.contact-textarea {
  width: 100%; min-height: 40px;
  border: 1px solid var(--color-border); border-radius: var(--radius-none);
  background: rgba(255,255,255,0.04); color: var(--color-fg);
  padding: 10px 12px; font-family: var(--font-sans); font-size: 13px;
}
.contact-input:focus,
.contact-textarea:focus { outline: none; border-color: var(--color-accent); background: rgba(255,255,255,0.08); }

.contact-select {
  width: 100%; min-height: 40px;
  border: 1px solid var(--color-border); border-radius: var(--radius-none);
  background: rgba(255,255,255,0.04); color: var(--color-fg);
  padding: 10px 12px; font-family: var(--font-sans); font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6963' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.contact-select:hover { border-color: var(--color-border-bright); }
.contact-select:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: rgba(200,255,0,0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23c8ff00' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.contact-select option {
  background: #1a1a1a;
  color: var(--color-fg);
  padding: 8px;
}
.contact-select option:checked {
  background: rgba(200,255,0,0.15);
  color: var(--color-accent);
}
.contact-textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.contact-hint { font-size: 11px; color: var(--color-fg-muted); line-height: 1.4; }
.contact-submit { width: 100%; padding: 12px 0; border-radius: var(--radius-none); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.contact-error { min-height: 16px; color: var(--color-warn); font-size: 11px; }

/* ── Testimonials Window ───────────────────────────────────────── */
.win-testimonials { width: 380px; height: 780px; }
.testimonials-body { padding: 10px 13px; display: flex; flex-direction: column; gap: 9px; }
.tcard {
  border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 13px 14px;
  display: flex; flex-direction: column; gap: 10px;
  transition: background 0.14s ease, border-color 0.14s ease;
  position: relative;
}
.tcard:hover { background: rgba(255,255,255,0.022); border-color: var(--color-border-bright); }
.tcard-verified {
  position: absolute; top: 10px; right: var(--space-md);
  font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.1em;
  color: var(--color-fg-dim); display: flex; align-items: center; gap: 3px;
}
.tcard-verified-dot { width: 5px; height: 5px; border-radius: var(--radius-full); background: var(--color-verified); flex-shrink: 0; }
.tcard-top { display: flex; gap: var(--space-md); align-items: flex-start; }
.tcard-avatar {
  width: 40px; height: 40px; border-radius: var(--radius-full); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-size: 13px; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.14);
  letter-spacing: -0.02em;
}
.tcard-meta { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.tcard-name { font-size: 12.5px; font-weight: 600; color: var(--color-fg); letter-spacing: -0.01em; }
.tcard-role { font-size: 10.5px; color: var(--color-fg-muted); letter-spacing: 0.01em; }
.tcard-org { font-family: var(--font-mono); font-size: 8.5px; color: var(--color-fg-dim); letter-spacing: 0.04em; }
.tcard-platform-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.tcard-platform {
  display: flex; align-items: center; gap: var(--space-xs);
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.06em;
  padding: 2px 7px; border: 1px solid var(--color-border); border-radius: 20px;
}
.tcard-platform svg { width: 9px; height: 9px; flex-shrink: 0; }
.linkedin-badge  { color: var(--color-linkedin); border-color: var(--color-linkedin-dim); }
.adplist-badge   { color: var(--color-accent);   border-color: var(--color-adplist-dim); }
.tcard-stars { display: flex; gap: 2px; }
.tcard-stars span { font-size: 10px; color: var(--color-star); }
.tcard-quote {
  font-size: 11.5px; color: var(--color-fg-muted); line-height: 1.68;
  border-left: 2px solid var(--color-fg-dim); padding-left: 11px;
  font-style: italic; margin-left: 1px;
}
.tcard:hover .tcard-quote { border-left-color: rgba(200,255,0,0.4); color: var(--color-fg); }
.tcard-footer {
  font-family: var(--font-mono); font-size: 8px; color: var(--color-fg-dim);
  letter-spacing: 0.08em; text-align: center; padding: 5px 0 2px;
  border-top: 1px solid var(--color-border); margin-top: 1px;
  display: flex; align-items: center; justify-content: center; gap: var(--space-sm);
}
.tcard-footer-dot { width: 3px; height: 3px; border-radius: var(--radius-full); background: var(--color-fg-dim); }

/* ── Links / Finder Window ─────────────────────────────────────── */
.win-links { width: 380px; height: 350px; }
.win-about { width: 380px; height: 400px; }
.about-body { padding: 14px 15px; display: flex; flex-direction: column; gap: var(--space-md); }
.principle-section { display: flex; flex-direction: column; gap: 10px; }
.principle-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; color: var(--color-fg-dim); text-transform: uppercase; font-weight: 600; }
.principle-list { list-style: disc inside; padding: 0; margin: 0; font-size: 12px; color: var(--color-fg-muted); line-height: 1.7; display: flex; flex-direction: column; gap: 8px; }
.principle-list li { margin: 0; padding: 0 0 0 var(--space-xs); }
.principle-list li::marker { color: var(--color-accent); font-size: 10px; }

.proj-table { display: flex; flex-direction: column; }
.proj-header {
  display: grid; grid-template-columns: 22px 1fr 1fr 20px;
  padding: 7px 14px; gap: 10px;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-mono); font-size: 8.5px;
  color: var(--color-fg-dim); letter-spacing: 0.1em; text-transform: uppercase;
}
.proj-row {
  display: grid; grid-template-columns: 22px 1fr 1fr 20px;
  padding: 11px 14px; gap: 10px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  background: rgba(255,255,255,0.008);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.proj-row .proj-name {
  text-decoration: underline;
  text-decoration-color: rgba(200,255,0,0.35);
  text-underline-offset: 3px;
  color: var(--color-fg);
  font-weight: 500;
  transition: text-decoration-color 0.12s ease, color 0.12s ease;
}
.proj-row .proj-arrow {
  font-size: 13px; color: var(--color-accent);
  opacity: 0.65;
  transition: opacity 0.12s, color 0.12s, transform 0.15s ease;
  text-align: right;
}
.proj-row:hover { background: rgba(200,255,0,0.05); }
.proj-row:hover .proj-name { text-decoration-color: var(--color-accent); color: var(--color-accent); }
.proj-row:hover .proj-arrow { opacity: 1; color: var(--color-accent); transform: translateX(2px); }
.proj-row:last-of-type { border-bottom: none; }
.proj-idx { font-family: var(--font-mono); font-size: 9px; color: var(--color-fg-dim); }
.proj-name-block { display: flex; flex-direction: column; gap: var(--space-xs); }
.proj-name { font-size: 13px; font-weight: 600; color: var(--color-fg); letter-spacing: -0.02em; }
.proj-tags { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.proj-tag {
  font-family: var(--font-mono); font-size: 8px; padding: 2px 6px;
  border: 1px solid var(--color-border); border-radius: var(--radius-none);
  color: var(--color-fg-dim); letter-spacing: 0.04em;
}
.proj-tag.accent-tag { border-color: rgba(200,255,0,0.35); color: var(--color-accent); }
.proj-desc { font-family: var(--font-mono); font-size: 9px; color: var(--color-fg-muted); letter-spacing: 0.04em; }
.proj-footer {
  display: flex; justify-content: space-between; padding: var(--space-sm) 14px;
  font-family: var(--font-mono); font-size: 8.5px; color: var(--color-fg-dim);
  letter-spacing: 0.07em; border-top: 1px solid var(--color-border);
  margin-top: auto;
}

/* ── Boot Screen ───────────────────────────────────────────────── */
#boot-screen {
  position: fixed; inset: 0; background: var(--color-boot-bg);
  z-index: var(--z-boot); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-xl);
}
#boot-logo { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.32em; color: var(--color-fg-muted); text-transform: uppercase; }
#boot-logo-accent { color: var(--color-accent); }
#boot-bar-wrap { width: 200px; height: 1px; background: var(--color-fg-dim); position: relative; }
#boot-bar { position: absolute; left: 0; top: 0; height: 100%; background: var(--color-accent); width: 0%; transition: width 0.05s linear; }
#boot-msg { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; color: var(--color-fg-dim); min-height: 14px; text-transform: uppercase; }

/* ── Resize handle ─────────────────────────────────────────────── */
.resize-handle {
  position: absolute; bottom: 0; right: 0; width: 16px; height: 16px;
  cursor: se-resize; z-index: 10;
}
.resize-handle::after {
  content: ''; position: absolute; bottom: var(--space-xs); right: var(--space-xs);
  width: 5px; height: 5px;
  border-right: 1px solid var(--color-fg-dim); border-bottom: 1px solid var(--color-fg-dim);
}

/* ── Context Menu ──────────────────────────────────────────────── */
#ctx-menu {
  position: fixed; background: var(--color-ctx-bg);
  border: 1px solid var(--color-border-bright); border-radius: 5px;
  padding: var(--space-xs) 0; z-index: var(--z-ctx); min-width: 164px;
  backdrop-filter: blur(24px); display: none;
  box-shadow: 0 12px 44px rgba(0,0,0,0.65);
}
.ctx-item {
  padding: 7px 14px; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.06em; color: var(--color-fg-muted); cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}
.ctx-item:hover { background: rgba(255,255,255,0.06); color: var(--color-fg); }
.ctx-sep { height: 1px; background: var(--color-border); margin: 3px 0; }
.ctx-item.accent-item:hover { color: var(--color-accent); }

/* ── Notification ──────────────────────────────────────────────── */
#notif {
  position: fixed; top: 36px; right: 14px;
  background: linear-gradient(135deg, rgba(200,255,0,0.16) 0%, rgba(200,255,0,0.09) 100%);
  border: 1.5px solid var(--color-accent);
  padding: 14px 18px; border-radius: 6px;
  font-family: var(--font-sans); font-size: 11px; color: var(--color-fg);
  letter-spacing: 0.02em; z-index: var(--z-notif); pointer-events: auto;
  opacity: 0; transform: translateY(-6px) scale(0.94);
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: 300px; line-height: 1.6;
  box-shadow: 0 0 0 1px rgba(200,255,0,0.22), 0 0 24px rgba(200,255,0,0.08), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
}
#notif.show { opacity: 1; transform: translateY(0) scale(1); }
#notif-title { color: var(--color-accent); display: block; margin-bottom: 4px; font-weight: 700; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ── Focus states ──────────────────────────────────────────────── */
.win-btn:focus-visible,
.dock-item:focus-visible,
.cta-btn:focus-visible,
.proj-row:focus-visible,
.ctx-item:focus-visible,
#battery-wrap:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #grain-canvas { display: none; }
}

/* ── Jazelle — Sleek Modern Retro Mac Computer Face ──────────── */
#jazbot {
  position: fixed;
  bottom: 90px;
  right: 18px;
  z-index: 7500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#jazbot:hover #jazbot-avatar {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 0 22px rgba(200,255,0,0.18),
    0 0 0 2px rgba(200,255,0,0.12),
    0 10px 28px rgba(0,0,0,0.42);
}
#jazbot.dismissed {
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
}

/* ── Jazelle — minimalist CLI icon (rectangle with >_) ───────── */
#jazbot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #0d0f14;
  border: 2px solid var(--color-border);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 12px 28px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  font-family: var(--font-mono);
  overflow: hidden;
  cursor: pointer;
}

#jazbot:hover #jazbot-avatar {
  transform: translateY(-4px) scale(1.06);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.10),
    0 16px 32px rgba(0,0,0,0.55);
}

#jazbot:focus-visible {
  outline: none;
}
#jazbot:focus-visible #jazbot-avatar {
  box-shadow:
    0 0 0 3px rgba(200,255,0,0.40),
    0 12px 28px rgba(0,0,0,0.5);
}

/* Minimalist CLI prompt >_ */
.jaz-dots {
  display: none;
}

.jaz-prompt {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.jaz-chevron {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  font-style: normal;
}

.jaz-underscore {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  animation: blinkUnderscore 1.1s steps(1) infinite;
}

@keyframes blinkUnderscore {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Speech bubble — appears ABOVE the avatar */
#jazbot-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: rgba(14,18,28,0.3);
  border: 1px solid rgba(255,255,255,0.14);
  border-left: 3px solid rgba(200,255,0,0.76);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  max-width: 240px;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-fg);
  line-height: 1.6;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  box-shadow: 0 18px 34px rgba(0,0,0,0.28);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(28px);
}
#jazbot-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
/* Bubble tail — points down toward avatar */
#jazbot-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 16px;
  width: 10px;
  height: 10px;
  background: rgba(14,18,28,0.3);
  border-right: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(255,255,255,0.14);
  transform: translateY(-50%) rotate(45deg);
}

/* ── Smart bubble flipping (toggled by JS on drag) ──────────── */
/* Bubble below avatar (when Jazelle is in top half) */
.bubble-below #jazbot-bubble {
  bottom: auto;
  top: calc(100% + 10px);
}
.bubble-below #jazbot-bubble::after {
  top: auto;
  bottom: 100%;
  transform: translateY(50%) rotate(225deg);
}

/* Bubble left-aligned (when Jazelle is in left half) */
.bubble-left #jazbot-bubble {
  right: auto;
  left: 0;
}
.bubble-left #jazbot-bubble::after {
  right: auto;
  left: 16px;
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE — sheet layout below 720px
══════════════════════════════════════════════════════════════════ */
@media (max-width: 719px) {
  html, body { overflow: hidden; }

  .window {
    position: fixed !important;
    left: 0 !important; right: 0 !important;
    top: auto !important;
    bottom: 72px !important;
    width: 100% !important;
    min-width: unset !important;
    max-width: 100% !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    border-left: none !important; border-right: none !important; border-bottom: none !important;
    border-top: 1px solid var(--color-border-bright) !important;
    transform: translateY(100%) !important;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1) !important;
    will-change: transform;
    z-index: var(--z-sheet) !important;
    height: calc(100dvh - var(--sysbar-h) - 72px) !important;
    max-height: calc(100dvh - var(--sysbar-h) - 72px) !important;
    overflow: hidden !important;
    display: flex !important;
  }
  .window.mobile-open {
    transform: translateY(0) !important;
    z-index: var(--z-sheet) !important;
  }
  .window:not(.mobile-open) { pointer-events: none; }
  .titlebar { cursor: default !important; }
  .win-btn.maximize, .win-path, .resize-handle { display: none !important; }
  .win-body { flex: 1; min-height: 0; padding-bottom: 20px !important; }

  #sheet-overlay { display: none !important; }

  #dock {
    bottom: 0 !important;
    left: 0 !important; right: 0 !important;
    width: 100% !important;
    transform: none !important;
    border-radius: 0 !important;
    border-left: none !important; border-right: none !important; border-bottom: none !important;
    border-top: 1px solid var(--color-border) !important;
    justify-content: space-around !important;
    padding: 10px var(--space-lg) calc(10px + env(safe-area-inset-bottom)) !important;
    gap: 0 !important;
    z-index: 8600 !important;
  }
  .dock-item { width: 52px; height: 52px; border-radius: var(--space-md); }
  .dock-item:hover { transform: none; }
  .dock-item:active { transform: scale(0.93) !important; background: rgba(255,255,255,0.08) !important; }
  .dock-label { display: none; }
  .dock-divider { display: none; }
  .dock-dot { bottom: -8px; }

  #sysbar { padding: 0 var(--space-md); }
  #cpu-label { display: none; }

  /* Jazelle — mobile: smaller, just above dock */
  #jazbot { bottom: 78px; right: 10px; }
  #jazbot-avatar { width: 40px; height: 40px; border-radius: 6px; border-width: 2px; }
  .jaz-chevron, .jaz-underscore { font-size: 16px; }
  #jazbot-bubble { max-width: 160px; font-size: 10px; padding: 6px 10px; }
  #jazbot-bubble::after { right: 10px; }

  #notif { right: 10px; max-width: calc(100vw - 20px); font-size: 10px; padding: 12px 14px; }
  #notif-title { font-size: 9px; }
  #ctx-menu { display: none !important; }

  #mobile-hero {
    position: fixed;
    top: var(--sysbar-h); left: 0; right: 0;
    bottom: 72px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px; padding: 24px;
    text-align: center;
    pointer-events: none;
  }
  .hero-eyebrow {
    font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.22em;
    color: var(--color-fg-dim); text-transform: uppercase; margin-bottom: var(--space-xs);
  }
  .hero-name {
    font-size: 52px; font-weight: 700; letter-spacing: -0.04em; line-height: 0.95;
    color: var(--color-fg);
  }
  .hero-role {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
    color: var(--color-accent); text-transform: uppercase; margin-top: 10px;
  }
  /* Hero confetti */
  .hero-confetti {
    position: fixed;
    top: -10px;
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 2px;
    z-index: 99999;
    pointer-events: none;
    animation: confettiFall 2.5s ease-out forwards;
    opacity: 0.9;
  }
  .hero-confetti:nth-child(odd) { width: 4px; height: 10px; border-radius: 1px; }
  .hero-confetti:nth-child(3n)  { background: #fff; opacity: 0.7; }

  .hero-hint {
    font-family: var(--font-mono); font-size: 9px; color: var(--color-fg-dim);
    letter-spacing: 0.1em; margin-top: 28px; text-transform: uppercase;
    animation: pulse 2.4s ease-in-out infinite;
  }
}

/* ══════════════════════════════════════════════════════════════════
   TABLET — scrollable desktop for iPad Mini and similar (720‑1024px)
   Enables horizontal scroll so off-screen windows can be reached
   without altering their default positions.
   ══════════════════════════════════════════════════════════════════ */
@media (min-width: 720px) and (max-width: 1024px) {
  #desktop {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    width: 100%;
  }
  .window {
    scroll-snap-align: start;
  }
  /* Ensure windows maintain their absolute positions within the
     scrollable container but don't get clipped by viewport edges */
  .window {
    flex-shrink: 0;
  }
}

@media (min-width: 720px) {
  #mobile-hero { display: none; }
  #sheet-overlay { display: none !important; }
  .window { transition: none; }
}

/* ──────────────────────────────────────────────
   COOKIE CONSENT BANNER
   Translucent, matches JAZ.OS glass aesthetic.
   Single thin line below sysbar, never overlaps dock.
   ────────────────────────────────────────────── */
#consent-banner {
  position: fixed;
  top: var(--sysbar-h);
  left: 0;
  right: 0;
  z-index: 7500;
  background: rgba(18,18,18,0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 5px 16px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
  min-height: 34px;
}

#consent-banner.visible {
  transform: translateY(0);
}

#consent-banner p {
  margin: 0;
  font-size: 0.68rem;
  color: #a09e98;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}

.consent-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  white-space: nowrap;
}

.consent-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.consent-accept {
  background: #c8ff00;
  color: #121212;
  font-weight: 600;
  border-color: #c8ff00;
}

.consent-accept:hover {
  background: #d4ff33;
  border-color: #d4ff33;
}

.consent-accept:focus-visible {
  outline: 2px solid #c8ff00;
  outline-offset: 2px;
}

.consent-more {
  background: transparent;
  color: #a09e98;
}

.consent-more:hover {
  background: rgba(255,255,255,0.06);
  color: #e8e6e1;
}

.consent-more:focus-visible {
  outline: 2px solid #a09e98;
  outline-offset: 2px;
}

/* ── Decline: subtle text-only link, industry standard pattern ─── */
.consent-decline {
  background: none;
  border: none;
  padding: 2px 4px;
  font-family: 'Space Mono', monospace;
  font-size: 0.58rem;
  color: #5a5855;
  cursor: pointer;
  transition: color 0.2s ease;
  text-decoration: none;
  letter-spacing: 0.03em;
  line-height: 1;
}

.consent-decline:hover {
  color: #a09e98;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.15);
}

.consent-decline:focus-visible {
  outline: 2px solid #6b6963;
  outline-offset: 3px;
  border-radius: 2px;
}

@media (max-width: 719px) {
  #consent-banner {
    flex-wrap: wrap;
    padding: 6px 12px;
    gap: 6px;
    justify-content: center;
    text-align: center;
  }
  #consent-banner p {
    font-size: 0.62rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    flex: unset;
    max-width: 100%;
  }
  .consent-actions {
    gap: 5px;
  }
  .consent-btn {
    font-size: 0.58rem;
    padding: 3px 8px;
  }
  .consent-decline {
    font-size: 0.55rem;
    padding: 2px 3px;
  }
}

