/* ==========================================
   SHAO — portfolio styles
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --red: #E63946;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #888888;
  --max-width: 1400px;
  --pad-x: clamp(1.5rem, 4vw, 4rem);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* =================
   Header / Nav
   ================= */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 2rem var(--pad-x);
}

.site-header nav > ul {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 900px;
}

.site-header nav a,
.site-header nav .nav-trigger {
  color: var(--red);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0;
  text-decoration: none;
  transition: color 0.2s ease;
}

/* >>> hover turns white <<< */
.site-header nav > ul > li > a:hover,
.site-header nav > ul > li > .nav-trigger:hover,
.site-header nav > ul > li:hover > a,
.site-header nav > ul > li:hover > .nav-trigger {
  color: #ffffff;
}

.site-header nav a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.caret {
  display: inline-block;
  font-size: 0.7rem;
  transform: translateY(-1px);
}

/* WORK dropdown */
.has-sub { position: relative; }
.has-sub > ul {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  margin-top: 0.75rem;
  padding: 0.75rem 0;
  background: #ffffff;
  list-style: none;
  min-width: 280px;
  align-items: stretch;
  gap: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  /* hidden but still receives hover after a delay */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0s linear 0.4s,
    transform 0.2s ease;
}
/* invisible bridge that closes the cursor gap between trigger and menu */
.has-sub > ul::before {
  content: '';
  position: absolute;
  top: -1.25rem;
  left: 0;
  right: 0;
  height: 1.25rem;
}
.has-sub:hover > ul,
.has-sub:focus-within > ul,
.has-sub > ul:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition:
    opacity 0.2s ease,
    visibility 0s linear 0s,
    transform 0.2s ease;
}
.has-sub > ul li { display: block; }
.has-sub > ul a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--red);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-align: right;
  transition: all 0.15s ease;
}
.has-sub > ul a:hover {
  color: #ffffff;
  background: var(--red);
}

/* =================
   Hero
   ================= */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}
.hero > img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* =================
   Section heading
   ================= */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem var(--pad-x) 4rem;
}

.section h2 {
  color: var(--red);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin: 0 0 4rem 0;
  letter-spacing: 0.01em;
}

.heading-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.heading-link:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 3px;
  opacity: 0.85;
}

/* =================
   Staggered gallery (5-col)
   ================= */
.staggered {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
  align-items: start;
}
.staggered figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: #000;
}
.staggered figure img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.5s ease;
}

/* Vertical staggering for 5-col */
.staggered figure:nth-child(5n+1) { margin-top: 3rem; }
.staggered figure:nth-child(5n+2) { margin-top: 6rem; }
.staggered figure:nth-child(5n+3) { margin-top: 0; }
.staggered figure:nth-child(5n+4) { margin-top: 7rem; }
.staggered figure:nth-child(5n+5) { margin-top: 2rem; }

/* =================
   Wide gallery (3-col, for theatre/gigs)
   ================= */
.staggered-wide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.staggered-wide figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: #000;
}
.staggered-wide figure img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.5s ease;
}
.staggered-wide figure:nth-child(3n+1) { margin-top: 2rem; }
.staggered-wide figure:nth-child(3n+2) { margin-top: 6rem; }
.staggered-wide figure:nth-child(3n+3) { margin-top: 0; }

/* =================
   Image hover — darken + white caption
   ================= */
.staggered figure:hover img,
.staggered-wide figure:hover img {
  opacity: 0.25;
  filter: brightness(0.35);
}

.staggered figcaption,
.staggered-wide figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
  padding: 1rem 0.9rem;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  gap: 0.4rem;
  overflow: hidden;
}
.staggered figure:hover figcaption,
.staggered-wide figure:hover figcaption {
  opacity: 1;
  pointer-events: auto;
}
.cap-title {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
  margin-bottom: 0.15rem;
}
.cap-desc {
  font-weight: 400;
  font-size: 0.72rem;
  line-height: 1.4;
  opacity: 0.92;
  white-space: pre-line;
  max-width: 95%;
}
.cap-link {
  margin-top: 0.35rem;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  pointer-events: auto;
}
.cap-link:hover {
  color: var(--red);
}

