/* ============================================================
   辰一 Personal Site — style.css
   Design system: minimal, high-contrast, photography-first
   ============================================================ */

/* ---------- Reset & Variables ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #0d0d0d;
  --white:   #f8f8f5;
  --gray-1:  #1a1a1a;
  --gray-2:  #3a3a3a;
  --gray-3:  #888;
  --gray-4:  #c8c8c8;
  --gray-5:  #ebebeb;

  --font-cn: 'Noto Serif SC', 'STSong', 'SimSun', serif;
  --font-en: 'EB Garamond', Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;

  --nav-h:   60px;
  --max-w:   1200px;
  --gap:     clamp(16px, 3vw, 40px);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Navigation ---------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 80px);
  transition: background 0.3s var(--ease), border-bottom 0.3s var(--ease);
}

nav.scrolled {
  background: var(--white);
  border-bottom: 1px solid var(--gray-5);
}

.nav-logo {
  font-family: var(--font-cn);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--white);
  transition: color 0.3s var(--ease);
}

nav.scrolled .nav-logo { color: var(--black); }

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  transition: color 0.2s;
}

nav.scrolled .nav-links a { color: var(--gray-2); }
.nav-links a:hover         { color: var(--white); }
nav.scrolled .nav-links a:hover { color: var(--black); }

.nav-links a.active { border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--white);
  transition: background 0.3s, transform 0.3s, opacity 0.3s;
}
nav.scrolled .nav-toggle span { background: var(--black); }
nav.mobile-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
nav.mobile-open .nav-toggle span:nth-child(2) { opacity: 0; }
nav.mobile-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--black);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--font-cn);
  font-size: clamp(28px, 7vw, 48px);
  color: var(--white);
  letter-spacing: 0.08em;
  transition: opacity 0.2s;
}
.mobile-menu a:hover { opacity: 0.5; }

/* ---------- Hero (index only) ---------- */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(40px, 8vh, 100px) clamp(24px, 6vw, 100px);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--black);
  overflow: hidden;
}

.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: transform 8s var(--ease);
}

.hero:hover .hero-bg img { transform: scale(1.03); }

/* Gradient overlay */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.1) 60%,
    transparent 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
}

.hero-name {
  font-family: var(--font-cn);
  font-size: clamp(52px, 10vw, 120px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-sub {
  font-family: var(--font-ui);
  font-size: clamp(13px, 1.5vw, 16px);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}

.hero-tagline {
  font-family: var(--font-cn);
  font-size: clamp(14px, 2vw, 18px);
  color: rgba(255,255,255,0.7);
  font-weight: 300;
  max-width: 420px;
  line-height: 1.8;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  right: clamp(24px, 6vw, 100px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 48px;
  background: rgba(255,255,255,0.3);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(1); opacity: 0.3; }
  50%       { transform: scaleY(0.5); opacity: 0.8; }
}

/* ---------- Page Header (inner pages) ---------- */
.page-header {
  padding: calc(var(--nav-h) + 80px) clamp(24px, 6vw, 100px) 60px;
  border-bottom: 1px solid var(--gray-5);
}

.page-header h1 {
  font-family: var(--font-cn);
  font-size: clamp(32px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-header p {
  margin-top: 16px;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-3);
}

/* ---------- Works Page ---------- */
.works-main {
  padding: 80px clamp(24px, 6vw, 100px);
}

/* Series filter */
.series-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 60px;
}

.series-btn {
  padding: 8px 20px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--gray-4);
  color: var(--gray-2);
  cursor: pointer;
  transition: all 0.2s;
}

.series-btn:hover,
.series-btn.active {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

/* Series section */
.series-section { margin-bottom: 100px; }

.series-title {
  font-family: var(--font-cn);
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 700;
  margin-bottom: 6px;
}

.series-desc {
  font-size: 13px;
  color: var(--gray-3);
  margin-bottom: 32px;
  max-width: 600px;
  line-height: 1.8;
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3/2;
  background: var(--gray-5);
}

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

.photo-item:hover img { transform: scale(1.04); opacity: 0.88; }

.photo-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 16px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: var(--white);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.photo-item:hover .photo-caption { opacity: 1; }

/* Featured / wide photo */
.photo-item.wide { grid-column: span 2; aspect-ratio: 16/9; }

/* ---------- Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.96);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.open { display: flex; }

.lightbox-img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 20px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 24px; right: 32px;
  color: rgba(255,255,255,0.6);
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
  line-height: 1;
}

.lightbox-close:hover { color: var(--white); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.5);
  font-size: 36px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 16px;
  transition: color 0.2s;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover { color: var(--white); }

/* ---------- About Page ---------- */
.about-main {
  padding: 80px clamp(24px, 6vw, 100px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 8vw, 120px);
  align-items: start;
  max-width: var(--max-w);
}

.about-photo {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  filter: grayscale(20%);
}

.about-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--gray-5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-3);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.about-text h2 {
  font-family: var(--font-cn);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 40px;
}

.about-section {
  margin-bottom: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--gray-5);
}

.about-section:first-of-type { border-top: none; padding-top: 0; }

.about-section h3 {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-3);
  margin-bottom: 16px;
}

.about-section p {
  font-family: var(--font-cn);
  font-size: 16px;
  line-height: 2;
  color: var(--gray-1);
}

/* ---------- Contact Page ---------- */
.contact-main {
  padding: 80px clamp(24px, 6vw, 100px);
  max-width: 720px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding: 40px 0;
  border-bottom: 1px solid var(--gray-5);
}

.contact-label {
  min-width: 80px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-3);
  padding-top: 4px;
}

.contact-value {
  font-family: var(--font-cn);
  font-size: 18px;
}

.contact-value a:hover { text-decoration: underline; }

.qr-placeholder {
  width: 120px; height: 120px;
  background: var(--gray-5);
  border: 1px dashed var(--gray-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--gray-3);
  letter-spacing: 0.05em;
  text-align: center;
  padding: 8px;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 120px;
  padding: 40px clamp(24px, 6vw, 100px);
  border-top: 1px solid var(--gray-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

footer span {
  font-size: 12px;
  color: var(--gray-3);
  letter-spacing: 0.08em;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .about-main { grid-template-columns: 1fr; }
  .about-photo { position: static; }

  .photo-item.wide { grid-column: span 1; aspect-ratio: 3/2; }

  .photo-grid { grid-template-columns: repeat(2, 1fr); }

  footer { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .photo-grid { grid-template-columns: 1fr; }
}
