/*
Theme Name: Pulse
Theme URI: https://example.com/pulse
Author: Pulse
Description: Custom theme for Pulse, a desktop music visualizer for techno, trance & house. Includes a landing page, feature sections, download/donate blocks, and a standard WordPress blog for AI news.
Version: 1.4
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: pulse
*/

:root{
  --bg: #05070a;
  --bg-alt: #0a0e15;
  --surface: #0e131b;
  --surface-2: #121926;
  --border: #1c2530;
  --ice: #6fe0ff;
  --ice-soft: #a6ecff;
  --ice-dim: #2c5b6b;
  --ember: #ff6a3d;
  --ember-soft: #ffb08a;
  --text: #e7edf3;
  --text-dim: #8a97a6;
  --text-faint: #566270;
  --radius: 10px;
  --mono: 'Space Mono', 'SFMono-Regular', Consolas, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --display: 'Inter Tight', 'Inter', system-ui, sans-serif;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width:100%; display:block; }
a{ color: inherit; }
::selection{ background: var(--ice); color: #05070a; }

:focus-visible{
  outline: 2px solid var(--ice);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap{
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Nav ---------- */
header.site{
  position: sticky;
  top:0;
  z-index: 50;
  background: rgba(5,7,10,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav.wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 20px;
  min-height: 68px;
  padding-top: 12px;
  padding-bottom: 12px;
  position: relative;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-family: var(--mono);
  font-weight:700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration:none;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}
.brand img, .brand .custom-logo{ height: 26px; width:auto; flex-shrink:0; filter: drop-shadow(0 0 10px rgba(111,224,255,0.35)); }
.navlinks{
  display:flex;
  gap: clamp(14px, 2.4vw, 30px);
  list-style:none;
  margin:0; padding:0;
  font-size: 0.86rem;
  color: var(--text-dim);
  flex-wrap: nowrap;
  white-space: nowrap;
}
.navlinks a{ text-decoration:none; transition: color .15s ease; }
.navlinks a:hover{ color: var(--ice); }
.navlinks li{ position:relative; }
.nav-cta{
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--ice);
  color: #04141a;
  padding: 9px 16px;
  border-radius: 6px;
  text-decoration:none;
  font-weight:700;
  letter-spacing: 0.02em;
  transition: transform .15s ease, box-shadow .15s ease;
  white-space:nowrap;
  flex-shrink: 0;
}
.nav-cta:hover{ transform: translateY(-1px); box-shadow: 0 4px 18px rgba(111,224,255,0.25); }
.navtoggle{ display:none; }

@media (max-width: 900px){
  .brand{ max-width: 60vw; font-size: 0.98rem; }
  .navlinks{
    display:none;
    position:absolute;
    top:100%; left:0; right:0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction:column;
    white-space: normal;
    gap:0;
    padding: 6px 28px 18px;
  }
  .navlinks.open{ display:flex; }
  .navlinks li{ padding: 12px 0; border-bottom: 1px solid var(--border); }
  .navlinks li:last-child{ border-bottom:none; }
  .navtoggle{
    display:block; background:none; border:1px solid var(--border);
    color: var(--text); border-radius:6px; padding:7px 10px; font-size:1rem;
    cursor:pointer;
    flex-shrink:0;
  }
}

@media (max-width: 420px){
  .brand{ font-size: 0.86rem; max-width: 52vw; }
  .brand img, .brand .custom-logo{ height: 22px; }
}

/* ---------- Hero ---------- */
.hero{
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity: 0.55;
}
.hero-inner{
  position: relative;
  z-index: 2;
  padding: 128px 28px 108px;
  max-width: 1120px;
  margin: 0 auto;
  text-align:center;
}
.eyebrow{
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--ice);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.glitch-title{
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.4rem, 11vw, 7.2rem);
  line-height: 0.95;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
  position: relative;
  color: var(--text);
  display:inline-block;
}
.glitch-title span{ position:relative; display:inline-block; }
.glitch-title span::before,
.glitch-title span::after{
  content: attr(data-text);
  position:absolute; left:0; top:0;
  width:100%; height:100%;
  background: var(--bg);
  overflow:hidden;
}
.glitch-title span::before{
  color: var(--ice);
  animation: glitch-1 4.5s infinite linear;
  clip-path: inset(0 0 60% 0);
}
.glitch-title span::after{
  color: var(--ember);
  animation: glitch-2 4.5s infinite linear;
  clip-path: inset(60% 0 0 0);
}
@keyframes glitch-1{
  0%, 92%, 100%{ transform: translate(0,0); opacity:0; }
  93%{ transform: translate(-3px,-1px); opacity:0.9; }
  95%{ transform: translate(3px,1px); opacity:0.9; }
  97%{ transform: translate(-2px,1px); opacity:0.9; }
  98%{ opacity:0; }
}
@keyframes glitch-2{
  0%, 90%, 100%{ transform: translate(0,0); opacity:0; }
  91%{ transform: translate(3px,1px); opacity:0.9; }
  94%{ transform: translate(-3px,-1px); opacity:0.9; }
  96%{ transform: translate(2px,-1px); opacity:0.9; }
  98%{ opacity:0; }
}
@media (prefers-reduced-motion: reduce){
  .glitch-title span::before, .glitch-title span::after{ animation:none; display:none; }
  .hero canvas{ display:none; }
}

.hero p.lede{
  font-size: 1.12rem;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 40px;
}
.hero-ctas{
  display:flex;
  gap:16px;
  justify-content:center;
  flex-wrap:wrap;
}
.btn{
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight:700;
  padding: 14px 26px;
  border-radius: 7px;
  text-decoration:none;
  letter-spacing: 0.02em;
  display:inline-flex;
  align-items:center;
  gap:9px;
  border: 1px solid transparent;
  cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary{ background: var(--ice); color: #04141a; }
.btn-primary:hover{ transform: translateY(-1px); box-shadow: 0 6px 22px rgba(111,224,255,0.3); }
.btn-ghost{ background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover{ border-color: var(--ice); color: var(--ice); }
.btn-ember{ background: var(--ember); color: #230900; }
.btn-ember:hover{ transform: translateY(-1px); box-shadow: 0 6px 22px rgba(255,106,61,0.3); }

/* ---------- Sections generic ---------- */
section{ padding: 96px 0; border-bottom: 1px solid var(--border); }
.section-head{ max-width: 640px; margin-bottom: 56px; }
.section-head .eyebrow{ margin-bottom: 14px; }
.section-head h2{
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 800;
  letter-spacing:-0.01em;
  margin: 0 0 14px;
}
.section-head p{ color: var(--text-dim); margin:0; font-size:1.02rem; }

/* ---------- Idea / steps ---------- */
.steps{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.step{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.step .num{
  font-family: var(--mono);
  color: var(--ice);
  font-size: 0.85rem;
  display:block;
  margin-bottom: 14px;
}
.step h3{ margin: 0 0 8px; font-size: 1.05rem; font-family: var(--display); font-weight:700; }
.step p{ margin:0; color: var(--text-dim); font-size: 0.94rem; }
@media (max-width: 760px){ .steps{ grid-template-columns: 1fr; } }

/* ---------- Screenshots ---------- */
.shot-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 900px){
  .shot-grid{
    grid-template-columns: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: 86%;
    display:flex;
    overflow-x:auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    margin: 0 -28px;
    padding-left: 28px;
    padding-right: 28px;
  }
  .shot-grid > .shot{ scroll-snap-align: center; flex: 0 0 86%; }
}
.shot{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color .15s ease, transform .15s ease;
}
.shot:hover{ border-color: var(--ice-dim); transform: translateY(-2px); }
.shot-chrome{
  display:flex;
  align-items:center;
  gap:7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #0b0f16;
}
.shot-chrome .dot{ width:9px; height:9px; box-shadow:none; border-radius:50%; }
.shot-chrome .dot.red{ background:#4a3038; }
.shot-chrome .dot.yellow{ background:#4a4530; }
.shot-chrome .dot.green{ background:#2f4a38; }
.shot-chrome .shot-title{
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  margin-left: 6px;
}
.shot-frame{ overflow: hidden; }
.shot img{
  display:block;
  width:100%;
  height:auto;
  transform-origin: center top;
  transition: transform .45s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.shot:hover img{ transform: scale(1.06); }
@media (prefers-reduced-motion: reduce){
  .shot img{ transition: none; }
  .shot:hover img{ transform: none; }
}
.shot-caption{
  padding: 16px 18px 20px;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.shot-caption strong{ color: var(--text); display:block; margin-bottom: 4px; font-family: var(--display); font-size: 0.98rem; }

/* ---------- Engine / feature cards ---------- */
.grid-3{ display:grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.grid-2{ display:grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
@media (max-width: 900px){ .grid-3{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 600px){ .grid-3, .grid-2{ grid-template-columns: 1fr; } }

.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover{ border-color: var(--ice-dim); transform: translateY(-2px); }
.card h3{
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.card p{ margin:0; font-size: 0.9rem; color: var(--text-dim); }
.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top: 14px; }
.chip{
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ice-soft);
  border: 1px solid var(--ice-dim);
  padding: 4px 9px;
  border-radius: 20px;
}

/* ---------- Export spec table ---------- */
.spec-table{
  width:100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.spec-table th{
  text-align:left;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  text-transform:uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.spec-table td{
  padding: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.spec-table td:first-child{ color: var(--text); font-weight:600; width: 220px; }
.spec-table tr:last-child td{ border-bottom:none; }

/* ---------- Download ---------- */
.dl-panel{
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px;
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items:center;
}
@media (max-width: 800px){ .dl-panel{ grid-template-columns: 1fr; } }
.platform-list{ list-style:none; margin: 22px 0 28px; padding:0; font-family: var(--mono); font-size:0.85rem; }
.platform-list li{ display:flex; align-items:center; gap:10px; margin-bottom: 10px; color: var(--text-dim); }
.dot{ width:8px; height:8px; border-radius:50%; display:inline-block; flex-shrink:0; }
.dot.ok{ background: var(--ice); box-shadow: 0 0 8px var(--ice); }
.dot.warn{ background: var(--ember); box-shadow: 0 0 8px var(--ember); }
.term{
  background: #05080c;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ice-soft);
  overflow-x:auto;
}
.term .muted{ color: var(--text-faint); }
.term .line{ margin: 3px 0; }
details.source-instr{ margin-top:18px; }
details.source-instr summary{
  cursor:pointer; font-family: var(--mono); font-size:0.82rem; color: var(--text-dim);
  list-style:none;
}
details.source-instr summary::-webkit-details-marker{ display:none; }
details.source-instr summary::before{ content:'▸ '; color: var(--ice); }
details.source-instr[open] summary::before{ content:'▾ '; }

/* ---------- Support ---------- */
.support-panel{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 48px;
  text-align:center;
}
.support-panel p{ color: var(--text-dim); max-width: 480px; margin: 0 auto 28px; }
.paypal-btn{
  background: #ffc439;
  color: #003087;
  font-family: var(--mono);
  font-weight:700;
  font-size: 0.92rem;
  padding: 14px 30px;
  border-radius: 24px;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:10px;
  transition: transform .15s ease;
}
.paypal-btn:hover{ transform: translateY(-1px); }

/* ---------- Blog (native WP loop) ---------- */
.blog-toolbar{ display:flex; justify-content:space-between; align-items:flex-end; gap: 20px; flex-wrap:wrap; margin-bottom: 40px;}
#postList{ display:flex; flex-direction:column; gap: 18px; }
.post-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.post-meta{ font-family: var(--mono); font-size: 0.76rem; color: var(--text-faint); margin-bottom: 10px; display:flex; gap:14px; flex-wrap:wrap; align-items:center; }
.post-card h2, .post-card h3{ margin: 0 0 10px; font-family: var(--display); font-size: 1.25rem; }
.post-card h2 a, .post-card h3 a{ text-decoration:none; color: var(--text); }
.post-card h2 a:hover, .post-card h3 a:hover{ color: var(--ice); }
.post-body{ color: var(--text-dim); font-size: 0.96rem; }
.tag{ font-family: var(--mono); font-size:0.7rem; color: var(--ember-soft); border:1px solid #4a2818; padding:2px 8px; border-radius: 20px; text-decoration:none; }
.empty-state{
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align:center;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.readmore{ font-family: var(--mono); font-size:0.8rem; color: var(--ice); text-decoration:none; display:inline-block; margin-top:10px; }

/* ---------- Single post ---------- */
.single-post{ max-width: 720px; margin: 0 auto; padding: 80px 28px 100px; }
.single-post .post-meta{ margin-bottom: 18px; }
.single-post h1{ font-family: var(--display); font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 24px; font-weight:800; letter-spacing:-0.01em; }
.single-post .content{ font-size: 1.05rem; color: var(--text-dim); }
.single-post .content p{ margin: 0 0 20px; }
.single-post .content a{ color: var(--ice); }
.single-post .content img{ border-radius: 10px; margin: 24px 0; }
.single-post .content h2, .single-post .content h3{ color: var(--text); font-family: var(--display); margin-top: 36px; }
.back-link{ font-family: var(--mono); font-size:0.85rem; color: var(--text-dim); text-decoration:none; display:inline-block; margin-bottom: 34px; }
.back-link:hover{ color: var(--ice); }

/* ---------- Pagination ---------- */
.pulse-pagination{ display:flex; gap:10px; margin-top: 40px; font-family: var(--mono); font-size:0.85rem; }
.pulse-pagination a, .pulse-pagination span{
  border: 1px solid var(--border); border-radius:6px; padding: 8px 14px; text-decoration:none; color: var(--text-dim);
}
.pulse-pagination a:hover{ border-color: var(--ice); color: var(--ice); }
.pulse-pagination .current{ color: var(--ice); border-color: var(--ice-dim); }

/* ---------- Contact form ---------- */
.contact-section{ padding-top: 64px; }
.contact-wrap{ max-width: 640px; }
.contact-form{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px;
}
.form-field{ margin-bottom: 20px; }
.form-field label{
  display:block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.form-field input,
.form-field textarea{
  width: 100%;
  background: #05080c;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.96rem;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus{ border-color: var(--ice); outline: none; }
.form-actions{ margin-top: 6px; }
.form-msg{
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 28px;
}
.form-msg.success{ background: rgba(111,224,255,0.08); border: 1px solid var(--ice-dim); color: var(--ice-soft); }
.form-msg.error{ background: rgba(255,106,61,0.08); border: 1px solid #4a2818; color: var(--ember-soft); }
.hp-field{
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- Lightbox ---------- */
.lightbox-backdrop{
  position: fixed; inset: 0;
  background: rgba(3,5,7,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.lightbox-backdrop.open{ opacity: 1; visibility: visible; }
.lightbox-inner{
  max-width: 1200px;
  width: 100%;
  transform: scale(0.96);
  transition: transform .25s ease;
}
.lightbox-backdrop.open .lightbox-inner{ transform: scale(1); }
.lightbox-frame{
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 40px 90px rgba(0,0,0,0.55);
}
.lightbox-frame img{ width: 100%; display: block; }
.lightbox-caption{
  text-align: center;
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.lightbox-close{
  position: fixed;
  top: 22px; right: 26px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 210;
  transition: border-color .15s ease, color .15s ease;
}
.lightbox-close:hover{ border-color: var(--ice); color: var(--ice); }
@media (max-width: 600px){
  .lightbox-backdrop{ padding: 80px 16px 24px; }
}

footer.site{
  padding: 48px 0 60px;
}
.footer-inner{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap: 20px; }
.footer-inner .brand img{ height:20px; }
.footer-links{ display:flex; gap: 22px; list-style:none; margin:0; padding:0; font-size:0.85rem; color: var(--text-dim); }
.footer-links a{ text-decoration:none; }
.footer-links a:hover{ color: var(--ice); }
.fine{ font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint); margin-top: 26px; }

/* WP core alignment helpers used inside post content */
.alignwide{ margin-left: auto; margin-right:auto; }
.aligncenter{ display:block; margin-left:auto; margin-right:auto; }
