/* WhatChord site — shared styles */

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

:root {
  --bg: #0d0d13;
  --bg-raised: #13131b;
  --bg-card: #181822;
  --bg-code: #09090e;
  --border: rgba(255 255 255 / 0.07);
  --border-mid: rgba(255 255 255 / 0.11);
  --border-strong: rgba(255 255 255 / 0.18);
  --text: #eaeaf2;
  --text-2: #9494ae;
  --text-3: #4e4e65;
  --accent: #4080ff;
  --accent-light: #7aaaff;
  --accent-bg: rgba(64 128 255 / 0.09);
  --accent-border: rgba(64 128 255 / 0.28);
  --r: 10px;
  --r-lg: 18px;
  --r-xl: 24px;
  --max-w: 1120px;
  --article-w: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --shadow: 0 2px 8px rgba(0 0 0 / 0.45), 0 12px 40px rgba(0 0 0 / 0.22);
  --shadow-sm: 0 1px 4px rgba(0 0 0 / 0.4), 0 4px 16px rgba(0 0 0 / 0.18);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-light);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
img {
  max-width: 100%;
  display: block;
}

/* ─── Layout wrappers ─────────────────────────────────────────── */

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

.article-wrap {
  max-width: var(--article-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Navigation ──────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13 13 19 / 0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.logo-bold {
  font-weight: 700;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-logo img {
  width: 40px;
  height: 40px;
  border-radius: 7px;
}

.github-icon {
  width: 18px;
  height: 18px;
  opacity: 0.75;
  flex-shrink: 0;
}

.nav-spacer {
  flex: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin-right: 8px;
}

.nav-links a {
  color: var(--text-2);
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: var(--r);
  transition:
    color 0.15s,
    background 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255 255 255 / 0.06);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  text-decoration: none !important;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #5592ff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-mid);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255 255 255 / 0.06);
}

/* ─── Hero ────────────────────────────────────────────────────── */

.hero {
  padding: 72px 0 80px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--text);
  max-width: 820px;
  margin: 0 auto 22px;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.175rem);
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

.store-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.store-badge {
  height: 60px;
  width: auto;
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.store-badge:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

.hero-screenshot {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255 255 255 / 0.16),
    0 0 60px rgba(64 128 255 / 0.09),
    var(--shadow);
}

.hero-screenshot img {
  width: 100%;
}

/* ─── Section primitives ─────────────────────────────────────── */

section {
  padding: 88px 0;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.18;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 540px;
  line-height: 1.7;
}

/* ─── Features ────────────────────────────────────────────────── */

.features {
  background: var(--bg);
}

.features-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
  align-items: center;
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.feature-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 10px;
}

.feature h3 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.22;
  margin-bottom: 14px;
}

.feature p {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.75;
}

.feature-img-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.feature-img-wrap img {
  max-height: 620px;
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: var(--r-xl);
  box-shadow:
    0 0 0 1px rgba(255 255 255 / 0.16),
    0 0 60px rgba(64 128 255 / 0.09),
    var(--shadow);
}

.feature.reverse .feature-text {
  order: 2;
}
.feature.reverse .feature-img-wrap {
  order: 1;
}

/* ─── Difference / comparison ────────────────────────────────── */

.difference {
  background: var(--bg-raised);
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 52px;
}

.compare-card {
  background: #16161f;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  padding: 32px;
}

.compare-card.better {
  border-color: var(--accent-border);
  background: linear-gradient(145deg, #16161f 0%, rgba(64 128 255 / 0.07) 100%);
}

.compare-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 18px;
}

.compare-card.better .compare-label {
  color: var(--accent-light);
}

.compare-chord {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 8px;
  color: var(--text-2);
}

.compare-card.better .compare-chord {
  color: var(--accent-light);
}

.compare-notes {
  font-size: 0.82rem;
  color: var(--text-2);
  font-family: var(--mono);
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.compare-explanation {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.65;
}

.compare-explanation strong {
  color: var(--text);
}

/* ─── Audience ───────────────────────────────────────────────── */

.audience {
  background: var(--bg);
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 52px;
}

.audience-card {
  background: #16161f;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  transition:
    border-color 0.18s,
    transform 0.18s;
}

.audience-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.audience-icon {
  font-size: 1.6rem;
  margin-bottom: 14px;
  line-height: 1;
}

.audience-card h4 {
  font-size: 0.975rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.audience-card p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ─── Privacy callout ────────────────────────────────────────── */

.privacy {
  background: var(--bg-raised);
}

.privacy-inner {
  text-align: center;
  max-width: 580px;
  margin: 0 auto;
}

.oss-callout {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  padding: 12px 20px;
  border-radius: var(--r-lg);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent-light);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.oss-callout:hover {
  background: rgba(64 128 255 / 0.15);
  border-color: rgba(64 128 255 / 0.4);
}

.oss-callout .oss-arrow {
  opacity: 0.6;
  font-size: 0.85rem;
}

/* ─── Articles section ───────────────────────────────────────── */

.articles-section {
  background: var(--bg);
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 52px;
}

.article-card {
  background: #16161f;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 36px;
  transition:
    border-color 0.18s,
    transform 0.18s;
  text-decoration: none !important;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.article-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.article-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.3;
  margin-bottom: 12px;
  flex: 1;
}

.article-card p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 22px;
}

.read-more {
  font-size: 0.875rem;
  color: var(--accent-light);
  font-weight: 500;
}

/* ─── Android beta dialog ────────────────────────────────────── */

dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  padding: 0;
  max-width: 400px;
  width: calc(100% - 48px);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog-content {
  padding: 32px;
}

.dialog-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.018em;
  margin-bottom: 12px;
}

