/* Public chrome that is not the marketing page: the auth screens and site error pages.
 *
 * `auth_shell` (sign-in, sign-up, password reset, spent links, invite joins) and
 * `site_shell` (a 404 or 500 on the public host) load this on top of `app.css`. The
 * marketing page is `landing.css` with `site.js`, a separate design that loads neither
 * this file nor `app.css`, so a rule written for it belongs there, not here.
 */

/* ─────────────────────────────────────────────────────────── site nav ── */

.site { background: var(--canvas); }

.sitebar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid transparent;
  transition: background var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.sitebar-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  width: min(1180px, 100% - var(--sp-8));
  min-height: 66px;
  margin: 0 auto;
}
.sitenav { display: flex; gap: var(--sp-1); }
.sitenav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: var(--text-md);
  font-weight: 550;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.sitenav a:hover { background: var(--surface); color: var(--ink); }
.sitebar-menu { display: none; }
.sitenav .only-sm { display: none; }

@media (max-width: 860px) {
  /* The bar keeps the brand, one call to action and the menu. Everything else
   * moves into the dropdown — at 375px the full row is ~450px of content in
   * 343px of space, and something has to give. */
  .sitebar .theme-toggle,
  .sitebar .btn.quiet { display: none; }
  .sitenav .only-sm { display: inline-flex; }
  .sitenav {
    position: absolute;
    left: var(--sp-4);
    right: var(--sp-4);
    top: 100%;
    flex-direction: column;
    padding: var(--sp-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-raised);
    box-shadow: var(--shadow-lg);
  }
  .sitenav[hidden] { display: none; }
  .sitenav a { min-height: 42px; }
  .sitebar-menu { display: inline-grid; order: 3; }
  .sitebar-inner { position: relative; gap: var(--sp-3); }
}

/* ──────────────────────────────────────────────────────────── footer ── */

.sitefoot { border-top: 1px solid var(--line); background: var(--surface); }
.sitefoot-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
  gap: clamp(32px, 5vw, 72px);
  width: min(1180px, 100% - var(--sp-8));
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) 0 var(--sp-10);
}
.sitefoot-brand p { max-width: 34ch; margin: var(--sp-4) 0 0; color: var(--ink-muted); font-size: var(--text-md); line-height: 1.55; }
.sitefoot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-6); }
.sitefoot-cols > div { display: grid; gap: var(--sp-2); align-content: start; }
.sitefoot-head { color: var(--ink); font-size: var(--text-xs); font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.sitefoot-cols a { color: var(--ink-muted); font-size: var(--text-md); text-decoration: none; }
.sitefoot-cols a:hover { color: var(--accent); }
.sitefoot-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  width: min(1180px, 100% - var(--sp-8));
  margin: 0 auto;
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: var(--text-sm);
}
@media (max-width: 800px) {
  .sitefoot-inner { grid-template-columns: minmax(0, 1fr); }
}

/* ──────────────────────────────────────────────────────────────- auth ── */

.auth-body { background: var(--canvas); }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.auth-form-side { display: grid; grid-template-rows: auto 1fr auto; padding: var(--sp-6) clamp(var(--sp-5), 5vw, var(--sp-12)); }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-form { display: grid; align-content: center; width: min(400px, 100%); margin: 0 auto; padding: var(--sp-10) 0; }
.auth-form h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  font-weight: 660;
  letter-spacing: -.026em;
}
.auth-form > p { margin: var(--sp-2) 0 var(--sp-8); color: var(--ink-muted); font-size: var(--text-md); }
.auth-bottom { color: var(--ink-muted); font-size: var(--text-sm); }
.auth-bottom a { color: var(--ink-muted); text-decoration: none; }
.auth-bottom a:hover { color: var(--ink); }

.sso { display: grid; gap: var(--sp-2); }
.sso .btn { justify-content: center; }
.sso-glyph { flex: none; width: 17px; height: 17px; }
.divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-6) 0;
  color: var(--ink-faint);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { margin: var(--sp-6) 0 0; color: var(--ink-muted); font-size: var(--text-md); text-align: center; }
.auth-fine { margin: var(--sp-5) 0 0; color: var(--ink-faint); font-size: var(--text-xs); line-height: 1.55; text-align: center; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.field-row a { font-size: var(--text-xs); font-weight: 600; text-decoration: none; }

.auth-aside {
  position: relative;
  display: grid;
  align-content: center;
  gap: var(--sp-8);
  padding: clamp(var(--sp-8), 5vw, var(--sp-16));
  overflow: hidden;
  background: linear-gradient(155deg, var(--a-800), var(--a-600) 52%, var(--a-500));
  color: #fff;
}
.auth-aside::before {
  content: "";
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(38% 34% at 26% 28%, rgba(255, 255, 255, .22), transparent 70%),
    radial-gradient(34% 30% at 74% 66%, color-mix(in srgb, var(--m-300) 44%, transparent), transparent 70%);
  filter: blur(16px);
  animation: drift 26s var(--ease-in-out) infinite alternate;
}
@keyframes drift {
  to { transform: translate3d(-3%, 2%, 0) scale(1.07); }
}
.auth-aside > * { position: relative; }
.auth-quote {
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.15rem);
  font-weight: 620;
  letter-spacing: -.024em;
  line-height: 1.2;
}
.auth-quote .u {
  border-radius: 3px;
  background: color-mix(in srgb, var(--m-300) 82%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--m-300) 82%, transparent);
  color: var(--n-900);
}
.auth-points { display: grid; gap: var(--sp-4); margin: 0; padding: 0; list-style: none; }
.auth-points li { display: flex; gap: var(--sp-3); align-items: flex-start; color: rgba(255, 255, 255, .9); font-size: var(--text-md); line-height: 1.5; }
.auth-points svg { flex: none; margin-top: 2px; }

@media (max-width: 880px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-aside::before { animation: none; }
}
