/* Tinnitune / ShahWave shared site styles.
   Tokens mirror the app's own theme.ts exactly, so the website and the
   product feel like one brand, not a separate marketing skin. */

:root {
  --bg: #fbfcfe;
  --surface: #f1f5f9;
  --surface-raised: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --primary: #0ea5e9;
  --accent: #14b8a6;
  --accent-rgb: 20, 184, 166;
  --primary-rgb: 14, 165, 233;
  --shadow: 220 20% 10%;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e14;
    --surface: #141a24;
    --surface-raised: #171e2a;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border: #232b38;
    --primary: #38bdf8;
    --accent: #2dd4bf;
    --accent-rgb: 45, 212, 191;
    --primary-rgb: 56, 189, 248;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0e14;
  --surface: #141a24;
  --surface-raised: #171e2a;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border: #232b38;
  --primary: #38bdf8;
  --accent: #2dd4bf;
  --accent-rgb: 45, 212, 191;
  --primary-rgb: 56, 189, 248;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, .wordmark, .btn, .fact .value {
  font-family: "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1, h2 { text-wrap: balance; }

a { color: var(--primary); }

/* ---------- Ambient background ---------- */
/* A slow-drifting teal/blue wash behind the hero, echoing the app's own
   BrandBackdrop component. Fixed + behind everything, never intercepts
   clicks, and is skipped entirely under reduced motion. */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.ambient span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
}
.ambient span:nth-child(1) {
  width: 46vw;
  height: 46vw;
  top: -14vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.55), transparent 70%);
  animation: drift1 26s ease-in-out infinite;
}
.ambient span:nth-child(2) {
  width: 38vw;
  height: 38vw;
  top: 8vw;
  right: -12vw;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.5), transparent 70%);
  animation: drift2 32s ease-in-out infinite;
}
.ambient span:nth-child(3) {
  width: 30vw;
  height: 30vw;
  bottom: -12vw;
  left: 20vw;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.35), transparent 70%);
  animation: drift3 38s ease-in-out infinite;
}
@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vw, 5vw) scale(1.08); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5vw, 4vw) scale(1.05); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3vw, -3vw) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .ambient span { animation: none; }
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 24px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  color: var(--text);
}
.wordmark .mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wordmark .mark svg { display: block; }
nav { display: flex; align-items: center; }
nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  margin-left: 22px;
  position: relative;
  transition: color 0.2s ease;
}
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
nav a:hover { color: var(--text); }
nav a:hover::after { transform: scaleX(1); }

main {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero waveform motif ---------- */
.hero-wave {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 4px 0 28px;
}
.hero-wave path {
  fill: none;
  stroke: url(#waveGradient);
  stroke-width: 3;
  stroke-linecap: round;
  animation: wavePulse 4.5s ease-in-out infinite;
}
@keyframes wavePulse {
  0%, 100% { opacity: 0.55; transform: scaleY(0.9); }
  50% { opacity: 1; transform: scaleY(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-wave path { animation: none; opacity: 0.85; }
}

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 14px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18);
}
h1 {
  font-size: 2.375rem;
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.lede {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 48ch;
  margin: 0 0 40px;
}
h2.section {
  font-size: 1.1875rem;
  font-family: "Lexend", sans-serif;
  font-weight: 600;
  margin: 64px 0 6px;
  letter-spacing: -0.01em;
}
.section-lede {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 0 0 20px;
  max-width: 56ch;
}

/* ---------- Store badge ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 28px; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.store-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(var(--accent-rgb), 0.45);
}
.store-badge svg { flex-shrink: 0; }
.store-badge .sub { display: block; font-size: 0.6875rem; font-weight: 400; opacity: 0.75; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 48px;
}

/* ---------- Buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 48px; }
.btn {
  display: inline-block;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 11px;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(var(--accent-rgb), 0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(var(--accent-rgb), 0.6); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Cards & grids ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  background: var(--surface);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 16px 32px -18px rgba(var(--accent-rgb), 0.35);
}
.card h3 { margin: 0 0 6px; font-size: 1rem; font-family: "Lexend", sans-serif; font-weight: 600; }
.card p { margin: 0; color: var(--text-secondary); font-size: 0.9375rem; }

.highlight {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--surface), var(--bg));
  margin-top: 16px;
}
.highlight h3 { margin: 0 0 8px; font-size: 1.0625rem; font-family: "Lexend", sans-serif; }
.highlight p { margin: 0; color: var(--text-secondary); }

.tracks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.track {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.track:hover { transform: translateY(-3px); border-color: rgba(var(--primary-rgb), 0.5); }
.track .tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.track h3 { margin: 0 0 8px; font-size: 1.0625rem; font-family: "Lexend", sans-serif; }
.track p { margin: 0; color: var(--text-secondary); font-size: 0.9375rem; }

.contact-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 24px 28px;
  margin-top: 16px;
}
.contact-card h2 { font-size: 1rem; margin: 0 0 4px; font-family: "Lexend", sans-serif; }
.contact-card p { margin: 0 0 14px; color: var(--text-secondary); font-size: 0.9375rem; }
.contact-card a.button {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}
.contact-card a.button:hover { transform: translateY(-2px); }

/* Fact grid (press kit) */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 16px 0 8px; }
.fact { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--surface); }
.fact .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 4px; }
.fact .value { font-size: 0.9375rem; font-weight: 600; }