.dialog-content p {
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 24px;
}

/* ─── Footer ─────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border-mid);
  background: var(--bg-raised);
  padding: 36px 0;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-2);
}

.footer-copy a {
  color: var(--text-2);
  transition: color 0.15s;
}

.footer-copy a:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-license {
  white-space: nowrap;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-2);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ─── Article page layout ────────────────────────────────────── */

.article-header {
  padding: 60px 0 52px;
  border-bottom: 1px solid var(--border);
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 28px;
  transition: color 0.15s;
}

.article-back:hover {
  color: var(--text);
  text-decoration: none;
}

.article-header .article-tag {
  margin-bottom: 20px;
}

.article-header h1 {
  font-size: clamp(1.85rem, 4.5vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.033em;
  line-height: 1.13;
  margin-bottom: 20px;
}

.article-deck {
  font-size: 1.1rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 640px;
}

.article-body {
  padding: 56px 0 96px;
}

.article-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
  margin: 60px 0 14px;
  padding-top: 60px;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.article-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 32px 0 10px;
  color: var(--text);
}

.article-body p {
  color: var(--text-2);
  margin-bottom: 22px;
  font-size: 1rem;
  line-height: 1.8;
}

.article-body p strong {
  color: var(--text);
}

.article-body ul,
.article-body ol {
  color: var(--text-2);
  padding-left: 22px;
  margin-bottom: 22px;
}

.article-body li {
  margin-bottom: 7px;
  line-height: 1.75;
  font-size: 1rem;
}

.article-body li strong {
  color: var(--text);
}

.article-body a {
  color: var(--accent-light);
}

.article-body code {
  font-family: var(--mono);
  font-size: 0.865em;
  background: rgba(255 255 255 / 0.07);
  border: 1px solid var(--border-mid);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-light);
}

.article-body pre {
  background: var(--bg-code);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-lg);
  padding: 28px;
  margin: 28px 0;
  overflow-x: auto;
  tab-size: 2;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.75;
}

/* Syntax-hint coloring (manual, no highlighter needed) */
.kw {
  color: #c792ea;
} /* keyword */
.cm {
  color: #6e7fa8; /* 5.4:1 contrast on bg-code */
  font-style: italic;
} /* comment */
.nu {
  color: #f78c6c;
} /* number */
.fn {
  color: #82aaff;
} /* function/method */

.chord {
  font-weight: 600;
  color: var(--accent-light);
}

.callout {
  background: #14141d;
  border: 1px solid var(--border-mid);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  padding: 20px 24px;
  margin: 28px 0;
}

.callout p {
  margin-bottom: 0 !important;
  font-size: 0.95rem;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}

.score-table th {
  text-align: left;
  padding: 10px 16px;
  background: #14141d;
  border: 1px solid var(--border-mid);
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.score-table td {
  padding: 9px 16px;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.9rem;
}

.score-table tr:nth-child(even) td {
  background: rgba(255 255 255 / 0.02);
}
.score-table .pos {
  color: #56d364;
}
.score-table .neg {
  color: #f85149;
}
.score-table .mono {
  font-family: var(--mono);
  font-size: 0.82em;
}

.article-cta {
  background: #14141d;
  border: 1px solid var(--accent-border);
  border-radius: var(--r-lg);
  padding: 40px;
  text-align: center;
  margin-top: 60px;
}

.article-cta h3 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 10px;
}

.article-cta p {
  color: var(--text-2);
  margin-bottom: 24px;
}

.article-related {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.article-related h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 20px;
}

/* ─── Pipeline diagram ───────────────────────────────────────── */

.pipeline-flow {
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.pf-endpoint {
  font-size: 0.82rem;
  color: var(--text-2);
  font-style: italic;
  text-align: center;
  padding: 4px 0;
}

.pf-box {
  width: 100%;
  max-width: 520px;
  background: #14141d;
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  padding: 12px 20px;
  text-align: center;
  transition:
    border-color 0.18s,
    background 0.18s,
    transform 0.18s;
}

.pf-box:hover {
  border-color: var(--border-strong);
  background: rgba(255 255 255 / 0.04);
  transform: translateY(-2px);
}

.pf-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.pf-sub {
  font-size: 0.78rem;
  color: var(--text-2);
  margin-top: 3px;
  line-height: 1.4;
}

.pf-arrow {
  height: 22px;
  display: flex;
  align-items: center;
  color: var(--text-3);
  font-size: 1rem;
}

/* ─── Bit-field table ─────────────────────────────────────────── */

.bit-field {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  table-layout: fixed;
}

.bit-field th {
  padding: 5px 2px;
  text-align: center;
  color: var(--text-2);
  font-weight: 400;
  border: none;
  background: none;
  font-size: 0.72rem;
  letter-spacing: 0;
}

.bit-field .note-row td {
  padding: 4px 2px;
  text-align: center;
  color: var(--text);
  border: 1px solid var(--border);
  background: #14141d;
  font-size: 0.72rem;
}

.bit-field .bit-row td {
  padding: 7px 2px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--border-mid);
  background: #14141d;
  color: var(--text-2);
}

.bit-field .bit-row td.b1 {
  background: rgba(64 128 255 / 0.14);
  border-color: var(--accent-border);
  color: var(--accent-light);
}

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .feature {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 48px 0;
  }

  .feature.reverse .feature-text {
    order: 0;
  }
  .feature.reverse .feature-img-wrap {
    order: 0;
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .store-badges {
    flex-direction: column;
    align-items: center;
  }
  .source-label {
    display: none;
  }
  .footer-separator {
    display: none;
  }
  .footer-license {
    display: block;
    margin-top: 4px;
  }
}
