/* ============================================================================
   Wise Guys — chrome.css
   Single source of truth for tokens, typography, and chrome (topstrip / masthead
   / nav / user-chip / footer) shared across every page.
   Round 10 — foundations refactor. Visually identical to what shipped in R2-R9.

   Page-specific CSS continues to live inline in page <style> blocks.
   ========================================================================== */

:root {
  --ink: #0E0E0E;
  --ink-2: #181716;
  --ink-3: #26231F;
  --bone: #F2EEE5;
  --bone-2: #E8E2D4;
  --paper: #FAF6EC;
  --ox: #6B1414;
  --ox-bright: #8A1A1A;
  --ox-soft: rgba(138,26,26,0.14);
  --rule: rgba(242,238,229,0.22);
  --rule-strong: rgba(242,238,229,0.44);
  --muted: #C2BAAC;
  --ok: #6FA56F;
  --warn: #C9A227;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--ink); color: var(--bone); font-family: 'Inter', system-ui, sans-serif; font-weight: 450; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
.mono { font-family: 'JetBrains Mono', monospace; }
.serif { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; }
.display { font-family: 'Oswald', 'Arial Narrow', sans-serif; font-weight: 600; letter-spacing: -0.01em; text-transform: uppercase; }

.shell { max-width: 1440px; margin: 0 auto; padding: 0 40px; }

/* Anti-FOUC: page content hidden until chrome.js resolves auth state.
   The inline guard in header.php sets html{visibility:hidden}; this flips
   it back on once <html data-ready> is set. */

/* ============ AUTH BRANCH ============
   body[data-auth="out"]  → show .auth-out, hide .auth-in
   body[data-auth="in"]   → show .auth-in, hide .auth-out
   body[data-auth="load"] → hide both (html is visibility:hidden during this window)
*/
body[data-auth="out"] .auth-in  { display: none !important; }
body[data-auth="in"]  .auth-out { display: none !important; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  background: var(--bone); color: var(--ink);
  padding: 10px 16px; font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Visually hidden */
.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; }

/* ============ TOP STRIP ============ */
.topstrip {
  border-bottom: 1px solid var(--rule);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.topstrip-inner {
  display: flex; justify-content: space-between; align-items: center;
  height: 34px;
}
.topstrip .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #C9A227; margin-right: 8px; vertical-align: 1px; animation: wg-pulse 2.2s infinite; }
body[data-auth="in"] .topstrip .dot { background: var(--ok); }
@keyframes wg-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@media (prefers-reduced-motion: reduce) { .topstrip .dot { animation: none; } }
.topstrip-right { display: flex; gap: 22px; }

/* ============ MASTHEAD / NAV ============ */
nav.masthead {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.nav-left, .nav-right { display: flex; gap: 24px; align-items: center; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.nav-right { justify-content: flex-end; }
.nav-link { color: var(--bone); opacity: 0.72; transition: opacity .2s; cursor: pointer; background: transparent; border: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.nav-link:hover { opacity: 1; }
.nav-link.active { opacity: 1; border-bottom: 1px solid var(--ox-bright); padding-bottom: 4px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px; border: 1.5px solid var(--bone); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 16px; letter-spacing: -0.02em;
}
.brand-name { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: 0.04em; text-transform: uppercase; }

.signin-btn {
  padding: 9px 18px; border: 1px solid var(--bone); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: all .2s; cursor: pointer; background: transparent; color: var(--bone); font-family: inherit;
}
.signin-btn:hover { background: var(--bone); color: var(--ink); }

/* User chip (signed-in) */
.user-chip {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--rule-strong);
  padding: 6px 8px 6px 14px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  position: relative;
}
.user-chip .uc-name { color: var(--bone); font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 12px; }
.user-chip .uc-init {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ox); color: var(--bone);
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 0;
}
.user-chip .uc-menu-btn {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 14px; padding: 0 6px;
}
.user-chip .uc-menu-btn:hover { color: var(--bone); }
.uc-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--ink); border: 1px solid var(--rule-strong);
  min-width: 220px; padding: 6px 0; z-index: 50;
  display: none;
}
.uc-dropdown.open { display: block; }
.uc-dropdown button, .uc-dropdown a {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--bone);
  font-family: inherit; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 12px 18px; cursor: pointer;
}
.uc-dropdown button:hover, .uc-dropdown a:hover { background: var(--ink-2); color: var(--ox-bright); }

