/* deadheap.com - GTK heaptty & Cypherpunk Theme */

/* Self-hosted JetBrains Mono (variable, wght 100-800) - no third-party font CDN. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg-void: #05080c;
  --bg-navy: #090e17;
  /* Translucent enough to read the synapse field through the panels. The
     companion backdrop blur is kept tiny (3px) on purpose -- a large radius
     smears the thin dendrite lines into flat haze and hides them entirely. */
  --panel-bg: rgba(10, 15, 24, 0.52);
  --panel-border: rgba(74, 144, 226, 0.3);
  --gtk-header-bg: #141a24;
  --gtk-border: #222c3c;
  
  --steely-blue: #4a90e2;
  --ice-cyan: #00bfff;
  --neon-glow: rgba(0, 191, 255, 0.45);
  --neon-pink: #ff2a75;
  
  --text-main: #d0e3f8;
  --text-muted: #6b829e;
  --text-bright: #ffffff;
  
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-card: 12px;
  --radius-pill: 20px;
}

/* Reset & Box Sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-mono);
  overflow-x: hidden;
}

/* Faint Digital Synapse Canvas */
#synapse-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
}

/* CRT Overlay */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  opacity: 0.6;
}

/* App Layout */
.app-layout {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1200px;
  min-height: calc(100vh - 60px);
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

/* Grid items default to min-width:auto, so any nowrap descendant can force the
   whole track wider than the viewport. Pin the floor to zero. */
.app-layout > * {
  min-width: 0;
}

/* Left Column: Profile Card */
.profile-card {
  background: var(--panel-bg);
  backdrop-filter: blur(3px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.avatar-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 20px;
}

/* The glow pulse animates opacity rather than box-shadow: box-shadow is a
   paint property, so animating it repaints the ring every frame forever. */
.avatar-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 2px solid var(--ice-cyan);
  box-shadow: 0 0 22px rgba(0, 191, 255, 0.6), inset 0 0 14px rgba(0, 191, 255, 0.6);
  will-change: opacity;
  animation: pulse-ring 4s ease-in-out infinite alternate;
}

@keyframes pulse-ring {
  0% { opacity: 0.55; }
  100% { opacity: 1; }
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--steely-blue);
  display: block;
}

.profile-meta {
  margin-bottom: 24px;
}

.handle-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-bright);
  text-shadow: 0 0 10px var(--neon-glow);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--steely-blue);
  background: rgba(74, 144, 226, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(74, 144, 226, 0.25);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--ice-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--ice-cyan);
  animation: pulse-dot-anim 2s infinite;
}

@keyframes pulse-dot-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Horizontal Social Icon Bar (Clean, Borderless) */
.social-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  padding: 8px 0 0 0;
  background: transparent;
  border: none;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-icon-btn:hover {
  color: var(--ice-cyan);
  background: transparent;
  transform: translateY(-2px);
}

.social-svg {
  width: 20px;
  height: 20px;
  display: block;
  shape-rendering: geometricPrecision;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: transform 0.2s ease, fill 0.2s ease;
}

.social-icon-btn:hover .social-svg {
  transform: scale(1.08);
  fill: var(--ice-cyan);
}

/* Right Column: Linux GTK Terminal Window (heaptty) */
.terminal-container {
  background: var(--panel-bg);
  backdrop-filter: blur(3px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

/* GTK4 Headerbar */
.gtk-headerbar {
  height: 42px;
  background: var(--gtk-header-bg);
  border-bottom: 1px solid var(--gtk-border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.gtk-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.gtk-app-icon {
  color: var(--steely-blue);
}

.gtk-title {
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.gtk-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gtk-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.gtk-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-bright);
}

.gtk-btn.gtk-close:hover {
  background: var(--neon-pink);
  color: #fff;
  border-color: var(--neon-pink);
}

/* Terminal Body */
.terminal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

/* ASCII Art Banner */
.ascii-art {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1.5vw, 0.85rem);
  line-height: 1.15;
  color: var(--steely-blue);
  text-shadow: 0 0 8px var(--neon-glow);
  white-space: pre;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(74, 144, 226, 0.2);
}

/* Quote Box */
.quote-box {
  background: rgba(8, 14, 22, 0.6);
  border-left: 3px solid var(--ice-cyan);
  border-radius: 0 8px 8px 0;
  padding: 16px;
  position: relative;
  margin-top: 4px;
}

.quote-tag {
  font-size: 0.68rem;
  letter-spacing: 1px;
  color: var(--steely-blue);
  margin-bottom: 8px;
}

.quote-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-bright);
  margin-bottom: 10px;
  font-style: normal;
}

.quote-author {
  font-size: 0.8rem;
  color: var(--ice-cyan);
  text-align: right;
}

.next-quote-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 191, 255, 0.1);
  border: 1px solid var(--panel-border);
  color: var(--ice-cyan);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.next-quote-btn:hover {
  background: var(--ice-cyan);
  color: var(--bg-void);
  box-shadow: 0 0 10px var(--neon-glow);
}

/* CLI Output Buffer */
.cli-output {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.output-line {
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.output-line.cmd {
  color: var(--steely-blue);
  font-weight: 500;
}

.output-line.highlight {
  color: var(--ice-cyan);
}

.output-line.error {
  color: var(--neon-pink);
}

/* CLI Input Line */
.cli-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(6, 10, 16, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: auto;
  min-width: 0;
}

.prompt-text {
  font-size: 0.85rem;
  color: var(--ice-cyan);
  white-space: nowrap;
  user-select: none;
}

.cli-input {
  flex: 1;
  /* Without this the input's intrinsic size becomes a hard floor (flex items
     default to min-width:auto), forcing the whole grid wider than a phone. */
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  caret-color: var(--ice-cyan);
}

.cli-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* Command Quick Badges */
.cmd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.cmd-badge {
  background: rgba(74, 144, 226, 0.08);
  border: 1px solid rgba(74, 144, 226, 0.2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cmd-badge:hover {
  background: rgba(0, 191, 255, 0.2);
  border-color: var(--ice-cyan);
  color: var(--text-bright);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 16px 20px 30px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* 404 page: single centred column instead of the two-column home grid. */
.error-layout {
  grid-template-columns: 1fr;
  max-width: 720px;
}

.error-layout .terminal-container {
  min-height: 0;
}

a.cmd-badge {
  text-decoration: none;
  display: inline-block;
}

/* Responsive Rules */
@media (max-width: 860px) {
  .app-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px 14px;
  }
  
  .profile-card {
    padding: 20px;
  }

  .ascii-art {
    font-size: 0.55rem;
  }
}

/* Phones: the full "deadheap ⚡ heaptty ~ >" prompt eats over half the input
   row, so drop the host segment and keep the bare cwd marker. */
@media (max-width: 560px) {
  .prompt-host {
    display: none;
  }

  .cli-input-wrapper {
    padding: 9px 11px;
    gap: 7px;
  }

  .terminal-body {
    padding: 16px 14px;
  }

  .cmd-badge {
    font-size: 0.68rem;
    padding: 4px 8px;
  }
}

/* Respect the OS "reduce motion" preference: kill the looping decorations.
   terminal.js applies the same check to the synapse canvas. */
@media (prefers-reduced-motion: reduce) {
  .avatar-ring,
  .pulse-dot {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
