/*
  styles.css — John Castner site
  Charcoal palette, Cormorant Garamond headings, Inter body. Generous
  whitespace so the wood does the talking. Mobile-first; desktop breakpoint
  kicks in at 760px and a wider layout opens at 1100px.
*/

/* ----- Reset and base ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

:root {
  --bg:           #1a1a1a;            /* charcoal background */
  --bg-elevated:  #222222;            /* hover state, slightly lifted */
  --ink:          #ebe6d9;            /* warm cream body text */
  --ink-soft:     #b6ad99;            /* muted ink for subtitles */
  --rule:         #2e2a25;            /* hairline dividers */
  --accent:       #c8a36a;            /* warm wood-amber for links */
  --accent-soft:  #8d7649;
  --serif:        'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max:          1200px;
  --gutter:       1.5rem;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color 200ms ease; }
a:hover { color: var(--ink); }

/* ----- Header / nav ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(26, 26, 26, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.brand {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand:hover { color: var(--accent); }
.nav-link {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav-link:hover { color: var(--ink); }

/* ----- Hero ----- */
/* Hero fills the full viewport so Selected Works sits exactly at the fold.
   The cropped image band stays at 62vh anchored to the top; the remaining
   space below the image is solid charcoal background. */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}
.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 62vh;
  object-fit: cover;
  object-position: center 45%; /* land the visible band on the wall art — keeps ceiling and TV out of frame */
  filter: brightness(0.62);
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0 var(--gutter) 4rem;
  max-width: var(--max);
  margin: 0 auto;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  margin: 0;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #f4efe2;
  text-shadow: 0 2px 16px rgba(0,0,0,0.6);
}
.hero-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  margin: 0.6rem 0 0;
  color: var(--ink);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* ----- Sections ----- */
.section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: none; }
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.02em;
  margin: 0 0 2.5rem;
  color: var(--ink);
}
.category-title {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.section-cta {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

/* ----- Image grid ----- */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 920px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid { gap: 1.5rem; }
}

/* Mobile hero swaps to the closeup wall-art shot via <picture>; reset
   object-position so the closeup is centered, not anchored to 45% which
   was tuned for the desktop three-piece composition. */
@media (max-width: 700px) {
  .hero-image { object-position: center center; }
}

.card {
  margin: 0;
  overflow: hidden;
  background: var(--bg-elevated);
  aspect-ratio: 4 / 5;
  position: relative;
  cursor: zoom-in;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease, filter 400ms ease;
}
.card:hover img { transform: scale(1.03); filter: brightness(1.05); }

/* ----- Bio ----- */
.bio {
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.65;
  margin: 0 0 1.4rem;
  color: var(--ink);
}
.bio-coda {
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 2rem;
}

/* ----- Footer ----- */
.site-footer {
  padding: 2.5rem var(--gutter);
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  border-top: 1px solid var(--rule);
}

/* ----- Lightbox ----- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.94);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
  animation: fadeIn 200ms ease;
}
.lightbox[hidden] { display: none; }
.lightbox-image {
  max-width: 95%;
  max-height: 92vh;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 8px 60px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  font-size: 2.2rem;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 200;
  line-height: 1;
  transition: color 200ms ease, transform 200ms ease;
}
.lightbox-close:hover { color: var(--accent); transform: scale(1.1); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ----- Gallery intro spacing ----- */
.gallery-intro { padding-top: 4rem; padding-bottom: 1rem; border-bottom: none; }
.gallery-category { padding-top: 3rem; padding-bottom: 3rem; }

/* Back-to-home link sits above the gallery title, understated */
.back-link {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.back-link a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.back-link a:hover { color: var(--accent); border-bottom-color: var(--accent); }
