/* ══════════════════════════════════════════
   334DIGITAL — style.css
   Covers: index, about, blog, blog-post, 404
   Upload alongside all HTML to Neocities
══════════════════════════════════════════ */


/* ════════════════════════════════════════
   TOKENS & RESET
════════════════════════════════════════ */

:root {
  --hot:    #ff2d78;
  --cyan:   #00ffe7;
  --yellow: #ffe600;
  --purple: #b400ff;
  --bg:     #0a0010;
  --grid:   rgba(180,0,255,0.08);
}

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


/* ════════════════════════════════════════
   BASE
════════════════════════════════════════ */

body {
  background: var(--bg);
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  pointer-events: none;
}


/* ════════════════════════════════════════
   CUSTOM CURSOR
════════════════════════════════════════ */

#cursor {
  position: fixed;
  width: 18px;
  height: 18px;
  border: 2px solid var(--hot);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.08s, background 0.15s;
  transform: translate(-50%, -50%);
}
#cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: left 0.12s ease, top 0.12s ease;
}
/* script.js adds .has-cursor to <html> only when #cursor exists and the
   device has a fine pointer, so touch/keyboard users keep a normal cursor
   and pages without the cursor divs never lose the pointer entirely. */
html.has-cursor body { cursor: none; }
html:not(.has-cursor) #cursor,
html:not(.has-cursor) #cursor-trail { display: none; }
body:has(a:hover) #cursor,
body:has(button:hover) #cursor {
  transform: translate(-50%, -50%) scale(2.4);
  background: rgba(255,45,120,0.2);
}


/* ════════════════════════════════════════
   STARFIELD CANVAS
════════════════════════════════════════ */

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}


/* ════════════════════════════════════════
   LAYOUT
════════════════════════════════════════ */

.page {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 80px;
}


/* ════════════════════════════════════════
   HEADER & NAV
════════════════════════════════════════ */

header {
  text-align: center;
  padding: 60px 0 30px;
}

nav {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
nav a {
  color: var(--cyan);
  text-decoration: none;
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  letter-spacing: 2px;
  border-bottom: 1px dashed var(--cyan);
  transition: color 0.15s, border-color 0.15s;
}
nav a:hover { color: var(--hot); border-color: var(--hot); }


/* ════════════════════════════════════════
   GLITCH TITLE
════════════════════════════════════════ */

.glitch-title {
  font-family: 'VT323', monospace;
  font-size: clamp(3rem, 10vw, 7rem);
  color: var(--cyan);
  text-shadow:
    0 0 10px var(--cyan),
    0 0 30px var(--cyan),
    0 0 60px rgba(0,255,231,0.4);
  position: relative;
  display: inline-block;
  letter-spacing: 4px;
  animation: flicker 6s infinite;
}
.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
}
.glitch-title::before {
  color: var(--hot);
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  animation: glitch-top 3s infinite;
  text-shadow: 2px 0 var(--hot);
}
.glitch-title::after {
  color: var(--yellow);
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  animation: glitch-bot 2.5s infinite;
  text-shadow: -2px 0 var(--yellow);
}

@keyframes glitch-top {
  0%,90%,100% { transform: none; opacity: 0; }
  91% { transform: translate(-3px,0) skewX(-2deg); opacity: 1; }
  94% { transform: translate(3px,0) skewX(2deg); opacity: 1; }
  97% { transform: none; opacity: 0; }
}
@keyframes glitch-bot {
  0%,85%,100% { transform: none; opacity: 0; }
  86% { transform: translate(3px,0) skewX(3deg); opacity: 1; }
  90% { transform: translate(-3px,0); opacity: 1; }
  93% { opacity: 0; }
}
@keyframes flicker {
  0%,95%,100% { opacity: 1; }
  96% { opacity: 0.7; }
  97% { opacity: 1; }
  98% { opacity: 0.4; }
  99% { opacity: 1; }
}


/* ════════════════════════════════════════
   MARQUEE
════════════════════════════════════════ */

.marquee-wrap {
  overflow: hidden;
  background: var(--hot);
  color: #000;
  font-family: 'VT323', monospace;
  font-size: 1.4rem;
  padding: 4px 0;
  letter-spacing: 2px;
  margin: 24px 0;
}
.marquee-inner {
  display: inline-block;
  white-space: nowrap;
  animation: scroll-left 18s linear infinite;
}
@keyframes scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}


