/* Wundersoul Atlas - CRT Theme with Pixel Elements */
:root{
  --bg:#2d2d30; --fg:#b0b0b0; --muted:#7a8a9a;
  --accent:#e0e0e0; --card:#3a3a3f;
  --radius:0; --gap:1rem; --shadow:0 0 20px rgba(176,176,176,0.1);
  --pixel-cyan: #e0e0e0; --pixel-green: #b0b0b0; --pixel-yellow: #d0d0d0;
  --crt-green:#b0b0b0; --crt-blue:#e0e0e0;
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--fg);font:16px/1.5 'IBM Plex Mono', monospace;font-display:swap;}

/* Wundersoul Console Loader */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  color: var(--pixel-cyan);
  font-family: 'IBM Plex Mono', monospace;
  overflow: hidden;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#console-wrapper {
  width: 100%;
  max-width: 100ch;
  height: 100%;
  overflow-y: auto;
}

#console-text {
  font-size: 1rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'IBM Plex Mono', monospace;
}

#console-wrapper::after {
  content: "_";
  animation: blink 1s step-start infinite;
  display: inline-block;
  color: var(--pixel-cyan);
  margin-left: 0.25rem;
}

@keyframes blink {
  50% { opacity: 0; }
}
/* GPU acceleration hint */
.cursor, .hover-text, .btn { transform: translateZ(0); }

/* CRT scanline effect for preloader */
#preloader::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(224, 224, 224, 0.05),
    rgba(224, 224, 224, 0.05) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* Mobile optimizations for preloader */
@media (max-width: 768px) {
  #preloader {
    padding: 1rem;
  }
  
  #console-text {
    font-size: 0.9rem;
  }
}

/* Header */
.site-header{position:sticky;top:0;z-index:20;display:flex;gap:1rem;align-items:center;justify-content:space-between;padding:12px 20px;background:var(--card);box-shadow:0 1px 0 rgba(255,255,255,0.04)}
.brand{font-weight:700;letter-spacing:.1em;color:var(--pixel-cyan);font-family:'IBM Plex Mono', monospace}
.top-actions .btn{margin-left:.5rem}

/* Buttons */
.btn{display:inline-block;padding:.6em 1em;border-radius:10px;background:var(--fg);color:var(--bg);border:0;font-weight:700;text-decoration:none;cursor:pointer;transition:transform 0.2s ease, box-shadow 0.2s ease;font-family:'IBM Plex Mono', monospace;text-transform:uppercase;letter-spacing:0.05em;will-change:transform}
.btn.ghost{background:transparent;color:var(--fg);outline:1px solid rgba(221,225,230,.45)}
.btn:hover{transform:translate3d(0,-2px,0);box-shadow:0 4px 12px rgba(0,0,0,0.3)}

/* Prevent button size changes during scramble text effect */
.btn.hover-text {
  /* Fix width to prevent shrinking during scramble */
  width: auto;
  min-width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Fix height to prevent changing during hover/scramble */
  height: auto;
  min-height: 2.2em; /* Based on padding + font size */
  line-height: 1.2;
  box-sizing: border-box;
}

.btn.hover-text span {
  display: inline-block;
  min-width: 0.6em;
  text-align: center;
  line-height: inherit;
}

/* When scramble is active, preserve dimensions */
.btn.hover-text.active {
  white-space: nowrap;
  width: var(--original-width);
  height: var(--original-height);
  box-sizing: border-box;
}

