/* ─────────────────────────────────────────────────────────────
   components.css — shared interface layer.
   Loaded after each page's inline <style>, so rules here apply
   site-wide. Tokens stay in each page's :root; nothing here
   redefines colour or type.
   ───────────────────────────────────────────────────────────── */

html { scroll-padding-top: 6rem; }

/* ── TYPE ── */
h1, .project-title, .work-title, .index-card-title,
.note-page-title, .art-page-title, .project-next-title { text-wrap: balance; }
p { text-wrap: pretty; }

/* ── FOCUS ── keyboard only, a hairline not a glow */
:focus { outline: none; }
:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
}
.index-card:focus-visible,
.work-item a:focus-visible { outline-offset: 8px; }
.art-page-thumb:focus-visible { outline-offset: 3px; opacity: 1; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: var(--page);
  z-index: 300;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

/* ── NAV ── */
.nav-links a[aria-current],
.mobile-nav-links a[aria-current] { color: var(--text); }

/* Larger hit areas, same visual position */
.menu-trigger,
.mobile-menu-close {
  padding: 0.75rem;
  margin: -0.75rem;
}

/* Mobile menu fades in and out instead of snapping */
.mobile-menu {
  display: flex;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
}
.mobile-menu.open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.35s var(--ease);
}

/* ── PAGE TITLES ── clear the fixed nav, same rhythm as project headers */
.index-page-title,
.notes-title,
.about-title { padding-top: calc(6rem + var(--page)); }

.art-page-back,
.note-page-back { padding-top: 6rem; }

/* ── IMAGE LABELS ── placeholder labels only show on empty frames */
.work-thumb:has(img) .work-thumb-label,
.project-image:has(img) .project-image-label { display: none; }

/* ── MISSING IMAGES ── fall back to the surface placeholder */
img.is-missing { visibility: hidden; }
.has-missing-img { background: var(--surface); }
.art-page-main-image.has-missing-img { aspect-ratio: 4 / 5; }

/* ── FOOTER ── */
footer {
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.footer-icon {
  color: var(--muted);
  padding: 0.35rem;
  margin: -0.35rem;
}
.footer-icon:hover { color: var(--text); }

/* ── NO JS ── content must never stay invisible */
html:not(.js) .reveal { opacity: 1; transform: none; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── FOOTER LINKS (Art, Photography, Notes) ── */
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem clamp(1.5rem, 4vw, 3.5rem);
}
.footer-link {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.35rem;
  margin: -0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer-link:hover { color: var(--text); border-color: var(--muted); }
.footer-link:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* ── CLOSING BAND: rises into view, retracts on the way back up (Home, Work, About) ── */
@media (prefers-reduced-motion: no-preference) {
  html.js footer.closing {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.32s cubic-bezier(0.5, 0, 0.75, 0);
  }
  html.js footer.closing > * {
    opacity: 0;
    transform: translateY(3rem);
    transition: transform 0.3s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.22s ease;
  }
  html.js footer.closing.in {
    clip-path: inset(0 0 0 0);
    transition: clip-path 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  }
  html.js footer.closing.in > * {
    opacity: 1;
    transform: none;
    transition: transform 0.75s cubic-bezier(0.34, 1.45, 0.5, 1), opacity 0.4s ease;
  }
  html.js footer.closing.in > :nth-child(2) { transition-delay: 0.04s; }
  html.js footer.closing.in > :nth-child(3) { transition-delay: 0.08s; }
}

/* h1 tracking: -5% on every page title (overrides each page's inline -0.01em / -0.02em) */
.index-page-title,
.about-title,
.notes-title,
.note-page-title,
.project-title,
.art-page-title { letter-spacing: -0.05em; }
