/* Hacker CRT Terminal Portfolio — Varad Raj Agrawal */

:root {
  --bg: #050808;
  --bg-deep: #020404;
  --fg: #d4ffd4;
  --fg-dim: #6cff9a;
  --accent: #00ff9c;         /* primary neon green */
  --accent-2: #ff3cac;        /* magenta */
  --accent-3: #00e5ff;        /* cyan */
  --accent-4: #ffee00;        /* yellow */
  --accent-5: #b388ff;        /* violet */
  --scanline: rgba(0, 255, 156, 0.06);
  --mono: 'JetBrains Mono', 'IBM Plex Mono', 'Fira Code', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-deep);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  cursor: none;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* CRT curvature + vignette */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 0%, transparent 55%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
  z-index: 9000;
  mix-blend-mode: multiply;
}
/* scanlines */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.25) 2px,
    rgba(0, 0, 0, 0.25) 3px
  );
  pointer-events: none;
  z-index: 9001;
  animation: flicker 6s infinite;
}
@keyframes flicker {
  0%, 98%, 100% { opacity: 1; }
  99% { opacity: 0.85; }
}

/* Background canvas */
#bg-canvas {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Cursor */
#cursor-dot, .cursor-trail-dot {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  mix-blend-mode: screen;
}
#cursor-dot {
  width: 14px; height: 14px;
  border: 1px solid var(--accent);
  background: transparent;
  box-shadow: 0 0 12px var(--accent), inset 0 0 8px var(--accent);
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease-out, border-color 0.2s, width 0.2s, height 0.2s;
}
#cursor-dot.hover {
  width: 32px; height: 32px;
  border-color: var(--accent-2);
  box-shadow: 0 0 22px var(--accent-2);
}
.cursor-trail-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transform: translate(-50%, -50%);
}

/* Main layout */
#root {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 96px;
  width: 100%;
}

/* Top status bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
  border-bottom: 1px dashed rgba(0,255,156,0.2);
  padding-bottom: 8px;
  margin-bottom: 24px;
  text-transform: uppercase;
}
.status-bar .dots { display: flex; gap: 6px; }
.status-bar .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2a2a2a; border: 1px solid rgba(0,255,156,0.2);
}
.status-bar .dot.live { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 2s infinite; }
.status-bar .dot.warn { background: var(--accent-4); box-shadow: 0 0 8px var(--accent-4); }
.status-bar .dot.err { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
@keyframes blink {
  0%, 90%, 100% { opacity: 1; }
  95% { opacity: 0.3; }
}

.status-bar .right { display: flex; gap: 24px; }

/* Section headers */
.sec {
  margin-top: 72px;
}
.sec-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--fg-dim);
}
.sec-header .prompt { color: var(--accent); }
.sec-header .cmd { color: var(--fg); }
.sec-header .rule {
  flex: 1;
  border-bottom: 1px dashed rgba(0,255,156,0.2);
  transform: translateY(-4px);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 28px;
}
.hero-ascii {
  white-space: pre;
  font-size: 9px;
  line-height: 0.95;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0,255,156,0.55);
  user-select: none;
}
.hero-ascii .ch-b { color: var(--accent-3); }
.hero-ascii .ch-r { color: var(--accent-2); }

.hero-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-shadow: 0 0 12px rgba(0,255,156,0.45), 2px 0 var(--accent-2), -2px 0 var(--accent-3);
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 16px;
  color: var(--fg-dim);
  margin-bottom: 28px;
  max-width: 46ch;
}
.hero-sub .accent { color: var(--accent); }

.hero-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--fg-dim);
  margin-bottom: 28px;
  border: 1px dashed rgba(0,255,156,0.25);
  padding: 14px 16px;
  background: rgba(0, 20, 10, 0.35);
}
.hero-meta .k { color: var(--accent); }
.hero-meta .v { color: var(--fg); }
.hero-meta .v a { color: var(--accent-3); text-decoration: none; border-bottom: 1px dashed var(--accent-3); }
.hero-meta .v a:hover { color: var(--accent-2); border-color: var(--accent-2); }

.hint {
  font-size: 12px;
  color: var(--fg-dim);
  opacity: 0.7;
}
.hint kbd {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(0,255,156,0.1);
  border: 1px solid rgba(0,255,156,0.35);
  border-radius: 3px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  margin: 0 2px;
}

