/* CodeItAll — shared site chrome */
:root {
  --black: #000000;
  --white: #ffffff;
  --off-white: #fafafa;
  --gray: #404040;
  --muted: #8a8a8a;
  --accent: #8b1e1e;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --page-pad: clamp(1rem, 3vw, 2rem);
  --max: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Montserrat", sans-serif;
  background: var(--black);
  color: var(--white);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap {
  width: min(100% - (var(--page-pad) * 2), var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: var(--page-pad);
  z-index: 50;
  margin: var(--page-pad) auto 0;
  width: min(100% - (var(--page-pad) * 2), var(--max));
  background: var(--white);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  /* anchor for mobile dropdown */
  /* sticky already creates containing block for absolute nav */
}
.brand { display: flex; align-items: center; line-height: 0; }
.brand-logo { height: 32px; width: auto; display: block; }
.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}
.nav a {
  color: var(--black);
  font-weight: 700;
  font-size: 0.95rem;
}
.nav a:hover { opacity: 0.65; }
.nav a.active { color: var(--accent); }
.menu-toggle {
  display: none;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--black);
}

.site-footer {
  padding: 3.5rem 0 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 3rem;
}
.site-footer.light {
  background: var(--white);
  color: var(--black);
  border-top: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin: 2rem var(--page-pad) 0;
  padding: 3rem clamp(1.25rem, 4vw, 2.5rem) 2.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.footer-brand { display: block; line-height: 0; width: fit-content; }
.footer-brand img { height: clamp(2.2rem, 5vw, 3rem); width: auto; }
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.9rem;
}
.footer-links.row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.footer-links a:hover { opacity: 0.7; }
.footer-contact {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  display: grid;
  gap: 0.35rem;
}
.site-footer.light .footer-contact { color: var(--gray); }
.footer-copy {
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}
.site-footer.light .footer-copy { color: var(--muted); }

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.35rem 0.65rem;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
  }
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    background: var(--white);
    border-radius: 18px;
    padding: 0.65rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    max-height: min(70vh, 540px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 60;
  }
  .site-header.open .nav { display: flex; }
  .nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: 100%;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    font-size: 1rem;
  }
  .nav a:hover,
  .nav a:focus-visible {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
  }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .brand-logo { height: 26px; }
  .site-footer { padding: 2.5rem 0 2rem; margin-top: 2rem; }
  .footer-copy { margin-top: 1.5rem; }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.85rem 1rem;
    top: max(0.65rem, env(safe-area-inset-top));
    width: min(100% - 1.3rem, var(--max));
    margin-top: max(0.65rem, env(safe-area-inset-top));
  }
  .site-footer.light {
    margin-left: 0.65rem;
    margin-right: 0.65rem;
  }
}