/* Ensure button text doesn't wrap or shift */
.btn.hover-text {
  white-space: nowrap;
  overflow: hidden;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  /* Mobile Header */
  .site-header {
    padding: 8px 16px;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  
  .brand {
    font-size: 1.1rem;
    order: 1;
    flex: 1;
  }
  
  .top-actions {
    order: 2;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  
  .top-actions .btn {
    margin-left: 0;
    padding: 0.7em 0.8em;
    font-size: 0.85rem;
    min-height: 44px; /* Touch-friendly minimum */
    display: flex;
    align-items: center;
  }
  
  /* Mobile Typography */
  body {
    font-size: 15px;
    line-height: 1.6;
  }
  
  h2 {
    font-size: 1.2rem;
  }
  
  /* Mobile Content Padding */
  .content {
    padding: 20px 16px;
  }
  
  /* Mobile Hero Adjustments */
  .hero {
    min-height: 50vh;
  }
  
  .hero__content {
    padding: clamp(20px, 3vw, 40px);
  }
  
  .hero__actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .hero__actions .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  /* Extra small mobile adjustments */
  .site-header {
    padding: 6px 12px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .brand {
    text-align: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.5rem;
  }
  
  .top-actions {
    justify-content: center;
  }
  
  .top-actions .btn {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    text-align: center;
  }
  
  /* Smaller content padding on very small screens */
  .content {
    padding: 16px 12px;
  }
  
  /* Page footer mobile adjustment */
  .page-footer {
    padding: 1.5rem 1rem;
    font-size: 0.75rem;
  }
}

/* Page footer styling */
.page-footer {
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  opacity: 0.7;
  font-size: 0.8rem;
}

/* Hero */
.hero{position:relative;min-height:60vh;display:grid;place-items:center;overflow:hidden;background:var(--bg)}
.hero__content{text-align:center;padding: clamp(24px,4vw,60px)}
.hero__actions{display:flex;gap:.75rem;justify-content:center;margin-top:1rem;flex-wrap:wrap}
.hero h1{font-size: clamp(40px,8vw,96px); letter-spacing:.02em; margin:0 0 .25em; color:var(--pixel-cyan);font-family:'IBM Plex Mono', monospace}

/* Canvas topographic map background */
#topoMap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Global topo map (when outside hero) */
.crt-container > #topoMap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}
/* Collection section styling */
.collection-section {
  margin-bottom: 2.5rem;
}

/* Mini Music Player Mobile Optimizations */
.mini-player {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 0.75rem;
  z-index: 100;
  box-shadow: var(--shadow);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .mini-player {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem;
    font-size: 0.75rem;
  }
  
  .mini-player-info {
    flex: 1;
    margin-right: 0.5rem;
  }
  
  .mini-player-controls {
    display: flex;
    gap: 0.25rem;
  }
  
  .mini-btn {
    padding: 0.4rem;
    font-size: 0.9rem;
    min-width: 36px;
    min-height: 36px;
  }
}

.collection-title {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--pixel-green);
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  font-weight: 600;
}

/* Content */
.content{padding:32px 20px}
.story-section{margin-bottom:3rem}
h2{margin:0 0 24px 0;font-size:1.4rem;color:var(--fg);opacity:.9;font-family:'IBM Plex Mono', monospace;text-transform:uppercase}

/* Story Grid Layout - 5 columns with smaller cards */
.story-grid{
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap:1rem;
  margin-bottom:2rem;
}

@media (max-width:1200px){
  .story-grid{grid-template-columns: repeat(4, 1fr)}
}
@media (max-width:900px){
  .story-grid{grid-template-columns: repeat(3, 1fr)}
}
@media (max-width:640px){
  .story-grid{grid-template-columns: repeat(2, 1fr)}
}
@media (max-width:420px){
  .story-grid{grid-template-columns: 1fr}
}

/* Story Cards - Now replaced with CRT column layout */
.story-card {
  display: none; /* Deprecated - using CRT columns instead */
}

.story-card:hover {
  transform: translateY(-2px);
  border-color: #606060;
  background: #323232;
}

/* Corner brackets that appear on hover */
.story-card::before,
.story-card::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid #888888;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.story-card::before {
  top: 8px;
  left: 8px;
  border-right: none;
  border-bottom: none;
}

.story-card::after {
  bottom: 8px;
  right: 8px;
  border-left: none;
  border-top: none;
}

.story-card:hover::before,
.story-card:hover::after {
  opacity: 1;
}

.story-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #ffffff;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* Story meta and read time styling */
.story-meta {
  font-size: 0.85rem;
  color: #888888;
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Read time with eye icon in top right corner */
.story-card .read-time {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #888888;
  font-weight: 500;
}

.story-card .read-time::before {
  content: "👁";
  font-size: 0.8rem;
  opacity: 0.7;
}

/* External link icon for top left */
.story-card .external-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: #888888;
  font-size: 0.9rem;
  opacity: 0.6;
}

.story-card .external-link::before {
  content: "↗";
}

.story-category{
  background:rgba(156,224,107,0.1);
  color:var(--accent);
  padding:0.2rem 0.5rem;
  border-radius:10px;
  font-size:0.7rem;
  font-family:'Courier New', monospace;
  text-transform:uppercase;
  font-weight:600;
}

.story-card p{
  margin:0;
  color:var(--muted);
  line-height:1.4;
  flex:1;
  font-size:0.9rem;
}

.story-actions{
  display:flex;
  gap:0.5rem;
  margin-top:auto;
}

.story-chip{
  padding:0.3rem 0.6rem;
  border-radius:999px;
  background:var(--accent);
  color:var(--bg);
  text-decoration:none;
  font-weight:600;
  font-size:0.8rem;
  font-family:'Courier New', monospace;
  transition:all 0.2s ease;
  display:inline-flex;
  align-items:center;
  gap:0.2rem;
}

.story-chip:hover{
  background:var(--pixel-cyan);
  transform:translateY(-1px);
}

.story-chip.secondary{
  background:transparent;
  color:var(--muted);
  border:1px solid rgba(171,179,186,.3);
}

.story-chip.secondary:hover{
  background:rgba(171,179,186,.1);
  color:var(--fg);
}

/* Player pill */
.player-pill{
  position:fixed;right:14px;bottom:14px;display:flex;align-items:center;gap:.6rem;
  background:var(--card);border-radius:999px;padding:.5rem .6rem;box-shadow:var(--shadow);z-index:30;
  border:1px solid var(--accent);
}
.pill-btn{appearance:none;border:0;border-radius:999px;padding:.4rem .5rem;background:#12161c;color:var(--fg);cursor:pointer;transition:all 0.2s ease}
.pill-btn:hover{background:var(--accent);color:var(--bg)}
.pill-meta strong{display:block;font-size:.9rem;color:var(--pixel-cyan)}
.pill-meta span{display:block;font-size:.75rem;color:var(--muted)}

/* Accessibility / motion */
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;white-space:nowrap;clip-path:inset(50%)}
@media (prefers-reduced-motion: reduce){
  .ink-bg::before{animation:none}
  .card, .btn{transition:none}
}

/* Magnetic hover for hero buttons (lightweight) */
.magnet{transition:transform 0.2s ease}

/* Mini music player for site-wide playback */
.mini-player {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 90;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--pixel-cyan);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--pixel-cyan);
  min-width: 250px;
}

