/* ============ Jie — Photography · Apple-inspired minimal ============ */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --hairline: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --serif: "Playfair Display", "Georgia", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
          "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --maxw: 1120px;
  --pad: clamp(20px, 4.5vw, 48px);
  --radius: 18px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 56px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: rgba(0, 113, 227, 0.18); }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 var(--pad);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.nav-brand {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-2);
  transition: color 0.25s var(--ease);
}

.nav-links a:hover { color: var(--text); }

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 120px var(--pad) 24px;
  max-width: calc(var(--maxw) + 2 * var(--pad));
  margin: 0 auto;
}

.hero-tag {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--text-2);
  animation: rise 1.1s var(--ease) both;
}

.hero-figure {
  width: 100%;
  margin-top: 40px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
  animation: rise 1.1s var(--ease) 0.2s both;
}

.hero-figure img {
  width: 100%;
  height: clamp(320px, 62vh, 640px);
  object-fit: cover;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(72px, 10vw, 128px) var(--pad);
  max-width: calc(var(--maxw) + 2 * var(--pad));
  margin: 0 auto;
}

.section-alt { background: var(--bg-alt); }

.section-head { margin-bottom: 56px; }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5.5vw, 58px);
  letter-spacing: 0;
  line-height: 1.15;
}

.lede {
  margin-top: 14px;
  font-size: 21px;
  line-height: 1.5;
  color: var(--text-2);
  max-width: 620px;
}

/* ---------- Photo grids ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
  gap: 16px;
}

.photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e8e8ea;
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease),
              box-shadow 0.3s var(--ease);
}

.photo.visible {
  opacity: 1;
  transform: translateY(0);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.photo:hover img { transform: scale(1.035); }
.photo:hover { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); }

/* iPad Photos (iOS 18) style: justified rows, no cropping */
.grid-featured {
  display: block;
}

.featured-row {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.featured-row .photo {
  flex: none;
  border-radius: 10px;
}

.featured-row .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Timeline ---------- */

.album { margin-bottom: 96px; }

.album:last-child { margin-bottom: 0; }

.album-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.album-year {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--text-3);
}

.album-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0;
}

.album-meta {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-3);
}

.album-desc {
  max-width: 560px;
  margin: -8px 0 24px;
  color: var(--text-2);
  font-size: 16px;
}

.grid-album {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.grid-album .photo { border-radius: 12px; }

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

.about-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  max-width: 1000px;
  margin: 0 auto;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}

.about-photo img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.about-text p {
  font-size: 19px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 20px;
}

.about-text p:first-child {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.5;
}

.about-text strong { font-weight: 600; }

.resume {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline);
}

.resume-block h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
}

.resume-block li {
  list-style: none;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 16px;
}

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

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.contact-icon {
  font-size: 26px;
  color: var(--accent);
  margin-bottom: 10px;
}

.contact-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.contact-value { font-size: 17px; word-break: break-all; }

/* ---------- Footer ---------- */

footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--hairline);
  padding: 40px var(--pad);
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
  animation: lbfade 0.28s var(--ease);
}

.lightbox[hidden] { display: none; }

@keyframes lbfade { from { opacity: 0; } to { opacity: 1; } }

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
}

.lb-figure img {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: lbimg 0.3s var(--ease);
}

@keyframes lbimg {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.lb-cap {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.lb-btn {
  position: absolute;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s, transform 0.2s;
}

.lb-btn:hover { color: #fff; transform: scale(1.12); }

.lb-close { top: 22px; right: 26px; font-size: 24px; }

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 54px;
  font-weight: 300;
  padding: 12px 18px;
}

.lb-nav:hover { transform: translateY(-50%) scale(1.12); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid-album { grid-template-columns: repeat(3, 1fr); }
  .about-wrap { grid-template-columns: 1fr; }
  .about-photo { display: flex; justify-content: center; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { gap: 20px; }
  .grid { grid-template-columns: 1fr; }
  .grid-album { grid-template-columns: repeat(2, 1fr); }
  .about-photo img { margin: 0 auto; }
  .album-meta { margin-left: 0; width: 100%; }
  .lb-nav { font-size: 40px; }
}

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