/* ==========================================================================
   HOGAN — 作品集
   单一浅色主题，系统字体，无第三方依赖
   ========================================================================== */

:root {
  --bg: #fafaf7;
  --ink: #12120f;
  --muted: #75756e;
  --line: rgba(18, 18, 15, 0.14);
  --line-strong: rgba(18, 18, 15, 0.28);
  --pad: clamp(20px, 5vw, 72px);
  --max: 1360px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    "Source Han Sans SC", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--ink); color: var(--bg); }

/* ---------- 排版 ---------- */

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.022em;
}

.display {
  font-size: clamp(1.85rem, 4.4vw, 3.4rem);
  letter-spacing: -0.022em;
  line-height: 1.14;
  text-wrap: balance;
}

.h2 { font-size: clamp(1.5rem, 3.2vw, 2.4rem); }

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  font-size: clamp(1.02rem, 1.9vw, 1.28rem);
  line-height: 1.6;
  color: var(--ink);
  max-width: 44ch;
}

.prose p { margin: 0 0 1.1em; max-width: 62ch; }
.prose p:last-child { margin-bottom: 0; }

.muted { color: var(--muted); }

/* ---------- 骨架 ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header[data-scrolled="true"] { border-bottom-color: var(--line); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 62px;
}

.brand {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  font-size: 0.86rem;
}
@media (max-width: 420px) {
  .nav { gap: 14px; font-size: 0.8rem; }
  .brand { font-size: 0.76rem; letter-spacing: 0.14em; }
}
.nav a { color: var(--muted); transition: color 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

main { display: block; padding-bottom: clamp(60px, 10vw, 140px); }

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(36px, 6vw, 64px);
  font-size: 0.86rem;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  justify-content: space-between;
  align-items: baseline;
}
.site-footer a { border-bottom: 1px solid var(--line-strong); }
.site-footer a:hover { color: var(--ink); }

/* ---------- 首页 ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(44px, 8vw, 104px) clamp(36px, 6vw, 76px);
}

.hero__text > * + * { margin-top: 22px; }
.hero__text .display { max-width: min(13em, 100%); }

.hero__media {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 74vh;
  justify-self: end;
  width: 100%;
  overflow: hidden;
  background: #e9e9e4;
}
.hero__media video,
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- 区块标题 ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: 22px;
  border-top: 1px solid var(--line);
}
.section-head:first-child { border-top: 0; padding-top: 0; }

.section-head h2 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 500;
}

.more-link {
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s;
}
.more-link:hover { color: var(--ink); }

/* ---------- 网格 ---------- */

.grid {
  display: grid;
  gap: clamp(14px, 2.4vw, 30px);
}

/* 横版作品：等宽 */
.grid--wide { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 700px) { .grid--wide { grid-template-columns: repeat(2, 1fr); } }

/* 数量少时收窄列数，只在桌面端生效，避免影响手机 */
@media (min-width: 700px) {
  .grid--wide.is-solo { grid-template-columns: 1fr; }
  .grid--wide.is-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--tall.is-solo { grid-template-columns: minmax(0, 420px); }
}

