/* Oddsprey v2 base: reset, type, layout shell (header, bottom tab bar, footer). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.v2 {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-base)/1.6 var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
.v2 main { flex: 1 0 auto; }
.v2 img { max-width: 100%; height: auto; }
.v2 a { color: var(--accent); text-decoration: none; }
.v2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.v2 :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.v2 h1, .v2 h2, .v2 h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; font-weight: 700; }
.v2 h1 { font-size: var(--fs-3xl); }
.v2 h2 { font-size: var(--fs-xl); }
.v2 h3 { font-size: var(--fs-md); letter-spacing: -.01em; }
.v2 p { margin: 0; }
.v2 .num, .v2 .tnum { font-variant-numeric: tabular-nums; }
.v2 .muted { color: var(--muted); }
.v2 .wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s-4); }
.v2 .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.v2 .skip-link { position: absolute; left: var(--s-4); top: -60px; z-index: 50; padding: var(--s-2) var(--s-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.v2 .skip-link:focus { top: var(--s-2); }
@media (min-width: 760px) { .v2 .wrap { padding: 0 var(--s-6); } }

/* ── header: glass, sticky ─────────────────────────────────────────────── */
.v2-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--header-glass);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.v2-header .wrap { display: flex; align-items: center; gap: var(--s-6); height: var(--header-h); }
.v2-brand { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--text) !important;
  font-weight: 700; font-size: var(--fs-md); letter-spacing: -.01em; text-decoration: none !important; }
.v2-brand img { width: 28px; height: 28px; }
.v2-nav { display: flex; gap: var(--s-1); flex: 1; }
.v2-nav a { color: var(--muted); font-size: 14px; font-weight: 500; padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm); text-decoration: none; }
.v2-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.v2-nav a[aria-current="page"] { color: var(--text); }
.v2-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.v2-theme-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--muted);
  cursor: pointer; }
.v2-theme-btn:hover { color: var(--text); background: var(--surface); }
.v2-theme-btn svg { width: 18px; height: 18px; }
.v2-theme-btn .i-sun { display: none; }
[data-theme="light"] .v2-theme-btn .i-sun { display: block; }
[data-theme="light"] .v2-theme-btn .i-moon { display: none; }

@media (max-width: 1099px) {
  .v2-header .wrap { gap: var(--s-4); }
  .v2-nav a { padding: var(--s-2); }
}
@media (max-width: 899px) {
  .v2-nav { display: none; }
}
@media (max-width: 759px) {
  .v2-actions .v2-hide-sm { display: none; }
}

/* ── bottom tab bar, phones only ────────────────────────────────────────── */
.v2-tabbar { display: none; }
@media (max-width: 759px) {
  body.v2 { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .v2-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--header-glass);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--line);
  }
  .v2-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 44px; color: var(--muted); font-size: 11px; font-weight: 500;
    text-decoration: none; }
  .v2-tabbar a svg { width: 22px; height: 22px; }
  .v2-tabbar a[aria-current="page"] { color: var(--accent); }
}

/* ── footer ─────────────────────────────────────────────────────────────── */
.v2-footer { border-top: 1px solid var(--line); margin-top: var(--s-16); padding: var(--s-8) 0; color: var(--muted);
  font-size: var(--fs-sm); }
.v2-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-8); align-items: center; }
.v2-footer nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.v2-footer nav a { color: var(--muted); }
.v2-footer nav a:hover { color: var(--text); }
.v2-rg { display: flex; align-items: center; gap: var(--s-3); margin-left: auto; }
.v2-rg-badge { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--muted); color: var(--text); font-weight: 700; font-size: 11px; flex: none; }
@media (max-width: 759px) { .v2-rg { margin-left: 0; } }

@media (prefers-reduced-motion: reduce) {
  .v2 *, .v2 *::before, .v2 *::after { transition: none !important; animation: none !important; }
}
