/* ============================================================
   Viktor Turskyi — Photography. Single hand-written stylesheet.
   Mobile-first; breakpoints at 600 / 800 / 1000px.
   ============================================================ */

:root {
  --bg: #0c0c0d;
  --surface: #161618;
  --surface-2: #1d1d20;
  --text: #ededed;
  --text-dim: #9a9aa0;
  --line: #2a2a2e;
  --accent: #e6b54a;
  --maxw: 1180px;
  --gap: 14px;
  --radius: 6px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-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.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Blur-up placeholder: .ph carries the LQIP background; the sharp image fades in. */
.ph {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.ph picture, .ph img { display: block; width: 100%; height: 100%; }
.ph img { object-fit: cover; }
img.blurup { opacity: 0; transition: opacity 0.6s ease; }
img.blurup.loaded { opacity: 1; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}

/* The album gallery breaks out wider than the 1180px text column on large
   screens so big/4K displays get more photos per row (paired with a smaller
   --row-h below). Width scales with the viewport rather than a hard cap. */
@media (min-width: 1300px) { .container-gallery { max-width: min(1560px, 92vw); } }
@media (min-width: 2000px) { .container-gallery { max-width: min(2240px, 90vw); } }

/* ---- Navigation ---------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(12, 12, 13, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 16px;
}
.nav-links { display: flex; gap: 20px; }
.nav-links a {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

/* ---- Hero / page heads --------------------------------------------------- */
.hero {
  padding: clamp(56px, 12vw, 120px) 0 clamp(32px, 6vw, 56px);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.hero-eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: clamp(11px, 1.6vw, 13px);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(44px, 9vw, 96px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.hero-tagline {
  margin: 18px auto 0;
  max-width: 44ch;
  color: var(--text-dim);
  font-size: clamp(15px, 2.4vw, 19px);
}

/* Full-bleed photo hero */
.hero-photo {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(78vh, 720px);
  padding: 0;
  text-align: left;
  overflow: hidden;
  border-bottom: none;
}
.hero-photo .hero-bg,
.hero-photo .hero-bg .ph {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-photo .hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(7, 7, 8, 0.92) 0%,
    rgba(7, 7, 8, 0.45) 38%,
    rgba(7, 7, 8, 0.15) 70%,
    rgba(7, 7, 8, 0.35) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 60px;
  padding-bottom: clamp(36px, 6vw, 64px);
}
.hero-photo .hero-tagline { margin-left: 0; margin-right: 0; }

.page-head { padding: clamp(36px, 7vw, 64px) 0 8px; }
.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(23px, 4.2vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.section-lead { margin: 10px 0 0; color: var(--text-dim); max-width: 60ch; }
.crumb { margin: 0 0 8px; }
.crumb a { color: var(--accent); font-size: 14px; font-weight: 500; }

/* ---- Sections + album grid ---------------------------------------------- */
.section { padding: clamp(28px, 5vw, 48px) 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-more { color: var(--accent); font-size: 14px; font-weight: 500; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 800px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: #3a3a40;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.card-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-2); }
.card-img .ph img { transition: transform 0.5s ease, opacity 0.6s ease; }
.card:hover .card-img .ph img { transform: scale(1.04); }
.card-body { display: block; padding: 13px 15px 15px; }
.card-title { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.card-meta { display: block; margin-top: 4px; color: var(--text-dim); font-size: 13px; }
.card-count { display: block; margin-top: 7px; color: var(--accent); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- Album gallery — justified rows -------------------------------------- */
/* Flickr/Lightroom-style layout: each photo keeps its native aspect ratio and
   rows are filled to the container width. --ar (set inline per .shot) drives
   both the wrap basis and the grow factor, which keeps every photo in a row at
   the same height. --row-h is the target row height; raise it for larger
   photos on wider screens. No JS — degrades to inline-flow if CSS is disabled. */
.gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--gap);
  --row-h: 300px;
}
@media (min-width: 1000px) { .gallery { --row-h: 320px; gap: 16px; } }
@media (min-width: 1400px) { .gallery { --row-h: 340px; } }
@media (min-width: 2000px) { .gallery { --row-h: 380px; } }

.shot {
  position: relative;
  flex: 1 1 100%; /* mobile: one full-width photo per row */
  aspect-ratio: var(--ar, 1.5);
  min-width: 0;
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
}
/* Fillers only matter for justified rows (≥600px); hidden on mobile's single
   column where every photo is already full width. */
.shot-filler { display: none; }
/* Justified rows kick in above phone widths, where fitting several photos to a
   row reads well. Below this, a single column avoids odd part-width rows. */
@media (min-width: 600px) {
  .shot { flex: var(--ar, 1.5) 1 calc(var(--ar, 1.5) * var(--row-h)); }
  /* Trailing fillers: huge grow + zero basis soak up the final row's slack so
     the last photos hold their target height instead of stretching full width. */
  .shot-filler {
    display: block;
    flex: 1000 1 0;
    height: 0;
    min-width: 0;
    pointer-events: none;
  }
}
.shot .ph img { transition: transform 0.5s ease, opacity 0.6s ease; }
.shot:hover .ph img { transform: scale(1.05); }
.shot-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 14px 12px;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.shot:hover .shot-cap { opacity: 1; transform: translateY(0); }

.empty { color: var(--text-dim); }
.empty code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }

/* ---- Lightbox ------------------------------------------------------------ */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lb.open { display: flex; opacity: 1; }
.lb-figure {
  margin: 0;
  max-width: 94vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lb-figure img {
  max-width: 94vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lb-caption {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}
.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.18); }
.lb-prev { left: max(12px, 2vw); }
.lb-next { right: max(12px, 2vw); }
.lb-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 30px;
  background: transparent;
}
.lb-counter {
  position: absolute;
  top: 18px;
  left: 20px;
  color: var(--text-dim);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .lb-btn { width: 44px; height: 44px; font-size: 22px; }
}

/* ---- About / Contact ----------------------------------------------------- */
.about { padding: clamp(44px, 8vw, 88px) 0; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}
@media (min-width: 800px) {
  .about-grid { grid-template-columns: 320px 1fr; }
  .about-grid.no-portrait { grid-template-columns: 1fr; }
}
.about-portrait {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.about-portrait img { width: 100%; height: auto; display: block; }
.about-body { max-width: 60ch; }
.about-body p { color: #cfcfd3; font-size: 17px; margin: 0 0 16px; }
.about-body .section-title { margin-bottom: 18px; }
.about-booking {
  color: var(--text) !important;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  font-size: 16px !important;
}
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.contact-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.contact-link:hover { border-color: var(--accent); background: var(--surface-2); }

/* ---- Footer -------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  text-align: center;
  color: var(--text-dim);
}
.footer-name { margin: 0; color: var(--text); font-weight: 600; }
.footer-links { margin: 10px 0 0; font-size: 14px; }
.footer-links a { color: var(--text-dim); transition: color 0.15s ease; }
.footer-links a:hover { color: var(--text); }
.footer-links span { opacity: 0.4; }
.footer-copy { margin: 12px 0 0; font-size: 13px; opacity: 0.7; }
