/* ==========================================================
   Harley Zhong — Photography Portfolio
   Split-screen layout: fixed menu left · photos right
   Palette: black #111 · white #fff · greys #f4f4f4 / #999
   ========================================================== */

:root {
  --ink: #111111;
  --paper: #fffefd;   /* pure white with the faintest warm touch */
  --grey-light: #f4f4f4;
  --grey-mid: #999999;
  --grey-dark: #444444;
  --split: max(20vw, 240px);  /* width of the left menu panel */
  --pad: clamp(28px, 5vw, 72px);
  --font: Georgia, "Times New Roman", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Left panel ---------- */

.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--split);
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--pad) clamp(24px, 3.5vw, 60px);
  background: var(--paper);
  z-index: 100;
}

.logo {
  display: inline-block;
  margin-top: clamp(40px, 9vh, 100px);
  font-size: clamp(13px, 1.15vw, 18px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-nav a {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: capitalize;
  color: var(--grey-dark);
  width: fit-content;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, letter-spacing 0.25s ease;
}

.side-nav a:hover { color: var(--ink); letter-spacing: 0.22em; }

.side-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.side-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-meta a {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: capitalize;
  color: var(--grey-mid);
  width: fit-content;
  transition: color 0.2s ease;
}

.side-meta a:hover { color: var(--ink); }

.side-meta p {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: capitalize;
  color: #c4c4c4;
  margin-top: 8px;
}

/* ---------- Right content ---------- */

.content {
  margin-left: var(--split);
  min-height: 100vh;
  min-height: 100svh;
}

/* Gallery pages: single column of photographs */

.page {
  padding: var(--pad);
}

.page-title {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 12px;
  color: var(--grey-mid);
  letter-spacing: 0.08em;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vw, 40px);
}

.gallery figure {
  overflow: hidden;
}

.gallery img {
  width: 100%;
}

/* Home feed: each photo fits the screen whole, hung larger than the section walls */
.gallery.feed { align-items: center; }

.gallery.feed img {
  width: auto;
  max-width: 100%;
  max-height: 88svh;
}

/* Section galleries: every photo fits fully in the viewport, at a consistent scale */
.gallery.fit { align-items: center; }

.gallery.fit figcaption { text-align: right; }

.gallery.fit img {
  width: auto;
  max-width: 100%;
  max-height: calc(100svh - 2 * var(--pad));
}

/* Museum wall: photos hang in one horizontal row; the wheel scrolls sideways */
@media (min-width: 861px) {
  .content.wall { overflow: hidden; }

  .wall .page {
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    padding-top: clamp(24px, 3vw, 44px);
    padding-bottom: 0;
  }

  .wall .gallery.fit {
    flex: 1;
    min-height: 0;
    flex-direction: row;
    align-items: stretch;
    gap: 35px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-top: clamp(32px, 6.5vh, 64px);   /* nudges the hang line down */
    padding-bottom: clamp(24px, 3vw, 44px);
    scrollbar-width: none;
  }

  .wall .gallery.fit::-webkit-scrollbar { display: none; }

  .wall .gallery.fit figure {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .wall .gallery.fit img {
    max-width: none;
    /* caption room, capped at ~74% of screen height (≈665px on a 900px display) */
    max-height: min(calc(100% - 40px), 74svh);
  }

  /* fade in place — no vertical shift on the wall */
  .wall .gallery.fit figure { transform: none; }

  /* panoramas: cap width so the whole frame fits the visible area */
  .wall .gallery.fit img.panorama {
    max-width: calc(100vw - var(--split) - 2 * var(--pad));
  }
}

.gallery figcaption {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink);
  padding-top: 10px;
}



/* fade-in on scroll */
.gallery figure,
.about-layout {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.gallery figure.visible,
.about-layout.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .gallery figure, .about-layout { opacity: 1; transform: none; transition: none; }
}

/* ---------- Film ---------- */

.film-list {
  margin-top: clamp(32px, 6.5vh, 62px);   /* same hang line as the galleries */
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 5vw, 64px);
  max-width: 960px;
}

.film-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.film-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.film-caption {
  font-size: 12px;
  letter-spacing: 0.06em;
  padding-top: 10px;
  text-align: right;
}

.films-soon {
  font-size: 13px;
  color: var(--grey-mid);
  letter-spacing: 0.06em;
}

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

.about-layout {
  margin-top: clamp(32px, 6.5vh, 62px);   /* aligns the photo with the gallery hang line */
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

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

.about-lead {
  color: var(--ink) !important;
  line-height: 1.9;
}

.prose { max-width: 46ch; }

.prose .inquiries {
  margin-top: 3em;
}

.prose .inquiries a,
.prose .bio-link {
  border-bottom: 1px solid #d5d5d5;
  transition: border-color 0.2s ease;
}

.prose .inquiries a:hover,
.prose .bio-link:hover { border-bottom-color: var(--ink); }

.prose p {
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 1.2em;
}

.prose h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 2.2em 0 0.8em;
}

.portrait {
  width: 100%;
  max-width: 460px;
  filter: grayscale(1);
  background: var(--grey-light);
  margin-bottom: clamp(28px, 4vw, 48px);
}

.contact-list {
  list-style: none;
  max-width: 560px;
}

.contact-list li {
  padding: 18px 0;
  border-bottom: 1px solid #eaeaea;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
}

.contact-list .label {
  width: 110px;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--grey-mid);
}

.contact-list a {
  border-bottom: 1px solid #d5d5d5;
  transition: border-color 0.2s ease;
}

.contact-list a:hover { border-bottom-color: var(--ink); }

/* ---------- Mobile: panel collapses to a top bar ---------- */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 20px;
  position: relative;
  z-index: 110;
}
.nav-toggle span {
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}
.nav-toggle span:nth-child(1) { top: 2px; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 16px; }
.nav-open .nav-toggle span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { top: 9px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .side-panel {
    position: sticky;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 18px 24px;
    border-right: none;
    border-bottom: 1px solid #ececec;
  }

  .logo { font-size: 15px; margin-top: 0; }

  .nav-toggle { display: block; margin-left: auto; }

  .side-nav {
    position: fixed;
    inset: 0;
    background: var(--paper);
    align-items: center;
    justify-content: center;
    gap: 28px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 105;
  }
  .nav-open .side-nav { opacity: 1; pointer-events: auto; }
  .side-nav a { font-size: 14px; }

  .side-meta { display: none; }

  .content { margin-left: 0; }
}
