/**
 * =========================================================================
 * REUSABLE COMPONENTS & INTERACTIVE UI ELEMENTS
 * =========================================================================
 */

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--trans-base), background-color var(--trans-base), border-color var(--trans-base), box-shadow var(--trans-base), color var(--trans-base);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--grad-accent);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background-color: var(--bg-elevated);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background-color: var(--accent-primary-faint);
}

.btn-sm {
  padding: 0.5rem 1.05rem;
  font-size: 0.8125rem;
}

/* Theme Switcher Button */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans-base);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-primary-light);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: rotate(15deg) scale(1.08);
}

.theme-icon-sun,
.theme-icon-moon {
  transition: transform var(--trans-base), opacity var(--trans-base);
  width: 18px;
  height: 18px;
}

/* Dark mode: show sun to switch to light */
[data-theme="dark"] .theme-icon-sun,
:root:not([data-theme="light"]) .theme-icon-sun {
  display: block;
  color: var(--accent-warm-light);
}
[data-theme="dark"] .theme-icon-moon,
:root:not([data-theme="light"]) .theme-icon-moon {
  display: none;
}

/* Light mode: show moon to switch to dark */
[data-theme="light"] .theme-icon-sun {
  display: none;
}
[data-theme="light"] .theme-icon-moon {
  display: block;
  color: var(--accent-primary);
}

/* Floating Quick Theme Switcher Widget */
.floating-theme-widget {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: var(--z-sticky);
  pointer-events: auto;
}

.floating-theme-pill {
  width: auto;
  height: auto;
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: all var(--trans-base);
  transform: none;
}

.floating-theme-pill:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--accent-primary-light);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.floating-theme-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.floating-theme-icon-wrap svg {
  width: 15px;
  height: 15px;
}

.floating-theme-label {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

[data-theme="dark"] .floating-theme-label.light-label,
:root:not([data-theme="light"]) .floating-theme-label.light-label {
  display: none;
}
[data-theme="dark"] .floating-theme-label.dark-label,
:root:not([data-theme="light"]) .floating-theme-label.dark-label {
  display: inline;
}

[data-theme="light"] .floating-theme-label.dark-label {
  display: none;
}
[data-theme="light"] .floating-theme-label.light-label {
  display: inline;
}

@media (max-width: 640px) {
  .floating-theme-widget {
    bottom: 1rem;
    left: 1rem;
  }
  .floating-theme-label {
    display: none !important;
  }
  .floating-theme-pill {
    padding: 0.5rem;
    width: 42px;
    height: 42px;
    justify-content: center;
  }
}

/* ================= Badges & Chips ================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  transition: all var(--trans-fast);
}

.badge-iris {
  background-color: var(--accent-primary-faint);
  color: var(--accent-primary-light);
  border-color: rgba(129, 140, 248, 0.3);
}

[data-theme="light"] .badge-iris {
  color: var(--accent-primary);
}

.badge-warm {
  background-color: var(--accent-warm-faint);
  color: var(--accent-warm);
  border-color: rgba(245, 158, 11, 0.3);
}

.badge-cyan {
  background-color: var(--accent-cyan-faint);
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.3);
}

.badge-amber {
  background-color: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}

[data-theme="light"] .badge-amber {
  background-color: rgba(249, 115, 22, 0.1);
  color: #ea580c;
  border-color: rgba(249, 115, 22, 0.22);
}

/* ================= Glass & Editorial Cards ================= */
.card-glass {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: border-color var(--trans-base), transform var(--trans-base), box-shadow var(--trans-base);
  position: relative;
  overflow: hidden;
}

.card-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
}

.card-glass:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ================= Project Filter Tabs ================= */
.filter-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2xl);
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-secondary);
  padding: 0.375rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.filter-btn {
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--trans-base);
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

