/* SHARED NAV */
#shared-nav:empty {
  display: block;
  min-height: 72px;
}

#shared-footer:empty {
  display: block;
  min-height: 400px;
}

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.25rem 3rem;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--sans); font-weight: 400; font-size: 1.15rem;
  color: var(--text-on-dark); text-decoration: none; letter-spacing: -0.01em;
}
.nav-logo svg { width: 22px; height: 20px; flex-shrink: 0; }
.nav-logo span { color: var(--accent); }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--text-dim);
  text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-on-dark); }
.nav-cta, .nav-links a.nav-cta {
  padding: 0.6rem 1.5rem; background: white; color: #0c0c0c;
  border: none; border-radius: 999px; font-family: var(--sans); font-size: 0.85rem;
  font-weight: 600; cursor: pointer; text-decoration: none; transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, color 0.22s ease;
  letter-spacing: -0.01em;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.nav-cta:hover, .nav-links a.nav-cta:hover {
  background: white; color: #0c0c0c;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.28), 0 2px 10px rgba(255,255,255,0.08);
}

/* SHARED THEME TOGGLE — floating button */
.theme-toggle {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  background: var(--dark-card, #1a1a1e); border: 1px solid var(--surface-border, rgba(255,255,255,0.08));
  color: var(--text-dim, rgba(255,255,255,0.4)); cursor: pointer; padding: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; line-height: 0;
  border-radius: 50%; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.theme-toggle:hover { color: var(--text-on-dark); border-color: var(--surface-border); background: var(--surface-hover); }
.icon-moon { display: none; }
body.light .icon-sun, .light .icon-sun { display: none; }
body.light .icon-moon, .light .icon-moon { display: block; }

/* SHARED FOOTER */
footer {
  position: relative;
  background: var(--dark);
  display: flex; flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
footer::before,
footer::after {
  content: none;
}
footer > * {
  position: relative;
  z-index: 1;
}
footer > *::before {
  content: none;
}
.footer-main,
.footer-bar {
  background: transparent;
}
.footer-main {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 0;
}
.footer-wordmark {
  display: flex; align-items: center; justify-content: center;
  user-select: none; pointer-events: none;
  width: min(92vw, 996px);
  max-width: 996px;
}
.footer-wordmark img {
  display: block;
  width: 100%;
  max-height: 340px;
  height: auto;
  opacity: 0.82;
  filter: none;
}
/* SHARED CTA BUTTON */
.btn-dark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 1.1rem 2.8rem; background: var(--text-on-dark); color: var(--dark);
  border: none; border-radius: 40px; font-family: var(--sans); font-size: 1.05rem; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, color 0.22s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.btn-dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.28), 0 2px 10px rgba(255,255,255,0.08);
}

.footer-bar-wrap {
  border-top: var(--separator);
}
.footer-bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 3.5rem 3rem;
  max-width: 996px;
  margin: 0 auto;
  width: 100%;
}
.footer-made { font-size: 0.78rem; color: var(--text-dim); }
.footer-made span { color: #4A9EFF; }
.footer-cols { display: flex; gap: 3rem; }
.footer-col h4 {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-on-dark); margin-bottom: 1.2rem;
}
.footer-col a {
  display: block; font-size: 0.78rem; color: var(--text-dim);
  text-decoration: none; line-height: 1.9; transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-on-dark); }

/* LIGHT MODE - NAV & FOOTER */
.light nav { background: var(--nav-bg); }
.light .nav-logo { color: #091717; }
.light .nav-logo svg path { fill: #091717; }
.light .nav-links a { color: rgba(9,23,23,0.5); }
.light .nav-links a:hover { color: #091717; }
.light .nav-cta, .light .nav-links a.nav-cta {
  background: #091717; color: #FBFAF4;
}
.light .nav-cta:hover, .light .nav-links a.nav-cta:hover {
  background: #1a2a2a;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.2);
}
.light .theme-toggle {
  color: rgba(9,23,23,0.4);
  background: #EFEEE8; border-color: rgba(0,0,0,0.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.light .theme-toggle:hover { color: #091717; background: rgba(0,0,0,0.06); }
.light footer { background: #FBFAF4; border-top-color: rgba(0,0,0,0.1); }
.light .footer-main,
.light .footer-bar { background: transparent; }
.light footer::before,
.light footer::after {
  content: none;
}
.light .footer-wordmark img {
  opacity: 0.2;
  filter: none;
}
.light .footer-made { color: rgba(9,23,23,0.5); }
.light .footer-made span { color: #2797FF; }
.light .footer-bar { border-top-color: rgba(0,0,0,0.1); }
.light .footer-col h4 { color: #091717; }
.light .footer-col a { color: rgba(9,23,23,0.6); }
.light .footer-col a:hover { color: #091717; }
.light .btn-dark { background: #091717; color: #FBFAF4; }
.light .btn-dark:hover {
  background: #1a2a2a;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.2);
}

/* Focus outlines — dark in light mode */
.light *:focus-visible { outline-color: #091717; }
.light a:focus-visible, .light button:focus-visible {
  outline: 2px solid #091717; outline-offset: 2px;
}

/* RESPONSIVE - NAV & FOOTER */
@media (max-width: 900px) {
  #shared-nav:empty { min-height: 64px; }
  #shared-footer:empty { min-height: 350px; }
  nav { padding: 1rem 1.5rem; gap: 0.5rem; }
  .nav-why-writing, .nav-hide-mobile { display: none !important; }
  .footer-wordmark { width: min(92vw, 640px); max-width: 640px; }
  .footer-wordmark img { max-height: 220px; }
  .footer-bar { gap: 1.5rem; padding: 1.5rem; }
  .footer-cols { gap: 2rem; }
}
@media (max-width: 768px) {
  .footer-wordmark img { max-height: 160px; }
}