.mini-player-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mini-player-controls {
  display: flex;
  gap: 5px;
}

.mini-btn {
  background: none;
  border: 1px solid var(--pixel-cyan);
  color: var(--pixel-cyan);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.mini-btn:hover {
  background: var(--pixel-cyan);
  color: #000;
}

#miniTrackName {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

#miniTime {
  font-size: 11px;
  color: #ccc;
}

/* Custom Cursor Styles - Optimized */
.hero h1, .brand { will-change: transform; }
.hover-text { will-change: contents; }
:root {
    --cursor-stroke: var(--pixel-cyan);
}

.cursor {
    display: none;
}

@media (any-pointer: fine) {
    .cursor {
        position: fixed;
        top: 0;
        left: 0;
        display: block;
        pointer-events: none;
        z-index: 10000;
    }

    .cursor__inner {
        fill: none;
        stroke: var(--cursor-stroke);
        stroke-width: 1px;
    }

    .no-js .cursor {
        display: none;  
    }
}

/* Blog-specific styling - Single column, compact like stories */
.blog-column {
  position: relative;
  max-width: 100%;
}

.blog-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 0.6rem;
  min-height: auto;
}

.blog-meta {
  font-size: 0.7rem;
  opacity: 0.6;
  white-space: nowrap;
  margin-left: 0;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  align-self: flex-start;
}

/* Removed individual blog meta styles - now using single line format */

/* Blog layout with desktop sidebar */
.blog-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 3rem;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.session-nav {
  padding: 1rem;
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.1);
  border-radius: 4px;
  height: fit-content;
  position: sticky;
  top: 2rem;
}

.session-nav h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0 0 1rem 0;
  opacity: 0.7;
  font-family: 'IBM Plex Mono', monospace;
}

.desktop-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.desktop-timeline-item {
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.2s ease;
  font-family: 'IBM Plex Mono', monospace;
  display: block;
}

.desktop-timeline-item:hover {
  background: rgba(0, 255, 255, 0.1);
  color: var(--accent-color);
}

.desktop-only {
  display: block;
}

/* Single column for main content */
.single-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding: 0;
  max-width: none;
  margin: 0;
  width: 100%;
}

.single-column .crt-column {
  padding: 1rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Override any inherited max-width from crt-effect.css */
.blog-layout .crt-column {
  max-width: none !important;
  width: 100% !important;
}

/* Expand blog content to use more available space */
.blog-layout .crt-list {
  max-width: 900px;
  width: 100%;
}

.blog-layout .crt-list-item {
  padding: 0.2rem 1rem 0.2rem 0;
}

/* Mobile responsive */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
  
  .desktop-only {
    display: none;
  }
  
  .single-column {
    padding: 0;
  }
}

.empty-blog-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-message {
  margin-top: 20px;
  opacity: 0.6;
}

.empty-message p {
  margin: 5px 0;
  font-size: 0.9em;
  color: #b0b0b0;
}

/* Timeline Navigation */
.timeline-section {
    margin: 2rem 0;
}

.timeline-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.timeline-toggle {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.timeline-toggle:hover,
.timeline-toggle.active {
    background: rgba(0, 255, 255, 0.2);
    color: var(--accent-color);
}

.timeline-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 1rem;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.6rem;
    background: rgba(0, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.timeline-item:hover {
    background: rgba(0, 255, 255, 0.08);
    border-color: rgba(0, 255, 255, 0.3);
}

.timeline-sequence {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    min-width: 2rem;
    text-align: center;
    background: rgba(0, 255, 255, 0.1);
    padding: 0.3rem;
    border-radius: 2px;
}

.timeline-title {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 500;
}

.timeline-title:hover {
    color: var(--accent-color);
}

.timeline-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    align-items: center;
}

.timeline-type {
    padding: 0.2rem 0.4rem;
    border-radius: 2px;
    font-weight: 600;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.4);
    color: #ff6666;
}

.timeline-author {
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: left;
    }
    
    .timeline-sequence {
        justify-self: start;
    }
    
    .timeline-meta {
        justify-self: start;
    }
}