
:root {
  --color-page-bg: #0f1419;
  --color-surface: #1a2332;
  --color-surface-elevated: #1e2d3d;
  --color-surface-subtle: #1a2332ee;
  --color-border: rgba(47, 128, 255, 0.35);
  --color-border-subtle: #2f80ff;
  --color-primary: #00ffe7;
  --color-primary-soft: rgba(0, 255, 231, 0.08);
  --color-accent: #00ffe7;
  --color-accent-soft: #00ffe7;
  --color-accent-muted: rgba(0, 255, 231, 0.6);
  --color-accent2: #2f80ff;
  --color-accent3: #ffe600;
  --color-danger: #ff2f5a;
  --color-danger-soft: #2f1a2a;
  --color-text: #f0f4f8;
  --color-text-muted: #8b9cad;
  --radius-md: 16px;
  --radius-lg: 24px;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1.2rem;
  --space-5: 1.7rem;
  --space-6: 2.2rem;
  --shadow-soft: 0 10px 40px rgba(0, 255, 231, 0.12), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 0 1px rgba(0, 255, 231, 0.3), 0 8px 26px rgba(0, 0, 0, 0.45);
  --font-family-display: 'Orbitron', sans-serif;
  --font-family-mono: 'IBM Plex Mono', monospace;
  --font-size-sm: 0.95rem;
  --font-size-md: 1.1rem;
  --font-size-lg: 1.5rem;
  --font-size-xl: 2.5rem;
  --line-height-tight: 1.1;
  --line-height-relaxed: 1.6;
}

body {
  margin: 0;
  background: var(--color-page-bg);
}

.github-icon-link {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background-color: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.github-icon-link:hover {
  transform: translateY(-1px);
  border-color: var(--color-accent-muted);
  color: var(--color-accent-soft);
  box-shadow: var(--shadow-glow);
}

.github-icon-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.retro-bg {
  position: relative;
  min-height: 100vh;
  background: var(--color-page-bg);
}

/* Overlay only dims the outer background; main content sits above it (z-index 3) so list stays clear */
.retro-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(15, 20, 25, 0.85) 0%, rgba(26, 35, 50, 0.8) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Performance-optimized grid overlay */
.grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(0deg, transparent, transparent 48px, rgba(47, 128, 255, 0.06) 50px),
              repeating-linear-gradient(90deg, transparent, transparent 48px, rgba(47, 128, 255, 0.06) 50px);
  background-size: 100% 100%;
  pointer-events: none;
  opacity: 0.6;
}

@keyframes grid-fade {
  0% { opacity: 0.5; }
  100% { opacity: 0.9; }
}

.page-shell {
  position: relative;
  z-index: 3;
  width: 96vw;
  max-width: 1400px;
  min-width: 340px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  padding: clamp(2.2rem, 4vw, 3.2rem);
  margin: 3vw auto;
  overflow-x: auto;
}

.page-header {
  margin-bottom: var(--space-5);
  border-bottom: 2px solid var(--color-accent2);
  padding-bottom: var(--space-4);
  text-align: left;
  position: relative;
}

.neon-glow {
  text-shadow: 0 2px 6px #000b;
  filter: none;
}

.neon-accent {
  color: var(--color-primary);
  text-shadow: 0 0 8px rgba(0, 255, 231, 0.5);
}

.page-title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-2);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text);
  text-shadow:
    0 0 12px var(--color-primary),
    0 0 24px rgba(0, 255, 231, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.5);
}

.page-subtitle {
  margin: 0;
  color: #9caec2;
  font-size: var(--font-size-md);
  font-family: var(--font-family-mono);
  letter-spacing: 0.02em;
}

.page-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.7s cubic-bezier(.7,0,.3,1), transform 0.7s cubic-bezier(.7,0,.3,1);
}

.animated-reveal.show {
  opacity: 1;
  transform: none;
  transition-delay: 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  .page-main {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .animated-reveal.show {
    transition: none;
  }
}

#error-message {
  display: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #2f1a2a 60%, #ff2f5a22 100%);
  color: var(--color-danger);
  border: 1.5px solid var(--color-danger);
  font-size: var(--font-size-sm);
  box-shadow: 0 0 8px #ff2f5a55;
}

.bookmarklet-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2.2rem 2.5rem;
  z-index: 2;
  width: 100%;
  max-width: 100%;
}

.bookmarklet-item {
  padding: 1.2rem 2.2rem 1.2rem 1.2rem;
  background: #1e2d3d;
  border-radius: var(--radius-md);
  border: 1px solid rgba(47, 128, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.2rem;
  position: relative;
  overflow: visible;
  min-width: 0;
  transition: box-shadow 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.25s ease, background-color 0.2s ease;
}

.bookmarklet-item:hover {
  background: #243447;
  border-color: rgba(47, 128, 255, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.bookmarklet-item.error-item {
  background: linear-gradient(90deg, #2f1a2a 60%, #ff2f5a22 100%);
  border-color: var(--color-danger);
  color: var(--color-danger);
  box-shadow: 0 0 8px #ff2f5a55;
  font-size: var(--font-size-sm);
}


.bookmarklet-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 0%;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--color-accent);
  background: rgba(0, 255, 231, 0.08);
  color: var(--color-text);
  font-family: var(--font-family-display);
  font-weight: 700;
  font-size: var(--font-size-sm);
  text-decoration: none;
  white-space: normal;
  cursor: grab;
  box-shadow: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bookmarklet-link:hover {
  background: rgba(47, 128, 255, 0.2);
  color: var(--color-text);
  border-color: var(--color-accent2);
  box-shadow: 0 0 0 1px var(--color-accent2);
}

.bookmarklet-link:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 0 12px rgba(0, 255, 231, 0.25);
}


.bookmarklet-link:focus-visible {
  outline: 2px solid var(--color-accent3);
  outline-offset: 2px;
}


.bookmarklet-readme {
  margin-left: var(--space-3);
  font-size: var(--font-size-sm);
  color: #a8b8c8;
  text-decoration: none;
  font-style: italic;
  white-space: nowrap;
  font-family: var(--font-family-mono);
  letter-spacing: 0.02em;
  background: transparent;
  border-radius: 6px;
  padding: 0.25em 0.5em;
  max-width: 120px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.bookmarklet-readme:hover {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.bookmarklet-readme:focus-visible {
  outline: 2px solid var(--color-accent3);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .page-shell {
    max-width: 99vw;
    padding: var(--space-4);
  }
  .bookmarklet-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem 1.2rem;
  }
  .bookmarklet-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.1rem 1.1rem 1.1rem 1.1rem;
  }
  .bookmarklet-link {
    width: 100%;
    justify-content: flex-start;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 640px) {
  .github-icon-link {
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
  }

  .github-icon-link svg {
    width: 14px;
    height: 14px;
  }
}

