/* Reset + shared typography + section top bar */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

/* ---- Accessibility: skip link + visible keyboard focus ---- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: top var(--speed) var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Shared entrance animation (gated by reduced-motion below) */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Error (404) page ---- */
.error {
  max-width: 560px;
  margin: clamp(48px, 12vh, 140px) auto;
  text-align: center;
}
.error__code {
  display: block;
  margin-bottom: 14px;
  color: var(--accent-deep);
}
.error__title {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.08;
}
.error p {
  margin: 14px auto 0;
  max-width: 44ch;
  color: var(--text-secondary);
  font-size: clamp(15px, 1.6vw, 17px);
}
.error__home {
  display: inline-block;
  margin-top: 28px;
  padding: 11px 22px;
  border-radius: var(--radius);
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--speed) var(--ease);
}
.error__home:hover { background: var(--accent-deep); color: #fff; }
.error__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 26px;
}
.error__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-deep);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}
.error__links a:hover { color: var(--text-primary); }

/* scroll-reveal: only applied to elements JS marked as starting below the fold */
.reveal-pending { opacity: 0; transform: translateY(16px); }
.reveal-pending.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-1) var(--ease-swing), transform var(--dur-1) var(--ease-swing);
}

/* ---- Print: clean black-on-white, no site chrome ---- */
@media print {
  .skip-link,
  .topbar { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  .page { width: 100%; max-width: none; padding: 0; }
}

.label {
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- Section top bar (appears on all non-home pages) ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: var(--bg-tint);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.topbar__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.topbar__name {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1;
}

.topbar__nav {
  display: flex;
  gap: clamp(12px, 2.4vw, 30px);
}

.topbar__nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  /* roomier tap target (≥44px) for touch / a11y */
  padding: 12px 2px;
  border-bottom: 2px solid transparent;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.topbar__nav a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.topbar__nav a[aria-current="page"] {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* ---- Shared page shell for scrollable section pages ---- */
.page {
  width: var(--content-width);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) 0 96px;
}

.page__header { margin-bottom: clamp(32px, 5vw, 56px); }
.page__title { font-size: clamp(34px, 6vw, 56px); }
.page__lede {
  margin: 14px 0 0;
  max-width: 60ch;
  color: var(--text-secondary);
  font-size: clamp(15px, 1.6vw, 17px);
}

/* Quick jump-links under a page title (e.g. Photography's Favorites/Gallery/
   Contact). Anchor targets get scroll-margin-top so the sticky topbar
   doesn't cover the section when jumped to. */
/* Label sits on its own line above the buttons, so the three buttons always
   share a single row no matter how narrow the viewport gets. */
.jump-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
}
.jump-nav__label { color: var(--text-muted); font-weight: 400; }

/* nowrap is the point: the row shrinks its own padding on small screens
   (see the media query below) rather than dropping a button to a new line. */
.jump-nav__links {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  max-width: 100%;
}

/* Outlined boxes with a faint purple wash — obvious jump targets without the
   weight of a solid button. The wash is the accent (rgb 136 79 134) at low
   alpha; it deepens on hover. */
.jump-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 8px 16px;
  color: var(--accent-deep);
  border: 1.5px solid var(--accent-deep);
  border-radius: var(--radius);
  background: rgba(136, 79, 134, 0.08);
  transition: background var(--dur-micro) var(--ease-glide),
              color var(--dur-micro) var(--ease-glide);
}
.jump-nav a:hover {
  background: rgba(136, 79, 134, 0.16);
  color: var(--text-primary);
}

/* Tighten the row rather than let it wrap or overflow on narrow phones. */
@media (max-width: 430px) {
  .jump-nav__links { gap: 6px; }
  .jump-nav a { padding: 8px 10px; font-size: 13px; }
}

.section-eyebrow {
  margin: 0 0 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 88px;
}

.state-msg {
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 600px) {
  .topbar { gap: 10px; flex-wrap: wrap; }
  .topbar__nav { width: 100%; order: 3; overflow-x: auto; }
}
