/* =====================================================================
   STYLESHEET INDEX
   1.  Reset
   2.  Design tokens (light / dark / auto-dark)
   3.  Base (body, typography, layout)
   4.  Links
   5.  Buttons
   6.  Header & navigation
   7.  Hero
   8.  Bento grid & cards
   9.  Animations & badges
   10. Page sections (utilities, time badge, git pulse, certifications)
   11. Projects & tiers
   12. Code blocks & article content
   13. Video
   14. Footer
   15. Components (modals, command palette, terminal, lightbox, toast)
   16. Floating UI (docks, digital pet, OS widgets, sidebars)
   17. Blog post meta & digital signature
   18. Easter egg: Konami overdrive
   19. Responsive overrides (keep LAST - order matters)
   ===================================================================== */

/* =========================================
   1. RESET
   ========================================= */

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

/* =========================================
   2. DESIGN TOKENS
   ========================================= */

/* ---------- Variables (Light Mode - Alabaster & Charcoal) ---------- */
:root {
  --color-bg: #f6f6f8;           /* Warm industrial gray-white */
  --color-surface: #ffffff;      /* Pure white cards to pop off the background */
  --color-surface-elevated: #ffffff;
  --color-bg-glass: rgba(246, 246, 248, 0.85); /* ADDED */ 
  
  --color-text: #18181b;         /* Rich charcoal zinc (no pure black) */
  --color-muted: #71717a;        /* Warm mid-slate */
  --color-accent: #65a30d;       /* Acid Lime (dark variant) */
  --color-accent-hover: #4d7c0f;
  --color-border: #e4e4e7;       /* Crisp warm zinc border */
  
  --gradient-start: #65a30d;
  --gradient-end: #a3e635;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 2rem;
  --space-4: 4rem;
  --space-5: 6rem;

  --width-content: 1000px; 
  --transition: all 0.2s ease-in-out;
}

/* ---------- Variables (Dark Mode - Tonal Elevation) ---------- */
[data-theme="dark"] {
  --color-bg: #09090b;
  --color-bg-glass: rgba(9, 9, 11, 0.85); /* ADDED */           
  --color-surface: #121215;      
  --color-surface-elevated: #18181b; 
  --color-text: #fafafa;         
  --color-muted: #a1a1aa;        
  --color-accent: #a3e635;       
  --color-accent-hover: #bef264;
  --color-border: #27272a;       
  
  --gradient-start: #a3e635;
  --gradient-end: #bef264;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #09090b;
    --color-bg-glass: rgba(9, 9, 11, 0.85);
    --color-surface: #121215;
    --color-surface-elevated: #18181b;
    --color-text: #fafafa;
    --color-muted: #a1a1aa;
    --color-accent: #a3e635;
    --color-accent-hover: #bef264;
    --color-border: #27272a;
    --gradient-start: #a3e635;
    --gradient-end: #bef264;
  }
}

/* =========================================
   3. BASE
   ========================================= */

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: 1rem;
  transition: background-color 0.3s, color 0.3s;
  padding-top: 80px; /* ADDED: Space for the fixed header */
}

/* ---------- Editorial Typography ---------- */
h1, h2 {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: 1.05;
  letter-spacing: -0.04em; 
}

h1 {
  font-size: clamp(3rem, 8vw, 5.5rem); 
  margin-bottom: var(--space-3);
  font-weight: 700;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

/* ---------- Layout & Global Elements ---------- */
header,
main,
footer {
  max-width: var(--width-content);
  margin: 0 auto;
  padding: 0 var(--space-4); 
}

ul { list-style: none; }
ul li + li { margin-top: var(--space-1); }
p + p, ul + p, p + ul { margin-top: var(--space-2); }

/* Bottom spacing for the page content (must follow the shared layout rule above) */
main {
  padding-bottom: var(--space-5);
}

/* =========================================
   4. LINKS
   ========================================= */

/* ---------- Links ---------- */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

main p a:not(.btn) {
  font-weight: 500;
  position: relative;
}
main p a:not(.btn)::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--color-accent);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}
main p a:not(.btn):hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* =========================================
   5. BUTTONS
   ========================================= */

