/* ==========================================================
   WEST OFFICIAL — Modern Minimalist Dark & Light Theme
   Crimson Accent: #F42442
   ========================================================== */

:root {
  --bg: #0a0a0c;
  --bg-elevated: #121215;
  --surface: #16161a;
  --surface-hover: #1e1e24;
  --text: #f5f5f7;
  --text-muted: #9a9aa4;
  --text-faint: #666670;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #f42442;
  --accent-hover: #ff3653;
  --accent-soft: rgba(244, 36, 66, 0.14);
  --accent-glow: rgba(244, 36, 66, 0.26);
  --shadow: 0 28px 70px -20px rgba(0, 0, 0, 0.75);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --display: "Plus Jakarta Sans", "Inter", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

html[data-theme="light"] {
  --bg: #f8f8fa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f1f1f5;
  --text: #111114;
  --text-muted: #585862;
  --text-faint: #8a8a96;
  --border: rgba(17, 17, 20, 0.09);
  --border-strong: rgba(17, 17, 20, 0.16);
  --accent: #e61e3c;
  --accent-hover: #d11733;
  --accent-soft: rgba(230, 30, 60, 0.09);
  --accent-glow: rgba(230, 30, 60, 0.18);
  --shadow: 0 24px 60px -20px rgba(17, 17, 20, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 15.5px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
code, kbd { font-family: var(--mono); }
::selection { background: var(--accent); color: #fff; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 32px);
}

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 400;
  padding: 10px 16px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font: 600 12px/1 var(--mono);
  transform: translateY(-200%); transition: transform 0.2s;
}
.skip-link:focus { transform: none; }

/* ---------- Brand Wordmark + 5-Bar Crimson Waveform ---------- */
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-wordmark {
  font: 800 22px/1 var(--display);
  letter-spacing: -0.04em;
  text-transform: lowercase;
}
.waveform { display: inline-flex; align-items: center; gap: 2.5px; height: 18px; }
.waveform i {
  display: block; width: 3px; border-radius: 99px;
  background: var(--accent);
}
.waveform i:nth-child(1), .waveform i:nth-child(5) { height: 5px; }
.waveform i:nth-child(2), .waveform i:nth-child(4) { height: 11px; }
.waveform i:nth-child(3) { height: 17px; }

/* ---------- Top Navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto;
  height: 66px; padding: 0 clamp(18px, 4vw, 32px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
  font-size: 13.5px; font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-links a span {
  font: 500 11px/1 var(--mono);
  color: var(--text-faint);
  margin-right: 4px;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active span { color: var(--accent); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.search-pill {
  display: inline-flex; align-items: center; gap: 16px;
  height: 36px; padding: 0 10px 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  transition: border-color 0.15s;
}
.search-pill:hover { border-color: var(--border-strong); color: var(--text); }
.search-pill kbd {
  font-size: 11px; color: var(--text-faint);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 5px;
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-hover); }

html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }

.nav-download {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px; font-weight: 600;
  transition: background 0.15s, transform 0.15s;
}
.nav-download:hover { background: var(--accent-hover); transform: translateY(-1px); }

.mobile-toggle { display: none; position: relative; }
.mobile-toggle span {
  position: absolute; width: 15px; height: 1.5px; background: currentColor; transition: 0.2s;
}
.mobile-toggle span:first-child { transform: translateY(-3px); }
.mobile-toggle span:last-child { transform: translateY(3px); }
.mobile-toggle.open span:first-child { transform: rotate(45deg); }
.mobile-toggle.open span:last-child { transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(48px, 7vw, 84px) 0 clamp(60px, 8vw, 92px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.status-pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero-title {
  margin-top: 22px;
  font: 800 clamp(2.8rem, 6vw, 4.6rem)/1.02 var(--display);
  letter-spacing: -0.04em;
}
.accent-text { color: var(--accent); }

.hero-subtitle {
  margin-top: 20px;
  max-width: 550px;
  font-size: 16px;
  color: var(--text-muted);
}
.hero-subtitle strong { color: var(--text); font-weight: 600; letter-spacing: 0.03em; }

.hero-actions {
  margin-top: 30px;
  display: flex; flex-wrap: wrap; gap: 12px;
}

.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  transition: transform 0.18s, background 0.18s, border-color 0.18s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 30px -10px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-meta {
  font: 500 11px/1 var(--mono);
  padding: 3px 6px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-hover); transform: translateY(-2px); }
.btn-ghost { color: var(--text-muted); padding: 0 12px; }
.btn-ghost:hover { color: var(--text); }

/* ---------- Hero Mockup Image ---------- */

.hero-phone-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  /* background: radial-gradient(circle, var(--accent-glow), transparent 70%); */
  pointer-events: none;
}

.hero-mockup-img {
  position: relative;
  z-index: 1;
  width: min(310px, 100%);
  height: auto;
  border-radius: 28px;
  /* box-shadow: var(--shadow); */
  display: block;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(64px, 9vw, 104px) 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

.section-head { margin-bottom: 40px; max-width: 640px; }
.section-tag {
  display: inline-block;
  font: 600 11.5px/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-head h2 {
  font: 700 clamp(1.75rem, 3.5vw, 2.5rem)/1.15 var(--display);
  letter-spacing: -0.03em;
}
.section-head p {
  margin-top: 10px;
  color: var(--text-muted);
}

/* ---------- 01 / INTERFACE — Pure Content Grid (No Images) ---------- */
.content-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.content-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.card-index {
  font: 600 11.5px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 12px;
}
.content-card h3 {
  font: 700 18px/1.3 var(--display);
  letter-spacing: -0.02em;
}
.content-card p {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-muted);
}
.content-card strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Features Grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.feature-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  transition: border-color 0.2s;
}
.feature-item:hover { border-color: var(--border-strong); }
.feature-num {
  font: 600 12px/1 var(--mono);
  color: var(--accent);
  margin-bottom: 14px;
}
.feature-item h3 { font: 700 17px/1.3 var(--display); }
.feature-item p { margin-top: 8px; font-size: 14px; color: var(--text-muted); }

/* ---------- Install CLI Widget & Steps ---------- */
.cli-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 780px;
}
.cli-header {
  display: flex; align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.cli-tab {
  padding: 12px 14px;
  font: 500 12.5px/1 var(--mono);
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
}
.cli-tab:hover { color: var(--text); }
.cli-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.cli-copy {
  margin-left: auto;
  padding: 6px 10px; border-radius: 6px;
  font: 500 11.5px/1 var(--mono);
  color: var(--text-muted);
}
.cli-copy:hover { background: var(--surface-hover); color: var(--text); }
.cli-body {
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13px;
}

.steps-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.step-index {
  font: 600 11px/1 var(--mono);
  color: var(--accent);
}
.step-card h4 { margin-top: 10px; font: 700 15.5px/1.3 var(--display); }
.step-card p { margin-top: 8px; font-size: 13.5px; color: var(--text-muted); }
.step-card code {
  font-size: 12px;
  background: var(--surface-hover);
  padding: 2px 5px; border-radius: 4px;
  color: var(--text);
}

/* ---------- Privacy ---------- */
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.privacy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}
.privacy-card h3 { font: 700 17px/1.3 var(--display); margin-bottom: 10px; }
.privacy-card p { font-size: 14.5px; color: var(--text-muted); }
.privacy-card strong { color: var(--text); }

