/* 竞之景哲 — Galleries index (covers) + album drill-down */
:root {
  --mat: #eeeeee;
  --frame-pad: 10px; /* Alex: border 10px solid #eee */
  --text: #ececec;
  --text-soft: #dddddd;
  --text-muted: #b8b8b8;
  --accent: #e7ad00;
  --lightbox: #111111;
  /*
   * 照片尺寸你已满意：内容区宽度基本不动。
   * 间距单独加大（尤其画册页），略增 max-width 补偿 gap，避免图变小。
   */
  /* 再缩小一档（在 1370 基础上约 0.9） */
  --gap: 44px;
  --album-gap: 56px;
  --side-pad: clamp(22px, 3.2vw, 36px);
  --content-max: min(1230px, calc(100vw - 2 * var(--side-pad)));
  --font-size: 15px;
  /* versioned bg — break CDN/browser 14d cache */
  --site-bg: url("../assets/bg-v53.jpg");
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Fixed background: 沙漠之翼 (versioned filename) */
body {
  font-family: system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial,
    "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: var(--font-size);
  line-height: 1.6;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-color: #0a0a0a;
  background-image: var(--site-bg);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -10;
  background: #0a0a0a var(--site-bg) center center / cover no-repeat;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -9;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.14) 45%,
    rgba(0, 0, 0, 0.32) 100%
  );
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #1a1a1a;
  font-weight: 600;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* Header */
.site-header {
  padding: 40px 24px 20px;
  text-align: center;
}

/*
 * International wordmark (portfolio standard):
 *   JINGZHE          ← Latin primary
 *   ────────         ← thin gold rule
 *   竞之景哲         ← Chinese secondary
 * Clean, bilingual, no decorative mountain.
 */
.logo-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: #f3f1ec;
  transition: opacity 160ms ease, color 160ms ease;
}

.logo-link:hover {
  color: #ffffff;
  opacity: 0.95;
}

.logo-link:hover .logo-rule {
  background: #f0c14d;
}

.logo-en {
  display: block;
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", system-ui, sans-serif;
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 300;
  font-style: normal;
  letter-spacing: 0.55em;
  line-height: 1.15;
  padding-left: 0.55em; /* optical center for tracking */
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

.logo-rule {
  display: block;
  width: 2.75rem;
  height: 1px;
  margin: 12px auto 10px;
  background: var(--accent);
  opacity: 0.85;
}

.logo-zh {
  display: block;
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: clamp(13px, 1.7vw, 15px);
  font-weight: 400;
  letter-spacing: 0.55em;
  line-height: 1.3;
  padding-left: 0.55em;
  color: rgba(243, 241, 236, 0.78);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.logo-link:hover .logo-zh {
  color: rgba(255, 255, 255, 0.9);
}

.tagline {
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--accent);
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 36px;
  margin-top: 28px;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.header-nav a.active,
.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--accent);
}

.header-nav a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 6px;
}

.page-divider {
  max-width: 120px;
  height: 1px;
  margin: 28px auto 0;
  background: rgba(238, 238, 238, 0.28);
}

.page-title {
  text-align: center;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--text-soft);
  margin: 28px 0 2rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

/* 整页视图切换：主页 / 画册互斥，不叠在下方 */
.page-view[hidden] {
  display: none !important;
}

.page-view--album {
  min-height: 50vh;
}

/* —— Home covers only —— */
.covers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--side-pad) 3.5rem;
  box-sizing: border-box;
}

.cover-card {
  text-align: center;
  cursor: pointer;
  outline: none;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  width: 100%;
  min-width: 0;
}

.cover-frame {
  /* Alex: 10px solid #eee mat — no heavy shadow that shrinks visual weight */
  background: var(--mat);
  padding: var(--frame-pad);
  line-height: 0;
  box-shadow: none;
  transition: opacity 180ms ease;
}

.cover-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #ddd;
}

