/* ViewOnPhone — shared styles for content pages (blog, device reference) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117; --bg2: #1a1d27; --bg3: #22263a; --border: #2e3354;
  --accent: #6c63ff; --accent2: #8b83ff;
  --text: #e8eaf6; --text2: #9096b8; --text3: #555f85;
  --radius: 12px;
}
/* Dark is the default. Light only when the app toggle stored a preference. */
:root[data-theme="light"] {
  --bg: #f0f2fa; --bg2: #ffffff; --bg3: #e8eaff; --border: #d0d4f0;
  --text: #1a1d2e; --text2: #4a5480; --text3: #7078a0;
}
html { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; flex-direction: column; line-height: 1.6;
}
a { color: var(--accent2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

header.site {
  padding: 0 24px; height: 60px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border);
  background: var(--bg2); position: sticky; top: 0; z-index: 100;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text); }
.logo-icon {
  width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.logo span { color: var(--accent2); }
header.site nav { display: flex; gap: 18px; align-items: center; }
header.site nav a { font-size: 13px; color: var(--text2); text-decoration: none; font-weight: 500; }
header.site nav a:hover { color: var(--accent); }

main.doc { flex: 1; max-width: 760px; width: 100%; margin: 0 auto; padding: 44px 24px 72px; }
main.wide { max-width: 1000px; }

.crumbs { font-size: 12px; color: var(--text3); margin-bottom: 20px; }
.crumbs a { color: var(--text3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

h1 { font-size: 30px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 700; margin: 36px 0 12px; }
h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
.doc p { color: var(--text2); margin-bottom: 14px; }
.doc ul, .doc ol { color: var(--text2); margin: 0 0 14px 20px; display: flex; flex-direction: column; gap: 6px; }
.doc li { line-height: 1.6; }
.lede { font-size: 17px; color: var(--text); margin-bottom: 24px; }
.meta { font-size: 13px; color: var(--text3); margin-bottom: 28px; }

pre, code { font-family: 'JetBrains Mono', ui-monospace, monospace; }
code { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; }
pre { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; overflow-x: auto; margin-bottom: 16px; }
pre code { background: none; padding: 0; font-size: 13px; }

.callout {
  background: rgba(108,99,255,.1); border: 1px solid rgba(108,99,255,.28);
  border-radius: 10px; padding: 14px 18px; margin: 18px 0; font-size: 14px; color: var(--text2);
}
.cta {
  display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 4px;
  padding: 10px 20px; background: var(--accent); color: #fff; border-radius: 10px;
  font-weight: 600; font-size: 14px; text-decoration: none;
}
.cta:hover { opacity: .92; color: #fff; }

table.devices { width: 100%; border-collapse: collapse; margin: 12px 0 28px; font-size: 13px; }
table.devices th, table.devices td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
table.devices th { color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
table.devices td { color: var(--text2); }
table.devices td a { text-decoration: none; }
table.devices tr:hover td { background: var(--bg2); }
.dim { font-family: 'JetBrains Mono', monospace; color: var(--text3); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 28px; }
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; text-decoration: none; color: var(--text); display: block;
}
.card:hover { border-color: var(--accent); }
.card .t { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.card .d { font-size: 12px; color: var(--text3); }

.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.post-list li { border-bottom: 1px solid var(--border); }
.post-list a { display: block; padding: 18px 0; text-decoration: none; color: var(--text); }
.post-list a:hover .pt { color: var(--accent); }
.post-list .pt { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.post-list .pd { font-size: 13px; color: var(--text3); }

footer.site {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; font-size: 12px; color: var(--text3);
  border-top: 1px solid var(--border); background: var(--bg2); flex-wrap: wrap;
}
footer.site a { color: var(--text3); text-decoration: none; }
footer.site a:hover { color: var(--accent); }
footer.site .links { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 560px) {
  header.site nav a:not(.logo) { display: none; }
  h1 { font-size: 24px; }
}

/* ---------- donate button ---------- */
.vop-donate {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-radius: 999px; border: none;
  text-decoration: none; cursor: pointer;
  font-weight: 800; font-size: .85rem; letter-spacing: .3px; white-space: nowrap;
  color: #3a0a12; background: linear-gradient(90deg, #fbbf24, #fb7185);
  box-shadow: 0 6px 24px rgba(251,113,133,.35);
  animation: vopDonatePulse 2.6s ease-in-out infinite;
  transition: transform .15s, box-shadow .15s;
}
.vop-donate:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 10px 32px rgba(251,113,133,.55); color: #3a0a12; }
.vop-donate .heart { font-size: 1.1rem; line-height: 1; }
@keyframes vopDonatePulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(251,113,133,.35), 0 0 0 0 rgba(251,191,36,.45); }
  50%      { box-shadow: 0 6px 24px rgba(251,113,133,.5),  0 0 0 9px rgba(251,191,36,0); }
}
@media (prefers-reduced-motion: reduce) { .vop-donate { animation: none; } }
@media (max-width: 680px) {
  .vop-donate { right: 14px; bottom: 14px; padding: 14px; border-radius: 50%; }
  .vop-donate .label { display: none; }
  .vop-donate .heart { font-size: 1.3rem; }
}
