/* =============================================================
   chrome.css — Ryno Tools shared navbar + footer
   Applies to every page: home/app, blog, about, legal.
   Tokens from theme.css (:root). Depends on body.dark-mode /
   body.light-mode classes set by each page's inline theme script.
   ============================================================= */

/* ── Base reset (ensures no body margin gap on pages that skip base.css) ── */
html,
body {
  margin: 0;
  padding: 0;
}

/* ── Sizing token ─────────────────────────────────────────────── */
:root {
  --site-header-h: 4rem;
}

/* ── Site Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  height: var(--site-header-h);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  box-sizing: border-box;
  /* green brand gradient — site's visual signature */
  background-size: 40px 40px;
  background-image:
    repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.05) 0px,
      rgba(255, 255, 255, 0.05) 20px,
      transparent 20px,
      transparent 40px),
    var(--gradient-green-torque);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Light-mode checkered tint is slightly darker */
body.light-mode .site-header {
  background-image:
    repeating-linear-gradient(45deg,
      rgba(0, 0, 0, 0.05) 0px,
      rgba(0, 0, 0, 0.05) 20px,
      transparent 20px,
      transparent 40px),
    var(--gradient-green-torque);
  border-bottom-color: rgba(0, 0, 0, 0.10);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

/* ── Brand (logo + wordmark) ──────────────────────────────────── */
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.site-brand-name {
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap;
}

/* ── Primary nav ──────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.site-nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.80);
  white-space: nowrap;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover {
  color: #fff;
}

.site-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.65);
}

/* ── Theme toggle ─────────────────────────────────────────────── */
.site-theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
  color: #fff;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s;
}

.site-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ── Site Footer ──────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  padding: 2rem 1.25rem 2.5rem;
  border-top: 1px solid;
  text-align: center;
  box-sizing: border-box;
}

body.dark-mode .site-footer {
  border-color: rgba(255, 255, 255, 0.08);
  color: #9099b0;
}

body.light-mode .site-footer {
  border-color: rgba(0, 0, 0, 0.08);
  color: #666;
}

.site-footer-brand {
  font-family: var(--font-headline);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.75rem;
}

body.dark-mode .site-footer-brand {
  color: var(--color-primary-light);
}

body.light-mode .site-footer-brand {
  color: var(--color-primary-dark);
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.8rem;
}

.site-footer-nav a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer-nav a:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-nav li:not(:last-child)::after {
  content: '·';
  margin-left: 0.75rem;
  opacity: 0.35;
}

.site-footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.site-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.65;
  transition: opacity 0.15s, transform 0.15s;
}

.site-footer-social a:hover {
  opacity: 1;
  transform: scale(1.1);
}

.site-footer-copy {
  font-size: 0.78rem;
  opacity: 0.5;
  margin: 0;
}

/* ── Responsive: narrow viewports ─────────────────────────────── */
@media (max-width: 480px) {
  .site-nav {
    gap: 0.85rem;
  }

  .site-brand-name {
    font-size: 0.9rem;
  }
}