/* ---------- Buttons (Elite UI) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--color-accent);
  color: #ffffff !important; 
  padding: 0.8rem 1.5rem;
  border-radius: 8px; /* Slightly rounder */
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  text-decoration: none !important;
  margin-top: var(--space-2);
  cursor: pointer;
}

[data-theme="dark"] .btn {
  color: #000000 !important; 
}

.btn:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(163, 230, 53, 0.3);
}

/* Fix the underline animation for buttons */
main p a.btn::after {
  display: none !important; 
}

/* ---------- Secondary Buttons (Ghost Style) ---------- */
.btn-secondary {
  background-color: transparent !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}

[data-theme="dark"] .btn-secondary {
  background-color: rgba(255, 255, 255, 0.03) !important; /* Subtle glass tint */
  color: #fafafa !important;
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--color-accent) !important;
  box-shadow: none !important;
}

:root:not([data-theme="dark"]) .btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.03) !important;
  border-color: var(--color-accent) !important;
}

/* =========================================
   6. HEADER & NAVIGATION
   ========================================= */

/* ---------- Header ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center; 
  max-width: 100%; /* Override the shared layout max-width */
  margin: 0;       /* Override the shared layout margin */
  /* This padding trick aligns the inner content with your main 1000px content */
  padding: var(--space-2) max(var(--space-4), calc((100vw - var(--width-content)) / 2));
  background: var(--color-bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

header > a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
}

nav {
  display: flex;
  align-items: center;
  gap: var(--space-3); 
}

nav ul {
  display: flex;
  flex-direction: row;
  gap: var(--space-3);
  align-items: center; 
  flex-wrap: nowrap; /* Prevents wrapping */
}

nav a {
  color: var(--color-muted);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap; /* Prevents text from breaking into 2 lines */
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--color-text);
}

nav a[aria-current="page"] {
  font-weight: 600;
}

/* ---------- Theme Toggle ---------- */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.3s ease, color 0.2s ease;
}
#theme-toggle:hover { color: var(--color-text); }
#theme-toggle:active { transform: rotate(180deg); }
.moon { display: block; }
.sun { display: none; }
[data-theme="dark"] .moon { display: none; }
[data-theme="dark"] .sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .moon { display: none; }
  :root:not([data-theme="light"]) .sun { display: block; }
}

/* ---------- Mobile menu button (shown <= 768px, see Responsive) ---------- */
.mobile-menu-btn {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  z-index: 1001;
}

/* =========================================
   7. HERO
   ========================================= */

/* ---------- Hero Section ---------- */
#hero {
  padding-top: var(--space-3); /* REDUCED from var(--space-5) */
  padding-bottom: var(--space-3);
}


#hero p {
  font-size: 1.15rem;
  color: var(--color-muted);
  max-width: 600px;
}

/* =========================================
   8. BENTO GRID & CARDS
   ========================================= */

/* ---------- Bento Grid ---------- */

/* Default: 1 column on mobile */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3); 
}

/* 2 columns on tablets and desktops */
@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3 columns ONLY if the grid has the "bento-grid-3" class */
@media (min-width: 1100px) {
  .bento-grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ---------- Cards (Depth Discipline) ---------- */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-4) var(--space-3);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--color-accent);
}

/* Light Mode Chromatic Shadow (Accent-Tinted) */
:root:not([data-theme="dark"]) .card:hover {
  box-shadow: 0 10px 30px -10px rgba(101, 163, 13, 0.1);
  transform: translateY(-2px);
}

/* Dark Mode Shadow */
[data-theme="dark"] .card:hover {
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* ---------- Mouse-Tracking Spotlight ---------- */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0; 
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

/* Light Mode Spotlight (Glass-Polishing Indentation) */
:root:not([data-theme="dark"]) .card::before {
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(0, 0, 0, 0.03),
    transparent 40%
  );
}

/* Dark Mode Spotlight (Acid Lime Trace) */
[data-theme="dark"] .card::before {
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(163, 230, 53, 0.06),
    transparent 40%
  );
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card::before {
    background: radial-gradient(
      600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(163, 230, 53, 0.06),
      transparent 40%
    );
  }
}

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

/* ---------- Top-Edge Specular Highlight ---------- */
.card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  opacity: 0.8;
  z-index: 2;
  pointer-events: none;
}

