@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  --bg: #070908;
  --bg-elev: #101514;
  --bg-elev-2: #171f1d;
  --bg-soft: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f2ea;
  --text-soft: #d7d2c8;
  --text-dim: #aaa69c;
  --text-muted: #77756d;
  --wood: #d6a15d;
  --leaf: #79c97d;
  --water: #69b7c8;
  --plum: #bd82d8;
  --rose: #d97f7a;
  --ink: #1f1a16;
  --radius-sm: 6px;
  --radius: 8px;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

body::selection {
  background: rgba(214, 161, 93, 0.35);
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1, h2, h3, h4 {
  line-height: 1.16;
  letter-spacing: 0;
}

h1 {
  font-size: 4.8rem;
  font-weight: 900;
}

h2 {
  font-size: 2.1rem;
  font-weight: 850;
}

h3 {
  font-size: 1.18rem;
  font-weight: 750;
}

h4 {
  font-size: 0.96rem;
  font-weight: 700;
}

p {
  color: var(--text-dim);
}

a {
  color: var(--wood);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

.site-header {
  position: relative;
  min-height: 560px;
  overflow: hidden;
}

.hero-bg,
.hero-device {
  position: absolute;
  pointer-events: none;
}

.hero-bg {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

.hero-device {
  top: 26px;
  right: max(1.5rem, calc((100vw - 1120px) / 2));
  width: auto;
  height: calc(100% - 52px);
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 22px 36px rgba(0, 0, 0, 0.38));
}

.header-inner {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4.8rem 1.5rem 3.4rem;
}

.header-copy {
  max-width: min(680px, calc(100% - 400px));
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.72);
}

.header-eyebrow,
.section-label,
.nav-btn,
.chip,
.metric-label,
.mini-label {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
}

.header-eyebrow {
  margin-bottom: 1.1rem;
  color: var(--leaf);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.header-title {
  margin-bottom: 1.15rem;
  color: var(--text);
  font-style: italic;
}

.header-sub {
  max-width: 680px;
  margin-bottom: 1.8rem;
  color: var(--text-soft);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1.35rem;
}

.hero-dl-btn,
.hero-link,
.text-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 800;
}

.hero-dl-btn {
  padding: 0.72rem 1.25rem;
  background: var(--wood);
  color: #17100a;
  box-shadow: 0 10px 28px rgba(214, 161, 93, 0.24);
}

.hero-link,
.text-btn {
  padding: 0.72rem 1.1rem;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.hero-dl-btn:hover,
.hero-link:hover,
.text-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: 720px;
}

.hero-stats span,
.chip {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-stats span {
  padding: 0.35rem 0.75rem;
}

.hero-calibration-note {
  margin: 0.9rem 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.hero-calibration-note a {
  color: var(--wood);
  font-weight: 800;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 9, 8, 0.93);
  backdrop-filter: blur(14px);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  padding: 0 1.5rem;
  scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  flex: 0 0 auto;
  padding: 1rem 1.05rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text-soft);
}

.nav-btn.active {
  border-bottom-color: var(--wood);
  color: var(--wood);
}

.tab-panel {
  display: none;
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4.5rem;
}

.tab-panel.active {
  display: block;
  animation: fadeUp 180ms ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-label {
  margin-bottom: 0.45rem;
  color: var(--wood);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.section-title {
  margin-bottom: 0.65rem;
}

.section-intro {
  max-width: 760px;
  margin-bottom: 2rem;
  color: var(--text-dim);
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.card-dark,
.media-panel {
  border: 0;
  border-radius: 0;
}

.card {
  background: transparent;
  padding: 0;
}

.card-dark {
  background: transparent;
  padding: 0;
}

.card:hover {
  border-color: transparent;
}

.media-panel {
  overflow: hidden;
  background: transparent;
}

.media-panel img,
.plain-image {
  display: block;
  width: 100%;
  height: auto;
}

.media-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-band {
  margin-bottom: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.metric strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--text);
  font-size: 1.35rem;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.accent-wood {
  color: var(--wood);
}

.accent-leaf {
  color: var(--leaf);
}

.accent-water {
  color: var(--water);
}

.accent-plum {
  color: var(--plum);
}

.accent-rose {
  color: var(--rose);
}

.calibration-confirm {
  color: var(--wood);
  font-weight: 850;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: 0.88rem;
  -webkit-overflow-scrolling: touch;
}

.data-table table {
  width: 100%;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--text-muted);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.data-table td {
  color: var(--text-dim);
}

.data-table td:first-child {
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.chip {
  padding: 0.18rem 0.55rem;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
  margin: 1.5rem 0 2rem;
}

.flow-node {
  flex: 1 1 120px;
  min-height: 92px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.flow-node strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.flow-node span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.control-strip,
.timeline {
  display: grid;
  gap: 0.8rem;
}

.control-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.control-item {
  padding: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
}

.control-item:nth-child(2n) {
  border-left-color: var(--leaf);
}

.control-item:nth-child(3n) {
  border-left-color: var(--water);
}

.control-item:nth-child(4n) {
  border-left-color: var(--plum);
}

.control-item h4 {
  margin-bottom: 0.35rem;
}

.control-item p {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.voice-selector,
.scale-arc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.2rem 0 1.5rem;
}

.voice-btn,
.scale-btn {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text-dim);
  cursor: pointer;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.voice-btn {
  padding: 0.45rem 0.72rem;
}

.scale-btn {
  padding: 0.42rem 0.62rem;
}

.voice-btn.active,
.scale-btn.active {
  background: rgba(214, 161, 93, 0.16);
  color: var(--text);
}

.voice-detail,
.scale-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.detail-stat {
  display: grid;
  gap: 0.6rem;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

.stat-line:last-child {
  border-bottom: 0;
}

.stat-line span:first-child {
  color: var(--text-muted);
}

.pad-cluster {
  display: grid;
  grid-template-columns: repeat(9, minmax(58px, 1fr));
  gap: 0.45rem;
  margin: 1.5rem 0;
}

.pad {
  min-height: 72px;
  padding: 0.55rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.pad strong {
  display: block;
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

.pad span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.timeline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.timeline-step {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.timeline-step::before {
  content: attr(data-step);
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  border-radius: 999px;
  background: rgba(214, 161, 93, 0.18);
  color: var(--wood);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 800;
}

.print-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.print-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.print-card:hover {
  text-decoration: none;
}

.print-card img {
  width: 100%;
  border-radius: var(--radius-sm);
  background: transparent;
}

.split-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 2rem;
  align-items: center;
  margin: 2rem 0;
}

.overview-feature {
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, 0.45fr);
  gap: 2.4rem;
}

.overview-feature .plain-image {
  width: min(100%, 260px);
  margin: 0 auto;
}

.text-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem 1.6rem;
}

.quiet-rule {
  height: 1px;
  margin: 2.3rem 0;
  background: rgba(255, 255, 255, 0.08);
}

.emulator-embed {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(121, 201, 125, 0.08), rgba(105, 183, 200, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.emulator-embed h3 {
  margin: 0.4rem 0 0.6rem;
}

.emulator-embed > p {
  max-width: 720px;
  margin-bottom: 1.2rem;
}

.emulator-iframe {
  display: block;
  width: 100%;
  height: clamp(620px, 80vh, 880px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #0a0a12;
}

.emulator-fallback {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.65);
}

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  margin: 2rem 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #0a0a12;
}

/* Backwards-compat alias kept in case any older content still references it.
   Safe to remove once nothing in the repo uses the old class. */
.emulator-placeholder {
  margin-top: 2.5rem;
  min-height: 320px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(121, 201, 125, 0.08), rgba(105, 183, 200, 0.05));
}

.emulator-placeholder > div {
  max-width: 560px;
  padding: 1.5rem;
  text-align: center;
}

.compact-diagram {
  width: min(100%, 480px);
  margin: 0 auto 1.6rem;
}

.wide-diagram {
  width: min(100%, 760px);
  margin: 0 auto 1.6rem;
}

.equal-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.equal-image-grid img {
  width: 100%;
  height: clamp(260px, 34vw, 420px);
  object-fit: contain;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-support {
  margin-bottom: 1.5rem;
}

.footer-support-line {
  margin-bottom: 1rem !important;
  font-size: 1.05rem;
  color: var(--text-primary, #e0e0e0) !important;
}

.bmc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  background: rgba(214, 161, 93, 0.18);
  border: 1px solid rgba(214, 161, 93, 0.45);
  border-radius: 999px;
  color: var(--wood);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: all 0.2s ease;
}

.bmc-btn:hover {
  background: rgba(214, 161, 93, 0.32);
  box-shadow: 0 0 22px rgba(214, 161, 93, 0.35);
  text-decoration: none;
}

@media (max-width: 920px) {
  h1 {
    font-size: 3.5rem;
  }

  .site-header {
    min-height: 560px;
  }

  .hero-device {
    right: 1rem;
    top: auto;
    bottom: 1.2rem;
    width: min(260px, 38vw);
    height: auto;
    max-width: none;
    opacity: 0.95;
  }

  .header-copy {
    max-width: 720px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .metric-grid,
  .control-strip,
  .timeline,
  .voice-detail,
  .scale-detail,
  .print-grid,
  .split-feature,
  .text-grid,
  .equal-image-grid {
    grid-template-columns: 1fr;
  }

  .pad-cluster {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 2.8rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .site-header {
    min-height: 640px;
  }

  .header-inner {
    padding: 3rem 1rem 15rem;
  }

  .header-sub {
    font-size: 1rem;
  }

  .tab-panel {
    padding: 2rem 1rem 3rem;
  }

  .nav-inner {
    padding: 0 1rem;
  }

  .nav-btn {
    padding: 0.9rem 0.85rem;
  }

  .print-card {
    grid-template-columns: 1fr;
  }

  .emulator-placeholder {
    min-height: 240px;
  }
}