/* 竖版作品：一屏 3 列，保持海报比例 */
.grid--tall { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .grid--tall { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 卡片 ---------- */

.card { display: block; }

.card__media {
  position: relative;
  overflow: hidden;
  background: #ecece7;
}
.card--wide .card__media { aspect-ratio: 16 / 9; }
.card--tall .card__media { aspect-ratio: 4 / 5; }

.card__media img,
.card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

@media (hover: hover) {
  .card:hover .card__media img,
  .card:hover .card__media video { transform: scale(1.028); }
}

.card__body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
}

.card__title { font-size: 0.98rem; font-weight: 500; }
.card__meta { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

.badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  padding: 3px 8px;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(10, 10, 10, 0.68);
  color: #fff;
  backdrop-filter: blur(4px);
}

/* ---------- 作品索引页 ---------- */

.page-head {
  padding-block: clamp(40px, 7vw, 84px) clamp(28px, 4vw, 52px);
}
.page-head > * + * { margin-top: 18px; }

.filters {
  display: flex;
  gap: 8px;
  padding-bottom: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.filters button {
  flex: none;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.filters button:hover { border-color: var(--line-strong); color: var(--ink); }
.filters button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ---------- 项目详情 ---------- */

.project-head {
  padding-block: clamp(32px, 5vw, 64px) clamp(24px, 4vw, 44px);
}
.project-head h1 {
  font-size: clamp(1.9rem, 5vw, 3.6rem);
  letter-spacing: -0.03em;
}
.project-head .sub { margin-top: 10px; font-size: clamp(0.95rem, 1.6vw, 1.1rem); color: var(--muted); }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 40px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}
.meta-row div { display: flex; gap: 8px; }
.meta-row dt, .meta-row .k { color: var(--muted); }
.meta-row .v { color: var(--ink); }

.project-hero {
  margin-bottom: clamp(28px, 4vw, 48px);
  background: #ecece7;
}
.project-hero--wide { aspect-ratio: 16 / 9; }
.project-hero--tall { max-width: 560px; aspect-ratio: 9 / 16; margin-inline: auto; }
.project-hero img,
.project-hero video { width: 100%; height: 100%; object-fit: cover; }

.project-body {
  display: grid;
  gap: clamp(22px, 3.4vw, 40px);
  padding-block: clamp(28px, 4vw, 52px);
  border-top: 1px solid var(--line);
}
.psec { display: grid; gap: 10px; }
@media (min-width: 860px) {
  .psec { grid-template-columns: 160px 1fr; gap: clamp(24px, 3vw, 48px); align-items: start; }
}

.project-body h2 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding-top: 0.4em;
}

/* ---------- 图文流 ---------- */

.flow { display: grid; gap: clamp(14px, 2.4vw, 30px); }

.flow--wide { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 860px) { .flow--wide { grid-template-columns: repeat(2, 1fr); } }
.flow--wide > .span-wide { grid-column: 1 / -1; }

.flow--tall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 860px) { .flow--tall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

figure { margin: 0; }
figure img, figure video {
  width: 100%;
  height: auto;
  background: #ecece7;
}
figcaption {
  padding-top: 9px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* 竖版海报：保持原始比例，不裁 */
.span-tall figure img { object-fit: contain; }

/* ---------- 首页精选 ---------- */

.pick {
  display: grid;
  gap: clamp(18px, 3vw, 34px);
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .pick { grid-template-columns: repeat(12, 1fr); align-items: start; }
  .pick > :nth-child(1) { grid-column: span 7; }
  .pick > :nth-child(2) { grid-column: span 5; }
  .pick > :nth-child(3) { grid-column: span 5; }
  .pick > :nth-child(4) { grid-column: span 7; }
}

/* ---------- 关于 ---------- */

.about {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(36px, 6vw, 72px);
}
@media (min-width: 860px) {
  .about { grid-template-columns: 1fr 0.8fr; align-items: start; }
}
.about__img { aspect-ratio: 4 / 3; overflow: hidden; background: #ecece7; }
.about__img img { width: 100%; height: 100%; object-fit: cover; }

.client-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.client-list li {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- 联系方式 ---------- */

.contact {
  padding-block: clamp(40px, 7vw, 84px);
  border-top: 1px solid var(--line);
}
.contact a.mail {
  font-size: clamp(1.3rem, 3.4vw, 2.2rem);
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line-strong);
  transition: opacity 0.2s;
}
.contact a.mail:hover { opacity: 0.55; }

/* ---------- 灯箱 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(12, 12, 10, 0.94);
}
.lightbox[open], .lightbox.is-open { display: grid; }
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
body.is-locked { overflow: hidden; }

/* ---------- 进入动画 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 移动端 ---------- */

@media (max-width: 859px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero__media { max-height: 66vh; justify-self: stretch; }
  .project-hero--tall { max-width: none; }
  .site-header .wrap { height: 56px; }
  .card__body { flex-direction: column; gap: 2px; }
  .card__meta { white-space: normal; }
}

@media (max-width: 699px) {
  .grid--tall.is-solo { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .grid--tall { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .flow--tall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

[hidden] { display: none !important; }