/* Light Mode Top Highlight (Pure White Bevel) */
:root:not([data-theme="dark"]) .card::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

/* Dark Mode Top Highlight (Faint Light) */
[data-theme="dark"] .card::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0.5;
}

/* Make the cards layout nicely in the grid */
.bento-grid .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Adds space between stacked cards on About/Detail pages */
main > .card {
  margin-bottom: var(--space-3);
}

/* =========================================
   9. ANIMATIONS & BADGES
   ========================================= */

.js-enabled [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.js-enabled [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-tilt] {
  transition: transform 0.1s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* =========================================
   10. PAGE SECTIONS
   ========================================= */

/* ---------- Typography Utilities ---------- */
.prompt {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-weight: 700;
  margin-right: 0.5rem;
}

#typewriter {
  font-family: var(--font-mono);
  font-size: 0.95em;
  color: var(--color-accent);
}

#typewriter::after {
  content: '|';
  animation: blink 0.8s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Local Time Badge ---------- */
.local-time-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem !important; 
  color: var(--color-muted);
  margin-top: var(--space-3);
  display: inline-flex;
  align-items: center;
  background: var(--color-surface);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  opacity: 0.8;
}

.time-divider { margin: 0 0.5rem; opacity: 0.4; }
#local-clock { color: var(--color-accent); font-weight: 600; }

/* ---------- Development Pulse (Git Log) ---------- */
.pulse-feed {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  position: relative;
}

.terminal-prompt { margin-top: 0.5rem; color: var(--color-text); opacity: 0.9; }
.prompt-user { color: #10b981; }
.prompt-path { color: #3b82f6; }
.cursor {
  color: var(--color-accent);
  animation: blink 1s step-end infinite;
  font-size: 0.9rem;
  margin-left: 2px;
}

.commit-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}
[data-theme="dark"] .commit-line { background: rgba(255, 255, 255, 0.03); }

.commit-hash { color: var(--color-muted); font-size: 0.8rem; opacity: 0.7; }
.commit-msg { color: var(--color-text); }
.tag { font-weight: 700; margin-right: 0.5rem; }
.tag.active { color: #10b981; }
.tag.learning { color: #3b82f6; }
.tag.done { color: #a855f7; }

/* ---------- Certifications Section ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

@media (min-width: 600px) {
  .cert-grid {
    grid-template-columns: 1fr 1fr; 
    align-items: center;
  }
}

.cert-item { display: flex; gap: 1rem; align-items: flex-start; }
.cert-icon {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cert-details h3 { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 0.25rem; color: var(--color-text); }
.cert-issuer { font-size: 0.9rem; color: var(--color-muted); margin-bottom: 0.2rem; }
.cert-date { font-size: 0.8rem; color: var(--color-muted); font-family: var(--font-mono); margin-bottom: 0.75rem; }
.cert-link { font-size: 0.9rem; font-weight: 600; color: var(--color-accent); text-decoration: none; }
.cert-link:hover { text-decoration: underline; }
.credly-container { justify-content: center; background: var(--color-bg); border-radius: 8px; padding: 1rem; border: 1px solid var(--color-border); }
.credly-container iframe { max-width: 100%; border-radius: 4px; }

/* =========================================
   11. PROJECTS & TIERS
   ========================================= */

/* =========================================
   TIER SYSTEM LAYOUT
   ========================================= */

.tier-section {
  margin-top: var(--space-5);
  margin-bottom: var(--space-4);
}

.tier-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
  margin-bottom: var(--space-3);
  letter-spacing: 0;
}

.tier-title .prompt {
  color: var(--color-accent);
}

/* =========================================
   PROJECT CARDS (Tier Layout)
   ========================================= */

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.project-icon {
  color: var(--color-accent);
  background: var(--color-bg);
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  background: var(--color-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--color-border);
}

.project-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: -0.5rem; /* Pulls it closer to the title */
  margin-bottom: var(--space-2);
  opacity: 0.8;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: var(--space-2);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-2);
}

.tech-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
}

.project-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-accent); /* Or var(--color-muted) if you want it subtle */
  background: rgba(163, 230, 53, 0.1); /* Very faint lime tint */
  border: 1px dashed var(--color-accent);
  padding: 0.5rem;
  border-radius: 6px;
  margin-bottom: var(--space-2);
  margin-top: auto; /* Pushes it down above the buttons */
}

