/* ============================================================
   Pulse Works Studio — shared styles
   Dark, modern, astronomy/space theme
   ============================================================ */

:root {
  --bg: #05060d;
  --bg-2: #0a0e1d;
  --panel: rgba(18, 22, 40, 0.72);
  --panel-solid: #11152a;
  --border: rgba(120, 150, 220, 0.16);
  --border-strong: rgba(120, 150, 220, 0.32);
  --text: #e8ecf8;
  --text-dim: #a4adc8;
  --text-faint: #6e7794;
  --accent: #5fd0ff;
  --accent-2: #b48bff;
  --gold: #ffd27d;
  --good: #6ee7a8;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Cosmic background layers */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(95, 110, 255, 0.18), transparent 60%),
    radial-gradient(1000px 800px at 12% 8%, rgba(180, 139, 255, 0.14), transparent 55%),
    radial-gradient(900px 600px at 50% 110%, rgba(95, 208, 255, 0.10), transparent 60%),
    linear-gradient(180deg, #05060d 0%, #070a16 45%, #05060d 100%);
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #9fe2ff; }

img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(5, 6, 13, 0.66);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand .logo-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold), #c98a2a 70%);
  box-shadow: 0 0 18px rgba(255, 210, 125, 0.55);
  flex: none;
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  color: var(--text-dim);
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #07101e;
  box-shadow: 0 10px 30px rgba(95, 208, 255, 0.28);
}
.btn-primary:hover { color: #07101e; box-shadow: 0 14px 38px rgba(95, 208, 255, 0.42); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 56px; text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(95, 208, 255, 0.06);
  margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
  background: linear-gradient(180deg, #ffffff 0%, #b9c6ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 30px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 60px 0; }
.section-head { margin-bottom: 34px; }
.section-head.center { text-align: center; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  margin: 0 0 10px;
  letter-spacing: -0.3px;
}
.section-head p { color: var(--text-dim); margin: 0; max-width: 620px; }
.section-head.center p { margin-left: auto; margin-right: auto; }

/* ---------- Project cards ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  color: var(--text);
}
.project-card .thumb {
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--bg-2);
}
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.project-card:hover .thumb img { transform: scale(1.05); }
.project-card .card-body { padding: 20px 22px 24px; }
.project-card h3 { font-family: var(--font-display); margin: 0 0 8px; font-size: 1.3rem; }
.project-card p { margin: 0 0 16px; color: var(--text-dim); font-size: 0.96rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.card-status {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(110, 231, 168, 0.16);
  color: var(--good);
  border: 1px solid rgba(110, 231, 168, 0.3);
}

/* "coming soon" placeholder card */
.project-card.soon { opacity: 0.6; pointer-events: none; }
.project-card.soon .thumb {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-family: var(--font-display); font-size: 1.1rem;
}

/* ---------- Generic panels / prose ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
}
.prose { max-width: 760px; }
.prose h2 { font-family: var(--font-display); margin: 36px 0 12px; font-size: 1.5rem; }
.prose h3 { font-family: var(--font-display); margin: 26px 0 8px; font-size: 1.15rem; color: var(--text); }
.prose p, .prose li { color: var(--text-dim); }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose code {
  background: rgba(255,255,255,0.07);
  padding: 2px 7px; border-radius: 6px;
  font-size: 0.88em; color: var(--gold);
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

/* ---------- Feature list ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.feature {
  display: flex;
  gap: 13px;
  padding: 18px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.feature .ic {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(95, 208, 255, 0.12);
  font-size: 1.05rem;
}
.feature h4 { margin: 0 0 4px; font-size: 0.98rem; font-family: var(--font-display); font-weight: 600; }
.feature p { margin: 0; font-size: 0.88rem; color: var(--text-dim); line-height: 1.5; }

/* ---------- Screenshot gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.gallery figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-2);
}
.gallery img { width: 100%; height: auto; }

/* ---------- Devlog ---------- */
.devlog-list { display: flex; flex-direction: column; gap: 14px; }
.devlog-item {
  display: block;
  padding: 20px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.devlog-item:hover { border-color: var(--border-strong); transform: translateX(3px); color: var(--text); }
.devlog-item .meta { font-size: 0.8rem; color: var(--text-faint); letter-spacing: 0.03em; }
.devlog-item h3 { font-family: var(--font-display); margin: 4px 0 8px; font-size: 1.18rem; color: var(--text); }
.devlog-item p { margin: 0; color: var(--text-dim); font-size: 0.94rem; }

/* version tag */
.vtag {
  display: inline-block; font-size: 0.74rem; font-weight: 700;
  color: var(--gold); background: rgba(255, 210, 125, 0.12);
  border: 1px solid rgba(255, 210, 125, 0.28);
  padding: 2px 9px; border-radius: 999px; margin-right: 8px;
}

/* ---------- Play embed ---------- */
.play-shell {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
.play-frame {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 80vh;
  border: 0;
  display: block;
  background: #05060d;
}
.play-placeholder {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}
.play-placeholder .big { font-family: var(--font-display); font-size: 1.3rem; color: var(--text); margin-bottom: 8px; }

/* ---------- Hero banner image ---------- */
.banner {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}
.banner img { width: 100%; height: auto; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 40px 0 56px;
  color: var(--text-faint);
  font-size: 0.9rem;
}
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-grid a { color: var(--text-dim); }
.footer-grid a:hover { color: var(--text); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: 0.86rem; color: var(--text-faint); padding-top: 28px; }
.crumbs a { color: var(--text-dim); }

/* ---------- Two-column meta layout for game page ---------- */
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.facts { position: sticky; top: 88px; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.facts dt { color: var(--text-faint); font-size: 0.86rem; }
.facts dd { margin: 0; color: var(--text); font-size: 0.9rem; text-align: right; }
.facts .btn { width: 100%; justify-content: center; margin-bottom: 10px; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--text-faint); }
.stack-gap > * + * { margin-top: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .facts { position: static; }
  .nav-links {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(7, 10, 22, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; }
  .nav-toggle { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  #starfield { display: none; }
}
