/* Shared shell (nav + footer) for all pages.
 * Self-contained: uses .shell-* namespace to avoid clashing with per-page styles.
 * Dark strip on top regardless of page background. Loaded everywhere; the
 * landing page also uses --shell-* tokens for its own sections. */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --shell-ink: #06182E;
  --shell-bg: #0E2645;
  --shell-fg: #E6ECF3;
  --shell-mute: #9DB3CC;            /* было #7E96B0 — поднял яркость для читаемости меты */
  --shell-line: rgba(230, 236, 243, 0.18);          /* было 0.10 */
  --shell-line-strong: rgba(230, 236, 243, 0.38);    /* было 0.22 */
  --shell-accent: #3A86C8;          /* было #2A6FA8 — ярче */
  --shell-accent-warm: #6BA9D9;     /* было #4D90C6 */
  --shell-accent-coral: #F08C6E;    /* было #E07856 */
  --shell-pad: clamp(20px, 4vw, 64px);
  --shell-max: 1440px;
  --shell-nav-h: 64px;
}
:root[data-theme="light"] {
  --shell-ink: #EEF2F7;
  --shell-bg: #EEF2F7;
  --shell-fg: #06182E;
  --shell-mute: #3F5872;             /* было #4F6A87 — темнее = контрастнее на светлом */
  --shell-line: rgba(6, 24, 46, 0.16);
  --shell-line-strong: rgba(6, 24, 46, 0.35);
  --shell-accent: #15527E;
  --shell-accent-warm: #1F6BA0;
}

/* Nav ───────────────────────────────────────────────────────────── */
.shell-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 280ms ease, backdrop-filter 280ms ease, border-color 280ms ease;
  border-bottom: 1px solid transparent;
  background: var(--shell-bg);
  color: var(--shell-fg);
  font-family: "Geist", -apple-system, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
}
.shell-nav.is-scrolled {
  background: color-mix(in oklab, var(--shell-bg) 80%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--shell-line);
}
.shell-nav-row {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--shell-pad);
  height: var(--shell-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.shell-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--shell-fg);
  text-decoration: none;
}
.shell-brand .shell-brand-rule {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--shell-accent-warm);
  transform: translateY(-4px);
  margin: 0 2px;
}
.shell-brand .shell-brand-v {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: var(--shell-mute);
  letter-spacing: 0.08em;
}

.shell-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.shell-nav-link {
  position: relative;
  font-size: 14px;
  color: var(--shell-fg);
  text-decoration: none;
  padding-bottom: 3px;
  letter-spacing: -0.01em;
}
.shell-nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 480ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.shell-nav-link:hover::after,
.shell-nav-link[aria-current="page"]::after { transform: scaleX(1); }
.shell-nav-link[aria-current="page"] { color: var(--shell-accent-warm); }

/* Sign in / user chip */
.shell-cta {
  font-size: 14px;
  color: var(--shell-fg);
  text-decoration: none;
  padding-bottom: 3px;
  position: relative;
}
.shell-cta::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--shell-accent-warm);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 480ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.shell-cta:hover::after { transform: scaleX(1); }

.shell-chip-wrap { position: relative; }
.shell-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--shell-line-strong);
  color: var(--shell-fg);
  padding: 6px 10px 6px 6px;
  font: inherit;
  cursor: pointer;
  border-radius: 0;
}
.shell-chip-ini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: var(--shell-accent-warm); color: #EEF2F7;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.04em;
  overflow: hidden;
}
.shell-chip-ini img { width: 100%; height: 100%; object-fit: cover; }
.shell-chip-name { font-size: 13px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-chip-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px; padding: 10px;
  background: color-mix(in oklab, var(--shell-bg) 92%, var(--shell-fg) 6%);
  border: 1px solid var(--shell-line-strong);
  z-index: 60;
  display: flex; flex-direction: column; gap: 4px;
}
.shell-chip-menu[hidden] { display: none; }
.shell-chip-menu .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--shell-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--shell-line);
  margin-bottom: 4px;
}
.shell-chip-menu a {
  padding: 8px 6px;
  font-size: 14px;
  text-decoration: none;
  color: var(--shell-fg);
}
.shell-chip-menu a:hover { background: color-mix(in oklab, var(--shell-fg) 6%, transparent); }
.shell-chip-menu .danger { color: var(--shell-accent-coral); }