/* ---------- Download Card ---------- */
.download-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.download-main { max-width: 640px; }
.download-main h2 {
  margin-top: 18px;
  font: 800 clamp(2rem, 4vw, 3rem)/1.08 var(--display);
  letter-spacing: -0.03em;
}
.download-main p { margin-top: 14px; color: var(--text-muted); }

.release-specs {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.release-specs dt { font: 500 11px/1.2 var(--mono); color: var(--text-faint); }
.release-specs dd { margin-top: 6px; font: 600 15px/1.3 var(--mono); }

.checksum-strip {
  margin-top: 22px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 12px;
}
.checksum-strip span { font: 600 11px/1 var(--mono); color: var(--accent); }
.checksum-strip code { color: var(--text-muted); word-break: break-all; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 40px;
}
.footer-sub { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.footer-legal {
  margin-top: 20px;
  max-width: 760px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.footer-bottom {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font: 500 11.5px/1.4 var(--mono);
  color: var(--text-faint);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--text); }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 16px;
}
.modal-overlay[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative; z-index: 1;
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 18px;
}
.modal-panel h2 { font: 700 22px/1.25 var(--display); margin-bottom: 10px; }
.modal-panel p { font-size: 14px; color: var(--text-muted); }
.modal-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }

.jump-panel { padding: 0; overflow: hidden; }
.jump-search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.jump-search input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 14px; color: var(--text);
}
.esc-tag {
  font: 500 10.5px/1 var(--mono);
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 4px 6px; border-radius: 5px;
}
.jump-results { padding: 8px; max-height: 300px; overflow-y: auto; }
.jump-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
}
.jump-row:hover { background: var(--surface-hover); }
.jump-row small { font-size: 12px; color: var(--text-faint); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .mobile-toggle { display: grid; }
  .search-pill { display: none; }
}

@media (max-width: 620px) {
  .content-cards-grid, .features-grid, .steps-grid, .privacy-grid { grid-template-columns: 1fr; }
  .release-specs { grid-template-columns: repeat(2, 1fr); }
  .nav-download { display: none; }
}
/* Shared song fallback, using the existing WEST design tokens. */
.shared-song[hidden], .shared-song [hidden] { display: none !important; }
.shared-song {
  display: flex; align-items: flex-start; gap: 22px;
  margin: 30px 0 8px; padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--border-strong); border-radius: 22px;
  background: var(--surface);
}
.shared-song-icon {
  display: grid; place-items: center; flex: 0 0 62px; height: 62px;
  border-radius: 16px; background: var(--accent-soft); color: var(--accent);
}
.shared-song-copy { flex: 1; min-width: 0; }
.shared-song h2 {
  font: 700 clamp(23px, 3vw, 34px)/1.22 var(--display);
  letter-spacing: -.035em; margin: 8px 0;
}
.shared-song p { color: var(--text-muted); }
.shared-song .hero-actions { margin-top: 18px; }
.shared-song .shared-song-hint { font-size: 12px; margin-top: 16px; }
@media (max-width: 600px) {
  .shared-song { flex-direction: column; gap: 14px; margin-top: 20px; }
  .shared-song-icon { flex-basis: auto; width: 52px; height: 52px; }
}