.cover-card:hover .cover-frame {
  opacity: 0.96;
}

.cover-card:focus-visible .cover-frame {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cover-label {
  margin-top: 22px; /* 图与画名上下间距略加大 */
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.cover-count {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #999;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* —— Album full page —— */
.page-view--album {
  max-width: none;
  margin: 0;
  padding: 0;
}

.album-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 4px auto 0;
  max-width: var(--content-max);
  padding: 0 var(--side-pad);
}

.album-page-title {
  margin-top: 1rem;
  margin-bottom: 1.75rem;
}

.back-btn {
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(238, 238, 238, 0.35);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}

.back-btn:hover,
.back-btn:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* 左右间距不变；上下保留原先「标题」占位，只藏字不缩距 */
  column-gap: var(--album-gap);
  row-gap: calc(var(--album-gap) + 42px);
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--side-pad) 3.5rem;
  box-sizing: border-box;
}

.photo-card {
  text-align: center;
  cursor: pointer;
  outline: none;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  width: 100%;
  min-width: 0;
}

.photo-frame {
  background: var(--mat);
  padding: var(--frame-pad);
  line-height: 0;
  box-shadow: none;
  transition: opacity 180ms ease;
}

.photo-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #ddd;
}

.photo-card:hover .photo-frame {
  opacity: 0.96;
}

.photo-card:focus-visible .photo-frame {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* 进入画册后不显示照片标题 */
.photo-title {
  display: none;
}

/* About */
.about-section {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 28px 4rem;
  text-align: center;
  scroll-margin-top: 24px;
}

.about-section h2 {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.14em;
  margin-bottom: 1.25rem;
  color: var(--text-soft);
}

.about-section p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.85;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.about-section .contact {
  margin-top: 1.5rem;
}

.about-section .contact a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Footer */
.site-footer {
  padding: 1rem 24px 3.5rem;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #aaa;
}

.site-footer em {
  font-style: italic;
}

/* Lightbox */
.lightbox {
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  background: var(--lightbox);
  color: var(--text);
}

.lightbox::backdrop {
  background: rgba(17, 17, 17, 0.98);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  z-index: 70;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, color 150ms;
}

.lightbox-close {
  top: 18px;
  right: 20px;
  width: 48px;
  height: 48px;
  font-size: 30px;
  line-height: 1;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 26px;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
  outline: none;
}

.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  outline: 1px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 5%;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 1;
  transition: opacity 160ms ease;
}

.lightbox-stage img.is-loading {
  opacity: 0.35;
}

.lightbox-stage figcaption {
  display: none;
}

html.lightbox-open {
  overflow: hidden;
}

.gallery-hint {
  max-width: var(--content-max);
  margin: 1rem auto;
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--accent);
  border: 1px solid rgba(231, 173, 0, 0.35);
  background: rgba(0, 0, 0, 0.35);
}

/* Responsive — keep images large; do NOT cap grid to 420px */
@media (max-width: 1100px) {
  :root {
    --gap: 44px;
    --album-gap: 56px;
  }
}

@media (max-width: 900px) {
  :root {
    --gap: 36px;
    --album-gap: 44px;
  }
  .covers-grid,
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --frame-pad: 5px;
    --gap: 28px;
    --album-gap: 32px;
    --side-pad: 16px;
  }
  body { background-attachment: scroll; }
  .cover-label,
  .photo-title { font-size: 15px; } /* Alex mobile title */
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

@media (max-width: 560px) {
  .covers-grid,
  .photo-grid {
    grid-template-columns: 1fr;
    /* full width of viewport minus side pad — no tiny 420px cap */
    max-width: none;
  }
  .site-header { padding: 36px 16px 16px; }
  .logo-en {
    letter-spacing: 0.4em;
    padding-left: 0.4em;
    font-size: clamp(22px, 6.5vw, 28px);
  }
  .logo-zh {
    letter-spacing: 0.4em;
    padding-left: 0.4em;
  }
}