.project-actions-vertical {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: auto;
}

.secondary-actions {
  display: flex;
  gap: var(--space-1);
}

.secondary-actions .btn {
  flex: 1; 
  text-align: center;
  margin-top: 0; 
}

/* =========================================
   DETAIL PAGE ACTION BUTTONS
   ========================================= */
.detail-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.detail-actions .btn {
  margin-top: 0; /* Overrides the default button top margin */
  width: 100%;
  text-align: center;
  padding: 0.8rem 1rem;
}

/* =========================================
   TIER 3 CARD OPTIMIZATION (3-Column Fix)
   ========================================= */
@media (min-width: 1100px) {
  /* Reduce the massive padding inside these specific cards */
  .bento-grid-3 .card {
    padding: var(--space-3) var(--space-2);
  }

  /* Slightly tighten the description text */
  .bento-grid-3 .project-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: var(--space-2);
  }

  /* Make the "Built in Month 3" note more compact */
  .bento-grid-3 .project-note {
    font-size: 0.7rem;
    padding: 0.4rem;
    margin-bottom: var(--space-2);
    margin-top: 0;
  }

  /* Shrink the buttons slightly so they fit the narrower width */
  .bento-grid-3 .btn {
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
  }

  /* Tighten the gap between the buttons */
  .bento-grid-3 .project-actions-vertical {
    gap: 0.5rem;
  }
  
  .bento-grid-3 .secondary-actions {
    gap: 0.5rem;
  }

  /* Make the tech badges a bit smaller */
  .bento-grid-3 .tech-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }

  /* Reduce the space below the header icon */
  .bento-grid-3 .project-header {
    margin-bottom: var(--space-1);
  }

  /* Shrink the card title slightly */
  .bento-grid-3 h2 {
    font-size: 1.25rem;
  }
}

/* =========================================
   12. CODE BLOCKS & ARTICLE CONTENT
   ========================================= */

/* =========================================
   CODE BLOCKS & HOW TO RUN
   ========================================= */
.code-block {
  position: relative;
  background: #0d1117; /* Hardcoded dark for terminal feel */
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  padding-top: 2.5rem; /* Space for the Copy button */
  margin: var(--space-2) 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.code-block pre {
  margin: 0;
}

/* Force the text inside the block to be light gray */
.code-block pre code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #c9d1d9 !important; /* Light GitHub text color */
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* The Copy Button */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--color-accent);
  color: #000;
  border-color: var(--color-accent);
}

/* Inline code snippets (like .exe) */
code {
  font-family: var(--font-mono);
  background: var(--color-bg);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

/* =========================================
   PREMIUM ARTICLE SPACING
   ========================================= */
.article-content p {
  margin-bottom: 1.8rem; /* More space between paragraphs */
  line-height: 1.85; /* Easier to read */
}

.article-content h2 {
  margin-top: 4rem; /* Huge space before new sections */
  margin-bottom: 1.5rem;
}

/* Make inline code look cleaner */
.article-content code {
  padding: 0.2rem 0.5rem;
  margin: 0 0.2rem;
  border-radius: 6px;
  background: rgba(163, 230, 53, 0.1); /* Subtle lime tint */
  border: 1px solid rgba(163, 230, 53, 0.2);
  color: var(--color-accent);
  font-weight: 600;
}

/* Give the code block more breathing room */
.code-block {
  margin: 2.5rem 0; /* Big gap above and below the black box */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* Adds depth */
}

/* =========================================
   13. VIDEO
   ========================================= */

/* =========================================
   VERTICAL VIDEO CONTAINER (9:16)
   ========================================= */
.video-container-vertical {
  position: relative;
  width: 100%;
  max-width: 450px; /* INCREASED size so it's not tiny */
  margin: var(--space-4) auto;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden; /* Keeps the rounded corners */
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  background: #000;
}

.video-container-vertical video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Use 'contain' instead of 'cover' so fullscreen doesn't crop */
  display: block;
}