.boilerplate {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 22px 26px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.boilerplate p { margin: 0; }

.quote {
  border-left: 3px solid var(--accent);
  padding-left: 22px;
  margin: 0;
  font-size: 1.0625rem;
  font-style: italic;
}
.quote cite {
  display: block;
  margin-top: 10px;
  font-size: 0.875rem;
  font-style: normal;
  color: var(--text-secondary);
}

.assets { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.asset-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px; text-align: center; background: var(--surface); }
.asset-swatch { width: 100%; height: 64px; border-radius: 10px; margin-bottom: 10px; }
.asset-card .name { font-size: 0.8125rem; font-weight: 600; }
.asset-card .hex { font-size: 0.75rem; color: var(--text-secondary); font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* Article list (resources index) */
.articles { display: grid; gap: 16px; }
.article-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.article-card:hover { transform: translateY(-3px) translateX(2px); border-color: var(--accent); }
.article-card .tag { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.article-card h2 { font-size: 1.125rem; margin: 0 0 6px; font-family: "Lexend", sans-serif; }
.article-card p { margin: 0; color: var(--text-secondary); font-size: 0.9375rem; }

/* Article body (individual resource pages) */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 28px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.back:hover { color: var(--accent); transform: translateX(-2px); }
article h2 { font-size: 1.25rem; margin: 44px 0 12px; font-family: "Lexend", sans-serif; }
article p { margin: 0 0 16px; }
article ul { margin: 0 0 16px; padding-left: 22px; }
article li { margin-bottom: 8px; }
.callout {
  border-left: 3px solid var(--accent);
  padding: 6px 22px;
  margin: 32px 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.06), transparent);
  border-radius: 0 12px 12px 0;
}
.note {
  margin-top: 48px;
  padding: 16px 20px;
  border-left: 3px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Legal page (privacy) */
.updated { color: var(--text-secondary); font-size: 0.875rem; margin: 0 0 40px; }
section.legal { margin-bottom: 32px; }
section.legal h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  font-family: "Lexend", sans-serif;
  margin: 0 0 8px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
section.legal:first-of-type h2 { border-top: none; padding-top: 0; }
section.legal p { margin: 0; color: var(--text-secondary); }

/* ---------- FAQ ---------- */
details {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
details:first-of-type { border-top: 1px solid var(--border); }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.875em;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
details[open] summary::before { content: "\2212"; transform: rotate(180deg); }
details p { margin: 12px 0 0 2.1em; color: var(--text-secondary); }

/* ---------- Footer ---------- */
footer {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 56px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--text-secondary); }
footer a:hover { color: var(--accent); }

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