/* ============================================
   ADVANCED MONKEY — COMPONENTS CSS
   Nav, footer, shared UI elements
   ============================================ */

/* ─── NAV ─── */
.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  height: var(--nav-height);
  background: var(--paper);
  border-bottom: 1px solid var(--faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  transition: box-shadow var(--transition);
}

.site-nav.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.nav-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--mid);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--ink); }

.nav-cta {
  font-size: 13px;
  font-weight: 500;
  background: var(--ink);
  color: var(--paper) !important;
  padding: 9px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--transition);
}
.nav-cta:hover { background: var(--accent) !important; }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--faint);
  padding: 24px var(--pad-x);
  z-index: 199;
  flex-direction: column;
  gap: 0;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  font-size: 16px;
  font-weight: 400;
  color: var(--mid);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--faint);
  transition: color var(--transition);
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { color: var(--ink); }
.nav-drawer .nav-cta {
  margin-top: 16px;
  text-align: center;
  padding: 14px 20px;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ─── FOOTER ─── */
.site-footer {
  background: #0C0B0B;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 40px var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: white;
  text-decoration: none;
}
.footer-logo span { color: var(--accent); }

.footer-links {
  display: flex;
  gap: 28px;
}
.footer-links a {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: white; }

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}

/* ─── TICKER STRIP ─── */
.ticker {
  background: var(--accent);
  padding: 14px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-inner {
  display: inline-flex;
  animation: ticker 28s linear infinite;
}
.ticker-item {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
  padding: 0 36px;
}
.ticker-item::after {
  content: '·';
  margin-left: 36px;
  opacity: 0.5;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── SECTION LABEL + HEADLINE BLOCK ─── */
.section-intro {
  margin-bottom: 56px;
}
.section-intro .label {
  margin-bottom: 16px;
}
.section-intro h2 {
  margin-bottom: 20px;
}
.section-intro .sub {
  font-size: 17px;
  font-weight: 300;
  color: var(--mid);
  max-width: 560px;
  line-height: 1.75;
}
.section-intro.center {
  text-align: center;
}
.section-intro.center .sub {
  margin: 0 auto;
}

/* ─── STAT BLOCK ─── */
.stat-val {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.stat-val span { color: var(--accent); }
.stat-val.lg { font-size: clamp(32px, 4vw, 48px); }
.stat-val.md { font-size: clamp(24px, 3vw, 36px); }
.stat-val.sm { font-size: 24px; }
.stat-key {
  font-size: 12px;
  color: var(--mid);
  font-weight: 300;
  line-height: 1.4;
  margin-top: 6px;
}

/* ─── DIVIDER GRID (card borders trick) ─── */
.grid-divided {
  display: grid;
  gap: 1px;
  background: var(--faint);
  border: 1px solid var(--faint);
}
.grid-divided > * {
  background: var(--paper);
  transition: background var(--transition);
}
.grid-divided > *:hover {
  background: var(--warm);
}
.grid-divided.dark {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.07);
}
.grid-divided.dark > * {
  background: var(--ink);
}
.grid-divided.dark > *:hover {
  background: #1a1818;
}

/* ─── SPLIT SECTION (two-col, no gutter) ─── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.split-left {
  padding: var(--pad-section) var(--pad-x);
  border-right: 1px solid var(--faint);
}
.split-right {
  padding: var(--pad-section) var(--pad-x);
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split-left {
    border-right: none;
    border-bottom: 1px solid var(--faint);
  }
}

/* ─── PILL / TAG ─── */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 3px;
  border: 1px solid;
}
.tag-dark {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.08);
}
.tag-light {
  background: var(--warm);
  color: var(--mid);
  border-color: var(--faint);
}

/* ─── ARROW LIST ─── */
.arrow-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.arrow-list li {
  font-size: 13px;
  color: var(--mid);
  font-weight: 300;
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
}
.arrow-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
  top: 1px;
}

/* ─── PAGE HERO (inner pages) ─── */
.page-hero {
  padding-top: calc(var(--nav-height) + var(--pad-section));
  padding-bottom: var(--pad-section);
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  background: var(--ink);
}
.page-hero .label { color: rgba(255,255,255,0.4); }
.page-hero h1 { color: white; margin-bottom: 20px; }
.page-hero .sub {
  font-size: 18px;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  max-width: 560px;
  line-height: 1.75;
}

/* ─── QUOTE BLOCK ─── */
.quote-block {
  padding: 36px;
  border-left: 3px solid var(--accent);
  background: var(--warm);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.quote-block p {
  font-size: 16px;
  color: var(--mid);
  font-weight: 300;
  line-height: 1.8;
  font-style: italic;
}
.quote-block cite {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--mid);
  font-style: normal;
  font-weight: 500;
}

/* ─── CTA BAND ─── */
.cta-band {
  background: var(--ink);
  padding: 96px var(--pad-x);
  text-align: center;
}
.cta-band h2 { color: white; max-width: 680px; margin: 20px auto; }
.cta-band .sub {
  font-size: 17px;
  color: rgba(255,255,255,0.45);
  font-weight: 300;
  max-width: 480px;
  margin: 0 auto 40px;
  line-height: 1.75;
}
.cta-band .btns {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.cta-band .note {
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.2);
  font-style: italic;
}

/* ─── THEME SWITCHER ─── */
.theme-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: transform var(--transition);
}
.theme-trigger:hover { transform: scale(1.2); }
.theme-trigger-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transition: background var(--transition);
}

#theme-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  background: var(--paper);
  border-left: 1px solid var(--faint);
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  overflow-y: auto;
}
#theme-panel.open { transform: translateX(0); }

.theme-panel-inner {
  padding: 32px 24px;
}

.theme-panel-header {
  position: relative;
  margin-bottom: 32px;
}
.theme-panel-header .label {
  margin-bottom: 10px;
}
.theme-panel-header h3 {
  font-size: 20px;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.theme-panel-header p {
  font-size: 13px;
  color: var(--mid);
  font-weight: 300;
  line-height: 1.6;
}

.theme-panel-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--warm);
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  font-size: 18px;
  color: var(--mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.theme-panel-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.theme-card {
  background: var(--warm);
  border: 2px solid var(--faint);
  border-radius: var(--radius);
  padding: 16px 12px 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card.active { border-color: var(--accent); }

.theme-swatches {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.theme-swatches span {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
}

.theme-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--mid);
  font-family: var(--font-head);
  letter-spacing: 0.02em;
}

/* Custom colour pickers */
.theme-custom {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--faint);
}

.theme-section-head {
  margin-bottom: 20px;
}
.theme-section-head .label {
  margin-bottom: 8px;
}
.theme-section-head p {
  font-size: 13px;
  color: var(--mid);
  font-weight: 300;
}

.theme-color-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--warm);
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  transition: background var(--transition);
}
.theme-color-row:hover { background: var(--faint); }

.theme-color-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--mid);
}

.theme-color-input {
  width: 40px;
  height: 28px;
  border: 1px solid var(--faint);
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  background: var(--paper);
}
