/* Shared portfolio shell - canonical navigation and palette */
:root {
  --shell-white: #ffffff;
  --shell-ink: #0f0f0f;
  --shell-soft: #4a4a4a;
  --shell-silver: #e2e2de;
  --shell-surface: #f4f4f2;
  --shell-gold: #9a7a14;
  --shell-action-bg: #f3eedf;
  --shell-action-hover: #e8dfbf;
  --shell-action-border: #d4c58d;
  --shell-action-text: #6f5710;
}

body { background-color: var(--shell-white); }

nav.site-nav,
body > nav:not(.rail) {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 28px;
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid var(--shell-silver);
  backdrop-filter: blur(14px);
}

body > nav:not(.rail) .nav-logo {
  justify-self: start;
  color: var(--shell-ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
}

body > nav:not(.rail) .nav-logo img {
  display: block;
  width: 132px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

body > nav:not(.rail) .nav-center {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: #111;
  border: 1px solid #111;
  border-radius: 10px;
}

body > nav:not(.rail) .nav-center a {
  padding: 6px 14px;
  color: rgba(255,255,255,.75);
  background: transparent !important;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

body > nav:not(.rail) .nav-center a:hover,
body > nav:not(.rail) .nav-center a.active {
  color: #fff !important;
  background: rgba(255,255,255,.12) !important;
}

body > nav:not(.rail) .nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

body > nav:not(.rail) .nav-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shell-soft);
  background: #fff;
  border: 1px solid var(--shell-silver);
  border-radius: 8px;
  text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}

body > nav:not(.rail) .nav-icon:hover {
  color: var(--shell-ink);
  background: var(--shell-surface);
  border-color: var(--shell-ink);
}

body > nav:not(.rail) .nav-icon svg { width: 20px; height: 20px; fill: currentColor; }

body > nav:not(.rail) .nav-linkedin {
  color: #fff;
  background: #0a66c2;
  border-color: #0a66c2;
}

body > nav:not(.rail) .nav-linkedin:hover {
  color: #fff;
  background: #084f96;
  border-color: #084f96;
}

body > nav:not(.rail) .nav-sayhi {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  color: var(--shell-action-text);
  background: var(--shell-action-bg);
  border: 1px solid var(--shell-action-border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

body > nav:not(.rail) .nav-sayhi:hover { border-color: var(--shell-gold); color: var(--shell-action-text); background:var(--shell-action-hover); }

body .hero-cta .btn,
body .contact-email,
body .closing a,
body .github-profile-link {
  color: var(--shell-action-text);
  background: var(--shell-action-bg);
  border: 1px solid var(--shell-action-border);
  box-shadow: none;
  text-decoration: none;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}

body footer .privacy-link {
  margin-left: 20px;
  color: inherit;
  font-size: inherit;
  text-decoration: none;
}

body footer .privacy-link:hover { color: var(--shell-gold); }

body .hero-cta .btn:hover,
body .contact-email:hover,
body .closing a:hover,
body .github-profile-link:hover {
  color: var(--shell-action-text);
  background: var(--shell-action-hover);
  border-color: var(--shell-gold);
  opacity: 1;
  transform: translateY(-1px);
}

body .hero-cta .btn:focus-visible,
body .contact-email:focus-visible,
body .closing a:focus-visible,
body .github-profile-link:focus-visible {
  outline: 3px solid rgba(154,122,20,.28);
  outline-offset: 3px;
}

body .github-profile-link {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
}

@media (max-width: 800px) {
  nav.site-nav,
  body > nav:not(.rail) { grid-template-columns: auto 1fr auto; padding: 14px 16px; }
  body > nav:not(.rail) .nav-center { display: none; }
  body > nav:not(.rail) .nav-logo img { width: 108px; height: 38px; }
}

@media (max-width: 1120px) and (min-width: 801px) {
  body > nav:not(.rail) .nav-center a { padding: 6px 9px; font-size: 12px; }
  body > nav:not(.rail) .nav-icon { width: 38px; height: 38px; }
}

/* ── Mobile bottom navigation (app-style, phones only) ── */
/* Selector specificity matches "body > nav:not(.rail)" above and relies on
   source order (this block comes later) so it can win the cascade instead
   of inheriting that rule's top:0 / 3-column grid / border-bottom. */
body > nav.bottom-nav { display: none; }

@media (max-width: 820px) {
  body > nav.bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    top: auto; left: 0; right: 0; bottom: 0;
    z-index: 1200;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(14px);
    border-bottom: none;
    border-top: 1px solid var(--shell-silver);
    padding: 7px 2px calc(7px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(15,15,15,0.06);
  }
  body > nav.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 2px;
    color: var(--shell-soft);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
  }
  body > nav.bottom-nav a svg { width: 21px; height: 21px; flex-shrink: 0; }
  body > nav.bottom-nav a.bn-active { color: var(--shell-gold); }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}