/* ════════════════════════════════════════
   SECTIONS
════════════════════════════════════════ */

section {
  margin: 48px 0;
  border: 1px solid rgba(0,255,231,0.2);
  padding: 28px;
  background: rgba(0,0,16,0.6);
  backdrop-filter: blur(4px);
  position: relative;
}
section::before {
  content: '';
  position: absolute;
  top: -1px; left: 10px; right: 10px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

h2 {
  font-family: 'VT323', monospace;
  font-size: 2rem;
  color: var(--hot);
  text-shadow: 0 0 8px var(--hot);
  margin-bottom: 18px;
  letter-spacing: 3px;
}

p {
  line-height: 1.7;
  color: rgba(0,255,231,0.8);
  font-size: 0.95rem;
}


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

footer {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(0,255,231,0.3);
  padding-top: 40px;
}
footer a { color: rgba(0,255,231,0.4); text-decoration: none; }
footer a:hover { color: var(--cyan); }


/* ════════════════════════════════════════
   SCROLL REVEAL
   JS adds "js-ready" to <html> without it
   content stays visible as a safe fallback.
════════════════════════════════════════ */

.reveal {
  opacity: 1;
  transform: none;
}

.js-ready .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-ready .reveal.visible {
  opacity: 1;
  transform: none;
}


/* ════════════════════════════════════════
   SHARED KEYFRAMES
════════════════════════════════════════ */

@keyframes blink    { 50% { opacity: 0; } }
@keyframes spin     { to  { transform: rotate(360deg); } }
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%     { transform: translateX(-50%) translateY(6px); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulse {
  to { text-shadow: 0 0 30px var(--yellow), 0 0 60px var(--hot); }
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.3; }
}


/* ════════════════════════════════════════
   DEMO PAGE
════════════════════════════════════════ */

#typing-output {
  font-size: 1.1rem;
  color: var(--yellow);
  text-shadow: 0 0 6px var(--yellow);
  min-height: 1.6em;
}
#typing-output::after {
  content: '█';
  animation: blink 0.9s step-end infinite;
}

.spark {
  position: fixed;
  pointer-events: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  z-index: 9997;
  animation: spark-out 0.6s ease-out forwards;
}
@keyframes spark-out {
  to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

#viz-canvas {
  width: 100%;
  height: 80px;
  display: block;
  border: 1px solid rgba(180,0,255,0.3);
  cursor: pointer;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.card {
  border: 1px solid var(--purple);
  padding: 20px 14px;
  text-align: center;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  letter-spacing: 2px;
  cursor: default;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,230,0,0.06));
}
.card:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 8px 30px rgba(180,0,255,0.5);
  border-color: var(--yellow);
  color: var(--yellow);
}

#konami-msg {
  display: none;
  text-align: center;
  font-family: 'VT323', monospace;
  font-size: 1.6rem;
  color: var(--yellow);
  text-shadow: 0 0 12px var(--yellow);
  padding: 16px;
  animation: pulse 1s ease-in-out infinite alternate;
}


