:root {
  --ink: #14120f;
  --paper: #f7f5f1;
  --paper-dim: #eeece6;
  --line: #dcd8d0;
  --muted: #6b665d;
  --accent: #14120f;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.07  0 0 0 0 0.06  0 0 0 0 0.04  0 0 0 0.14 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --collage: url("../images/texture/details-collage.png");
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 1300px 900px at 12% 0%, rgba(255,247,230,0.95) 0%, rgba(255,247,230,0) 60%),
    radial-gradient(ellipse 1100px 1000px at 100% 15%, rgba(201,184,153,0.4) 0%, rgba(201,184,153,0) 60%),
    radial-gradient(ellipse 1200px 1000px at 8% 100%, rgba(190,178,158,0.32) 0%, rgba(190,178,158,0) 60%),
    var(--grain);
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  background-attachment: fixed, fixed, fixed, fixed;
  background-size: auto, auto, auto, auto;
  background-position: center, center, center, top left;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg-parallax {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--collage);
  background-repeat: repeat;
  background-size: 2000px 1600px;
  background-position: center top;
  will-change: background-position;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, rgba(20,18,15,0.55), rgba(20,18,15,0));
  pointer-events: none;
}
.site-header a, .site-header button { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.brand-mark { width: 28px; height: 28px; filter: brightness(0) invert(1); }
.brand-word {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.site-nav {
  display: flex;
  gap: 32px;
}
.site-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.92;
  transition: opacity 0.15s;
}
.site-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none; border: none; cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* body scrolled state (darker fixed header once past hero) handled by JS toggling .scrolled */
.site-header.scrolled {
  background: rgba(20,18,15,0.92);
  backdrop-filter: blur(6px);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.hero-media { position: absolute; inset: 0; }
.hero-img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 25%;
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,9,7,0.78) 0%, rgba(10,9,7,0.25) 45%, rgba(10,9,7,0.15) 100%);
}
.hero-copy {
  position: relative;
  z-index: 2;
  color: #fff;
  padding: 0 var(--gutter) clamp(48px, 8vw, 96px);
  max-width: 900px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(48px, 9vw, 108px);
  margin: 0 0 16px;
}
.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  max-width: 520px;
  color: rgba(255,255,255,0.88);
  margin: 0 0 32px;
  font-weight: 300;
}
.btn {
  display: inline-block;
  padding: 14px 30px;
  border: 1px solid rgba(255,255,255,0.7);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: #fff; color: var(--ink); }

/* ---------- Highlights ---------- */

.highlights {
  padding: clamp(64px, 10vw, 120px) var(--gutter) clamp(40px, 8vw, 80px);
}
.section-intro { margin-bottom: 32px; max-width: 640px; }
.section-intro h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 10px;
}
.section-intro p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 12vw;
  gap: 8px;
}
.highlight-grid .h-item {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--paper-dim);
}
.highlight-grid .h-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.highlight-grid .h-item:hover img { transform: scale(1.045); }

/* span pattern for visual rhythm across 12 items */
.h-item:nth-child(1) { grid-column: span 3; grid-row: span 2; }
.h-item:nth-child(2) { grid-column: span 3; grid-row: span 1; }
.h-item:nth-child(3) { grid-column: span 3; grid-row: span 1; }
.h-item:nth-child(4) { grid-column: span 2; grid-row: span 2; }
.h-item:nth-child(5) { grid-column: span 2; grid-row: span 2; }
.h-item:nth-child(6) { grid-column: span 2; grid-row: span 2; }
.h-item:nth-child(7) { grid-column: span 3; grid-row: span 2; }
.h-item:nth-child(8) { grid-column: span 3; grid-row: span 2; }
.h-item:nth-child(9) { grid-column: span 2; grid-row: span 1; }
.h-item:nth-child(10) { grid-column: span 2; grid-row: span 1; }
.h-item:nth-child(11) { grid-column: span 2; grid-row: span 1; }
.h-item:nth-child(12) { grid-column: span 3; grid-row: span 2; }

@media (max-width: 900px) {
  .highlight-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 22vw; }
  .h-item:nth-child(n) { grid-column: span 2 !important; grid-row: span 1 !important; }
}
@media (max-width: 520px) {
  .highlight-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 42vw; gap: 6px; }
}

/* ---------- Category sections ---------- */

.category {
  padding: clamp(48px, 8vw, 88px) var(--gutter);
  border-top: 1px solid var(--line);
}
.category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.category-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
}
.category-count {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.gallery-grid {
  column-count: 3;
  column-gap: 10px;
}
.gallery-grid .g-item {
  overflow: hidden;
  cursor: pointer;
  background: var(--paper-dim);
  break-inside: avoid;
  margin-bottom: 10px;
}
.gallery-grid .g-item img {
  width: 100%; height: auto; display: block;
  transition: transform 0.5s ease;
}
.gallery-grid .g-item:hover img { transform: scale(1.045); }

@media (max-width: 720px) {
  .gallery-grid { column-count: 2; column-gap: 8px; }
  .gallery-grid .g-item { margin-bottom: 8px; }
}
@media (max-width: 460px) {
  .gallery-grid { column-count: 1; }
}

/* ---------- About ---------- */

.about {
  padding: clamp(64px, 10vw, 110px) var(--gutter);
  background-color: var(--paper-dim);
  background-image:
    radial-gradient(ellipse 1100px 800px at 90% 0%, rgba(255,250,238,0.7) 0%, rgba(255,250,238,0) 60%),
    var(--grain);
  background-repeat: no-repeat, repeat;
  background-position: center, top left;
  border-top: 1px solid var(--line);
}
.about-inner { max-width: 680px; margin: 0 auto; text-align: left; }
.about h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 22px; }
.about p {
  font-size: 17px;
  color: #302d27;
  margin: 0 0 18px;
  font-weight: 300;
}
.about p:last-child { margin-bottom: 0; }

/* ---------- Contact / Footer ---------- */

.contact {
  padding: clamp(72px, 12vw, 140px) var(--gutter) 48px;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}
.contact-inner { max-width: 640px; margin: 0 auto; }
.contact h2 {
  font-size: clamp(32px, 5vw, 52px);
  color: #fff;
  margin-bottom: 14px;
}
.contact-lede {
  color: rgba(247,245,241,0.7);
  font-size: 16px;
  margin: 0 0 32px;
  font-weight: 300;
}
.contact-email {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 4.6vw, 32px);
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 4px;
  margin-bottom: 56px;
  overflow-wrap: normal;
  white-space: nowrap;
}
@media (max-width: 360px) {
  .contact-email { font-size: 15px; }
}
.contact-email:hover { border-color: #fff; }
.copyright {
  font-size: 12px;
  color: rgba(247,245,241,0.45);
  margin: 0;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed; inset: 0;
  background: rgba(10,9,7,0.96);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: none; border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-close {
  top: 20px; right: 24px;
  font-size: 36px;
  line-height: 1;
}
.lightbox-prev, .lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  line-height: 1;
  padding: 8px 14px;
}
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lightbox-prev, .lightbox-next { font-size: 34px; padding: 6px 8px; }
  .lightbox-close { top: 10px; right: 12px; font-size: 30px; }
}

/* ---------- Mobile nav ---------- */

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--ink);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    padding: 0 40px;
    transform: translateX(100%);
    transition: transform 0.28s ease;
  }
  .site-nav.open { transform: translateX(0); }
  .site-nav a { font-size: 18px; }

  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
