/* ---------- Design tokens ---------- */
:root {
  --bg: #0b0b0c;
  --bg-elevated: #141416;
  --text: #f2f1ee;
  --text-muted: #a8a6a1;
  --accent: #f2f1ee;
  --border: #2a2a2c;
  --max-width: 1400px;
  --gap: clamp(1rem, 2vw, 2rem);
  /* Rendered height of .site-header (85px at the logo's current size) — kept
     as one variable since the hero and mobile nav both need to account for
     it exactly. Re-measure and update if the logo/header padding changes. */
  --header-h: 5.35rem;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gap);
  background: rgba(11, 11, 12, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

/* Unwrap the <nav> element from the flex layout entirely (its box, not its
   accessibility semantics — display:contents keeps the landmark role). On
   mobile, .site-nav inside it becomes position:fixed and no longer
   contributes any size, but the wrapping <nav> was still counted as a 3rd
   flex item by justify-content:space-between, so the toggle button landed
   at a "space-between of three" position instead of flush right. */
.site-header nav {
  display: contents;
}

.site-logo {
  position: relative;
  z-index: 16;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo img {
  height: 2.75rem;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.nav-toggle {
  position: relative;
  z-index: 16;
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 1rem;
}

/* ---------- Hero (full-bleed landing view) ---------- */
.hero {
  position: relative;
  /* Header is sticky-in-flow (not overlaid), so subtract its height here —
     otherwise header + 100vh hero together run taller than one screen and
     push the scroll cue below the fold. Value matches .site-header's
     rendered height (padding + logo line-height). */
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--gap);
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero::before {
  /* Legibility scrim over whatever photo is set — works regardless of the
     photo's own tones, and still looks intentional with no photo at all. */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.35) 55%, rgba(11, 11, 12, 0.9) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0 0 1.25rem;
  line-height: 0;
}

.hero-logo {
  width: clamp(220px, 32vw, 420px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 2px 24px rgba(0, 0, 0, 0.35));
}

.hero p {
  color: rgba(242, 241, 238, 0.85);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  max-width: 40rem;
  margin: 0 auto;
}

.hero-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  transform: translateX(-50%);
  z-index: 1;
  color: rgba(242, 241, 238, 0.75);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: hero-scroll-bounce 2.2s ease-in-out infinite;
}

.hero-scroll-cue svg {
  width: 1.1rem;
  height: 1.1rem;
}

@keyframes hero-scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

.portfolio-heading {
  padding: clamp(3rem, 8vw, 5rem) var(--gap) 0;
  text-align: center;
}

.portfolio-heading h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  margin: 0;
}

/* ---------- Category grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  padding: 0 var(--gap) 5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.category-card {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-elevated);
  text-decoration: none;
  display: block;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-card .label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 1.25rem 1.25rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.category-card .count {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 4rem var(--gap);
}

/* ---------- Photo grid (category page) ---------- */
.page-heading {
  padding: 3rem var(--gap) 1rem;
  text-align: center;
}

.page-heading h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  margin: 0 0 0.5rem;
}

.page-heading p {
  color: var(--text-muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
  padding: 1.5rem var(--gap) 5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.photo-grid figure {
  margin: 0;
  overflow: hidden;
  background: var(--bg-elevated);
  cursor: zoom-in;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.photo-grid figure:hover img {
  transform: scale(1.03);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  margin: 0 auto;
}

.lightbox figcaption {
  text-align: center;
  color: var(--text-muted);
  margin-top: 1rem;
  font-size: 0.9rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  line-height: 1;
}

.lightbox-close {
  top: 1rem;
  right: 1.5rem;
}

.lightbox-prev {
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- About page ---------- */
.about-section {
  display: grid;
  grid-template-columns: minmax(0, 380px) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding: 3rem var(--gap) 5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.about-section img {
  border-radius: 6px;
  width: 100%;
}

.about-section h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-top: 0;
}

.about-section p {
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

@media (max-width: 760px) {
  .about-section {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer / contact ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem var(--gap);
  text-align: center;
  color: var(--text-muted);
}

.site-footer .contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 1rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.social-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.social-links a:hover {
  color: var(--text);
}

.site-footer small {
  color: #6b6a67;
  font-size: 0.75rem;
}

/* ---------- Mobile nav ---------- */
@media (max-width: 640px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    /* top:0 + padding-top (rather than top:<header-height> + a percentage
       transform) so translateY(-100%) always clears the viewport fully,
       no matter how tall the menu's content ends up being. The old
       approach translated by a % of the nav's own height from a
       top:64px start, which left a sliver on screen whenever the menu
       was taller than expected. */
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 15;
    padding: calc(var(--header-h) + 1.25rem) 1.5rem 1.5rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    transform: translateY(-100%);
    transition: transform 0.25s ease;
  }

  .site-nav.open {
    transform: translateY(0);
  }

  .site-nav a {
    font-size: 1rem;
  }
}