/* Mobile toggle */
.shell-nav-toggle {
  display: none;
  align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--shell-line-strong); color: var(--shell-fg);
  padding: 8px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.shell-nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--shell-bg);
  color: var(--shell-fg);
  z-index: 49;
  transform: translateY(-100%);
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 88px var(--shell-pad) 40px;
  font-family: "Geist", -apple-system, sans-serif;
}
.shell-nav-overlay[data-open="true"] { transform: translateY(0); }
.shell-nav-overlay a {
  font-size: 32px;
  letter-spacing: -0.02em;
  padding: 12px 0;
  border-bottom: 1px solid var(--shell-line);
  display: block;
  color: var(--shell-fg);
  text-decoration: none;
}

/* Auth slot inside the mobile overlay: list items styled like the rest of
   the overlay (large rows), so logout / login is reachable on phones. */
.shell-auth--mobile { display: block; padding-top: 12px; }
.shell-auth--mobile .shell-chip-wrap { display: block; }
.shell-auth--mobile .shell-chip {
  width: 100%;
  justify-content: flex-start;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--shell-line);
}
.shell-auth--mobile .shell-chip-name { font-size: 22px; max-width: none; font-weight: 400; }
.shell-auth--mobile .shell-chip-ini { width: 32px; height: 32px; font-size: 12px; }
.shell-auth--mobile .shell-chip-menu {
  position: static;
  background: transparent;
  border: 0;
  padding: 0;
  margin-top: 4px;
  display: flex; flex-direction: column;
}
.shell-auth--mobile .shell-chip-menu .label { display: none; }
.shell-auth--mobile .shell-chip-menu a {
  font-size: 20px;
  padding: 10px 0 10px 44px;
  border-bottom: 1px solid var(--shell-line);
  color: var(--shell-fg);
}
.shell-auth--mobile .shell-chip-menu .danger { color: var(--shell-accent-coral); }
.shell-auth--mobile > a.shell-cta {
  display: block;
  font-size: 32px;
  letter-spacing: -0.02em;
  padding: 12px 0;
  border-bottom: 1px solid var(--shell-line);
  color: var(--shell-accent-warm);
  text-decoration: none;
}
.shell-nav-overlay .meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--shell-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.8;
}
body.shell-nav-locked { overflow: hidden; }

/* Footer ────────────────────────────────────────────────────────── */
.shell-footer {
  background: var(--shell-bg);
  color: var(--shell-fg);
  font-family: "Geist", -apple-system, sans-serif;
  padding: 120px 0 60px;
  letter-spacing: -0.01em;
}
.shell-footer-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--shell-pad);
}
.shell-footer .rule {
  height: 1px;
  background: var(--shell-line-strong);
  margin-bottom: 80px;
}
.shell-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.shell-footer-grid .brand-block .name {
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 18px;
  font-weight: 400;
}
.shell-footer-grid .brand-block .name b { color: var(--shell-accent-warm); font-weight: 400; }
.shell-footer-grid .brand-block p {
  color: var(--shell-mute);
  max-width: 36ch;
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}
.shell-footer-grid .col h4 {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10.5px;
  color: var(--shell-mute);
  font-weight: 400;
  margin: 0 0 14px;
}
.shell-footer-grid .col a {
  display: block;
  padding: 4px 0;
  font-size: 14px;
  color: var(--shell-fg);
  text-decoration: none;
  position: relative;
}
.shell-footer-grid .col a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.shell-footer-grid .col a:hover::after { transform: scaleX(1); }
.shell-footer .addr {
  font-size: 14px;
  line-height: 1.7;
  color: var(--shell-fg);
}

.shell-footer-bottom {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--shell-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.shell-footer-bottom .copy {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--shell-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Pages that aren't the landing get a small top padding so the fixed nav
   doesn't overlap their first element. The landing leaves it transparent
   on top because the hero already extends to 0. */
body.with-shell-pad { padding-top: var(--shell-nav-h); }

/* Theme toggle */
.shell-nav-trailing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.shell-theme {
  appearance: none;
  background: transparent;
  border: 1px solid var(--shell-line-strong);
  color: var(--shell-fg);
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font: 14px/1 "JetBrains Mono", monospace;
  border-radius: 0;
  flex-shrink: 0;
}
.shell-theme:hover { border-color: var(--shell-accent-warm); color: var(--shell-accent-warm); }
.shell-theme::before { content: "◐"; }
:root[data-theme="light"] .shell-theme::before { content: "◑"; }

@media (max-width: 1024px) {
  .shell-footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 36px; }
}
@media (max-width: 720px) {
  :root { --shell-pad: 20px; --shell-nav-h: 56px; }
  .shell-nav-links { display: none; }
  .shell-nav-toggle { display: inline-flex; }
  .shell-footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .shell-footer-bottom { flex-direction: column; align-items: flex-start; }
}