/* ════════════════════════════════════════
   INDEX PAGE — hero
════════════════════════════════════════ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.site-tag {
  font-size: 0.85rem;
  letter-spacing: 6px;
  color: var(--hot);
  text-transform: uppercase;
  margin-bottom: 16px;
  opacity: 0;
  animation: fade-up 0.6s 0.2s ease forwards;
}

.hero-title {
  font-family: 'VT323', monospace;
  font-size: clamp(4rem, 18vw, 10rem);
  line-height: 0.9;
  color: var(--cyan);
  text-shadow:
    0 0 10px var(--cyan),
    0 0 40px var(--cyan),
    0 0 80px rgba(0,255,231,0.3);
  letter-spacing: 6px;
  position: relative;
  display: inline-block;
  animation: flicker 6s infinite, fade-up 0.6s 0.4s ease both;
}
.hero-title::before,
.hero-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
}
.hero-title::before {
  color: var(--hot);
  clip-path: polygon(0 15%, 100% 15%, 100% 35%, 0 35%);
  animation: glitch-top 3s infinite;
  text-shadow: 3px 0 var(--hot);
}
.hero-title::after {
  color: var(--yellow);
  clip-path: polygon(0 65%, 100% 65%, 100% 82%, 0 82%);
  animation: glitch-bot 2.5s infinite;
  text-shadow: -3px 0 var(--yellow);
}

.hero-sub {
  font-size: 0.9rem;
  color: rgba(0,255,231,0.55);
  letter-spacing: 3px;
  margin-top: 16px;
  opacity: 0;
  animation: fade-up 0.6s 0.7s ease forwards;
}

.hero-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 48px;
  opacity: 0;
  animation: fade-up 0.6s 1s ease forwards;
}
.hero-nav a {
  font-family: 'VT323', monospace;
  font-size: 1.4rem;
  letter-spacing: 3px;
  color: #000;
  background: var(--cyan);
  padding: 8px 28px;
  text-decoration: none;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  transition: background 0.15s, transform 0.12s;
}
.hero-nav a:hover { background: var(--yellow); transform: translateY(-4px); }
.hero-nav a.ghost {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
  clip-path: none;
}
.hero-nav a.ghost:hover {
  background: rgba(0,255,231,0.1);
  color: var(--yellow);
  border-color: var(--yellow);
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: rgba(0,255,231,0.3);
  animation: bounce 2s ease-in-out infinite;
}

.intro-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 560px) { .intro-cols { grid-template-columns: 1fr; } }

.stat-box {
  border: 1px solid rgba(180,0,255,0.4);
  padding: 20px;
  text-align: center;
  background: rgba(180,0,255,0.04);
}
.stat-num {
  font-family: 'VT323', monospace;
  font-size: 3.5rem;
  color: var(--hot);
  text-shadow: 0 0 12px var(--hot);
  display: block;
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: rgba(0,255,231,0.5);
  margin-top: 4px;
}

.now-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(180,0,255,0.06);
  border: 1px solid rgba(180,0,255,0.3);
  padding: 14px 18px;
  margin-top: 20px;
}
.now-spin { font-size: 1.4rem; animation: spin 3s linear infinite; display: inline-block; }
.now-text { font-size: 0.85rem; line-height: 1.6; }
.now-text strong { color: var(--yellow); }

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.feat-card {
  border: 1px solid rgba(0,255,231,0.15);
  padding: 22px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
  cursor: default;
}
.feat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--hot), transparent);
  transform: scaleX(0);
  transition: transform 0.3s;
}
.feat-card:hover { border-color: rgba(0,255,231,0.4); transform: translateY(-4px); }
.feat-card:hover::after { transform: scaleX(1); }
.feat-icon { font-size: 2rem; margin-bottom: 12px; display: block; }
.feat-title {
  font-family: 'VT323', monospace;
  font-size: 1.4rem;
  color: var(--yellow);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.feat-desc { font-size: 0.85rem; color: rgba(0,255,231,0.6); line-height: 1.6; }
.feat-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--hot);
  text-decoration: none;
  letter-spacing: 2px;
}
.feat-link:hover { color: var(--yellow); }
.feat-link::before { content: '→ '; }

.log-entry {
  display: flex;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(0,255,231,0.1);
  align-items: baseline;
}
.log-date {
  font-size: 0.75rem;
  color: var(--hot);
  letter-spacing: 1px;
  flex-shrink: 0;
  width: 90px;
}
.log-text { font-size: 0.9rem; color: rgba(0,255,231,0.7); line-height: 1.5; }
.log-text a { color: var(--cyan); }


/* ════════════════════════════════════════
   ABOUT PAGE
════════════════════════════════════════ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}
@media (max-width: 560px) { .about-grid { grid-template-columns: 1fr; } }

.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.avatar {
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
  border: 2px solid var(--purple);
  box-shadow: 0 0 20px rgba(180,0,255,0.4);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(180,0,255,0.15) 0px, rgba(180,0,255,0.15) 2px,
      transparent 2px, transparent 8px
    ),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.avatar::after {
  content: '( ^.^ )';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  text-align: center;
  line-height: 1.3;
  padding: 10px;
}
.handle {
  font-family: 'VT323', monospace;
  font-size: 1.6rem;
  color: var(--yellow);
  text-shadow: 0 0 8px var(--yellow);
  letter-spacing: 3px;
}
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 6px #00ff88;
  margin-right: 6px;
  animation: pulse-dot 2s ease-in-out infinite;
}
.status-line { font-size: 0.8rem; color: rgba(0,255,231,0.5); }

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.info-list li { font-size: 0.9rem; color: rgba(0,255,231,0.8); line-height: 1.5; }
.info-list li::before { content: '▸ '; color: var(--hot); }
.info-list .label { color: var(--hot); font-size: 0.8rem; letter-spacing: 1px; }

.now-playing {
  border: 1px solid var(--purple);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  background: rgba(180,0,255,0.05);
}
.np-icon { font-size: 1.6rem; animation: spin 4s linear infinite; display: inline-block; }
.np-text { font-size: 0.85rem; line-height: 1.6; }
.np-text strong { color: var(--yellow); display: block; }

.link-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.link-list a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px dashed rgba(0,255,231,0.3);
  padding-bottom: 6px;
  transition: color 0.15s, border-color 0.15s;
}
.link-list a::before { content: '⟶ '; color: var(--hot); }
.link-list a:hover { color: var(--yellow); border-color: var(--yellow); }

.blinkies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.blinky {
  font-family: 'VT323', monospace;
  font-size: 0.75rem;
  padding: 3px 8px;
  border: 1px solid;
  letter-spacing: 1px;
  animation: blinky-flash 1.4s step-end infinite;
}
.blinky:nth-child(odd)  { border-color: var(--hot);    color: var(--hot);    animation-delay: 0s; }
.blinky:nth-child(even) { border-color: var(--yellow); color: var(--yellow); animation-delay: 0.7s; }
@keyframes blinky-flash { 50% { opacity: 0; } }

.bars { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 0.8rem; color: rgba(0,255,231,0.7); width: 70px; flex-shrink: 0; }
.bar-track {
  flex: 1; height: 12px;
  background: rgba(0,255,231,0.08);
  border: 1px solid rgba(0,255,231,0.15);
  position: relative; overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--hot));
  box-shadow: 0 0 8px var(--hot);
  width: 0;
  transition: width 1.2s cubic-bezier(.22,1,.36,1);
}
.bar-row.visible .bar-fill { width: var(--pct); }


/* ════════════════════════════════════════
   404 PAGE
════════════════════════════════════════ */