/* Fullscreen fix: When native fullscreen is active, remove the aspect ratio limits */
.video-container-vertical:fullscreen {
  max-width: none;
  aspect-ratio: auto;
  border-radius: 0;
  border: none;
}

.video-container-vertical:fullscreen video {
  object-fit: contain;
}

/* =========================================
   14. FOOTER
   ========================================= */

/* ---------- Footer ---------- */
footer {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.875rem;
}
footer a { color: var(--color-muted); }
footer a:hover { color: var(--color-accent); }

/* =========================================
   15. COMPONENTS
   ========================================= */

/* =========================================
   COMPONENTS (Modals & Terminal)
   ========================================= */

/* ---------- Certificate Modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal.open { opacity: 1; pointer-events: auto; }

.modal-content {
  position: relative;
  width: 90%; max-width: 800px; height: 80vh; 
  background: var(--color-surface-elevated);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.modal.open .modal-content { transform: scale(1); }
.cert-modal-content { display: flex; align-items: center; justify-content: center; padding: 1rem; }
.cert-modal-content img {
  max-width: 100%; max-height: 75vh;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); background: transparent;
}

.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0, 0, 0, 0.5); color: #fff;
  border: none; font-size: 24px; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10; transition: background 0.2s;
}
.modal-close:hover { background: var(--color-accent); }

/* ---------- Command Palette (Cmd + K) ---------- */
.cmd-palette {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.cmd-palette.open { opacity: 1; pointer-events: auto; }

.cmd-modal {
  width: 100%; max-width: 600px;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.2s ease;
}
.cmd-palette.open .cmd-modal { transform: translateY(0) scale(1); }
[data-theme="dark"] .cmd-modal { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); }

.cmd-search-wrapper {
  display: flex; align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  gap: 1rem;
}
.search-icon { color: var(--color-muted); }
#cmd-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 1.1rem; font-family: var(--font-body); color: var(--color-text);
}
#cmd-input::placeholder { color: var(--color-muted); }
.cmd-shortcut {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--color-muted); background: var(--color-bg);
  padding: 0.2rem 0.5rem; border-radius: 4px;
  border: 1px solid var(--color-border);
}
.cmd-list { list-style: none; max-height: 350px; overflow-y: auto; padding: 0.5rem; }
.cmd-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 1rem; border-radius: 8px; cursor: pointer;
  color: var(--color-text); font-weight: 500;
}
.cmd-list li.active, .cmd-list li:hover { background: var(--color-bg); color: var(--color-accent); }
.cmd-type { font-size: 0.75rem; font-family: var(--font-mono); color: var(--color-muted); }

/* ---------- Floating Mini-Terminal ---------- */
#terminal-toggle {
  position: fixed; bottom: 24px; right: 24px;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--color-accent); color: #000;
  border: none; cursor: pointer;
  box-shadow: 0 4px 15px rgba(163, 230, 53, 0.3);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}
#terminal-toggle:hover { transform: scale(1.1); background: var(--color-accent-hover); }

.terminal-window {
  position: fixed; bottom: 90px; right: 24px;
  width: 380px; height: 300px;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s ease;
  font-family: var(--font-mono);
}
.terminal-window.open { opacity: 1; pointer-events: auto; transform: translateY(0); }

.terminal-header {
  background: var(--color-surface);
  padding: 8px 12px; border-radius: 10px 10px 0 0;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--color-muted); font-size: 0.8rem;
  border-bottom: 1px solid var(--color-border);
}
#terminal-close {
  background: none; border: none; color: var(--color-muted);
  cursor: pointer; font-size: 1.2rem; line-height: 1;
}
#terminal-close:hover { color: var(--color-text); }

.terminal-body {
  flex: 1; padding: 12px; overflow-y: auto;
  color: var(--color-text); font-size: 0.85rem; line-height: 1.5;
}
.terminal-body p { margin-bottom: 6px; }

.terminal-input-line {
  display: flex; align-items: center; padding: 12px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text); font-size: 0.85rem;
}
#terminal-input {
  background: transparent; border: none; color: var(--color-text);
  font-family: var(--font-mono); font-size: 0.85rem;
  flex: 1; outline: none; margin-left: 8px;
}

/* Mobile terminal */
@media (max-width: 500px) {
  .terminal-window { width: calc(100vw - 48px); right: 24px; bottom: 80px; }
}

