/* ── abyOS base — tokens + reset ── */
:root {
  /* dark glass theme (default) */
  --bg:          #1a1510;
  --bg-grid:     rgba(244,241,232,.04);
  --win-bg:      rgba(20,18,15,.92);
  --win-border:  rgba(244,241,232,.15);
  --win-head:    rgba(244,241,232,.05);
  --text:        #f4f1e8;
  --text-muted:  rgba(244,241,232,.45); /* also used for tray text */
  --accent:      #ff5a3c;
  --accent-dim:  rgba(255,90,60,.15);
  --pill-bg:     rgba(244,241,232,.09);
  --pill-border: rgba(244,241,232,.18);
  --term-bg:     #0d0d0d;
  --term-text:   #b5e853;
  --icon-border: rgba(244,241,232,.15);
  --icon-bg:     rgba(244,241,232,.06);
  --zine-bg:     #1e1a14;
  --radius-win:  8px;
  --radius-pill: 10px;
  /* shared */
  --font-mono:   'JetBrains Mono', monospace;
  --font-ui:     'Inter', system-ui, sans-serif;
  --font-display:'Gloock', 'Georgia', serif;
  --font-hand:   'Kalam', 'Caveat', cursive;
  /* brand colours */
  --myrtle:      #6dbf78;
  --myrtle-dim:  rgba(109,191,120,.12);
}

[data-theme="light"] {
  --bg:          #e8e4da;
  --bg-grid:     rgba(26,26,26,.04);
  --accent:      #ff5a3c;
  --accent-dim:  rgba(255,90,60,.15);
  --win-bg:      rgba(244,241,232,.95);
  --win-border:  rgba(26,26,26,.18);
  --win-head:    rgba(26,26,26,.06);
  --text:        #1a1a1a;
  --text-muted:  rgba(26,26,26,.45); /* also used for tray text */
  --pill-bg:     rgba(26,26,26,.09);
  --pill-border: rgba(26,26,26,.18);
  --term-bg:     #1a1510;
  --term-text:   #b5e853;
  --icon-border: rgba(26,26,26,.18);
  --icon-bg:     rgba(26,26,26,.06);
  --zine-bg:     #ede9df;
}

*, *::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-ui);
  font-size: 16px;
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  transition: background .3s, color .3s;
}

/* desktop grid overlay */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* window control buttons — circular, consistent everywhere */
.win-controls { display: flex; gap: 6px; align-items: center; }
.win-controls button {
  width: 14px; height: 14px;
  border-radius: 50%; padding: 0;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s, opacity .15s;
  position: relative;
}
.win-controls button:hover:not(:disabled) { transform: scale(1.35); }
.win-controls button:disabled { cursor: default; opacity: .4; }
.win-btn-min  { background: #febc2e; border: 1px solid #d49b14; }
.win-btn-max  { background: #28c840; border: 1px solid #12ac25; }
.win-btn-close{ background: #ff5f57; border: 1px solid #e0443e; }
/* hover glyphs */
.win-controls button::after {
  content: ''; opacity: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 800; line-height: 1;
  color: rgba(0,0,0,.6);
  transition: opacity .12s;
}
.win-controls button:hover:not(:disabled)::after { opacity: 1; }
.win-btn-min::after  { content: '−'; }
.win-btn-max::after  { content: '□'; font-size: 9px; }
.win-btn-close::after{ content: '×'; }

/* mono tag chip */
.mono-tag {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 7px; border: 1px solid var(--win-border);
  border-radius: 3px; display: inline-block; color: var(--text-muted);
}

/* theme transition for all coloured elements */
.os-window, .taskbar-pill, .desktop-icon,
.sys-tray, footer { transition: background .3s, border-color .3s, color .3s; }

/* ── shared OS chrome for project pages ── */
.os-project-titlebar {
  position: sticky; top: 0; z-index: 200;
  padding: 10px 16px;
  background: var(--win-head);
  border-bottom: 1px solid var(--win-border);
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted);
  backdrop-filter: blur(16px);
}
.os-project-title { flex: 1; }
.os-project-exit {
  font-size: 9px; color: inherit; text-decoration: none; opacity: .6;
}
.os-project-exit:hover { opacity: 1; color: var(--accent, #ff5a3c); }