.lost-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.err-code {
  font-family: 'VT323', monospace;
  font-size: clamp(6rem, 25vw, 14rem);
  line-height: 1;
  color: var(--hot);
  text-shadow: 0 0 20px var(--hot), 0 0 60px rgba(255,45,120,0.4);
  animation: flicker 4s infinite, glitch-404 6s infinite;
  position: relative;
  letter-spacing: 8px;
}
@keyframes glitch-404 {
  0%,88%,100% { transform: none; clip-path: none; }
  89% { transform: translate(-4px,0); clip-path: polygon(0 30%,100% 30%,100% 50%,0 50%); color: var(--cyan); }
  91% { transform: translate(4px,0);  clip-path: polygon(0 60%,100% 60%,100% 75%,0 75%); color: var(--yellow); }
  93% { transform: none; clip-path: none; color: var(--hot); }
}

.err-label {
  font-family: 'VT323', monospace;
  font-size: 1.8rem;
  color: var(--cyan);
  letter-spacing: 4px;
  margin: 8px 0 32px;
  text-shadow: 0 0 8px var(--cyan);
}
.err-msg {
  font-size: 0.95rem;
  color: rgba(0,255,231,0.6);
  max-width: 420px;
  line-height: 1.8;
  margin-bottom: 40px;
}
.blink-cursor { animation: blink 0.9s step-end infinite; color: var(--yellow); }

.ascii-box {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: rgba(180,0,255,0.7);
  margin-bottom: 40px;
  line-height: 1.5;
  text-align: left;
}

.home-btn {
  display: inline-block;
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  letter-spacing: 3px;
  color: #000;
  background: var(--cyan);
  padding: 10px 32px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.home-btn:hover { background: var(--yellow); transform: translateY(-3px); }

.static-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: noise-shift 0.15s steps(1) infinite;
}
@keyframes noise-shift {
  0%   { background-position: 0 0; }
  25%  { background-position: -10px 5px; }
  50%  { background-position: 5px -10px; }
  75%  { background-position: -5px -5px; }
  100% { background-position: 10px 10px; }
}


/* ════════════════════════════════════════
   BLOG INDEX
════════════════════════════════════════ */