/* =========================================
   DRAGGABLE TERMINAL HEADER
   ========================================= */
.terminal-header {
  cursor: grab;
  user-select: none; /* Prevents highlighting text while dragging */
}

.terminal-header:active {
  cursor: grabbing;
}

/* Disable the default transitions when the user is actively dragging */
.terminal-window.dragging {
  transition: opacity 0.3s ease !important;
}

/* =========================================
   IMAGE LIGHTBOX MODAL
   ========================================= */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.image-modal.open {
  opacity: 1;
  pointer-events: auto;
}

/* Hidden completely until modal is open */
.image-modal-actions {
  position: absolute; 
  top: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.image-modal:not(.open) .image-modal-actions {
  display: none;
}

/* Solid dark style for the modal buttons */
.image-modal-actions .btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  margin-top: 0;
  background: #09090b !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(4px);
}

.image-modal-actions .btn:hover {
  background: var(--color-accent) !important;
  color: #000000 !important;
  border-color: var(--color-accent) !important;
  transform: translateY(-2px);
}

/* Solid dark style for the close button */
.image-modal .modal-close {
  position: relative;
  top: 0;
  right: 0;
  background: #09090b !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5) !important;
}

.image-modal .modal-close:hover {
  background: var(--color-accent) !important;
  color: #000000 !important;
  border-color: var(--color-accent) !important;
  transform: scale(1.05);
}

/* Scrollable container to allow zooming/panning on mobile */
.image-modal-content {
  width: 100%;
  height: 100%;
  overflow: auto; 
  padding: 70px 20px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.image-modal-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

/* Add a subtle hint that an image is clickable */
.zoomable-image {
  cursor: zoom-in;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.zoomable-image:hover {
  filter: brightness(1.1);
}

/* =========================================
   TOAST NOTIFICATION
   ========================================= */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-accent);
  color: #000;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(163, 230, 53, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 99999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =========================================
   16. FLOATING UI
   ========================================= */

/* =========================================
   FLOATING SOCIAL DOCK
   ========================================= */
.social-dock {
  position: fixed;
  bottom: 90px; /* Sits above the terminal button */
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.social-dock a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

/* Hover effects */
.social-dock a:hover {
  transform: translateY(-3px) scale(1.05);
  color: #000;
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 6px 20px rgba(163, 230, 53, 0.3);
}

[data-theme="dark"] .social-dock a:hover {
  color: #000; /* Keeps icon dark on the lime background */
}

/* =========================================
   BOTTOM LEFT DOCK (Arcade & Knowledge)
   ========================================= */
.bottom-left-dock {
  position: fixed;
  bottom: 90px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.dock-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
}

.dock-btn:hover {
  transform: translateY(-3px) scale(1.05);
  color: #000;
  background: var(--color-accent);
  border-color: var(--color-accent);
}

[data-theme="dark"] .dock-btn:hover { color: #000; }

/* Tooltip for the left dock */
.dock-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 130%;
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.dock-btn:hover::after {
  opacity: 1;
}

/* =========================================
   DIGITAL PET (THARANAOS DAEMON)
   ========================================= */
.digital-pet {
  position: fixed;
  bottom: 24px !important; /* Sits below the bottom-left dock */
  left: 21px !important;   /* Aligned with the dock */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.digital-pet:hover {
  transform: scale(1.05);
}

/* The floating glass box */
.pet-avatar {
  width: 50px;
  height: 50px;
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(163, 230, 53, 0.2);
  animation: float 3s ease-in-out infinite;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* The ASCII face */
.pet-face {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-weight: bold;
  font-size: 1.1rem;
  letter-spacing: -1px;
}

/* The speech bubble */
.pet-bubble {
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  position: absolute;
  top: 5px; /* Aligns vertically with the pet's face */
  left: 100%; /* Pushes the bubble to the right side of the pet */
  margin-left: 12px; /* Space between pet and bubble */
  opacity: 0;
  transform: translateX(-10px); /* Starts slightly to the left for animation */
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10000;
}

/* Show bubble when active */
.pet-bubble.show {
  opacity: 1;
  transform: translateX(0);
}

/* The little arrow pointing left to the pet */
.pet-bubble::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent var(--color-border) transparent transparent;
}

.pet-bubble::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent var(--color-surface-elevated) transparent transparent;
  margin-right: -1px; /* Covers the border of the triangle */
}

/* Float animation */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

/* Hide on very small mobile screens so it doesn't block content */
@media (max-width: 768px) {
  .digital-pet {
    display: none;
  }
}

/* =========================================
   OS TELEMETRY WIDGETS
   ========================================= */
.os-widget {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-muted);
  display: none; /* Hidden by default */
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.5px;
  pointer-events: none; /* So it doesn't block clicks */
}

.os-widget-left {
  left: 24px;
}

.os-widget-right {
  right: 24px;
}

.widget-divider {
  opacity: 0.3;
}

/* Only show widgets on screens wider than 1250px */
@media (min-width: 1250px) {
  .os-widget {
    display: flex;
  }
}

/* =========================================
   HIDE OS WIDGETS TO PREVENT OVERLAP
   ========================================= */
@media (max-width: 1450px) {
  .os-widget {
    display: none !important;
  }
}

/* =========================================
   VERTICAL TERMINAL SIDEBARS
   ========================================= */
.terminal-sidebar {
  position: fixed;
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-muted);
  opacity: 0.5; /* Faint so it doesn't distract from the main text */
  pointer-events: none;
  z-index: 0;
  letter-spacing: 2px;
}

.left-sidebar {
  left: 40px;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
}

.right-sidebar {
  right: 40px;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
  text-align: right;
}

/* Add a subtle glow to the first line */
.terminal-sidebar span:first-child {
  color: var(--color-accent);
  font-weight: bold;
}

/* Only show on wide screens to prevent overlap */
@media (max-width: 1400px) {
  .terminal-sidebar {
    display: none !important;
  }
}

/* =========================================
   17. BLOG POST META & DIGITAL SIGNATURE
   ========================================= */

/* Date styling */
.post-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 1rem;
  opacity: 0.8;
}

