/* ═══════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════ */

:root {
  --bg:           #f0ece4;
  --bg-darker:    #e8e3d9;
  --bg-darkest:   #ddd7cb;
  --fg:           #1a1a1a;
  --fg-muted:     #6b6560;
  --fg-faint:     #9e9690;
  --fg-ghost:     #c5bfb6;
  --accent:       #c94736;
  --green:        #2ea043;
  --border:       #ccc5b9;
  --statusbar-bg: #2d2d2d;
  --statusbar-fg: #cccccc;

  --font-mono:    'JetBrains Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  --max-width:    1200px;
  --tree-width:   320px;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--fg);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 28px;
}

a { color: var(--fg); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: #fff; }

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */

.hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 2.5rem 3.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.hero-inner { max-width: 680px; }

.hero-greeting {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
}

.prompt {
  color: var(--fg-muted);
  user-select: none;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

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

.hero-tagline {
  font-size: 0.9rem;
  color: var(--fg-muted);
  font-weight: 300;
  max-width: 520px;
  line-height: 1.8;
  margin-bottom: 1.75rem;
  min-height: 3.6em;
  white-space: pre-wrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.hero-tagline.visible { opacity: 1; transform: translateY(0); }

.hero-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}
.hero-links.visible { opacity: 1; transform: translateY(0); }

.hero-link {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.15s, color 0.15s;
}
.hero-link:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

/* Status */
.hero-status {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
  opacity: 0;
  animation: fadeIn 0.5s ease 2.2s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

/* ═══════════════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════════════ */

.divider-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}
.divider-inner { border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════
   CONTENT: TREE + README
   ═══════════════════════════════════════════════ */

.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 2.5rem;
}

.tree-section {
  display: grid;
  grid-template-columns: var(--tree-width) 1fr;
  gap: 3rem;
  align-items: start;
}

/* ── Tree ── */

.tree-container { position: sticky; top: 1.5rem; }

.tree-header {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--fg);
  transition: background 0.12s;
  white-space: nowrap;
}
.tree-item.file { cursor: pointer; }
.tree-item.file:hover { background: var(--bg-darker); }
.tree-item.file:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tree-item.file.active {
  background: var(--bg-darkest);
  font-weight: 600;
}

.tree-connector {
  color: var(--fg-ghost);
  font-size: 0.75rem;
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}

.tree-active-marker {
  font-size: 0.8rem;
  color: var(--fg-faint);
  width: 0.9em;
  text-align: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s;
}

.tree-item.file.active .tree-active-marker {
  opacity: 1;
}

.tree-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--fg-muted);
}

.tree-label { flex: 1; }

.tree-hint {
  margin-top: 1.5rem;
  font-size: 0.65rem;
  color: var(--fg-ghost);
}
.tree-hint kbd {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  background: var(--bg-darker);
  line-height: 1.6;
}

/* ── README Pane ── */

.readme-pane {
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 380px;
}

.readme-header {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
}

.readme-header-text {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}

.readme-body {
  padding: 1.75rem 1.5rem;
  flex: 1;
}

.readme-content {
  display: none;
  animation: fadeContent 0.3s ease;
}
.readme-content.active { display: block; }

@keyframes fadeContent {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.readme-lead {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: var(--fg);
}

.readme-content p {
  margin-bottom: 0.75rem;
  color: var(--fg-muted);
  line-height: 1.8;
}
.readme-content .readme-lead { color: var(--fg); }

.readme-muted { color: var(--fg-faint) !important; }

.readme-location {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--fg-faint) !important;
}

/* Meta */
.readme-meta {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  font-size: 0.8rem;
  color: var(--fg-muted);
}
.meta-lang {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.meta-stat { color: var(--fg-faint); }

.readme-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--fg-muted);
  transition: border-color 0.12s, color 0.12s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

.readme-repo-link {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.12s, color 0.12s;
}
.readme-repo-link:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

/* Stack grid */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}
.stack-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--fg);
}
.stack-col ul { font-size: 0.8rem; color: var(--fg-muted); }
.stack-col li { padding: 2px 0; }
.stack-col li::before { content: '|-- '; color: var(--fg-ghost); }
.stack-col li:last-child::before { content: '`-- '; }

/* Thinking */
.thinking-block { margin-top: 0.5rem; }
.thinking-block p {
  position: relative;
  padding-left: 1.25rem;
  font-style: italic;
}
.thinking-block p::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--fg-ghost);
  font-style: normal;
}
.thinking-sig {
  margin-top: 1rem;
  font-style: normal !important;
  color: var(--fg-faint) !important;
  font-size: 0.8rem;
}
.thinking-sig::before { content: '' !important; }

/* Terminal prompt in pane */
.readme-terminal {
  padding: 0.6rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--fg-faint);
  background: var(--bg-darker);
  user-select: none;
}
.term-user  { color: var(--fg-muted); font-weight: 500; }
.term-at    { color: var(--fg-ghost); }
.term-host  { color: var(--fg-muted); font-weight: 500; }
.term-sep   { color: var(--fg-ghost); }
.term-path  { color: var(--fg-muted); }
.term-dollar { color: var(--fg-ghost); margin-right: 0.5em; }
.term-cmd   { color: var(--fg-faint); }

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */

.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2.5rem 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
}

