/* ============================================================================
   FOUNDERS ALLEY APP · SHELL
   Phone first: a top bar with the wordmark, messages and notifications, and
   a five-tab bar in the thumb zone (Home, Connect, Events, Learn, You).
   From 1000px (tablet landscape and laptops) the tab bar becomes a left
   rail and screens that have a list and a detail show both at once.
   ========================================================================== */

#app{ min-height:100dvh; display:flex; flex-direction:column; }

.app-frame{ display:flex; min-height:100dvh; }
.app-col{ flex:1; min-width:0; display:flex; flex-direction:column; }

/* ------------------------------------------------------------------ top bar */
.topbar{
  position:sticky; top:0; z-index:40;
  background:var(--surface); border-bottom:1px solid var(--border);
  padding-top:env(safe-area-inset-top);
}
.topbar::before{ content:""; display:block; height:3px; background:var(--ramp); }
.topbar-inner{ display:flex; align-items:center; gap:8px; height:var(--topbar-h); padding:0 var(--s-2) 0 var(--gutter); max-width:var(--content-max); margin:0 auto; width:100%; }
/* The approved "FOUNDERS Alley" wordmark, set at 20px tall on the phone. */
.brand{ display:flex; align-items:center; min-height:var(--tap); }
.logo-wordmark{ display:block; height:20px; width:auto; }
.logo-lockup{ display:block; height:84px; width:auto; }
.topbar .city{ display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:0 12px; border-radius:var(--r-pill); background:var(--c-services-50); color:var(--c-services-ink); font-weight:700; font-size:var(--fs-14); }
.topbar .city .ic{ width:14px; height:14px; }
.topbar .grow{ flex:1; }

/* ------------------------------------------------------------------- main */
.app-main{ flex:1; width:100%; max-width:var(--content-max); margin:0 auto; padding:var(--s-4) var(--gutter) calc(var(--tabbar-h) + var(--s-8) + env(safe-area-inset-bottom)); }
.screen-title{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:var(--s-4); }
.screen-title .display{ font-size:var(--fs-30); }
.screen-title .sub{ color:var(--text-muted); font-size:var(--fs-15); margin-top:2px; }

/* Back link: the first action on any screen below a tab home. It is a real
   link that names the destination, because a PWA opened cold on a deep link
   has no history to go back to. */
.back{ display:inline-flex; align-items:center; gap:6px; min-height:var(--tap); font-weight:700; font-size:var(--fs-15); color:var(--ink-600); margin:-8px 0 4px -6px; padding:0 6px; }
.back .ic{ width:18px; height:18px; }

/* ------------------------------------------------------------------ tab bar */
.tabbar{
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  background:var(--surface); border-top:1px solid var(--border);
  padding-bottom:env(safe-area-inset-bottom);
}
.tabbar-inner{ display:grid; grid-template-columns:repeat(5,1fr); height:var(--tabbar-h); max-width:640px; margin:0 auto; }
.tab{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; color:var(--ink-500); font-size:var(--fs-12); font-weight:700; letter-spacing:.02em; position:relative; }
.tab .ic{ width:24px; height:24px; }
.tab[aria-current="page"]{ color:var(--ink-900); }
.tab[aria-current="page"]::before{ content:""; position:absolute; top:0; left:50%; transform:translateX(-50%); width:28px; height:3px; background:var(--magenta); }
.tab .dot{ position:absolute; top:8px; left:calc(50% + 6px); width:8px; height:8px; border-radius:50%; background:var(--magenta); box-shadow:0 0 0 2px var(--surface); }

/* --------------------------------------------------------------------- rail */
.rail{ display:none; }

@media (min-width:1000px){
  .tabbar{ display:none; }
  .rail{
    display:flex; flex-direction:column; gap:4px;
    width:var(--rail-w); flex:none; position:sticky; top:0; height:100dvh;
    padding:20px 14px; background:var(--surface); border-right:1px solid var(--border);
  }
  .rail::before{ content:""; display:block; height:3px; background:var(--ramp); margin:-20px -14px 18px; }
  .rail .brand{ padding:4px 10px 18px; }
  .rail .logo-wordmark{ height:22px; }
  .rail .tab{ flex-direction:row; justify-content:flex-start; gap:12px; min-height:var(--tap); padding:0 12px; border-radius:var(--r-md); font-size:var(--fs-15); }
  .rail .tab[aria-current="page"]{ background:var(--ink-100); }
  .rail .tab[aria-current="page"]::before{ left:0; top:50%; transform:translateY(-50%); width:3px; height:24px; }
  .rail .tab .dot{ position:static; margin-left:auto; box-shadow:none; }
  .rail .rail-foot{ margin-top:auto; padding:12px 10px; font-size:var(--fs-13); color:var(--text-muted); line-height:1.4; }
  .topbar::before{ display:none; }
  .topbar .brand{ display:none; }
  .topbar-inner{ padding:0 var(--gutter); }
  .app-main{ padding-bottom:var(--s-10); }
  .screen-title .display{ font-size:var(--fs-36); }
}