.blog-header { text-align: center; padding: 60px 0 10px; }
.post-count { font-size: 0.8rem; letter-spacing: 3px; color: rgba(0,255,231,0.35); margin-top: 10px; }

.tag-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.tag-btn {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  letter-spacing: 2px;
  padding: 4px 14px;
  background: transparent;
  border: 1px solid rgba(0,255,231,0.25);
  color: rgba(0,255,231,0.5);
  cursor: pointer;
  transition: all 0.15s;
}
.tag-btn:hover,
.tag-btn.active {
  border-color: var(--hot);
  color: var(--hot);
  background: rgba(255,45,120,0.05);
}

.post-list { display: flex; flex-direction: column; }

.post-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px dashed rgba(0,255,231,0.1);
  text-decoration: none;
  position: relative;
}
.post-item::before {
  content: '';
  position: absolute;
  left: -28px; top: 0; bottom: 0; width: 2px;
  background: var(--hot);
  transform: scaleY(0);
  transition: transform 0.2s;
  transform-origin: top;
}
.post-item:hover::before { transform: scaleY(1); }

.post-date { font-size: 0.75rem; color: var(--hot); letter-spacing: 1px; padding-top: 4px; flex-shrink: 0; }
.post-body { min-width: 0; }

.post-title {
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  color: var(--cyan);
  letter-spacing: 2px;
  line-height: 1.2;
  transition: color 0.15s;
  display: block;
  text-decoration: none;
}
.post-item:hover .post-title { color: var(--yellow); }

.post-excerpt {
  font-size: 0.85rem;
  color: rgba(0,255,231,0.5);
  line-height: 1.6;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-size: 0.7rem; letter-spacing: 1px; padding: 2px 8px;
  border: 1px solid rgba(180,0,255,0.4);
  color: rgba(180,0,255,0.8);
  font-family: 'VT323', monospace;
}

.post-arrow {
  font-size: 1.2rem; color: rgba(0,255,231,0.2);
  padding-top: 4px; flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}
.post-item:hover .post-arrow { color: var(--yellow); transform: translateX(4px); }

@media (max-width: 560px) {
  .post-item { grid-template-columns: 1fr; gap: 6px; }
  .post-arrow { display: none; }
}

.post-item.pinned {
  background: rgba(255,45,120,0.03);
  border: 1px solid rgba(255,45,120,0.2);
  padding: 22px; margin-bottom: 16px;
}
.post-item.pinned::before { display: none; }
.pin-label {
  font-size: 0.7rem; letter-spacing: 2px; color: var(--hot);
  margin-bottom: 8px; display: block; grid-column: 1 / -1;
}

.rss-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; letter-spacing: 2px;
  color: rgba(0,255,231,0.3); text-decoration: none;
  border: 1px dashed rgba(0,255,231,0.2); padding: 4px 12px;
  transition: color 0.15s, border-color 0.15s;
}
.rss-link:hover { color: var(--yellow); border-color: var(--yellow); }


/* ════════════════════════════════════════
   BLOG POST PAGE
════════════════════════════════════════ */

.post-header { padding: 60px 0 0; margin-bottom: 0; border: none; background: none; }
.post-header::before { display: none; }

.post-footer { border: none; background: none; padding: 40px 0 0; }
.post-footer::before { display: none; }

.post-meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-bottom: 20px; font-size: 0.8rem; letter-spacing: 2px;
  color: rgba(0,255,231,0.4);
}
.post-meta .date { color: var(--hot); }
.post-meta .read-time::before { content: '· '; }

.post-tag {
  font-size: 0.7rem; letter-spacing: 1px; padding: 2px 10px;
  border: 1px solid rgba(180,0,255,0.4);
  color: rgba(180,0,255,0.8); font-family: 'VT323', monospace;
}

.post-title-h1 {
  font-family: 'VT323', monospace;
  font-size: clamp(2.2rem, 7vw, 4rem);
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(0,255,231,0.3);
  letter-spacing: 3px; line-height: 1.1; margin-bottom: 12px;
}
.post-subtitle {
  font-size: 1rem; color: rgba(0,255,231,0.5);
  line-height: 1.6; margin-bottom: 32px; max-width: 600px;
}

.post-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  margin: 32px 0; border: none;
}

.post-content {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.05rem; line-height: 1.85;
  color: rgba(255,255,255,0.75); max-width: 680px;
}
.post-content p { margin-bottom: 1.4em; }

