/* ============================================================
   Yingzi Zhang — portfolio (placeholder draft)
   Minimal, image-forward style inspired by moriyukiochiai.com
   ============================================================ */

:root {
  --ink: #111111;
  --gray: #8a8a8a;
  --line: #e9e9e9;
  --bg: #ffffff;
  --overlay: rgba(8, 10, 14, 0.55);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

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

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

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  transition: background 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding: 14px 40px;
}

.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.nav .links { display: flex; gap: 34px; }

.nav .links a {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}

.nav .links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--ink);
  transition: width 0.3s ease;
}

.nav .links a:hover::after { width: 100%; }

/* Nav over hero: light text until scrolled */
.nav:not(.scrolled) .brand,
.nav:not(.scrolled) .links a { color: #fff; }
.nav:not(.scrolled) .links a::after { background: #fff; }
.nav:not(.scrolled) .burger span { background: #fff; }

.burger {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.burger span {
  display: block;
  width: 26px; height: 2px;
  background: var(--ink);
  margin: 6px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  from { transform: scale(1.06) translateY(0); }
  to   { transform: scale(1.12) translateY(-1.5%); }
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--overlay) 0%, rgba(8,10,14,0.15) 55%, rgba(8,10,14,0.35) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 0 40px 110px;
  max-width: 1200px;
}

.kicker {
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 26px;
}

.hero h1 {
  font-size: clamp(64px, 11vw, 150px);
  font-weight: 200;
  line-height: 0.98;
  letter-spacing: 0.01em;
}

.hero .sub {
  margin-top: 28px;
  font-size: 14px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.9;
}

.scroll-cue {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: 26px; height: 44px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 14px;
}

.scroll-cue span {
  display: block;
  width: 3px; height: 8px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: rgba(255,255,255,0.85);
  animation: cue 1.8s ease-in-out infinite;
}

@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(12px); opacity: 0.25; }
}

/* ---------- Sections ---------- */
section { padding: 110px 40px; }

.section-title {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 200;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 54px;
}

.works { max-width: 1400px; margin: 0 auto; }

/* ---------- Filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 30px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.filter {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray);
  padding: 6px 2px;
  position: relative;
  transition: color 0.25s ease;
}

.filter:hover { color: var(--ink); }

.filter.active { color: var(--ink); }

.filter.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -19px;
  height: 2px;
  background: var(--ink);
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 64px 36px;
}

.card { cursor: pointer; }

.card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f2f2f2;
}

.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), opacity 0.4s ease;
}

.card:hover .card-img img { transform: scale(1.05); }

.award {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 20px;
}

.card h3 {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--gray);
  letter-spacing: 0.06em;
}

.card.hidden { display: none; }

/* ---------- About ---------- */
.about { background: #fafafa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.about-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  align-items: start;
}

.mono {
  width: 280px; height: 340px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 200;
  letter-spacing: 0.1em;
}

.bio .lede {
  font-size: 21px;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 28px;
}

.bio p { color: #333; margin-bottom: 20px; max-width: 640px; }

.bio h4 {
  margin: 44px 0 14px;
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 500;
}

.cv { list-style: none; max-width: 640px; }

.cv li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.cv li em { font-style: normal; color: var(--gray); font-size: 14px; text-align: right; }

/* ---------- Contact ---------- */
.contact { text-align: center; max-width: 900px; margin: 0 auto; }

.contact .section-title { margin-bottom: 40px; }

.mail {
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 200;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  transition: opacity 0.25s ease;
}

.mail:hover { opacity: 0.55; }

.loc {
  margin-top: 30px;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gray);
}

.social { margin-top: 14px; }

.social a {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.social a:hover { border-color: var(--ink); }

footer {
  padding: 34px 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gray);
  text-align: center;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lightbox.open { opacity: 1; pointer-events: auto; }

.lb-figure {
  max-width: 1080px;
  width: calc(100% - 80px);
  max-height: 92vh;
  overflow: auto;
  text-align: left;
}

.lb-figure img {
  width: 100%;
  max-height: 68vh;
  object-fit: cover;
}

.lb-figure figcaption { padding: 26px 4px 10px; }

.lb-figure h3 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lb-meta {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
}

.lb-desc { margin-top: 16px; color: #333; max-width: 680px; }

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 44px;
  font-weight: 200;
  color: var(--ink);
  line-height: 1;
  padding: 12px 18px;
  transition: opacity 0.2s ease;
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 0.45; }

.lb-close { top: 18px; right: 26px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 48px 28px; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .mono { width: 220px; height: 270px; }
}

@media (max-width: 720px) {
  section { padding: 80px 24px; }
  .nav { padding: 16px 24px; }
  .nav.scrolled { padding: 12px 24px; }

  .nav .links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: #fff;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 34px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    box-shadow: -8px 0 30px rgba(0,0,0,0.08);
  }

  .nav.open .links { transform: none; }

  /* mobile menu always dark text */
  .nav .links a { color: var(--ink) !important; font-size: 14px; }
  .nav .links a::after { background: var(--ink) !important; }

  .burger { display: block; z-index: 60; position: relative; }

  .nav.open .burger span:first-child { transform: translateY(4px) rotate(45deg); background: var(--ink); }
  .nav.open .burger span:last-child { transform: translateY(-4px) rotate(-45deg); background: var(--ink); }

  .hero-inner { padding: 0 24px 96px; }
  .grid { grid-template-columns: 1fr; gap: 44px; }
  .lb-prev { left: 0; } .lb-next { right: 0; }
  .cv li { flex-direction: column; gap: 2px; }
  .cv li em { text-align: left; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
