/* Bytesong — shared site styles */
:root {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e6e8f0;
  --text: #1b1f2a;
  --text-soft: #5b6273;
  --text-faint: #8a90a2;
  --accent: #5b5bef;
  --accent-2: #8a5cf6;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(17, 20, 45, .06), 0 12px 32px -12px rgba(17, 20, 45, .18);
  --shadow-sm: 0 1px 2px rgba(17, 20, 45, .06), 0 4px 14px -8px rgba(17, 20, 45, .25);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d16;
    --bg-soft: #111522;
    --surface: #141826;
    --surface-2: #1b2030;
    --border: #262c3e;
    --text: #eef0f6;
    --text-soft: #aab0c2;
    --text-faint: #767d92;
    --accent: #8b8bff;
    --accent-2: #b389ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 40px -18px rgba(0, 0, 0, .7);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 20px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 12% -10%, rgba(91, 91, 239, .14), transparent 60%),
    radial-gradient(800px 460px at 100% 0%, rgba(138, 92, 246, .12), transparent 55%);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 5vw, 40px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-sm);
}

.back-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.back-link:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }

/* ---------- Landing / hero ---------- */
.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 96px) clamp(16px, 5vw, 40px) 8px;
  text-align: center;
}
.hero .eyebrow { margin: 0 0 14px; }
.hero h1 {
  margin: 0 auto 16px;
  max-width: 16ch;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -.03em;
  font-weight: 800;
  background: linear-gradient(120deg, var(--text), color-mix(in srgb, var(--accent) 70%, var(--text)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  margin: 0 auto;
  max-width: 52ch;
  font-size: clamp(1rem, 2.4vw, 1.18rem);
  color: var(--text-soft);
}

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- App cards ---------- */
.apps {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) clamp(16px, 5vw, 40px) 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.app-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.app-card .app-top { display: flex; align-items: center; gap: 13px; }

.app-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.app-card h2 { margin: 0; font-size: 1.06rem; font-weight: 700; letter-spacing: -.01em; }
.app-card .app-sub { margin: 2px 0 0; font-size: .85rem; color: var(--text-faint); }

.app-links { display: flex; gap: 10px; margin-top: auto; }
.app-links a {
  flex: 1;
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: var(--surface-2);
  transition: all .15s ease;
}
.app-links a:hover {
  text-decoration: none;
  color: var(--accent-ink);
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* ---------- Document pages (privacy / terms) ---------- */
.doc {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) clamp(16px, 5vw, 32px) 24px;
}

.doc-head { margin-bottom: 28px; }
.doc-head .eyebrow { margin-bottom: 10px; }
.doc-head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 800;
}
.doc-meta { margin: 0; font-size: .9rem; color: var(--text-faint); }

.doc-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 40px);
  overflow-wrap: break-word;
}

.doc-body > :first-child { margin-top: 0; }
.doc-body > :last-child { margin-bottom: 0; }

.doc-body p { margin: 0 0 16px; color: var(--text-soft); }
.doc-body strong, .doc-body b { color: var(--text); font-weight: 700; }

.doc-body h2, .doc-body h3 {
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.3;
  margin: 32px 0 12px;
}
.doc-body h2 { font-size: 1.3rem; }
.doc-body h3 { font-size: 1.08rem; }

.doc-body ul, .doc-body ol { margin: 0 0 16px; padding-left: 1.3em; color: var(--text-soft); }
.doc-body li { margin: 6px 0; }

.doc-body a { font-weight: 600; word-break: break-word; }

.doc-body hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* A leading bold pseudo-heading that legacy content uses as a title */
.doc-body p:first-child > strong:only-child {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

/* ---------- Support / generic content ---------- */
.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-sm);
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 980px;
  margin: 40px auto 0;
  padding: 28px clamp(16px, 5vw, 40px) 48px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: .88rem;
}
.site-footer a { color: var(--text-soft); font-weight: 600; }
.site-footer .foot-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- 404 ---------- */
.center-screen {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  text-align: center;
}
.center-screen .code {
  font-size: clamp(4rem, 18vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.center-screen h1 { margin: 8px 0 6px; font-size: 1.5rem; }
.center-screen p { color: var(--text-soft); max-width: 42ch; margin: 0 auto 24px; }
