/* ============================================================
   Header, nav, footer — shared shell for all pages
   ============================================================ */

/* ---------------- top strip ---------------- */
.top-strip {
  background: var(--ink);
  color: #C6C1B0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.top-strip .wrap-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 9px;
  padding-bottom: 9px;
  gap: 24px;
}
.top-strip .ts-left { display: flex; gap: 24px; align-items: center; }
.top-strip .ts-right { display: flex; gap: 20px; align-items: center; }
.top-strip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}
.top-strip a { color: #C6C1B0; }
.top-strip a:hover { color: #F3EEDC; }
.top-strip .sep { color: #4A5570; }

/* ---------------- masthead ---------------- */
.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead .wrap-wide {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 22px;
  padding-bottom: 22px;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
}
.brand .mark {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 26px;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand .mark .dot-accent {
  color: var(--accent-ink);
}
.brand .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-left: 14px;
  border-left: 1px solid var(--rule);
  line-height: 1.3;
}

.masthead .center-mark {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.masthead .center-mark .ver {
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  margin-left: 8px;
  background: var(--accent-soft);
}

.masthead .right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

/* ---------------- primary nav ---------------- */
.nav {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav .wrap-wide {
  display: flex;
  align-items: stretch;
  padding: 0 var(--gutter);
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  border-right: 1px solid var(--rule);
  transition: background .12s ease, color .12s ease;
  position: relative;
}
.nav a:first-child { border-left: 1px solid var(--rule); }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a .num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.nav a.active {
  color: var(--ink);
  background: var(--paper-2);
}
.nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.nav-spacer { flex: 1; border-bottom: 1px solid var(--rule); margin-bottom: -1px; }

.nav .nav-cta {
  border-right: 0;
  color: var(--accent-ink);
  font-weight: 600;
}

/* ---------------- footer ---------------- */
.footer {
  background: var(--ink);
  color: #B7B2A2;
  padding: 72px 0 32px;
  border-top: 1px solid var(--ink-2);
}
.footer .wrap-wide { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.78 0.10 82);
  margin: 0 0 16px;
  font-weight: 500;
}
.footer .brand-block .mark {
  font-family: var(--font-serif);
  font-size: 28px;
  color: #F3EEDC;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  display: block;
}
.footer .brand-block .desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: #948E7B;
  max-width: 40ch;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { color: #B7B2A2; font-size: 13.5px; }
.footer ul a:hover { color: #F3EEDC; }

.footer-btm {
  border-top: 1px solid var(--ink-2);
  margin-top: 56px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6D7288;
}

@media (max-width: 900px) {
  .masthead .wrap-wide { grid-template-columns: 1fr auto; }
  .masthead .center-mark { display: none; }
  .nav { position: static; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav .wrap-wide { min-width: max-content; }
  .footer .wrap-wide { grid-template-columns: 1fr 1fr; }
  .top-strip .ts-left .hide-sm { display: none; }
}

/* Narrow phones — let shared chrome wrap instead of forcing horizontal scroll */
@media (max-width: 640px) {
  .top-strip .wrap-wide { flex-wrap: wrap; row-gap: 6px; }
  .top-strip .ts-left,
  .top-strip .ts-right { gap: 14px; }
  .masthead .wrap-wide { grid-template-columns: 1fr; gap: 16px; }
  .masthead .right-actions { justify-content: flex-start; flex-wrap: wrap; }
  .footer .wrap-wide { grid-template-columns: 1fr; gap: 32px; }
  .footer-btm { flex-direction: column; gap: 8px; }
}
