:root {
  --bg: oklch(99% 0.012 350);
  --surface: oklch(100% 0 0);
  --surface-soft: oklch(98% 0.018 355);
  --fg: oklch(24% 0.035 345);
  --muted: oklch(57% 0.035 345);
  --border: oklch(92% 0.018 355);
  --accent: oklch(70% 0.13 350);
  --accent-strong: oklch(60% 0.17 355);
  --accent-soft: oklch(95% 0.035 350);
  --shadow: 0 22px 58px rgba(196, 94, 144, 0.16);
  --shadow-soft: 0 12px 34px rgba(196, 94, 144, 0.12);
  --radius: 24px;
  --font-display: "Songti SC", "Noto Serif SC", "Iowan Old Style", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, oklch(94% 0.06 350 / 0.7), transparent 34rem),
    radial-gradient(circle at 90% 12%, oklch(96% 0.045 15 / 0.7), transparent 30rem),
    linear-gradient(180deg, oklch(99% 0.012 350), oklch(98% 0.008 345));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.45) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

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

.site-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 0;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 18%, transparent 19%),
    linear-gradient(135deg, var(--accent), oklch(76% 0.11 18));
  box-shadow: 0 12px 28px oklch(70% 0.13 350 / 0.35);
}

.nav-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  box-shadow: 0 8px 24px rgba(255,255,255,0.4);
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-pills::-webkit-scrollbar { display: none; }

.nav-pills a,
.nav-pills button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 15px;
  white-space: nowrap;
  transition: color 160ms cubic-bezier(0.23, 1, 0.32, 1), background 160ms cubic-bezier(0.23, 1, 0.32, 1), transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-pills a:hover,
.nav-pills button:hover { color: var(--fg); transform: translateY(-1px); }

.nav-pills .active,
.nav-pills button[aria-pressed="true"] {
  color: var(--fg);
  background: #fff;
  box-shadow: 0 8px 22px rgba(196,94,144,0.12);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(26px, 5vw, 72px);
  align-items: end;
  min-height: 470px;
  padding: 58px 0 42px;
}

.eyebrow {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 10px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
}

h1 {
  max-width: 820px;
  margin: 18px 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.92;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-copy {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.8;
  text-wrap: pretty;
}

.hero-panel {
  justify-self: end;
  width: min(520px, 100%);
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: 34px;
  background: rgba(255,255,255,0.68);
  box-shadow: var(--shadow);
  padding: 14px;
  transform: rotate(1deg);
}

.hero-collage {
  display: grid;
  grid-template-columns: 0.78fr 1fr;
  gap: 12px;
}

.hero-collage img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 24px;
  background: var(--accent-soft);
}

.hero-collage img:first-child { height: 356px; }
.hero-collage img:nth-child(2) { height: 174px; }
.hero-collage img:nth-child(3) { height: 170px; }

.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 8px 4px;
  color: var(--muted);
  font-size: 13px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin: 34px 0 18px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 52px);
  letter-spacing: 0;
}

.section-head p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 16px;
  scrollbar-width: thin;
}

.category-card {
  flex: 0 0 auto;
  min-width: 190px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,0.72);
  box-shadow: var(--shadow-soft);
  padding: 15px;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.category-card strong { display: block; margin-bottom: 6px; }
.category-card span { color: var(--muted); font-size: 13px; }

.gallery-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 10px 0 24px;
}

.search-box {
  width: min(360px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.76);
  padding: 10px 16px;
  box-shadow: var(--shadow-soft);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
}

.search-box input::placeholder { color: oklch(67% 0.025 345); }
.soft-note { color: var(--muted); font-size: 13px; }

.masonry {
  column-count: 4;
  column-gap: 18px;
  padding-bottom: 80px;
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent-soft);
  box-shadow: 0 10px 28px rgba(150, 70, 110, 0.1);
  overflow: hidden;
  cursor: zoom-in;
  break-inside: avoid;
  transform: translateZ(0);
  contain: layout paint;
}

.photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, rgba(111,45,80,0.15));
  opacity: 0;
  transition: opacity 180ms cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}

.photo-card img {
  width: 100%;
  height: auto;
  min-height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, oklch(97% 0.03 350), #fff);
  opacity: 0;
  transition: transform 260ms cubic-bezier(0.23, 1, 0.32, 1), filter 260ms cubic-bezier(0.23, 1, 0.32, 1);
}

.photo-card.is-loaded img { opacity: 1; }
.photo-card:hover img { transform: scale(1.035); filter: saturate(1.04) brightness(1.015); }
.photo-card:hover::after { opacity: 1; }

.ad-card {
  break-inside: avoid;
  margin: 0 0 18px;
  border: 1px dashed oklch(76% 0.07 350);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.82), rgba(255,240,248,0.82)),
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(244,156,196,0.14) 12px 24px);
  color: oklch(48% 0.08 350);
  box-shadow: 0 10px 26px rgba(150, 70, 110, 0.08);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 18px;
  min-height: 190px;
}

.ad-card span {
  font: 11px/1 var(--font-body);
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.ad-card strong { font-size: 15px; font-weight: 700; }
.ad-card-square { aspect-ratio: 1 / 1; }
.ad-card-portrait { aspect-ratio: 4 / 5; }
.ad-card-landscape { aspect-ratio: 16 / 9; min-height: 145px; }

.placeholder {
  min-height: 280px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(135deg, oklch(96% 0.032 350), #fff);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 42px;
  background: rgba(46, 24, 38, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms cubic-bezier(0.23, 1, 0.32, 1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

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

.lightbox img {
  max-width: min(1180px, 92vw);
  max-height: 86vh;
  border-radius: 28px;
  box-shadow: 0 36px 110px rgba(25, 10, 20, 0.42);
  background: #fff;
  transform: scale(0.96);
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

.lightbox.open img { transform: scale(1); }

.lightbox button {
  position: fixed;
  top: 22px;
  right: 22px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  background: rgba(255,255,255,0.86);
  color: var(--fg);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  padding: 28px 0 42px;
  color: var(--muted);
  font-size: 13px;
}

.api-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 18px 0 56px;
}

.api-card {
  border: 1px solid var(--border);
  border-radius: 26px;
  background: rgba(255,255,255,0.74);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.api-card h3 { margin: 0 0 10px; }
.api-card p { margin: 0; color: var(--muted); line-height: 1.75; }
.api-card code { color: var(--accent-strong); }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-panel { justify-self: start; transform: none; }
  .masonry { column-count: 3; }
}

@media (max-width: 760px) {
  .site-shell { width: min(100% - 22px, 1440px); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav-pills { width: 100%; }
  .hero { padding-top: 32px; }
  h1 { font-size: clamp(44px, 14vw, 70px); }
  .hero-collage img:first-child { height: 300px; }
  .section-head, .gallery-tools, .footer { flex-direction: column; align-items: flex-start; }
  .masonry { column-count: 2; column-gap: 12px; }
  .photo-card { margin-bottom: 12px; border-radius: 18px; }
  .api-panel { grid-template-columns: 1fr; }
  .lightbox { padding: 18px; }
  .lightbox img { border-radius: 20px; }
}

@media (max-width: 430px) {
  .masonry { column-count: 1; }
  .hero-collage { grid-template-columns: 1fr 1fr; }
  .hero-collage img { height: 180px; }
  .hero-collage img:first-child { height: 250px; }
}
