:root {
  --bg: #2e2e2e;
  --bg-deep: #242424;
  --bg-soft: #3a3a3a;
  --text: #e8e4de;
  --muted: #a8a39a;
  --accent: #d4c4a8;
  --border: #4a4a4a;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body > main,
body > .hero {
  flex: 1 1 auto;
  min-height: 0;
}

body.home {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 3rem;
  height: 10dvh;
  min-height: 64px;
  flex: 0 0 auto;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-header nav {
  display: flex;
  gap: 2.5rem;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease, bottom 0.2s ease;
}

.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle span:nth-child(3) { bottom: 13px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.site-header nav a {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding-bottom: 4px;
}

.site-header nav a.active,
.site-header nav a:hover {
  color: var(--text);
}

.site-header nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

/* Hero */
.hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.55);
  animation: slowZoom 20s ease-in-out infinite alternate;
}

@keyframes slowZoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 2;
  padding: 2rem;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.hero-content p {
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-block;
  padding: 0.9rem 2.25rem;
  border: 1px solid var(--text);
  color: var(--text);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  transition: all 0.3s ease;
  font-family: var(--sans);
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
}

/* Featured */
.featured {
  padding: 6rem 3rem;
  max-width: 1600px;
  margin: 0 auto;
}

.featured h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3.5rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.featured-grid .photo {
  aspect-ratio: 4/5;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: transform 0.4s ease;
  border: 1px solid var(--border);
}

.featured-grid .video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery .video-thumb video {
  display: block;
}

.featured-grid .photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s ease;
}

.featured-grid .photo:hover::after {
  background: rgba(0,0,0,0.2);
}

.featured-cta {
  text-align: center;
  margin-top: 3rem;
}

.link-arrow {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: all 0.2s ease;
}

.link-arrow:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* Portfolio page */
.portfolio-page, .about-page, .contact-page {
  padding: 5rem 3rem 6rem;
  max-width: 1600px;
  margin: 0 auto;
  background: var(--bg-deep);
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 0;
  line-height: 1.05;
}

.page-header .subtitle { margin-top: 0.25rem; }

