/* THEME TOKENS — shared by every page */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg2: #f7f7f5;
  --card: #f7f7f5;
  --border: #e9e9e7;
  --text: #37352f;
  --muted: #9b9a97;
  --accent: #2383e2;
  --accent2: #0f7b6c;
  --tag-bg: #efefef;
  --tag-blue-bg: rgba(35, 131, 226, 0.1);
  --tag-green-bg: rgba(15, 123, 108, 0.1);
}
:root[data-theme="dark"] {
  --bg: #191919;
  --bg2: #202020;
  --card: #202020;
  --border: #2c2c2a;
  --text: #e8e8e4;
  --muted: #6b6b6b;
  --accent: #529cca;
  --accent2: #4dab9a;
  --tag-bg: #2c2c2a;
  --tag-blue-bg: rgba(82, 156, 202, 0.15);
  --tag-green-bg: rgba(77, 171, 154, 0.15);
}

/* SHARED FLOATING NAV PILLS — gallery.html & projects.html */
.glass-pill {
  position: fixed;
  top: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 50px;
  white-space: nowrap;
  backdrop-filter: blur(48px) saturate(200%) brightness(1.05);
  -webkit-backdrop-filter: blur(48px) saturate(200%) brightness(1.05);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
:root[data-theme="dark"] .glass-pill {
  background: rgba(18, 18, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
:root[data-theme="light"] .glass-pill {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}
.back-pill { left: 24px; }

.back-pill a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 50px;
  transition: background 0.15s;
}
.back-pill a:hover { background: rgba(128,128,128,0.15); }
.nav-link { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 50px; color: var(--muted); text-decoration: none; font-size: 13px; transition: background 0.15s, color 0.15s; }
.nav-link:hover { background: rgba(128,128,128,0.15); color: var(--text); }

.toggle-btn {
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  border-radius: 50px;
  transition: background 0.15s, color 0.15s;
}
.toggle-btn:hover { background: rgba(128,128,128,0.15); color: var(--text); }

/* REVEAL — shared by index.html, gallery.html, projects.html */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* HIDE NATIVE SCROLLBAR (scrolling still works) */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

/* ACCENT for every pixel effect: orange in dark mode, purple in light mode */
:root { --px-rgb: 165, 62, 8; --px-soft-rgb: 240, 130, 50; }
:root[data-theme="light"] { --px-rgb: 96, 38, 196; --px-soft-rgb: 139, 92, 246; }

/* ONGOING MARKER — box of pulsing orange pixels (projects.html cards, project.html title) */
.ongoing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgb(var(--px-soft-rgb));
}
.ongoing-pixels { display: grid; grid-template-columns: repeat(3, 3px); gap: 1px; flex-shrink: 0; }
.ongoing-pixels i { width: 3px; height: 3px; background: rgb(var(--px-soft-rgb)); animation: ongoing-pulse 1.2s ease-in-out infinite; }
.ongoing-pixels i:nth-child(2), .ongoing-pixels i:nth-child(4) { animation-delay: -0.3s; }
.ongoing-pixels i:nth-child(3), .ongoing-pixels i:nth-child(5), .ongoing-pixels i:nth-child(7) { animation-delay: -0.6s; }
.ongoing-pixels i:nth-child(6), .ongoing-pixels i:nth-child(8) { animation-delay: -0.9s; }
.ongoing-pixels i:nth-child(9) { animation-delay: -0.45s; }
@keyframes ongoing-pulse {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ongoing-pixels i { animation: none; }
}

/* PIXEL WAVE — orange pixels on hover/click; canvas injected by theme.js */
.btn, .exp-link, .link-card { position: relative; overflow: hidden; isolation: isolate; }
.px-wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }


/* BUTTONS — one quiet style in both themes, matching .exp-link (no solid white/black buttons).
   Padding is 1px less than .btn's to make room for the border, so sizes don't change. */
.btn {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 4px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  cursor: pointer;
  border: none;
}
.btn.btn-primary { background: var(--bg2); color: var(--muted); border: 1px solid var(--border); padding: 5px 13px; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s; }
.btn.btn-primary:hover { background: var(--card); border-color: var(--muted); color: var(--text); transform: translateY(-1px); }

/* ICON-ONLY BUTTONS — hidden old label keeps the original size, icon centred over it */
.btn-sizer { visibility: hidden; }
.btn-icon { position: absolute; inset: 0; display: grid; place-items: center; }

/* PIXEL ICONS — ui/ glyphs are masks so they take the text colour; colour icons are plain <img>s */
.px { display: inline-block; width: 15px; height: 15px; flex-shrink: 0; background: currentColor; mask: center / contain no-repeat; }
.i-briefcase { mask-image: url(icons/ui/briefcase.svg); }
.i-folder { mask-image: url(icons/ui/folder.svg); }
.i-book { mask-image: url(icons/ui/book.svg); }
.i-link { mask-image: url(icons/ui/link.svg); }
.i-grid { mask-image: url(icons/ui/grid.svg); }
.i-image { mask-image: url(icons/ui/image.svg); }
.i-arrow-left { mask-image: url(icons/ui/arrow-left.svg); }
.i-arrow-up-right { mask-image: url(icons/ui/arrow-up-right.svg); }
.prop-icon { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; flex-shrink: 0; }

/* MONO ACCENTS — Space Mono on small labels, dates and tags; Inter everywhere else */
.section-label, .exp-date, .exp-company-meta, .exp-org, .tag, .research-venue, .contrib-sub, .prop-key {
  font-family: 'Space Mono', ui-monospace, monospace;
}