.footer-avatar {
  width: 44px;
  height: 44px;
  border: 2px solid var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.footer-tagline {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--fg-muted);
  line-height: 1.6;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.footer-col li { margin-bottom: 0.2rem; }
.footer-col a,
.footer-col span {
  font-size: 0.8rem;
  color: var(--fg-muted);
  transition: color 0.12s;
}
.footer-col a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════
   STATUS BAR
   ═══════════════════════════════════════════════ */

.statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--statusbar-bg);
  color: var(--statusbar-fg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  font-size: 0.68rem;
  z-index: 100;
}
.statusbar-left,
.statusbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 0.3em;
}
.sb-icon { width: 12px; height: 12px; }
.sb-branch { color: #e8e8e8; }
.sb-commit { color: #888; font-size: 0.65rem; }

/* ═══════════════════════════════════════════════
   EASTER EGG
   ═══════════════════════════════════════════════ */

.easter-egg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 999;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 1rem;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.easter-egg.active { display: flex; }
.easter-egg pre {
  text-align: center;
  line-height: 1.5;
  animation: flicker 0.15s 3;
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 900px) {
  .hero { padding: 3.5rem 1.5rem 2.5rem; min-height: 40vh; }
  .hero-greeting { font-size: 1.6rem; }
  .hero-status { position: static; margin-top: 1.5rem; }
  .content { padding: 2rem 1.5rem; }
  .divider-bar { padding: 0 1.5rem; }
  .footer { padding: 2.5rem 1.5rem 1.5rem; }
}

@media (max-width: 720px) {
  .tree-section { grid-template-columns: 1fr; gap: 1.5rem; }
  .tree-container { position: static; }
  .hero-greeting { font-size: 1.3rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-columns { grid-template-columns: 1fr 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-greeting { font-size: 1.1rem; }
  .content { padding: 1.5rem 1rem; }
  .divider-bar { padding: 0 1rem; }
  .footer { padding: 2rem 1rem 1rem; }
  .footer-columns { grid-template-columns: 1fr; }
  .statusbar { font-size: 0.6rem; }
}

/* ═══════════════════════════════════════════════
   DEVELOPER EASTER EGGS STYLING
   ═══════════════════════════════════════════════ */



/* Hacker Mode Theme overrides */
body.hacker-mode {
  --bg: #030803;
  --bg-darker: #071207;
  --bg-darkest: #0b1a0b;
  --fg: #33ff33;
  --fg-muted: #11b811;
  --fg-faint: #0c800c;
  --fg-ghost: #064006;
  --accent: #39ff14;
  --green: #39ff14;
  --border: #0c800c;
  --statusbar-bg: #071207;
  --statusbar-fg: #33ff33;
  text-shadow: 0 0 4px rgba(51, 255, 51, 0.4);
}
body.hacker-mode::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%), 
              linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 4px, 6px 100%;
  z-index: 99999;
  pointer-events: none;
  animation: crt-flicker 0.15s infinite;
}
@keyframes crt-flicker {
  0% { opacity: 0.99; }
  50% { opacity: 1; }
  100% { opacity: 0.995; }
}

/* Git Log Drawer */
.git-log-drawer {
  position: fixed;
  bottom: -300px;
  left: 0;
  right: 0;
  height: 200px;
  background: #111111;
  border-top: 2px solid var(--border);
  color: #33ff33;
  z-index: 90;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: bottom 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}
.git-log-drawer.active {
  bottom: 28px; /* sits right on top of statusbar */
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  user-select: none;
}
.drawer-cmd {
  color: #888;
}
.drawer-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
}
.drawer-close:hover {
  color: #fff;
}
.drawer-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  line-height: 1.6;
}
.git-log-item {
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.git-log-hash {
  color: var(--accent);
  margin-right: 0.75rem;
  font-weight: bold;
}
.git-log-msg {
  color: #eee;
}
.git-log-meta {
  color: #555;
  margin-left: 0.75rem;
}

/* Interactive scrambler hover pointer */
.scramble-hover {
  cursor: pointer;
  transition: color 0.15s;
}
.scramble-hover:hover {
  color: var(--accent);
}



/* Screenshake for Caffeine Overload Crash */
.crash-flash {
  animation: crash-flash-effect 0.8s ease-out forwards;
}
@keyframes crash-flash-effect {
  0% {
    filter: invert(1) contrast(3) blur(2px);
    transform: scale(1.05) translate(5px, 5px);
  }
  15% {
    filter: invert(0) contrast(1) blur(0px);
    transform: scale(0.98) translate(-5px, -5px);
  }
  30% {
    filter: invert(1) hue-rotate(90deg) blur(4px);
    transform: scale(1.08) translate(8px, -8px);
  }
  45% {
    filter: invert(0) blur(0px);
    transform: scale(1);
  }
  60% {
    filter: invert(0.5) sepia(1) blur(1px);
    transform: translate(-3px, 3px);
  }
  100% {
    filter: none;
    transform: none;
  }
}

/* Interactive Console Input */
.console-input-wrapper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-left: 0.5rem;
  animation: expand-console 0.2s ease-out;
  vertical-align: middle;
}
@keyframes expand-console {
  from { width: 0; opacity: 0; }
  to { width: 250px; opacity: 1; }
}
#console-input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 200px;
}
#console-input::placeholder {
  color: var(--fg-ghost);
}

/* Terminal toast notification overlay */
.terminal-toast {
  position: fixed;
  bottom: 45px;
  right: 20px;
  background: #111111;
  color: #33ff33;
  border: 1px solid #33ff33;
  box-shadow: 0 4px 20px rgba(0,255,0,0.15);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  z-index: 1000;
  max-width: 320px;
  white-space: pre-wrap;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.terminal-toast.active {
  opacity: 1;
  transform: translateY(0);
}

/* Canvas Overlays */
.matrix-canvas {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1; /* behind everything, on background */
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}
.matrix-canvas.active {
  opacity: 0.12; /* subtle background flow */
}
body.hacker-mode .matrix-canvas.active {
  opacity: 0.22; /* stronger inside hacker mode */
}





.footer-avatar {
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.footer-avatar:hover {
  transform: rotate(360deg) scale(1.1);
}

