/* ============================================================
   Jacqueline Barber · shared design system
   Single source of truth for tokens, masthead, footer, animations.
   Pages link to this AND add their own page-specific <style>.
   ============================================================ */

/* ------ Tokens ------ */
:root {
  --paper: #fcfbf7;
  --ink: #1a1a1a;
  --ink-soft: #2a2a2a;
  --quiet: #6b6b6b; /* darkened from #888 to clear WCAG AA 4.5:1 contrast on paper */
  --hairline: #e8e3d8;
  --accent: #3a4f3a;
  --img-bg: #e8e3d8;
}

/* ------ A11y utilities ------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 1000;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Global focus-visible — accent ring on every interactive element.
   Uses :focus-visible (not :focus) so mouse clicks don't trigger the ring,
   only keyboard navigation does. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ------ Reset + base type ------ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Literata', Georgia, serif;
  font-variation-settings: 'opsz' 14;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
  border-radius: 10px;
}

/* ------ Image containers — round corners so overflow:hidden doesn't clip ------ */
.hero-img,
.feat-img-wrap,
.wt-img,
.wr-img,
.piece-img,
.cmp-img,
.fm-img,
.ih-img,
figure.illustration {
  border-radius: 10px;
}

/* ------ Masthead ------ */
nav.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 32px 56px 28px;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
  position: relative;
  z-index: 50;
}
.brand {
  font-family: 'Literata', serif;
  font-variation-settings: 'opsz' 36;
  font-style: italic;
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.012em;
  color: var(--ink);
  justify-self: start;
}
.brand-logo {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}
.brand-logo img {
  height: 44px;
  width: auto;
  display: block;
}
.brand-logo:hover {
  opacity: 0.75;
}
nav.masthead .links {
  display: flex;
  gap: 36px;
  justify-self: end;
}
nav.masthead .links a {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.15s;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
nav.masthead .links a.on {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
nav.masthead .links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ------ Hamburger (mobile trigger) ------ */
.hamburger {
  display: none;
  width: 32px;
  height: 24px;
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--ink);
  transition:
    transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 0.25s ease,
    top 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hamburger span:nth-child(1) {
  top: 4px;
}
.hamburger span:nth-child(2) {
  top: 12px;
}
.hamburger span:nth-child(3) {
  top: 20px;
}
body.menu-open .hamburger span:nth-child(1) {
  top: 12px;
  transform: rotate(45deg);
}
body.menu-open .hamburger span:nth-child(2) {
  opacity: 0;
}
body.menu-open .hamburger span:nth-child(3) {
  top: 12px;
  transform: rotate(-45deg);
}

/* ------ Mobile menu overlay ------ */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--paper);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden; /* removes menu links from tab order when closed */
  transition:
    opacity 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
    visibility 0s linear 0.35s;
}
body.menu-open .mobile-menu {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
    visibility 0s linear 0s;
}
.mobile-menu a {
  font-family: 'Literata', serif;
  font-variation-settings: 'opsz' 72;
  font-style: italic;
  font-weight: 500;
  font-size: 42px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.mobile-menu a:hover,
.mobile-menu a:focus {
  color: var(--accent);
}
body.menu-open {
  overflow: hidden;
}

/* ------ Footer ------ */
footer.site-footer {
  border-top: 1px solid var(--ink);
  max-width: 1480px;
  margin: 0 auto;
  padding: 40px 56px 56px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: baseline;
}
footer .f-brand {
  font-family: 'Literata', serif;
  font-variation-settings: 'opsz' 24;
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
}
footer .f-meta {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--quiet);
}
footer .f-links {
  display: flex;
  gap: 24px;
}
footer .f-links a {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}
footer .f-links a:hover {
  color: var(--accent);
}

/* ------ Contact CTA (shared component) ------ */
section.contact-cta {
  text-align: center;
  padding: 80px 56px;
  border-top: 1px solid var(--hairline);
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 36px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  transition: background 0.2s ease;
  text-decoration: none;
}
.contact-btn:hover {
  background: var(--accent);
}
.contact-btn .arrow {
  font-size: 14px;
  letter-spacing: 0;
}

/* ------ Shared CTA button rounding (softens contact, send, rc-btn, rp-btn) ------ */
.contact-btn,
.send-btn,
.rc-btn,
.rp-btn {
  border-radius: 4px;
}

/* ------ Shared animations ------ */
nav.masthead {
  opacity: 0;
  transform: translateY(-100%);
  transition:
    opacity 0.85s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.95s cubic-bezier(0.2, 0.7, 0.2, 1);
}
body.loaded nav.masthead {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.95s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.95s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  nav.masthead,
  .reveal {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ------ Shared mobile breakpoint ------ */
@media (max-width: 900px) {
  /* Mobile: switch from grid to flex — simpler, all 3 items share one row + share a single vertical center.
     Logo first (at left margin), 12px gap, brand text, then hamburger pushed to the right edge. */
  nav.masthead {
    padding: 22px 24px 20px;
    display: flex;
    align-items: center;
    column-gap: 12px;
    /* clear desktop grid */
    grid-template-columns: none;
  }
  .brand-logo {
    order: 1;
    margin-right: 0;
    display: inline-flex;
    align-items: center;
  }
  .brand-logo img {
    height: 36px;
    display: block;
  }
  nav.masthead .brand {
    order: 2;
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    line-height: 1;
  }
  nav.masthead .links {
    display: none;
  }
  .hamburger {
    order: 99;
    margin-left: auto;
    display: flex;
    align-items: center;
  }
  .mobile-menu {
    display: flex;
  }
  footer.site-footer {
    grid-template-columns: 1fr;
    gap: 18px;
    text-align: center;
    padding: 32px 24px;
  }
  footer .f-meta,
  footer .f-brand,
  footer .f-links {
    justify-self: center;
  }
}

/* Drop-cap clear: when the first paragraph is short, the floated ::first-letter
   drop cap overflows into the next paragraph and creates awkward wrapping.
   Clear any subsequent paragraph back to the left margin. Applies to the three
   prose containers used across pages: .prose, .reading-body, .as-prose. */
.prose p + p,
.reading-body p + p,
.as-prose p + p {
  clear: left;
}
