*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  /* the nav is position:fixed, so in-page anchors (e.g. index.html#projects)
     would otherwise land with the target tucked underneath it */
  scroll-padding-top: 5rem;
}

body {
  font-family: 'Exo', sans-serif;
  color: #231f20;
}

/* TYPOGRAPHY
   Base sizes match the two scales already used consistently across the
   case-study pages' own .project-title (h1) and .section-heading (h2) —
   clamp(2.1rem,4.2vw,3.5rem) and clamp(1.9rem,3vw,2.5rem) respectively —
   so a bare h1/h2 and a .project-title/.section-heading render at the same
   size everywhere. Per-page classes still override color/weight where
   that's an intentional accent; only font-size drifted before this pass. */
h1 { font-size: clamp(2.1rem, 4.2vw, 3.5rem); font-weight: 300; line-height: 1.3; }
h2 { font-size: clamp(1.9rem, 3vw, 2.5rem);   font-weight: 600; line-height: 1.3; }
h3 { font-size: clamp(1rem, 2vw, 1.5rem);     font-weight: 600; line-height: 1.3; }
p  { font-size: 1rem; line-height: 1.7; font-weight: 400; }

/* NAV */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 3rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ffffff70;
  z-index: 100;
  transition: transform 0.5s ease;
}
.nav-logo img { width: 36px; display: block; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  text-decoration: none;
  color: #231f20;
  font-size: 0.95rem;
  font-weight: 600;
}
.nav-links a:hover { opacity: 0.5; }

/* The nav is position:fixed, so when its contents are too wide they overflow
   its own box without growing document.scrollWidth — an overflow probe will
   not catch it. Tighten the gutters and gaps so the links clear the logo and
   the trailing icons stay on screen on small phones. */
@media (max-width: 700px) {
  .nav { padding: 0.6rem 1.25rem; }
  .nav-links { gap: 1.1rem; }
  .nav-links a { font-size: 0.9rem; }
  .nav-logo img { width: 30px; }
}

@media (max-width: 380px) {
  .nav { padding: 0.6rem 1rem; }
  .nav-links { gap: 0.85rem; }
  .nav-links a { font-size: 0.85rem; }
}

/* FOOTER */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem 2rem;
  gap: 3rem;
}
.footer-icons { display: flex; gap: 2.5rem; }
.footer-icons a { color: #231f20; font-size: 1.5rem; text-decoration: none; }
.footer-icons a:hover { opacity: 0.5; }
/* #888 was ~2.9-3.5:1 on the site's creams, well below the 4.5:1 AA minimum.
   #666 clears AA against every background in use, including the darkest
   cream (#efe8da on restaurant-redesign, where #6b6b6b only reached 4.37). */
.footer-copy { font-size: 1rem; color: #666666; }

/* The UA default focus ring is nearly invisible on the dark filled buttons. */
.nav-links a:focus-visible,
.footer-icons a:focus-visible,
.page-nav-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

/* PAGE NAV BUTTONS */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin: 6rem 6rem 4rem;
}

.page-nav-btn {
  background: #231f20;
  color: #fff;
  text-decoration: none;
  padding: 1rem 2.5rem;
  border-radius: 10px;
  font-family: 'Exo', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 1px;
  transition: opacity 0.3s ease;
}

.page-nav-btn:hover { opacity: 0.65; }

/* Stack on small screens so the buttons never squeeze or overflow.
   NOTE: this block must stay AFTER the base .page-nav / .page-nav-btn rules.
   A media query adds no specificity, so at equal specificity source order
   decides — placing it earlier silently loses `margin` to the base rule. */
@media (max-width: 767px) {
  .page-nav {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 4rem 1.5rem 3rem;
  }
  .page-nav-btn { width: 100%; max-width: 22rem; text-align: center; }
}
