/* layout.css — shell, responsive grid (desktop 3-col + mobile bottom-nav) */

/* ─────────────────────────── Shell layout ─────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--left-nav-w) minmax(0, 1fr) var(--right-rail-w);
  gap: var(--gutter-lg);
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-5) var(--sp-10);
  min-height: 100vh;
}
.shell-2col { grid-template-columns: var(--left-nav-w) minmax(0, 1fr); }
.shell-1col { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
.shell-full { grid-template-columns: minmax(0, 1fr); max-width: 100%; padding: 0; }

.shell-left   { position: sticky; top: calc(var(--header-h) + var(--sp-5)); align-self: start; max-height: calc(100vh - var(--header-h) - var(--sp-10)); overflow-y: auto; padding-right: 4px; }
.shell-main   { min-width: 0; }
.shell-right  { position: sticky; top: calc(var(--header-h) + var(--sp-5)); align-self: start; max-height: calc(100vh - var(--header-h) - var(--sp-10)); overflow-y: auto; padding-left: 4px; display: flex; flex-direction: column; gap: var(--sp-4); }

/* ─────────────────────────── Header (top bar) ─────────────────────────── */
.header {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; align-items: center; gap: var(--sp-5);
  height: var(--header-h);
  background: rgba(7, 16, 27, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border-2);
  padding: 0 var(--sp-5);
}
/* The logo keeps its size; the search box is what gives way. With the logo
   allowed to shrink, a tablet-width header (scores, Create, tokens, Invite…)
   squeezed the 5.7:1 wordmark into a 48px-wide box. */
.header > .logo { flex: 0 0 auto; }
.header-search { flex: 1; min-width: 0; max-width: 520px; position: relative; }
.header-actions { display: flex; align-items: center; gap: var(--sp-3); }
.header-icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-text-2); cursor: pointer;
  position: relative; transition: background 0.12s ease;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--c-text); }
.header-icon-btn .dot-badge { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--c-red); border-radius: 50%; }

.streak {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(255, 200, 61, 0.10); border: 1px solid rgba(255, 200, 61, 0.30);
  color: var(--c-gold); font-size: var(--fs-xs); font-weight: 700;
}

/* ─────────────────────────── Left nav (sidebar) ─────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: var(--sp-2); }
.sidebar-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--c-dim); padding: var(--sp-4) var(--sp-3) var(--sp-2); }

/* ─────────────────────────── Mobile header + bottom nav ─────────────────────────── */
.mobile-header {
  display: none;
  position: sticky; top: 0; z-index: var(--z-header);
  /* The inset is padding inside a border-box, so add it to the height. A bare
     56px under a 59px iPhone inset left a 0px content box: the icons spilled
     under the status bar and onto the page below. */
  height: calc(var(--mobile-header-h) + env(safe-area-inset-top, 0px));
  background: rgba(7, 16, 27, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border-2);
  padding: 0 var(--sp-4);
  align-items: center;
  gap: var(--sp-3);
  padding-top: env(safe-area-inset-top);
}

.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-header);
  height: var(--mobile-bottom-h);
  background: rgba(11, 18, 32, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--c-border-2);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); height: 100%; }
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--c-muted); cursor: pointer;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
}
.bottom-nav-item.active { color: var(--c-lime); }
.bottom-nav-item .icon { font-size: 22px; line-height: 0; }
.bottom-nav-item .icon iconify-icon { display: block; }
.bottom-nav-cta iconify-icon { display: block; }
.bottom-nav-cta {
  position: relative; top: -16px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--c-lime); color: #0A0F1A;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px var(--c-lime-glow), 0 0 0 4px var(--c-bg);
  margin: 0 auto;
}

/* ─────────────────────────── Responsive ─────────────────────────── */
@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--left-nav-w) minmax(0, 1fr); }
  /* Landscape tablets get the desktop header without the room for it: the
     logo, scores ticker and nine actions came to ~1076px at 900px wide, and the
     page scrolled sideways. The Invite button keeps its icon here, and the
     ticker goes below 1000px (scores are on the feed itself). */
  .header .fp-invite-label { display: none; }
  .shell-right { display: none; }
}

@media (max-width: 1000px) {
  .header .fp-ticker { display: none; }
}

@media (max-width: 880px) {
  :root {
    --gutter: 12px;
    --gutter-lg: 16px;
  }
  .header { display: none; }
  .mobile-header { display: flex; }
  .bottom-nav   { display: block; }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--sp-4) var(--sp-4) calc(var(--mobile-bottom-h) + var(--sp-6));
    gap: var(--sp-4);
  }
  .shell-left { display: none; }
  .shell-right { display: none; }

  body { font-size: var(--fs-sm); }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  h3 { font-size: var(--fs-lg); }

  .card, .post { padding: var(--sp-4); border-radius: var(--r-md); }
}

/* iOS-like swipe-area at bottom */
@media (max-width: 880px) {
  .bottom-nav::after {
    content: ''; position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 4px);
    transform: translateX(-50%); width: 124px; height: 4px; border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
  }
}

/* Page sections inside main */
.section { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.section-title { display: flex; align-items: center; justify-content: space-between; }
.section-title h2 { font-size: var(--fs-xl); }
.section-action { font-size: var(--fs-sm); color: var(--c-lime); cursor: pointer; }

/* Hero (marketing pages) */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--sp-12) var(--sp-5);
  text-align: center;
}
.hero-eyebrow { color: var(--c-lime); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; font-size: var(--fs-xs); margin-bottom: var(--sp-3); }
.hero h1 {
  font-size: clamp(40px, 6vw, 72px); line-height: 0.96;
  margin: 0 auto var(--sp-4);
}
.hero p.lede { font-size: var(--fs-lg); color: var(--c-text-2); max-width: 640px; margin: 0 auto var(--sp-6); }
.hero-cta { display: inline-flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center; }
.hero-orb { position: absolute; right: -10%; top: -10%; }
.hero-orb-2 { position: absolute; left: -10%; bottom: -20%; opacity: 0.6; }

/* Container helpers */
.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--sp-5); }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 var(--sp-5); }

/* Marketing nav (top, public pages) */
.market-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border-2);
}
.market-nav-links { display: flex; gap: var(--sp-6); }
.market-nav-links a { color: var(--c-text-2); font-size: var(--fs-sm); font-weight: 500; }
.market-nav-links a:hover { color: var(--c-lime); }

@media (max-width: 880px) {
  .market-nav-links { display: none; }
}

/* Footer */
.footer {
  border-top: 1px solid var(--c-border-2);
  padding: var(--sp-10) var(--sp-5) var(--sp-8);
  color: var(--c-muted);
  font-size: var(--fs-sm);
  text-align: center;
}
.footer-links { display: flex; gap: var(--sp-5); justify-content: center; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.footer-links a:hover { color: var(--c-lime); }

/* Blank headshot (fp_ph_person() / data-fallback="person"): fills its frame. */
.fp-ph-person {
  display: grid;
  place-items: end center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--fp-surface-raised);
  color: var(--fp-dim);
}
.fp-ph-person svg { width: 80%; height: 80%; fill: currentColor; }
