:root {
  --bg: #0d1117;
  --card-bg: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --subtext: #8b949e;
  --accent: #58a6ff;
  --arch-cyan: #1793d1;
  --green: #3fb950;
  --yellow: #d29922;
  --terminal-bg: #090d12;
}

[data-theme="light"] {
  --bg: #f6f8fa;
  --card-bg: #ffffff;
  --border: #d0d7de;
  --text: #24292f;
  --subtext: #57606a;
  --accent: #0969da;
  --arch-cyan: #0969da;
  --green: #1a7f37;
  --yellow: #9a6700;
  --terminal-bg: #1f242c;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace; }
body { background: var(--bg); color: var(--text); padding: 18px; overflow-x: hidden; }

/* crt effects */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none; /* Lets you click the dashboard through the overlay */
  
  /* scanlines */
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
  background-size: 100% 4px;
  
  /* vignette */
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.6);
  
  /* crt flicker */
  animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
  0% { opacity: 0.85; }
  50% { opacity: 1; }
  100% { opacity: 0.90; }
}

/* yaku style console */
.terminal-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 380px;
  min-height: 200px;
  max-height: 90vh;
  resize: vertical;
  overflow: hidden; 
  transform: translateY(calc(-100% - 40px));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  
  background: var(--terminal-bg);
  border-bottom: 2px solid var(--arch-cyan);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  color: #58a6ff;
  font-family: monospace;
}

.terminal-drawer.open { 
  transform: translateY(0); 
}
.terminal-header {
  background: #161b22;
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--subtext);
}
.terminal-close { background: none; border: none; color: var(--subtext); font-size: 1.2rem; cursor: pointer; }
.terminal-output { flex: 1; overflow-y: auto; padding: 12px 16px; font-size: 0.9rem; line-height: 1.4; color: #f0f6fc; }
.terminal-prompt-row { display: flex; align-items: center; padding: 8px 16px; background: rgba(0,0,0,0.2); }
.prompt-symbol { color: var(--green); margin-right: 8px; font-weight: bold; }
#terminal-input { flex: 1; background: transparent; border: none; color: #f0f6fc; font-family: monospace; font-size: 0.95rem; outline: none; }
.cmd-highlight { color: var(--yellow); }

/* top nav */
.top-nav { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 20px; }
.nav-btn, .theme-toggle {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: monospace;
  font-size: 0.85rem;
}
.nav-right { display: flex; align-items: center; gap: 14px; }
.clock-display { font-family: monospace; font-size: 0.9rem; color: var(--subtext); }

/* main grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; }
.card-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--subtext); }
.primary-text { font-size: 1.1rem; font-weight: 600; color: var(--text); text-shadow: 0 0 4px rgba(201, 209, 217, 0.2); }
.sub-text { font-size: 0.85rem; color: var(--subtext); }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--subtext); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--subtext); }
.badge.online { color: var(--green); }
.badge.online::before { background: var(--green); }

/* discord specific stuff */
.user-row { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); }
.card-actions { margin-top: auto; }
.action-btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
}

/* fastfetch */
.fastfetch-card { grid-column: span 2; }
.fastfetch-wrapper { display: flex; gap: 24px; align-items: center; }
.arch-ascii { color: var(--arch-cyan); font-family: monospace; font-size: 0.75rem; line-height: 1.15; text-shadow: 0 0 6px rgba(23, 147, 209, 0.4); }
.specs-table { font-family: monospace; font-size: 0.85rem; display: flex; flex-direction: column; gap: 4px; }
.specs-table .key { color: var(--accent); font-weight: bold; }

/* carousel */
.media-card { grid-column: span 1; }
.media-viewer { background: #000; border-radius: 6px; aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); }
.media-placeholder { font-family: monospace; font-size: 0.85rem; color: var(--subtext); }
.carousel-controls { display: flex; gap: 8px; margin-top: auto; }

/* responsiveness stuff */
@media (max-width: 900px) {
  body { padding: 12px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .top-nav { flex-direction: column; align-items: stretch; gap: 12px; }
  .nav-right { justify-content: space-between; width: 100%; }
  .nav-btn, .theme-toggle { text-align: center; }
  .fastfetch-card { grid-column: span 1; }
  .fastfetch-wrapper { flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; overflow-x: auto; }
  .arch-ascii { font-size: 0.65rem; }
  .specs-table { font-size: 0.75rem; }
}

/* github feed stuff */
.feed-container { display: flex; flex-direction: column; gap: 10px; }
.feed-item { 
  font-size: 0.82rem; 
  border-left: 2px solid var(--arch-cyan); 
  padding-left: 10px; 
  background: rgba(255, 255, 255, 0.02);
  padding-top: 4px;
  padding-bottom: 4px;
  border-radius: 0 4px 4px 0;
  color: var(--text); 
}
.commit-msg { color: var(--text); text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.commit-msg:hover { color: var(--accent); text-decoration: underline; }
.commit-time { font-size: 0.75rem; color: var(--subtext); white-space: nowrap; }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--subtext); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--subtext); }
.badge.online { color: var(--green); }
.badge.online::before { background: var(--green); }
.badge.idle { color: var(--yellow); }
.badge.idle::before { background: var(--yellow); }
.badge.dnd { color: #f85149; }
.badge.dnd::before { background: #f85149; }

/* carousel */
.media-card { grid-column: span 1; }
.media-viewer { 
  background: #000; 
  border-radius: 6px; 
  aspect-ratio: 16/10; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border: 1px dashed var(--border); 
  position: relative;
  overflow: hidden;
}
.carousel-media { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; cursor: zoom-in; }
.media-placeholder { font-family: monospace; font-size: 0.85rem; color: var(--subtext); }
.carousel-controls { display: flex; gap: 8px; margin-top: auto; }
.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.75);
  color: #f0f6fc;
  font-size: 0.8rem;
  padding: 6px 10px;
  text-align: center;
  backdrop-filter: blur(4px);
}

/* lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  backdrop-filter: blur(5px);
}
.lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox-media {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  object-fit: contain;
  cursor: default;
}

/* csutom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--subtext);
}

.terminal-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.ascii-art {
  display: block;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  white-space: pre !important;
  line-height: 1.2;               /* Restores proper vertical height on 4K */
  letter-spacing: 0.05em;         /* Slight horizontal breathing room */
  font-variant-ligatures: none;   /* Prevents ligature merging on == or -- */
  font-size: clamp(0.55rem, 0.8vw, 1.1rem); /* Scales nicely up to 4K */
  overflow-x: auto;
  margin: 8px 0;
}