/* ================= Modal System (Case Studies) ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

[data-theme="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.7);
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.is-open .modal-container {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: sticky;
  top: 1.25rem;
  right: 1.25rem;
  float: right;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
  cursor: pointer;
  margin-top: 1rem;
  margin-right: 1rem;
}

.modal-close-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  transform: rotate(90deg);
}

.modal-body {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.modal-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.modal-tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.modal-meta-item .label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.modal-meta-item .val {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.modal-preview-box {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-card);
  background: var(--bg-tertiary);
  margin-bottom: 2.25rem;
}

.modal-preview-box img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
}

.modal-section-block {
  margin-bottom: 2rem;
}

.modal-section-block h4 {
  font-size: 1.2rem;
  color: var(--accent-primary-light);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="light"] .modal-section-block h4 {
  color: var(--accent-primary);
}

.modal-section-block p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.modal-features-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.modal-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.modal-features-list li::before {
  content: '→';
  color: var(--accent-primary);
  font-weight: 700;
  font-family: var(--font-mono);
}

.modal-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* ================= UI/UX Lab Widgets ================= */
.ui-lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.75rem;
}

.ui-lab-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--trans-base);
  position: relative;
  overflow: hidden;
}

.ui-lab-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity var(--trans-base);
}

.ui-lab-card:hover::before {
  opacity: 1;
}

.ui-lab-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), 0 0 25px var(--accent-glow);
  transform: translateY(-3px);
}

.ui-lab-header {
  margin-bottom: 1.25rem;
}

.ui-lab-number {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-primary-light);
  margin-bottom: 0.35rem;
}

[data-theme="light"] .ui-lab-number {
  color: var(--accent-primary);
}

.ui-lab-title {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.ui-lab-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.ui-lab-interactive-area {
  margin-top: 1.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.clarity-switch-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.clarity-toggle-btn {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.clarity-toggle-btn.active {
  background: var(--accent-primary-faint);
  color: var(--accent-primary-light);
  border-color: rgba(129, 140, 248, 0.4);
}

[data-theme="light"] .clarity-toggle-btn.active {
  color: var(--accent-primary);
}

.clarity-view-container {
  font-size: 0.85rem;
  transition: all var(--trans-base);
}

.clarity-messy {
  color: #f43f5e;
  font-family: monospace;
  background: rgba(244, 63, 94, 0.08);
  padding: 0.75rem;
  border-radius: 6px;
  line-height: 1.4;
  word-break: break-all;
}

.clarity-clean {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.clean-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.interaction-playground {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.tactile-button {
  position: relative;
  padding: 0.8rem 1.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--grad-accent);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px var(--accent-glow);
  color: #fff;
  overflow: hidden;
}

.tactile-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}

.tactile-button:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 28px var(--accent-glow);
  filter: brightness(1.1);
}

.tactile-button:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.tactile-feedback-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary-light);
  min-height: 1.2rem;
}

[data-theme="light"] .tactile-feedback-pill {
  color: var(--accent-primary);
}

.simplicity-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.simplicity-steps-display {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
}

.simplicity-step {
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.simplicity-step.active {
  background: var(--accent-primary);
  color: #ffffff;
  font-weight: 700;
}

.simplicity-slider-control {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Toast Notifications */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--accent-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  z-index: var(--z-modal);
  transform: translateY(50px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* ================= VERTICAL SCROLL PROGRESS HUD (RIGHT-SIDE) ================= */
.scroll-hud {
  position: fixed;
  right: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-fixed);
  display: flex;
  align-items: center;
  pointer-events: auto;
  opacity: 0.85;
  transition: opacity var(--trans-base);
}

.scroll-hud:hover {
  opacity: 1;
}

.hud-line-track {
  position: absolute;
  right: 6px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
  z-index: 1;
}

.hud-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, var(--accent-primary-light), var(--accent-warm));
  transition: height 0.15s ease-out;
}

.hud-markers-list {
  position: relative;
  z-index: 2;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.hud-marker a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-decoration: none;
  padding: 4px 0;
}

.hud-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(6px);
  transition: all var(--trans-fast);
  margin-right: 0.5rem;
  letter-spacing: 0.08em;
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-card);
  border: 1px solid var(--border-hover);
  transition: all var(--trans-fast);
  flex-shrink: 0;
}

