/* Shared header, mobile menu and footer styles for the public pages:
   home, /ai/, /websites/, /work/, /pricing/, /about/, /contact/ and
   /privacy/. Each page links this before its own <style>, so page rules
   still win. The colour variables (--navy, --line and so on) come from
   each page's :root.

   Change these rules here, never in the pages, and bump the ?v= number
   on every page's <link> to this file whenever it changes. */

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: var(--parchment);
  border-bottom: 1px solid var(--line);
}
/* header.site in front so each page's own .wrap padding, which loads
   later, can't reset the row's vertical padding */
header.site .nav-row { display: flex; align-items: center; justify-content: space-between; padding-block: 16px; }
/* 28px side padding on every page, whatever the page's own .wrap uses */
header.site .nav-row { padding-left: 28px; padding-right: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-word { font-family: 'Fraunces', serif; font-weight: 700; font-size: 19px; color: var(--navy); position: relative; }
nav.links { display: flex; gap: 28px; }
nav.links a { margin-right: 28px; }
nav.links a:last-child { margin-right: 0; }
nav.links a {
  text-decoration: none; font-size: 14px; color: var(--ink);
  font-weight: 500;
}
nav.links a:hover { color: var(--brass-text); }
.nav-cta {
  background: var(--navy); color: #FFF; text-decoration: none;
  font-size: 13.5px; font-weight: 500; padding: 9px 18px; border-radius: 8px;
}
.nav-cta:hover { background: var(--navy-deep); }
.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 32px; height: 32px; padding: 0;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--navy); transition: transform 0.25s ease, opacity 0.25s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Mobile menu ---------- */
/* Closed, the menu is also visibility: hidden, so Tab skips its links and
   screen readers don't announce them. The visibility change waits until
   the 0.3s closing transition has finished, and is immediate on opening. */
.mobile-menu {
  display: none; flex-direction: column;
  max-height: 0; overflow: hidden;
  visibility: hidden;
  transition: max-height 0.3s ease, visibility 0s linear 0.3s;
  border-top: 1px solid var(--line);
}
.mobile-menu.open { max-height: 400px; visibility: visible; transition: max-height 0.3s ease, visibility 0s; }
.mobile-menu a {
  display: block; padding: 14px 28px; text-decoration: none; color: var(--ink);
  font-size: 15px; font-weight: 500; border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child { border-bottom: none; }

/* ---------- Footer ---------- */
footer { padding: 28px 0; }
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--mute); flex-wrap: wrap; gap: 10px;
}
.footer-row .nw { white-space: nowrap; }
@media (max-width: 860px) {
  .footer-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .footer-row .sep { display: none; }
  .footer-row .brk { display: block; width: fit-content; }
}

/* ---------- Header entrance on page load ---------- */
header.site { opacity: 0; transform: translateY(-10px); animation: navIn 0.6s ease forwards; }
@keyframes navIn { to { opacity: 1; transform: translateY(0); } }

.brand-mark { opacity: 0; transform: rotate(-720deg) scale(0.7); animation: iconIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; animation-delay: 0.15s; }
@keyframes iconIn { to { opacity: 1; transform: rotate(0) scale(1); } }

/* The brass line under the LodeTec wordmark */
.brand-word::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  background: var(--brass);
  transform: scaleX(0); transform-origin: left;
  animation: underlineIn 0.5s ease forwards;
  animation-delay: 0.55s;
}
@keyframes underlineIn { to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  /* Most pages also switch off every animation in their own CSS; this
     covers the header on pages that don't */
  header.site, .brand-mark { animation: none !important; }
  header.site, .brand-mark { opacity: 1; transform: none; }
  .brand-word::after { animation: none !important; opacity: 1; transform: none; }
}

/* ---------- Phones and tablets ---------- */
@media (max-width: 860px) {
  nav.links { display: none; }
  /* Compact Get in touch button, left of the burger */
  .nav-cta { margin-left: auto; margin-right: 26px; padding: 6px 12px; font-size: 13px; line-height: 20px; white-space: nowrap; }
  .nav-cta:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
  .menu-toggle { display: flex; }
  .mobile-menu { display: flex; }
}

/* Small phones (340px and narrower): tighter header so the Get in touch
   button clears the LodeTec wordmark */
@media (max-width: 340px) {
  header.site .nav-row { padding-left: 16px; padding-right: 16px; }
  header.site .brand { gap: 10px; }
  header.site .nav-cta { margin-right: 12px; padding: 10px; font-size: 13px; line-height: 20px; min-height: 40px; white-space: nowrap; }
}
