/* Rockmoon site-wide theme — GitHub-dark palette + Inter / SF Mono.
   Ported from the status page. Every other page extends templates/base.html
   which links this stylesheet, so palette changes propagate everywhere. */

:root {
  --bg:         #0d1117;
  --bg-soft:    #0a0e14;
  --surface:    #161b22;
  --surface-2:  #1c2128;
  --border:     #30363d;
  --border-soft:#21262d;
  --text:       #e6edf3;
  --muted:      #8b949e;
  --muted-2:    #6e7681;
  --accent:     #58a6ff;
  --accent-dim: rgba(88, 166, 255, 0.12);
  --green:      #3fb950;
  --yellow:     #d29922;
  --red:        #f85149;
  --purple:     #a371f7;
  --gradient:   linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Sticky nav (~56px tall) covers the top of the viewport. When the user
   clicks an in-page anchor (e.g. #quickstart), the browser otherwise
   scrolls the target heading flush to the top — behind the nav. This
   reserves enough scroll padding above any [id] target so the heading
   lands below the nav with a small breathing strip. */
html { scroll-padding-top: 80px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono {
  font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}

/* ───────── Sticky nav ───────── */
nav.site {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}
nav.site .container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
nav.site .row {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
nav.site .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em;
  color: var(--text);
}
nav.site .brand:hover { text-decoration: none; }
nav.site .brand .dot { color: var(--accent); }
nav.site .brand .badge {
  font-size: 0.65rem; padding: 2px 6px;
  background: var(--accent-dim); color: var(--accent);
  border-radius: 4px; font-weight: 600; letter-spacing: 0.04em;
}
nav.site .links { display: flex; gap: 24px; flex: 1; margin-left: 16px; }
nav.site .links a {
  color: var(--muted); font-size: 0.9rem;
  position: relative; padding: 4px 0;
}
nav.site .links a:hover,
nav.site .links a.active { color: var(--text); text-decoration: none; }
nav.site .links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -16px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav-icon { display: none; }
.nav-icon,
.mobile-site-tabs svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mobile-site-tabs { display: none; }
nav.site .cta {
  background: var(--accent); color: var(--bg);
  padding: 7px 16px; border-radius: 6px; font-weight: 600;
  font-size: 0.88rem; transition: background 0.12s;
  display: inline-flex; align-items: center;
}
nav.site .cta:hover { background: #4493f8; text-decoration: none; }

/* ───────── Signed-in nav avatar + dropdown ───────── */

/* Reserved nav-right slot — width fixed to fit either the Sign-in CTA
   or the avatar, so the boot script's signin → avatar swap doesn't
   reflow the rest of the nav row when the session probe lands. */
.nav-cta-slot {
  min-width: 110px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.user-menu { position: relative; display: inline-block; }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-weight: 600; font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
.user-avatar:hover { box-shadow: 0 4px 14px rgba(88, 166, 255, 0.30); }
.user-avatar:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.35);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  padding: 6px;
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s, transform 0.12s, visibility 0.12s;
  z-index: 60;
}
.user-dropdown.open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.user-dropdown-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 6px;
}
.user-email-label {
  font-size: 0.68rem; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; margin-bottom: 3px;
}
.user-email {
  color: var(--text); font-size: 0.92rem;
  font-weight: 500;
  word-break: break-all;
  margin-bottom: 8px;
}
.user-plan-line { display: flex; }
.user-plan-pill {
  font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 100px;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.25);
}
.user-plan-pill.pro   { background: rgba(63, 185, 80, 0.10);  color: var(--green);  border-color: rgba(63, 185, 80, 0.25); }
.user-plan-pill.basic { background: rgba(210, 153, 34, 0.10); color: var(--yellow); border-color: rgba(210, 153, 34, 0.25); }

.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 6px;
  background: transparent; border: none;
  color: var(--text); font-family: inherit;
  font-size: 0.9rem; text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.10s, color 0.10s;
}
.user-dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text); text-decoration: none;
}
.user-dropdown-item svg { color: var(--muted); flex-shrink: 0; }
.user-dropdown-item:hover svg { color: var(--accent); }
.user-dropdown-item.logout:hover { color: var(--red); }
.user-dropdown-item.logout:hover svg { color: var(--red); }
.user-dropdown-divider {
  height: 1px; background: var(--border-soft);
  margin: 4px 8px;
}

/* ───────── Container + page head ───────── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.page-head {
  padding: 56px 0 24px;
  background: radial-gradient(ellipse 900px 400px at 50% 0%,
                              rgba(88, 166, 255, 0.05), transparent);
}
.page-head .eyebrow {
  display: inline-block;
  font-size: 0.74rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
  margin-bottom: 10px;
}
.page-head h1 {
  font-size: 2rem; letter-spacing: -0.02em;
  font-weight: 600; margin-bottom: 8px;
}
.page-head h1 .gradient {
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-head .lede { color: var(--muted); font-size: 1rem; }

/* ───────── Cards ───────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--muted-2); }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 0.92rem; font-weight: 500;
  cursor: pointer; transition: all 0.12s;
}
.btn:hover { border-color: var(--muted-2); text-decoration: none; }
.btn-primary {
  background: var(--accent); color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #4493f8; border-color: #4493f8;
  box-shadow: 0 4px 14px rgba(88,166,255,0.25);
}
.btn-gradient {
  background: var(--gradient); color: #fff; border: none;
}
.btn-gradient:hover { box-shadow: 0 6px 20px rgba(88,166,255,0.30); }

/* ───────── Footer ───────── */
footer.site {
  padding: 28px 24px; margin-top: 72px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted-2); font-size: 0.84rem;
  text-align: center;
  background: var(--bg-soft);
}
footer.site a { color: var(--muted); margin: 0 10px; }
footer.site a:hover { color: var(--text); text-decoration: none; }
footer.site .row { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
footer.site .meta {
  color: var(--muted-2); font-size: 0.78rem; margin-top: 8px;
  font-family: 'SF Mono', Menlo, monospace;
}

@media (max-width: 760px) {
  html { scroll-padding-top: 68px; }
  body {
    padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  }
  nav.site { padding: 10px 0; }
  nav.site .container-wide { padding: 0 16px; }
  nav.site .row { gap: 12px; }
  nav.site .links { display: none; }
  nav.site .brand { font-size: .96rem; }
  nav.site .cta { padding: 7px 12px; }
  .nav-cta-slot { min-width: 84px; }
  .user-dropdown {
    position: fixed;
    top: 58px;
    right: 12px;
    width: min(280px, calc(100vw - 24px));
  }
  .mobile-site-tabs {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding: 5px max(8px, env(safe-area-inset-right, 0px))
      calc(5px + env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--border);
    background: rgba(13, 17, 23, .96);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, .28);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
  }
  .mobile-site-tabs a {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 52px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 10px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-site-tabs a::before {
    content: '';
    position: absolute;
    top: 0;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: transparent;
  }
  .mobile-site-tabs a:hover { text-decoration: none; }
  .mobile-site-tabs a.active {
    background: var(--accent-dim);
    color: var(--accent);
  }
  .mobile-site-tabs a.active::before { background: var(--accent); }
  .mobile-site-tabs svg { width: 21px; height: 21px; }
  footer.site { margin-top: 48px; }
  .page-head h1 { font-size: 1.6rem; }
}