.hud-tooltip {
  position: absolute;
  right: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .hud-tooltip {
  color: var(--text-primary);
  background: #ffffff;
}

.hud-marker:hover .hud-tooltip,
.hud-marker:hover .hud-num {
  opacity: 1;
  transform: translateX(0);
}

.hud-marker:hover .hud-dot {
  background: var(--accent-primary-light);
  transform: scale(1.4);
}

.hud-marker.active .hud-dot {
  background: var(--accent-warm);
  box-shadow: 0 0 10px var(--accent-warm);
  transform: scale(1.45);
}

.hud-marker.active .hud-num {
  opacity: 0.9;
  color: var(--accent-warm);
  transform: translateX(0);
}

@media (max-width: 1080px) {
  .scroll-hud {
    display: none;
  }
}

/* ================= EASTER EGG SYS.EXE NAVBAR TRIGGER ================= */
.nav-sys-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.25);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.nav-sys-btn:hover {
  background: rgba(129, 140, 248, 0.18);
  border-color: var(--accent-primary-light);
  color: var(--accent-primary-light);
  transform: translateY(-1px);
}

.sys-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: sys-led-blink 3s infinite;
}

@keyframes sys-led-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ================= DIGITAL NOTEBOOK EDITORIAL METADATA TAGS ================= */
.notebook-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent-warm);
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.22);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.notebook-meta-tag .meta-icon {
  color: var(--accent-warm);
  font-size: 0.8rem;
}

/* Hackathon Case File Stamp */
.case-file-stamp {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-primary-light);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

/* ================= 16. EASTER EGG: MAHIMA.EXE TERMINAL MODAL ================= */
.terminal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.terminal-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.terminal-window {
  position: relative;
  width: 100%;
  max-width: 780px;
  background: #090c14;
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.2);
  font-family: var(--font-mono);
  color: #e2e8f0;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-modal-backdrop.is-open .terminal-window {
  transform: translateY(0) scale(1);
}

.terminal-scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.6;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #111625;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-actions {
  display: flex;
  gap: 0.5rem;
}

.term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
}

.term-dot-red { background: #ef4444; }
.term-dot-yellow { background: #f59e0b; }
.term-dot-green { background: #10b981; }

.terminal-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-primary-light);
}

.terminal-meta {
  font-size: 0.6875rem;
  color: #10b981;
}

.terminal-body {
  padding: 1.5rem;
  max-height: 55vh;
  overflow-y: auto;
  font-size: 0.84rem;
  line-height: 1.7;
}

.term-line {
  margin-bottom: 0.35rem;
  word-break: break-word;
}

.term-line.banner {
  color: var(--accent-warm);
  white-space: pre;
  font-size: 0.65rem;
  line-height: 1.15;
  margin-bottom: 1rem;
  overflow-x: hidden;
}

.term-highlight {
  color: #67e8f9;
  font-weight: 600;
}

.term-status-online {
  color: #34d399;
  font-weight: 700;
}

.term-cmd {
  color: var(--accent-warm);
  font-weight: 700;
}

.prompt-help {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.terminal-input-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: #0d121f;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.term-prompt {
  color: #34d399;
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
}

/* ================= Cute Aesthetic Doodles (Light Theme Specialty) ================= */
.aesthetic-doodle {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  transition: opacity var(--trans-smooth), transform var(--trans-smooth);
}

/* Light mode displays vibrant hand-drawn doodles */
[data-theme="light"] .aesthetic-doodle {
  opacity: 0.95;
  filter: drop-shadow(0 2px 8px rgba(236, 72, 153, 0.25));
}

/* In dark mode, doodles soften into glowing stardust runes */
[data-theme="dark"] .aesthetic-doodle,
:root:not([data-theme="light"]) .aesthetic-doodle {
  opacity: 0.35;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.4));
}

.doodle-svg {
  overflow: visible;
}