/* Wider (non-square) tiles get a bit more breathing room */
.staggered-wide .cap-title { font-size: 1rem; }
.staggered-wide .cap-desc { font-size: 0.82rem; }
.staggered-wide .cap-link { font-size: 0.78rem; }

/* =================
   Load More button
   ================= */
.load-more {
  display: block;
  margin: 5rem auto 0;
  padding: 1rem 3rem;
  background: transparent;
  color: var(--red);
  border: 2px solid var(--red);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}
.load-more:hover {
  background: var(--red);
  color: #ffffff;
}

/* =================
   Contact bar — FULL WIDTH gradient
   ================= */
.contact-bar {
  width: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #ffd6cf 60%, #ffa89c 100%);
  padding: 6rem 0 8rem;
  margin-top: 6rem;
}
.contact-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.contact-bar h2 {
  color: var(--red);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin: 0 0 2rem 0;
}

.contact-line {
  font-size: 1.15rem;
  margin: 0.5rem 0;
}
.contact-line .label {
  display: inline-block;
  width: 1.5rem;
  font-style: italic;
  color: var(--muted);
}
.contact-line a:hover { color: var(--red); }

.links {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.links a:hover { color: var(--red); }

/* =================
   Bio page
   ================= */
.bio-page .hero {
  height: 100vh;
  min-height: 700px;
}

.bio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 7rem var(--pad-x) 3rem;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  z-index: 2;
}

.bio-overlay h1 {
  color: var(--red);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  margin: 0 0 1.5rem 0;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.bio-text {
  max-width: 720px;
  padding: 1.5rem 2rem;
  color: #ffffff;
  opacity: 0.5;
  background: transparent;
  transition: all 0.3s ease;
  pointer-events: auto;
  cursor: default;
  overflow-y: auto;
  max-height: calc(100vh - 16rem);
}

.bio-text:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.85);
}

.bio-text h3 {
  font-size: 0.8rem;
  font-weight: 700;
  margin: 1.25rem 0 0.4rem 0;
  letter-spacing: 0.18em;
  color: #ffffff;
}
.bio-text h3:first-child { margin-top: 0; }

.bio-text p {
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
  font-weight: 500;
}

.bio-text strong { font-weight: 800; }

.photo-credit {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  font-weight: 600;
}

/* =================
   Mobile
   ================= */
@media (max-width: 900px) {
  .staggered {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .staggered figure:nth-child(5n+1),
  .staggered figure:nth-child(5n+2),
  .staggered figure:nth-child(5n+3),
  .staggered figure:nth-child(5n+4),
  .staggered figure:nth-child(5n+5) {
    margin-top: 0;
  }
  .staggered figure:nth-child(3n+2) { margin-top: 2rem; }
  .staggered figure:nth-child(3n+3) { margin-top: 4rem; }

  .staggered-wide {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .staggered-wide figure:nth-child(n) { margin-top: 0; }

  .bio-text { max-width: 100%; }
}

@media (max-width: 600px) {
  .site-header { padding: 1.25rem 1rem; }

  /* Full-width nav, items spread across edges */
  .site-header nav > ul {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
  }
  .site-header nav a,
  .site-header nav .nav-trigger { font-size: 0.8rem; }

  /* Hide WORK dropdown on mobile — sections are just a scroll away */
  .site-header nav .has-sub { display: none; }

  .has-sub > ul {
    left: auto;
    right: 0;
    transform: none;
    min-width: 220px;
  }

  .staggered { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .staggered figure:nth-child(2n+2) { margin-top: 2rem; }
  .staggered figure:nth-child(2n+1) { margin-top: 0; }

  .section { padding: 4rem 1rem 2rem; }
  .contact-bar { padding: 4rem 0 5rem; }
  .contact-bar-inner { padding: 0 1rem; }
  .bio-overlay { padding: 6rem 1rem 2rem; }
  .load-more { padding: 0.85rem 2rem; }

  /* Bio text: solid dark background by default on mobile — no hover state on touch */
  .bio-text {
    padding: 1.25rem 1.5rem;
    opacity: 1;
    background: rgba(0, 0, 0, 0.78);
  }
  .bio-text:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.78);
  }
}