/* ============ HAMBURGER + DRAWER (mobile) ============ */
.nav-hamburger {
  display: none;
  background: transparent; border: 1px solid var(--rule-strong);
  color: var(--bone); width: 44px; height: 44px;
  cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
}
.nav-hamburger span { display: block; width: 20px; height: 1.5px; background: var(--bone); transition: transform .2s, opacity .2s; }
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-drawer {
  display: none;
  position: fixed; left: 0; right: 0; top: 0; bottom: 0;
  z-index: 90;
  background: rgba(14,14,14,0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s ease-out;
  padding: 120px 28px 40px;
  overflow-y: auto;
}
.nav-drawer[data-open="true"] { display: block; opacity: 1; }
.nav-drawer .nd-inner { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; }
.nav-drawer a, .nav-drawer button.nav-link {
  display: block; padding: 18px 0;
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 28px;
  letter-spacing: 0.01em; text-transform: uppercase;
  color: var(--bone); opacity: 0.88;
  border-bottom: 1px solid var(--rule);
  text-align: left; width: 100%; background: transparent; border-left: 0; border-top: 0; border-right: 0;
}
.nav-drawer a:hover, .nav-drawer a:focus-visible,
.nav-drawer button.nav-link:hover, .nav-drawer button.nav-link:focus-visible { opacity: 1; color: var(--ox-bright); }
.nav-drawer a.active, .nav-drawer button.nav-link.active { color: var(--ox-bright); opacity: 1; }
.nav-drawer .nd-user {
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--rule-strong);
  display: flex; flex-direction: column; gap: 4px;
}
.nav-drawer .nd-user .nd-name {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase;
  padding: 12px 0;
}

/* ============ FOOTER ============ */
footer.wg-footer { padding: 80px 0 36px; border-top: 1px solid var(--rule); margin-top: 80px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px; padding-bottom: 60px; border-bottom: 1px solid var(--rule); }
.foot-brand .brand { margin-bottom: 20px; }
.foot-tag { font-family: 'Instrument Serif', serif; font-style: italic; font-size: 20px; line-height: 1.3; color: rgba(242,238,229,0.85); max-width: 340px; }
.foot-col h4 { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500; margin: 0 0 18px; }
.foot-col a { display: block; font-size: 13px; padding: 6px 0; opacity: 0.78; transition: opacity .2s; }
.foot-col a:hover { opacity: 1; }
.foot-bottom { display: flex; justify-content: space-between; padding-top: 28px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }

/* ============ RESPONSIVE ============ */
@media (max-width: 820px) {
  .shell { padding: 0 20px; }
  .topstrip-right { gap: 10px; }
  .topstrip-right span:nth-child(3) { display: none; }
  .topstrip-inner { font-size: 10px; }

  nav.masthead { grid-template-columns: auto 1fr auto; padding: 16px 0; }
  .nav-left, .nav-right { display: none; }
  .nav-hamburger { display: flex; }
  .brand { justify-self: center; }
  .brand-mark { width: 36px; height: 36px; font-size: 13px; }
  .brand-name { font-size: 16px; }

  .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; padding-bottom: 36px; }
  .foot-bottom { flex-direction: column; gap: 10px; align-items: flex-start; }
}
@media (max-width: 680px) {
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .topstrip-right span:nth-child(2) { display: none; }
  .nav-drawer a, .nav-drawer button.nav-link { font-size: 22px; padding: 14px 0; }
}