.post-content h2 {
  font-family: 'VT323', monospace; font-size: 1.8rem;
  color: var(--hot); text-shadow: 0 0 8px var(--hot);
  letter-spacing: 3px; margin: 2em 0 0.6em;
}
.post-content h3 {
  font-family: 'VT323', monospace; font-size: 1.4rem;
  color: var(--yellow); letter-spacing: 2px; margin: 1.6em 0 0.4em;
}

.post-content a {
  color: var(--cyan); text-decoration: none;
  border-bottom: 1px dashed rgba(0,255,231,0.4);
  transition: color 0.15s, border-color 0.15s;
}
.post-content a:hover { color: var(--yellow); border-color: var(--yellow); }
.post-content strong { color: var(--cyan); font-weight: 600; }
.post-content em { color: rgba(255,255,255,0.6); font-style: italic; }

.post-content blockquote {
  border-left: 3px solid var(--hot);
  margin: 1.8em 0; padding: 12px 20px;
  background: rgba(255,45,120,0.04);
  color: rgba(255,255,255,0.6); font-style: italic;
}
.post-content blockquote::before {
  content: '"';
  font-family: 'VT323', monospace; font-size: 3rem;
  color: var(--hot); line-height: 0;
  vertical-align: -0.6em; margin-right: 4px; opacity: 0.4;
}

.post-content code {
  font-family: 'Share Tech Mono', monospace; font-size: 0.88em;
  background: rgba(0,255,231,0.07); border: 1px solid rgba(0,255,231,0.15);
  padding: 1px 6px; color: var(--cyan);
}
.post-content pre {
  background: rgba(0,0,16,0.8);
  border: 1px solid rgba(0,255,231,0.15); border-left: 3px solid var(--cyan);
  padding: 18px 20px; overflow-x: auto; margin: 1.6em 0;
  font-family: 'Share Tech Mono', monospace; font-size: 0.85rem;
  color: rgba(0,255,231,0.85); line-height: 1.6;
}
.post-content pre code { background: none; border: none; padding: 0; font-size: inherit; }

.post-content img {
  max-width: 100%; border: 1px solid rgba(0,255,231,0.15);
  display: block; margin: 1.6em auto;
}
.post-content figure { margin: 1.8em 0; }
.post-content figcaption {
  font-family: 'Share Tech Mono', monospace; font-size: 0.75rem;
  color: rgba(0,255,231,0.35); text-align: center;
  margin-top: 8px; letter-spacing: 1px;
}

.post-content ul,
.post-content ol { padding-left: 1.4em; margin-bottom: 1.4em; color: rgba(255,255,255,0.7); }
.post-content ul li { list-style: none; position: relative; margin-bottom: 0.5em; }
.post-content ul li::before { content: '▸'; color: var(--hot); position: absolute; left: -1.2em; }
.post-content ol li { margin-bottom: 0.5em; }

.post-content hr {
  border: none; text-align: center; margin: 2.4em 0;
  color: rgba(0,255,231,0.3); letter-spacing: 8px;
  font-family: 'VT323', monospace;
}
.post-content hr::after { content: '· · · · ·'; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 40px; }
@media (max-width: 480px) { .post-nav { grid-template-columns: 1fr; } }

.nav-card {
  border: 1px solid rgba(0,255,231,0.15); padding: 16px;
  text-decoration: none; transition: border-color 0.15s, transform 0.12s; display: block;
}
.nav-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.nav-card.next { text-align: right; }
.nav-label { font-size: 0.7rem; letter-spacing: 2px; color: rgba(0,255,231,0.3); display: block; margin-bottom: 6px; }
.nav-title { font-family: 'VT323', monospace; font-size: 1.1rem; color: var(--cyan); letter-spacing: 1px; }
.nav-card:hover .nav-title { color: var(--yellow); }

.post-tags-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; align-items: center; }
.tags-label { font-size: 0.75rem; letter-spacing: 2px; color: rgba(0,255,231,0.3); }

.back-link {
  font-family: 'VT323', monospace; font-size: 1.1rem;
  letter-spacing: 2px; color: rgba(0,255,231,0.4);
  text-decoration: none; transition: color 0.15s;
}
.back-link:hover { color: var(--cyan); }