/* Signature Container */
.digital-signature {
  margin-top: 4rem;
  padding: 1.5rem;
  background: var(--color-surface-elevated);
  border: 1px dashed var(--color-accent);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.sig-left {
  display: flex;
  flex-direction: column;
}

/* Handwritten SVG Signature */
.handwritten-sig {
  width: 200px;
  height: 50px;
  margin-bottom: 0.5rem;
}

/* Animate the drawing of the signature path */
.handwritten-sig path {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: drawSignature 2s ease-out forwards;
}

@keyframes drawSignature {
  to { stroke-dashoffset: 0; }
}

.sig-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  margin: 0;
}

.sig-right {
  font-family: var(--font-mono);
  text-align: right;
  border-left: 1px solid var(--color-border);
  padding-left: 1.5rem;
}

.sig-status {
  color: #10b981; /* Emerald Green */
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.sig-hash {
  color: var(--color-muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
}

/* Mobile responsiveness for signature */
@media (max-width: 600px) {
  .digital-signature {
    flex-direction: column;
    align-items: flex-start;
  }
  .sig-right {
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: 1rem;
    text-align: left;
    width: 100%;
  }
}

/* =========================================
   18. EASTER EGG: KONAMI OVERDRIVE
   ========================================= */

.overdrive-mode {
  --color-accent: #ff0055 !important;
  --color-accent-hover: #ff3377 !important;
}

.overdrive-mode .btn {
  box-shadow: 0 0 20px rgba(255, 0, 85, 0.5) !important;
  border-color: #ff0055 !important;
}

.overdrive-mode .status-dot {
  background-color: #ff0055 !important;
  box-shadow: 0 0 10px #ff0055 !important;
}

/* =========================================
   19. RESPONSIVE OVERRIDES (keep last)
   ========================================= */

/* =========================================
   MOBILE RESPONSIVENESS (Phones & Tablets)
   ========================================= */
@media (max-width: 768px) {
  
  /* 1. Add more top padding because the header is taller (stacked) */
  body {
    padding-top: 130px; 
  }

  /* 2. Add massive bottom padding so text never hides behind the floating buttons */
  main {
    padding-bottom: 160px !important;
  }

  header, main, footer {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-top: var(--space-3);
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  nav ul {
    gap: var(--space-2); 
  }

  nav a {
    font-size: 0.85rem; 
  }

  .local-time-badge {
    font-size: 0.75rem !important;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  /* 3. Make the floating buttons slightly smaller and more opaque so they stand out */
  .social-dock {
    right: 16px;
    bottom: 90px; 
    gap: 10px;
  }

  .social-dock a {
    width: 40px;
    height: 40px;
    background: rgba(18, 18, 21, 0.95); /* Solid background on mobile */
    border: 1px solid rgba(255,255,255,0.1);
  }

  #terminal-toggle {
    right: 16px;
    bottom: 24px;
    width: 50px;
    height: 50px;
  }

  /* 4. Keep the terminal window on screen */
  .terminal-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 140px;
    height: 350px;
  }

  /* 5. Grid and Layout fixes */
  .bento-grid, .bento-grid-3 {
    grid-template-columns: 1fr !important;
  }

  .card {
    padding: var(--space-3) var(--space-2) !important;
  }

  .video-container-vertical {
    max-width: 100%;
  }
  
  .cmd-modal {
    max-width: 95%;
  }
  
  .detail-actions {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   STRICT MOBILE & RESIZE FIXES
   ========================================= */

/* 1. Hide OS Telemetry Widgets on anything smaller than a wide desktop */
@media (max-width: 1249px) {
  .os-widget {
    display: none !important;
  }

  /* Make the Social Dock semi-transparent on mobile */
  .social-dock a {
    background: rgba(18, 18, 21, 0.4) !important; /* 40% opacity dark glass */
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
  }

  /* Make the Terminal Toggle button slightly transparent too */
  #terminal-toggle {
    opacity: 0.85;
  }
}

/* =========================================
   TABLET & MOBILE HEADER (Stacks nicely)
   ========================================= */
@media (max-width: 900px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-top: var(--space-3);
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  nav ul {
    gap: var(--space-2);
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
  }

  nav a {
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  /* 1. Reset Header Layout */
  header {
    flex-direction: row; /* Put logo and button on same line */
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    gap: 0;
  }

  .mobile-menu-btn {
    display: block; /* Show hamburger */
  }

  /* 2. Hide the big OS widgets on mobile */
  .os-widget {
    display: none !important;
  }

  /* 3. Hamburger Menu Dropdown */
  nav {
    position: fixed;
    top: 60px; /* Sits right below the header */
    left: 0;
    width: 100%;
    background: var(--color-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 999;
  }

  /* Class added by JS to open the menu */
  nav.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  nav ul {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: var(--space-2);
  }

  nav ul li {
    width: 100%;
  }
  
  nav a {
    font-size: 1.1rem;
    display: block;
    width: 100%;
  }

  #theme-toggle {
    margin-top: var(--space-2);
    margin-left: 0;
  }

  /* 4. Fix padding so content isn't hidden behind the top header */
  body {
    padding-top: 70px; 
  }

  /* 5. Add massive bottom padding so docks don't cover text */
  main {
    padding-bottom: 140px !important;
  }

  /* 6. Hide the Arcade/Knowledge dock on mobile (handled via hamburger menu) */
  .bottom-left-dock {
    display: none !important;
  }

  /* 7. Make the social dock slightly smaller on mobile */
  .social-dock {
    transform: scale(0.85);
    transform-origin: bottom right;
    opacity: 0.9;
    bottom: 80px; /* Slightly raised so it doesn't hit the terminal button */
  }

  /* 8. Make sure the pet shows up and sits at the bottom left */
  .digital-pet {
    display: flex !important; /* Override any previous hide rules */
    bottom: 24px !important;
    left: 24px !important;
  }

  /* 9. Prevent the pet's speech bubble from going off-screen */
  .pet-bubble {
    white-space: normal !important;
    width: max-content;
    max-width: 200px;
    text-align: left;
  }
}

/* =========================================
   PAGE-SPECIFIC SEARCH BAR
   ========================================= */
.page-search-wrapper {
  max-width: 600px;
  margin: 0 auto var(--space-4) auto;
  position: relative;
}

.page-search-input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 99px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  transition: var(--transition);
  outline: none;
}

.page-search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.2);
}

.page-search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
}