.subtitle {
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.category-tabs {
  margin-bottom: 3.5rem;
}

.category-tabs .tab-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.category-tabs .tab-row.primary {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.category-tabs .tab-row.secondary {
  gap: 1.5rem;
  padding-top: 0.25rem;
}

.category-tabs button {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.category-tabs .tab-row.secondary button {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  opacity: 0.85;
}

.category-tabs button:hover { color: var(--text); }

.category-tabs button.active {
  color: var(--text);
  opacity: 1;
}

.category-tabs .tab-row.primary button.active::after {
  content: '';
  position: absolute;
  bottom: -1.25rem;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

.category-tabs .tab-row.secondary button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

.gallery {
  columns: 3;
  column-gap: 1rem;
}

.gallery .photo {
  width: 100%;
  margin-bottom: 1rem;
  break-inside: avoid;
  cursor: pointer;
  display: block;
  position: relative;
  transition: opacity 0.3s ease;
}

.gallery .photo img,
.gallery .photo video {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
}

.gallery .photo:hover { opacity: 0.8; }

/* Video thumbs */
.gallery .video-thumb,
.featured-grid .photo {
  position: relative;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding-left: 4px;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

/* Watermark */
.watermark {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  user-select: none;
  z-index: 2;
  line-height: 1;
}

/* Image protection — disable selection/drag on media */
.gallery img,
.featured-grid .photo,
.lightbox-media,
.about-image {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.about-image {
  aspect-ratio: 4/5;
  background-size: cover;
  background-position: center;
}

.about-text h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin-bottom: 1.5rem;
}

.about-text .lede {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 2rem;
  font-style: italic;
}

.about-text p {
  margin-bottom: 1.25rem;
  color: var(--text);
  opacity: 0.85;
}

.about-text a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

/* Stats */
.stats {
  margin-top: 6rem;
  padding-top: 4rem;
  border-top: 1px solid var(--border);
}

.stats h2 {
  font-size: 2.25rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 4rem;
}

.stat-card {
  padding: 2rem 1rem;
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.stat-value {
  font-family: var(--serif);
  font-size: 2.75rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats-subhead {
  font-family: var(--serif);
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text);
}

.top-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.top-photo {
  display: block;
  position: relative;
  overflow: hidden;
}

.top-photo img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.top-photo:hover img { transform: scale(1.03); }

.top-photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0.25rem 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.top-photo-caption { color: var(--text); }
.top-photo-views   { color: var(--muted); }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .top-photos { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .top-photos { grid-template-columns: 1fr; }
}

/* Contact */
.contact-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-inner h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin-bottom: 0.75rem;
}

.contact-form {
  margin-top: 3rem;
  text-align: left;
}

.contact-form label {
  display: block;
  margin-bottom: 1.5rem;
}

.contact-form span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.75rem 0;
  transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea { resize: vertical; }

.contact-form button {
  margin-top: 1rem;
}

.contact-alt {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-alt a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3rem;
  height: 10dvh;
  min-height: 64px;
  flex: 0 0 auto;
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
  z-index: 100;
  padding: 5vw 5vw 10vw;
}

.lightbox.open { display: flex; }

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.lightbox-media-wrap {
  display: inline-block;
  text-align: center;
}

.lightbox-media-frame {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.lightbox-media {
  max-width: 90vw;
  max-height: calc(100dvh - 18vw); /* viewport - 5vw top - caption - 10vw bottom strip */
  object-fit: contain;
  display: block;
}

video.lightbox-media { background: var(--bg); }

.lightbox-bottom {
  position: absolute;
  left: 5vw;
  right: 5vw;
  bottom: 2vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lightbox-nav {
  display: flex;
  gap: 0.5rem;
}

.lightbox-bottom button {
  background: none;
  border: none;
  padding: 0.7rem;
  margin: 0;
  min-width: 44px;
  min-height: 44px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.lightbox-bottom button:hover { color: var(--accent); }

.lightbox-tools {
  display: flex;
  gap: 0.5rem;
}

.lightbox-fullscreen .exit { display: none; }
.lightbox.is-fullscreen .lightbox-fullscreen .enter { display: none; }
.lightbox.is-fullscreen .lightbox-fullscreen .exit { display: inline-block; }

.lightbox-caption {
  margin-top: 1.2rem;
  line-height: 1.3;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-align: center;
}

.lightbox-rotate-hint {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  color: var(--text);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: none;
  align-items: center;
  gap: 0.55rem;
  pointer-events: none;
  z-index: 5;
}

.lightbox.show-rotate-hint .lightbox-rotate-hint {
  display: inline-flex;
  animation: rotateHintFade 2.8s ease forwards;
}

@keyframes rotateHintFade {
  0% { opacity: 0; }
  15%, 65% { opacity: 1; }
  100% { opacity: 0; }
}

.lightbox-rotate-hint svg {
  animation: rotateHintIcon 1.6s ease-in-out infinite;
}

@keyframes rotateHintIcon {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(75deg); }
}

/* Responsive */
@media (min-width: 901px) {
  body:has(.portfolio-page) {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body:has(.portfolio-page) .portfolio-page {
    flex: 1 1 auto;
    min-height: 0;
    padding: 2rem 1.5rem 1rem;
    max-width: none;
    display: flex;
    flex-direction: column;
  }
  body:has(.portfolio-page) .portfolio-page .page-header { margin-bottom: 1.25rem; }
  body:has(.portfolio-page) .portfolio-page .category-tabs { margin-bottom: 1.25rem; }
  body:has(.portfolio-page) .gallery {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    columns: unset;
    column-gap: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 0.75rem;
  }
  body:has(.portfolio-page) .gallery .photo {
    margin: 0;
    flex: 0 0 auto;
    overflow: hidden;
  }
  body:has(.portfolio-page) .gallery .photo img,
  body:has(.portfolio-page) .gallery .photo video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
  }
}

@media (max-width: 900px) {
  .site-header { padding: 0 1.5rem; }
  .site-footer { padding: 0 1.5rem; }
  .site-header nav { gap: 1.25rem; }
  .site-header nav a { font-size: 0.75rem; letter-spacing: 0.1em; }
  .logo { font-size: 1.2rem; }
  .featured, .portfolio-page, .about-page, .contact-page { padding: 3rem 1.5rem; }
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { columns: 2; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .category-tabs { gap: 1.25rem; }
}

@media (max-width: 560px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { columns: 2; column-gap: 0.5rem; }
  .gallery .photo { margin-bottom: 0.5rem; }
  .site-header { padding: 0 1rem; }
  .site-footer { padding: 0 1rem; }

  .subtitle { font-size: 0.75rem; letter-spacing: 0.08em; }
  .category-tabs .tab-row.primary { padding-bottom: 0.5rem; margin-bottom: 0.5rem; }
  .category-tabs .tab-row.secondary { padding-top: 0; row-gap: 0.6rem; column-gap: 1rem; }
  .category-tabs .tab-row.primary button.active::after { bottom: -0.5rem; }
  .category-tabs button { padding: 0.25rem 0; }

  .nav-toggle { display: block; }

  .site-header nav {
    position: fixed;
    top: 10dvh;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 9;
  }

  .site-header nav.open { transform: translateX(0); }

  .site-header nav a {
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    padding: 1rem 1.5rem;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .site-header nav a.active::after { display: none; }

  .site-header nav a.active {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
  }
}