/* -------------------------------------------------------- two-pane layouts */
.two-pane{ display:grid; grid-template-columns:minmax(0,1fr); gap:var(--s-5); }
.two-pane > *{ min-width:0; }
@media (min-width:1000px){
  .two-pane{ grid-template-columns:minmax(0,3fr) minmax(0,2fr); align-items:start; }
  .two-pane.pane-40-60{ grid-template-columns:minmax(0,2fr) minmax(0,3fr); }
  .two-pane > .pane-sticky{ position:sticky; top:calc(var(--topbar-h) + var(--s-4)); }
}
.feed-layout{ display:grid; grid-template-columns:minmax(0,1fr); gap:var(--s-5); }
.feed-layout > *{ min-width:0; }
@media (min-width:1000px){
  .feed-layout{ grid-template-columns:minmax(0,7fr) minmax(280px,4fr); align-items:start; }
  .feed-layout > aside{ position:sticky; top:calc(var(--topbar-h) + var(--s-4)); display:flex; flex-direction:column; gap:var(--s-4); }
}
.feed-layout > aside{ display:none; }
@media (min-width:1000px){ .feed-layout > aside{ display:flex; } }

/* ------------------------------------------------------------- entry screens */
.entry{ min-height:100dvh; display:grid; background:var(--canvas); }
.entry-art{ display:none; position:relative; background:var(--ink-900); overflow:hidden; }
.entry-art > svg.art, .entry-art > img.photo{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
/* A scrim under the copy, so white type never sits on a bright stripe. */
.entry-art::after{ content:""; position:absolute; inset:0; background:linear-gradient(180deg,rgba(11,11,30,0) 35%,rgba(11,11,30,.94) 70%); }
.entry-art .art-copy{ z-index:1; }
.entry-art .art-copy{ position:absolute; left:40px; right:40px; bottom:40px; color:#fff; }
.entry-art .art-copy .display{ color:#fff; font-size:var(--fs-44); }
.entry-art .art-copy p{ margin-top:12px; font-size:var(--fs-18); color:#E4E5EE; max-width:34ch; }
.entry-art .cities{ display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; }
.entry-art .cities .chip{ font-weight:700; }
.entry-body{ display:flex; flex-direction:column; padding:0 var(--gutter) var(--s-8); max-width:520px; width:100%; margin:0 auto; }
.entry-body .ramp{ margin:0 calc(-1 * var(--gutter)) var(--s-6); }
.entry-logo{ padding:var(--s-2) 0 var(--s-8); }
.entry-body h1.display{ font-size:var(--fs-36); margin-bottom:8px; }
.entry-body .lede{ color:var(--text-muted); font-size:var(--fs-16); margin-bottom:var(--s-6); }
.entry-options{ display:flex; flex-direction:column; gap:12px; }
.entry-or{ display:flex; align-items:center; gap:12px; color:var(--text-muted); font-size:var(--fs-13); font-weight:700; letter-spacing:.08em; text-transform:uppercase; margin:var(--s-2) 0; }
.entry-or::before,.entry-or::after{ content:""; flex:1; height:1px; background:var(--border); }
.entry-foot{ margin-top:auto; padding-top:var(--s-8); font-size:var(--fs-13); color:var(--text-muted); line-height:1.5; display:flex; flex-direction:column; gap:var(--s-3); }
.entry-foot .callout{ font-size:var(--fs-13); color:var(--ink-600); padding:12px 14px; }
.entry-art img.photo{ object-position:var(--focal, 50% 50%); }
.entry-art img.photo.fade-in{ animation:fade 480ms var(--ease) both; }
@media (prefers-reduced-motion:reduce){ .entry-art img.photo.fade-in{ animation:none; } }
/* The city on the skyline, and the way to change it. A solid ink backing keeps
   the white words readable over a bright sky. */
.city-pill{ position:absolute; z-index:2; top:var(--s-8); left:40px; display:inline-flex; align-items:center; gap:6px; min-height:var(--tap); padding:0 14px 0 12px; border-radius:var(--r-pill); background:rgba(11,11,30,.74); border:1px solid rgba(255,255,255,.3); color:#fff; font-size:var(--fs-15); font-weight:700; cursor:pointer; }
.city-pill .ic{ width:18px; height:18px; }
.city-pill .pill-chev{ width:16px; height:16px; transform:rotate(90deg); opacity:.85; }
.city-pill:hover{ background:rgba(11,11,30,.88); }
.city-pill:focus-visible{ outline:3px solid #fff; outline-offset:2px; }
.field .label-text{ font-size:var(--fs-14); font-weight:700; color:var(--ink-900); }
/* The campaign color bar along the photo's bottom edge, the same bar the app
   icon carries. Above the scrim so it reads at full color. */
.entry-art .art-ramp{ position:absolute; left:0; right:0; bottom:0; height:6px; background:var(--ramp); z-index:2; }
.entry-art .art-logo{ display:none; }
@media (min-width:1000px){
  .entry{ grid-template-columns:minmax(0,11fr) minmax(0,9fr); }
  /* The panel stays the height of the screen while a long form (onboarding)
     scrolls beside it, so its words and color bar stay in view. */
  .entry-art{ display:block; position:sticky; top:0; height:100dvh; align-self:start; }
  .entry-body{ justify-content:center; padding:var(--s-10) var(--s-10); max-width:none; }
  .entry-body .ramp{ display:none; }
}
/* Get in on a phone: the skyline becomes a band across the top with the
   reversed logo on it. A dark band at the top keeps the white logo off the
   bright sky, and the darker bottom carries the headline. */
@media (max-width:999.98px){
  .entry-auth{ grid-template-rows:auto 1fr; }
  .entry-auth .entry-art{ display:block; height:clamp(300px, 44dvh, 380px); }
  .entry-auth .entry-art::after{ background:linear-gradient(180deg, rgba(11,11,30,.62) 0%, rgba(11,11,30,.18) 26%, rgba(11,11,30,.12) 40%, rgba(11,11,30,.9) 80%); }
  .entry-auth .art-logo{ display:block; position:absolute; z-index:1; top:calc(var(--s-5) + env(safe-area-inset-top, 0px)); left:var(--gutter); }
  .entry-auth .city-pill{ top:calc(var(--s-5) + 4px + env(safe-area-inset-top, 0px)); left:auto; right:var(--gutter); }
  .entry-auth .art-logo img{ display:block; height:68px; width:auto; }
  .entry-auth .art-copy{ left:var(--gutter); right:var(--gutter); bottom:var(--s-6); }
  .entry-auth .art-copy .display{ font-size:var(--fs-36); line-height:1.02; }
  .entry-auth .art-copy p{ margin-top:8px; font-size:var(--fs-15); }
  .entry-auth .entry-art .cities{ margin-top:14px; }
  .entry-auth .entry-body{ padding-top:var(--s-8); }
  .entry-auth .entry-body > .ramp, .entry-auth .entry-logo{ display:none; }
  .entry-auth.entry-compact .entry-art{ height:calc(140px + env(safe-area-inset-top, 0px)); }
  .entry-auth.entry-compact .art-copy{ display:none; }
  .entry-auth.entry-compact .entry-art::after{ background:linear-gradient(180deg, rgba(11,11,30,.62) 0%, rgba(11,11,30,.3) 70%, rgba(11,11,30,.45) 100%); }
}
/* Short phones (an iPhone SE is 667 tall) keep every way in above the fold by
   giving the band less height and dropping the sentence under the headline. */
@media (max-width:999.98px) and (max-height:720px){
  .entry-auth .entry-art{ height:268px; }
  .entry-auth .art-logo img{ height:60px; }
  .entry-auth .art-copy p{ display:none; }
  .entry-auth .entry-body{ padding-top:var(--s-6); }
  .entry-auth.entry-compact .entry-art{ height:calc(124px + env(safe-area-inset-top, 0px)); }
}

/* onboarding progress: three hard steps */
.steps{ display:flex; gap:6px; margin-bottom:var(--s-6); }
.steps span{ flex:1; height:6px; background:var(--ink-200); }
.steps span.done{ background:var(--ink-900); }
.steps span.now{ background:var(--magenta); }
.onb-actions{ display:flex; gap:12px; margin-top:var(--s-6); }
.onb-actions .btn{ flex:1; }