.doodle-path {
  stroke: var(--accent-primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

[data-theme="light"] .doodle-path {
  stroke: #ec4899;
}

[data-theme="dark"] .doodle-path {
  stroke: #fbbf24;
}

.doodle-caption {
  font-family: 'Caveat', 'Comic Sans MS', cursive, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-block;
  transform: rotate(-3deg);
}

[data-theme="light"] .doodle-caption {
  color: #ec4899;
}

[data-theme="dark"] .doodle-caption {
  color: #fbbf24;
}

@keyframes doodle-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

@keyframes doodle-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

.doodle-animate-bob {
  animation: doodle-bob 4.5s ease-in-out infinite;
}

.doodle-animate-pulse {
  animation: doodle-pulse 2.2s ease-in-out infinite;
}

/* Washi Tape Paper Accent for Cards */
.washi-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 90px;
  height: 22px;
  background: rgba(244, 114, 182, 0.35);
  backdrop-filter: blur(4px);
  border-left: 2px dashed rgba(236, 72, 153, 0.5);
  border-right: 2px dashed rgba(236, 72, 153, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  z-index: 10;
  pointer-events: none;
  display: none;
}

[data-theme="light"] .washi-tape {
  display: block;
}

/* Underline Scribble Accent */
.doodle-scribble-underline {
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 12px;
  pointer-events: none;
}

/* ================= Ambient Audio Pill & Equalizer ================= */
.nav-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-base);
  backdrop-filter: blur(8px);
}

.nav-audio-btn:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 14px var(--accent-glow);
  transform: translateY(-1px);
}

.eq-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  width: 13px;
}

.eq-bar {
  width: 2.5px;
  height: 4px;
  background: var(--accent-primary);
  border-radius: 1px;
  transition: height 0.2s ease;
}

.nav-audio-btn.is-playing .eq-bar:nth-child(1) {
  animation: eq-bounce 0.8s ease-in-out infinite alternate;
}
.nav-audio-btn.is-playing .eq-bar:nth-child(2) {
  animation: eq-bounce 0.6s ease-in-out 0.2s infinite alternate;
}
.nav-audio-btn.is-playing .eq-bar:nth-child(3) {
  animation: eq-bounce 0.9s ease-in-out 0.4s infinite alternate;
}

@keyframes eq-bounce {
  0% { height: 3px; }
  100% { height: 12px; }
}

/* ================= Command Palette Trigger & Modal ================= */
.nav-cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-base);
}

.nav-cmd-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  box-shadow: 0 0 12px var(--accent-glow);
}

.nav-cmd-kbd {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.625rem;
}

[data-theme="light"] .nav-cmd-kbd {
  background: rgba(236, 72, 153, 0.08);
  border-color: rgba(236, 72, 153, 0.2);
}

.cmd-palette-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(5, 8, 14, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--trans-base), visibility var(--trans-base);
}

.cmd-palette-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.cmd-palette-card {
  width: 92%;
  max-width: 580px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  transform: scale(0.95) translateY(-10px);
  transition: transform var(--trans-spring);
}

.cmd-palette-modal.is-open .cmd-palette-card {
  transform: scale(1) translateY(0);
}

.cmd-palette-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
}

.cmd-palette-icon {
  color: var(--accent-primary);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.cmd-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
}

.cmd-palette-input::placeholder {
  color: var(--text-faint);
}

.cmd-palette-esc {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
}

.cmd-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.cmd-group-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.6rem 0.85rem 0.25rem;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
  color: var(--text-primary);
  text-decoration: none;
}

.cmd-item:hover,
.cmd-item.is-selected {
  background: var(--bg-elevated);
  color: var(--accent-primary-light);
  transform: translateX(4px);
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
}

.cmd-item-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-warm);
}

.cmd-item-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Card Cursor Spotlight Sheen */
.spotlight-card {
  position: relative;
  overflow: hidden;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(245, 158, 11, 0.09), transparent 40%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

[data-theme="light"] .spotlight-card::before {
  background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(236, 72, 153, 0.08), transparent 40%);
}

.spotlight-card:hover::before {
  opacity: 1;
}