/* ════════════════════════════════════════
   SOUND DEMO
   Scoped so it does not override site-wide styles
════════════════════════════════════════ */

.sound-demo {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0a0f12;
  color: #e7fff0;
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.sound-demo .panel {
  width: min(760px, 92vw);
  background: rgba(10, 20, 16, 0.96);
  border: 2px solid #52ff8f;
  box-shadow: 0 0 24px rgba(82, 255, 143, 0.15);
  padding: 24px;
  border-radius: 12px;
}

.sound-demo h1 {
  margin-top: 0;
  font-size: 1.4rem;
}

.sound-demo .row {
  margin: 16px 0;
}

.sound-demo label {
  display: block;
  margin-bottom: 8px;
}

.sound-demo input[type="range"] {
  width: 100%;
}

.sound-demo button {
  background: #52ff8f;
  color: #00160a;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  margin-right: 8px;
  margin-bottom: 8px;
}

.sound-demo .stats {
  margin-top: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  line-height: 1.7;
  font-family: Consolas, monospace;
}

.sound-demo .warn {
  color: #ffd27a;
}


/* ════════════════════════════════════════
   CALCULATOR
   Scoped so it does not override site-wide styles
════════════════════════════════════════ */

.calc-demo,
.calc-demo *,
.calc-demo *::before,
.calc-demo *::after {
  box-sizing: border-box;
}

/* (removed: an unscoped `body { background:#111827 }` rule that used to sit
   here leaked the calculator's slate background onto every page using
   style.css. Pages now get the intended --bg deep purple again.) */

.calc-demo {
  margin: 0;
  padding: 20px;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  background: radial-gradient(circle at center, #1f2937 0%, #111827 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-demo .calculator {
  width: 100%;
  max-width: 380px;
  background: #000;
  border: 1px solid #374151;
  border-radius: 32px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.calc-demo .display-container {
  min-height: 140px;
  margin-bottom: 20px;
  padding: 28px 24px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.calc-demo .history {
  min-height: 24px;
  margin-bottom: 8px;
  text-align: right;
  font-size: 16px;
  font-weight: 400;
  color: #9ca3af;
  word-wrap: break-word;
}

.calc-demo .display {
  text-align: right;
  font-size: 54px;
  font-weight: 300;
  color: #fff;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.calc-demo .display::-webkit-scrollbar {
  display: none;
}

.calc-demo .buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.calc-demo button {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  font-size: 22px;
  font-weight: 500;
  color: #fff;
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.calc-demo button:active {
  transform: scale(0.92);
}

.calc-demo .btn-gray {
  background: #4b5563;
  color: #f3f4f6;
}

.calc-demo .btn-gray:hover {
  background: #6b7280;
}

.calc-demo .btn-dark {
  background: #1f2937;
}

.calc-demo .btn-dark:hover {
  background: #374151;
}

.calc-demo .btn-orange {
  background: #f97316;
}

.calc-demo .btn-orange:hover {
  background: #fb923c;
}

/* Highlight the current active operator */
.calc-demo .btn-orange.active {
  background: #fff;
  color: #f97316;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.calc-demo .btn-wide {
  grid-column: span 2;
}

.calc-demo .hint {
  margin-top: 15px;
  text-align: center;
  font-size: 11px;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 1px;
}


/* ════════════════════════════════════════
   ACCESSIBILITY + POLISH (added 2026-09)
   Additive only — safe for every page using style.css
════════════════════════════════════════ */

::selection { background: var(--hot); color: #000; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px dashed var(--yellow);
  outline-offset: 4px;
}

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 10000;
  background: var(--cyan); color: #000; padding: 8px 14px;
  font-family: 'VT323', monospace; font-size: 1.2rem; letter-spacing: 2px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* dim text was below WCAG contrast on the dark background */
.hero-sub    { color: rgba(0,255,231,0.72); }
.stat-label  { color: rgba(0,255,231,0.68); }
.scroll-hint { color: rgba(0,255,231,0.5); }
footer       { color: rgba(0,255,231,0.55); }
footer a     { color: rgba(0,255,231,0.75); }

@media (max-width: 480px) {
  section { padding: 20px 16px; }
  .log-entry { flex-direction: column; gap: 4px; }
  .log-date { width: auto; }
  .hero-nav { gap: 12px; }
  .hero-nav a { padding: 8px 18px; font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .static-noise { display: none; }
}

