/* ==============================================
   Mobile-First Portrait Photography Portfolio
   Safari iOS Compatible
   ============================================== */

:root {
  --ink: #111111;
  --canvas: #ffffff;
  --soft-cloud: #f5f5f5;
  --hairline: #e0e0e0;
  --mute: #8e8e8e;
  --font-serif: 'Songti SC', 'STSong', 'Noto Serif SC', 'SimSun', serif;
  --font-sans: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

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

/* Reset button styles for Safari */
button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

button:focus { outline: none; }

/* --- Top Bar --- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: calc(16px + var(--safe-top)) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.top-bar > * { pointer-events: auto; }
.top-bar.scrim {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.top-bar .name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* --- Hero --- */
.hero {
  height: 100vh;
  height: 100dvh;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.hero-img {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}
.hero-img img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-img img.active {
  opacity: 1;
}
.hero-img::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.05) 45%, rgba(0,0,0,0.1) 100%);
}
.hero-text {
  position: relative;
  padding: 0 20px 40px;
  z-index: 1;
}
.hero-text .kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 12px;
}
.hero-text h1 {
  font-family: var(--font-serif);
  font-size: 52px;
  font-weight: 900;
  line-height: 1.05;
  color: #fff;
  letter-spacing: 2px;
}
.hero-text .sub {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  margin-top: 12px;
  line-height: 1.6;
}

/* --- Intro --- */
.intro {
  padding: 64px 24px 48px;
}
.intro .kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 16px;
}
.intro p {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
}

/* --- Photo Feed (buttons wrapping images) --- */
.feed {
  padding: 0 12px;
}
.feed-btn {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  border-radius: 4px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.feed-btn img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.feed-btn:active img {
  transform: scale(0.97);
}

/* --- Mini Grid (buttons wrapping images) --- */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 0 12px;
}
.grid-btn {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 2px;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.grid-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.3s ease;
}
.grid-btn:active img {
  transform: scale(0.95);
}

/* --- Section Title --- */
.sec-title {
  padding: 48px 24px 20px;
}
.sec-title .kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
.sec-title h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* --- About --- */
.about { padding: 64px 24px; }
.about .kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 16px;
}
.about h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.about p { font-size: 14px; line-height: 1.8; color: #555; margin-bottom: 16px; }
.about-stats { display: flex; gap: 32px; padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--hairline); }
.about-stats .st h3 { font-family: var(--font-serif); font-size: 28px; font-weight: 700; line-height: 1; }
.about-stats .st p { font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--mute); margin: 4px 0 0; }

/* --- Contact --- */
.contact { padding: 0 24px 80px; text-align: center; }
.contact .kicker {
  font-size: 10px; font-weight: 600; letter-spacing: 3px;
  text-transform: uppercase; color: var(--mute); margin-bottom: 12px;
}
.contact h2 { font-family: var(--font-serif); font-size: 28px; font-weight: 700; letter-spacing: 1px; margin-bottom: 12px; }
.contact p { font-size: 14px; color: var(--mute); margin-bottom: 24px; }
.contact .btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 32px; font-size: 13px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; border-radius: 24px;
  background: var(--ink); color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.contact .btn:active { opacity: 0.8; }

/* --- Contact --- */
.contact { padding: 0 24px 80px; text-align: center; }
.contact .kicker {
  font-size: 10px; font-weight: 600; letter-spacing: 3px;
  text-transform: uppercase; color: var(--mute); margin-bottom: 12px;
}
.contact h2 { font-family: var(--font-serif); font-size: 28px; font-weight: 700; letter-spacing: 1px; margin-bottom: 12px; }
.contact p { font-size: 14px; color: var(--mute); }
.contact .contact-info {
  font-size: 15px;
  color: var(--ink);
  margin-top: 8px;
  letter-spacing: 0.5px;
}

/* --- Footer --- */
.footer {
  padding: 32px 24px calc(32px + var(--safe-bottom));
  border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--mute);
}

/* ==============================================
   Full-Screen Viewer (single image + swipe)
   ============================================== */
.viewer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  touch-action: none;
  -webkit-overflow-scrolling: none;
}
.viewer.active {
  opacity: 1;
  pointer-events: auto;
}

/* Single image stage */
.viewer-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 12px;
  touch-action: none;
}
.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  transition: transform 0.1s ease;
}

/* Viewer chrome */
.viewer-top {
  position: fixed;
  top: 0; left: 0; right: 0; z-index: 210;
  padding: calc(12px + var(--safe-top)) 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75), rgba(0,0,0,0));
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.viewer-top.hidden { opacity: 0; transform: translateY(-20px); pointer-events: none; }
.viewer-top .counter {
  font-size: 13px; font-weight: 500; color: #fff;
  letter-spacing: 1px; font-variant-numeric: tabular-nums;
}
.viewer-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.15); display: flex;
  align-items: center; justify-content: center; color: #fff;
  font-size: 18px; -webkit-tap-highlight-color: transparent;
}
.viewer-close:active { background: rgba(255,255,255,0.3); }

.viewer-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 210;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  cursor: pointer;
}
.viewer-arrow:active { background: rgba(255,255,255,0.3); }
.viewer-arrow-left { left: 8px; }
.viewer-arrow-right { right: 8px; }
.viewer-arrow.hidden { opacity: 0; pointer-events: none; }

.viewer-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0; z-index: 210;
  padding: 20px 16px calc(16px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.viewer-bottom.hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }
.viewer-dots {
  display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.viewer-dots .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.3); transition: all 0.3s ease;
}
.viewer-dots .dot.active { background: #fff; transform: scale(1.4); }

/* --- Desktop --- */
@media (min-width: 768px) {
  .hero-text h1 { font-size: 72px; }
  .viewer-stage { padding: 60px; }
}