/* Terminal */
.terminal {
  margin-top: 28px;
  background: rgba(0, 12, 6, 0.85);
  border: 1px solid rgba(0,255,156,0.35);
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0,255,156,0.12), inset 0 0 30px rgba(0,255,156,0.04);
  backdrop-filter: blur(2px);
  overflow: hidden;
}
.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 40, 20, 0.5);
  border-bottom: 1px solid rgba(0,255,156,0.25);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.terminal-chrome .tdot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid currentColor;
}
.terminal-chrome .tdot.r { color: #ff5f56; }
.terminal-chrome .tdot.y { color: #ffbd2e; }
.terminal-chrome .tdot.g { color: #27c93f; }
.terminal-chrome .path { margin-left: auto; color: var(--accent); }

.terminal-body {
  padding: 16px 18px;
  max-height: 520px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.55;
}
.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(0,255,156,0.3); }

.line { white-space: pre-wrap; word-break: break-word; }
.line.sys { color: var(--fg-dim); }
.line.err { color: var(--accent-2); }
.line.warn { color: var(--accent-4); }
.line.ok { color: var(--accent); }
.line.info { color: var(--accent-3); }
.line.accent { color: var(--accent-5); }
.line pre { white-space: pre; font-family: inherit; }
.line .kw { color: var(--accent); }
.line .str { color: var(--accent-4); }
.line .num { color: var(--accent-2); }
.line .com { color: #4a6a55; font-style: italic; }

.prompt-line {
  display: flex;
  gap: 8px;
  align-items: center;
}
.prompt-line .user { color: var(--accent); }
.prompt-line .at { color: var(--fg-dim); }
.prompt-line .host { color: var(--accent-3); }
.prompt-line .path { color: var(--accent-4); }
.prompt-line .sym { color: var(--fg-dim); }
.prompt-line .cmd {
  color: var(--fg);
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 13.5px;
  caret-color: var(--accent);
}
.prompt-line .cmd-static { color: var(--fg); }

/* Blinking block cursor */
.blink::after {
  content: '▊';
  color: var(--accent);
  animation: blink-cursor 1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink-cursor { 50% { opacity: 0; } }

/* Cards */
.cards-wrap {
  position: relative;
  height: 560px;
  border: 1px dashed rgba(0,255,156,0.18);
  background:
    linear-gradient(rgba(0,255,156,0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(0,255,156,0.03) 1px, transparent 1px) 0 0 / 24px 24px;
  overflow: hidden;
  user-select: none;
}
.cards-wrap::before {
  content: "// drag me around. physics is real.";
  position: absolute; top: 10px; left: 14px;
  font-size: 11px; color: var(--fg-dim); opacity: 0.7;
  pointer-events: none;
  text-transform: lowercase;
}

.card {
  position: absolute;
  width: 280px;
  background: rgba(0, 15, 8, 0.92);
  border: 1px solid rgba(0,255,156,0.4);
  box-shadow: 0 0 20px rgba(0,255,156,0.15), 4px 4px 0 rgba(0,0,0,0.6);
  padding: 14px 16px;
  cursor: grab;
  transition: box-shadow 0.2s, border-color 0.2s;
  will-change: transform;
}
.card:hover {
  box-shadow: 0 0 30px var(--accent), 4px 4px 0 rgba(0,0,0,0.6);
  z-index: 50;
}
.card.dragging { cursor: grabbing; z-index: 100; }
.card.c-2 { border-color: var(--accent-2); box-shadow: 0 0 20px rgba(255,60,172,0.2), 4px 4px 0 rgba(0,0,0,0.6); }
.card.c-2:hover { box-shadow: 0 0 30px var(--accent-2), 4px 4px 0 rgba(0,0,0,0.6); }
.card.c-3 { border-color: var(--accent-3); box-shadow: 0 0 20px rgba(0,229,255,0.2), 4px 4px 0 rgba(0,0,0,0.6); }
.card.c-3:hover { box-shadow: 0 0 30px var(--accent-3), 4px 4px 0 rgba(0,0,0,0.6); }
.card.c-4 { border-color: var(--accent-4); box-shadow: 0 0 20px rgba(255,238,0,0.2), 4px 4px 0 rgba(0,0,0,0.6); }
.card.c-4:hover { box-shadow: 0 0 30px var(--accent-4), 4px 4px 0 rgba(0,0,0,0.6); }
.card.c-5 { border-color: var(--accent-5); box-shadow: 0 0 20px rgba(179,136,255,0.2), 4px 4px 0 rgba(0,0,0,0.6); }
.card.c-5:hover { box-shadow: 0 0 30px var(--accent-5), 4px 4px 0 rgba(0,0,0,0.6); }

.card-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--fg-dim);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px dashed rgba(0,255,156,0.2);
  padding-bottom: 6px;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.card-desc {
  font-size: 12px;
  color: var(--fg-dim);
  line-height: 1.5;
  margin-bottom: 12px;
}
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tag {
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  color: var(--accent-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-link:hover { color: var(--accent-2); }
.card-link::before { content: '→'; }

/* Skills grid */
.skills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.skill {
  border: 1px dashed rgba(0,255,156,0.3);
  padding: 12px 14px;
  background: rgba(0, 15, 8, 0.4);
  transition: all 0.2s;
}
.skill:hover {
  border-style: solid;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0,255,156,0.3);
  background: rgba(0, 30, 15, 0.6);
}
.skill .label {
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.skill .items {
  font-size: 12px;
  color: var(--fg);
  line-height: 1.6;
}
.skill .items span { color: var(--accent-3); }

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px dashed rgba(0,255,156,0.3);
  padding-left: 24px;
  margin-left: 12px;
}
.tl-item {
  position: relative;
  padding: 14px 0 20px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -30px; top: 20px;
  width: 11px; height: 11px;
  border: 1px solid var(--accent);
  background: var(--bg);
  box-shadow: 0 0 8px var(--accent);
}
.tl-item.now::before {
  background: var(--accent);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent); }
  50% { box-shadow: 0 0 20px var(--accent); }
}
.tl-date {
  font-size: 11px;
  color: var(--accent-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tl-title { font-size: 15px; color: var(--fg); font-weight: 700; }
.tl-desc { font-size: 12.5px; color: var(--fg-dim); margin-top: 3px; max-width: 70ch; }

/* Stats row */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat {
  border: 1px solid rgba(0,255,156,0.3);
  padding: 18px;
  background: rgba(0, 15, 8, 0.5);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0,255,156,0.05));
  pointer-events: none;
}
.stat .big {
  font-size: 38px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
  letter-spacing: -0.02em;
  text-shadow: 0 0 12px rgba(0,255,156,0.5);
}
.stat .lbl {
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}
.stat .graph {
  display: flex; gap: 2px;
  margin-top: 12px;
  height: 28px;
  align-items: flex-end;
}
.stat .bar {
  flex: 1;
  background: rgba(0,255,156,0.3);
  min-height: 2px;
}

/* Writing */
.writing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.post {
  border: 1px dashed rgba(0,255,156,0.25);
  padding: 16px 18px;
  background: rgba(0, 15, 8, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}
.post:hover {
  border-style: solid;
  background: rgba(0, 25, 12, 0.6);
  box-shadow: 0 0 20px rgba(0,255,156,0.15);
}
.post .date { font-size: 10px; color: var(--accent-2); letter-spacing: 0.1em; }
.post .ttl { font-size: 16px; color: var(--fg); margin: 6px 0 6px; font-weight: 700; }
.post .excerpt { font-size: 12px; color: var(--fg-dim); }

/* Footer */
.footer {
  margin-top: 96px;
  padding-top: 20px;
  border-top: 1px dashed rgba(0,255,156,0.2);
  font-size: 11px;
  color: var(--fg-dim);
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Glitch */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch:hover { cursor: none; }

/* Tweaks panel */
.tweaks {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 260px;
  background: rgba(0, 12, 6, 0.95);
  border: 1px solid var(--accent);
  box-shadow: 0 0 24px rgba(0,255,156,0.3);
  font-family: var(--mono);
  font-size: 12px;
  z-index: 9500;
  display: none;
}
.tweaks.active { display: block; }
.tweaks-head {
  display: flex; justify-content: space-between;
  padding: 8px 10px;
  background: rgba(0,255,156,0.1);
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
}
.tweaks-body { padding: 12px; display: flex; flex-direction: column; gap: 14px; }
.tw-row { display: flex; flex-direction: column; gap: 6px; }
.tw-row .lbl { color: var(--fg-dim); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.tw-opts { display: flex; gap: 4px; flex-wrap: wrap; }
.tw-opt {
  padding: 5px 10px;
  border: 1px dashed rgba(0,255,156,0.35);
  color: var(--fg);
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  cursor: none;
  transition: all 0.15s;
}
.tw-opt:hover { border-style: solid; color: var(--accent); }
.tw-opt.on { background: var(--accent); color: #000; border-color: var(--accent); }
.tw-swatches { display: flex; gap: 6px; }
.tw-sw {
  width: 24px; height: 24px;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: none;
}
.tw-sw.on { border-color: #fff; box-shadow: 0 0 8px currentColor; }

/* ============ RESPONSIVE ============ */

/* Tablets & below */
@media (max-width: 1024px) {
  #root { padding: 20px 18px 72px; }
  .hero { gap: 36px; }
  .gh-grid { grid-template-columns: 1fr; }
}

/* Mobile + small tablets */
@media (max-width: 860px) {
  body { cursor: auto; font-size: 13px; }
  #cursor-dot, .cursor-trail-dot { display: none !important; }

  #root { padding: 14px 14px 60px; }

  /* Status bar — stack, shrink, drop less-critical text */
  .status-bar {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 0.05em;
  }
  .status-bar .right { gap: 12px; flex-wrap: wrap; }
  .status-bar .right span:nth-child(3) { display: none; }

  /* Hero stacks */
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 18px;
  }
  .hero-title {
    font-size: clamp(36px, 11vw, 56px);
    margin-bottom: 16px;
    text-shadow: 0 0 10px rgba(0,255,156,0.45), 1px 0 var(--accent-2), -1px 0 var(--accent-3);
  }
  .hero-sub { font-size: 14px; margin-bottom: 20px; }
  .hero-ascii { font-size: 6px; overflow-x: auto; }
  .hero-meta {
    font-size: 11px;
    padding: 12px 14px;
    gap: 5px 12px;
  }
  .hero-meta .v { word-break: break-word; }
  .hero-meta .v a { font-size: 11px; word-break: break-all; }

  .sec { margin-top: 48px; }
  .sec-header { font-size: 11px; gap: 10px; }
  .sec-header .cmd { word-break: break-all; }

  /* Terminal */
  .terminal { margin-top: 18px; border-radius: 3px; }
  .terminal-chrome { font-size: 9px; padding: 6px 10px; gap: 6px; }
  .terminal-chrome span:nth-of-type(1) { display: none; }
  .terminal-body {
    padding: 12px 12px;
    font-size: 12px;
    max-height: 420px;
  }
  .prompt-line { flex-wrap: wrap; gap: 4px; font-size: 11px; }
  .prompt-line .cmd { font-size: 12px; min-width: 100px; }

  /* Projects — switch from physics canvas to vertical stack */
  .cards-wrap {
    height: auto;
    min-height: auto;
    padding: 48px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: visible;
    border-style: solid;
    border-color: rgba(0,255,156,0.15);
  }
  .cards-wrap::before { font-size: 10px; top: 14px; left: 14px; }
  .card {
    position: relative !important;
    transform: none !important;
    width: 100% !important;
    cursor: default;
    touch-action: manipulation;
  }
  .card:hover { box-shadow: 0 0 16px rgba(0,255,156,0.25), 3px 3px 0 rgba(0,0,0,0.6); }

  /* Skills */
  .skills { grid-template-columns: 1fr 1fr; gap: 10px; }
  .skill { padding: 10px 12px; }
  .skill .items { font-size: 11px; line-height: 1.55; }

  /* GitHub */
  .gh-grid { grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
  .gh-card { padding: 14px; }
  .gh-card h4 { font-size: 10px; flex-wrap: wrap; gap: 6px; }
  .gh-stats-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .gh-stat { padding: 10px 8px; }
  .gh-stat .big { font-size: 22px; }
  .gh-stat .lbl { font-size: 9px; }

  .gh-repos { grid-template-columns: 1fr; gap: 8px; }
  .gh-repo { padding: 10px 12px; }
  .gh-repo .r-name { font-size: 13px; }
  .gh-repo .r-desc { font-size: 11px; min-height: auto; margin-bottom: 6px; }
  .gh-repo .r-meta { font-size: 9.5px; gap: 10px; flex-wrap: wrap; }

  .gh-lang-row { grid-template-columns: 70px 1fr 32px; font-size: 10.5px; }
  .gh-contrib-grid { grid-template-rows: repeat(7, 8px); gap: 2px; }
  .gh-cell { width: 8px; height: 8px; }

  .gh-event { grid-template-columns: 54px 1fr; font-size: 10.5px; gap: 6px; }
  .gh-event .t { font-size: 9px; }

  /* Footer stacks */
  .footer {
    margin-top: 48px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 10px;
    letter-spacing: 0.05em;
  }

  /* Tweaks panel — full-width drawer on mobile */
  .tweaks {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
  }
  .tweaks-body { padding: 10px; gap: 10px; }
  .tw-opt { padding: 8px 12px; font-size: 11px; }
  .tw-sw { width: 30px; height: 30px; }

  /* Loader on mobile */
  .l-name {
    font-size: clamp(20px, 7vw, 32px);
    white-space: normal;
    text-align: center;
    line-height: 1.1;
  }
  .l-term { height: 170px; font-size: 10.5px; padding: 10px 12px; }
  .l-meta { font-size: 9.5px; }

  /* Reduce CRT vignette intensity on tiny screens */
  body::before { background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.5) 100%); }
}

/* Very small phones */
@media (max-width: 480px) {
  #root { padding: 10px 10px 48px; }

  .status-bar span:not(.glitch) { font-size: 9px; }
  .status-bar > div:first-child span { display: none; }

  .hero { gap: 22px; }
  .hero-title { font-size: clamp(30px, 13vw, 46px); }
  .hero-ascii { font-size: 5px; }

  .hero-meta {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .hero-meta .k {
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .hero-meta .v { font-size: 12px; }
  .hero-meta .v a { font-size: 11.5px; }

  .hint { font-size: 10.5px; }
  .hint kbd { font-size: 10px; padding: 1px 6px; }

  .terminal-body { font-size: 11.5px; padding: 10px; max-height: 360px; }
  .prompt-line .user, .prompt-line .host { font-size: 10.5px; }

  .skills { grid-template-columns: 1fr; }

  .gh-stats-row { grid-template-columns: 1fr 1fr 1fr; }
  .gh-stat .big { font-size: 19px; }

  .gh-lang-row { grid-template-columns: 60px 1fr 28px; font-size: 10px; }
  .gh-contrib-grid { grid-template-rows: repeat(7, 7px); gap: 1.5px; }
  .gh-cell { width: 7px; height: 7px; }

  .sec-header .cmd { font-size: 11px; }
}

/* Extra small (<360) — last line of defense */
@media (max-width: 359px) {
  html, body { font-size: 12px; }
  .hero-title { font-size: 28px; }
  .hero-ascii { display: none; }
  .gh-lang-row { grid-template-columns: 54px 1fr 26px; }
}

/* Short landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
  .l-term { height: 120px; }
  #loader { gap: 14px; padding: 14px; }
  .terminal-body { max-height: 60vh; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  .status-bar .dot.live { animation: none; }
  .gh-card h4 .live::before { animation: none; }
  .gh-loading::before { animation: none; }
  .tl-item.now::before { animation: none; }
}

/* Touch / coarse pointer — disable custom cursor everywhere */
@media (hover: none) or (pointer: coarse) {
  body { cursor: auto; }
  #cursor-dot, .cursor-trail-dot { display: none !important; }
}

/* ─── Loader ─── */
#loader {
  position: fixed; inset: 0;
  background: #020404;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  color: var(--fg);
  transition: opacity 0.4s ease;
  cursor: none;
  padding: 24px;
  gap: 24px;
}
#loader::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(0,0,0,0.35) 2px, rgba(0,0,0,0.35) 3px);
  pointer-events: none;
}
#loader::after {
  content:'';
  position:absolute; inset:0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.7) 100%);
  pointer-events:none;
}
.l-name {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow: 0 0 16px var(--accent), 2px 0 var(--accent-2), -2px 0 var(--accent-3);
  white-space: nowrap;
  position: relative;
  z-index: 2;
}
.l-term {
  width: min(640px, 92vw);
  height: 200px;
  border: 1px solid rgba(0,255,156,0.3);
  background: rgba(0,15,8,0.6);
  padding: 12px 14px;
  overflow: hidden;
  font-size: 12.5px;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 20px rgba(0,255,156,0.15);
}
.l-line { opacity: 0; animation: lfade 0.2s forwards; }
.l-line.sys { color: var(--fg-dim); }
.l-line.ok { color: var(--accent); }
.l-line.warn { color: var(--accent-4); }
.l-line.err { color: var(--accent-2); }
.l-line.info { color: var(--accent-3); }
@keyframes lfade { to { opacity: 1; } }

.l-bar-wrap {
  width: min(640px, 92vw);
  position: relative;
  z-index: 2;
}
.l-bar {
  width: 100%;
  height: 6px;
  background: rgba(0,255,156,0.1);
  border: 1px solid rgba(0,255,156,0.3);
  overflow: hidden;
}
.l-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.12s linear;
}
.l-meta {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.l-pct { color: var(--accent); }
.l-hint { color: var(--fg-dim); opacity: 0.6; }

/* ─── GitHub widgets ─── */
.gh-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.gh-card {
  border: 1px solid rgba(0,255,156,0.3);
  background: rgba(0,15,8,0.5);
  padding: 16px 18px;
  position: relative;
}
.gh-card h4 {
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.gh-card h4 .live {
  color: var(--accent); font-size: 9px;
  display: inline-flex; align-items: center; gap: 4px;
}
.gh-card h4 .live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
  animation: blink 2s infinite;
}
.gh-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.gh-stat {
  border: 1px dashed rgba(0,255,156,0.25);
  padding: 14px 12px;
  background: rgba(0,15,8,0.4);
  text-align: left;
}
.gh-stat .big {
  font-size: 28px; font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0,255,156,0.4);
  font-family: var(--mono);
}
.gh-stat .lbl {
  font-size: 10px; color: var(--fg-dim);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-top: 2px;
}

.gh-langs { display: flex; flex-direction: column; gap: 8px; }
.gh-lang-row {
  display: grid;
  grid-template-columns: 90px 1fr 36px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.gh-lang-row .name { color: var(--fg); }
.gh-lang-row .bar-wrap {
  height: 6px;
  background: rgba(0,255,156,0.08);
  border: 1px solid rgba(0,255,156,0.18);
  overflow: hidden;
}
.gh-lang-row .bar-fill {
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.gh-lang-row .pct { color: var(--fg-dim); text-align: right; }

.gh-contrib {
  overflow-x: auto;
}
.gh-contrib-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 11px);
  gap: 3px;
  min-width: 100%;
}
.gh-cell {
  width: 11px; height: 11px;
  border-radius: 2px;
}

.gh-repos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gh-repo {
  border: 1px dashed rgba(0,255,156,0.25);
  padding: 12px 14px;
  background: rgba(0,15,8,0.4);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  display: block;
}
.gh-repo:hover {
  border-style: solid;
  background: rgba(0,25,12,0.6);
  box-shadow: 0 0 18px rgba(0,255,156,0.15);
}
.gh-repo .r-name {
  font-size: 14px; color: var(--accent);
  font-weight: 700; margin-bottom: 4px;
}
.gh-repo .r-desc {
  font-size: 11.5px; color: var(--fg-dim);
  line-height: 1.4; margin-bottom: 8px;
  min-height: 32px;
}
.gh-repo .r-meta {
  display: flex; gap: 14px;
  font-size: 10px; color: var(--fg-dim);
  letter-spacing: 0.08em;
}
.gh-repo .r-meta .lang { color: var(--accent-3); }
.gh-repo .r-meta .star { color: var(--accent-4); }

.gh-events { display: flex; flex-direction: column; gap: 6px; }
.gh-event {
  font-size: 11px;
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(0,255,156,0.1);
}
.gh-event:last-child { border: none; }
.gh-event .t { color: var(--accent-2); font-size: 10px; letter-spacing: 0.08em; }
.gh-event .d { color: var(--fg); }
.gh-event .d .type { color: var(--accent); }
.gh-event .d .repo { color: var(--accent-3); }

.gh-loading {
  color: var(--fg-dim);
  font-size: 12px;
  padding: 20px;
  text-align: center;
}
.gh-loading::before {
  content: '◼ '; color: var(--accent);
  animation: blink 1s infinite;
}

/* ASCII banner */
.ascii-banner {
  font-size: 10px;
  line-height: 1;
  color: var(--accent);
  white-space: pre;
  text-shadow: 0 0 6px rgba(0,255,156,0.4);
  margin: 12px 0 24px;
  overflow: hidden;
}
