/* ═══════════════════════════════════════════════
   YIHAN DONG PORTFOLIO — style.css
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&display=swap');


/* ─────────────────────────────────────────────
   DESIGN TOKENS
───────────────────────────────────────────── */
:root {
  /* Colour */
  --bg:        #ffffff;
  --ink:       #1a1916;
  --mid:       #6e6a60;
  --rule:      rgba(26,25,22,0.15);

  /* Typography */
  --font:      'EB Garamond', Georgia, serif;
  --text-base: 22px;
  --text-lead: 24px;
  --text-sm:   18px;

  /* Layout widths */
  --content-max:  1040px;
  --content-wide: 1200px;
  --edge:         5vw;

  /* Vertical spacing scale */
  --space-xs:  0.75rem;
  --space-sm:  1.5rem;
  --space-md:  3rem;
  --space-lg:  5rem;
  --space-xl:  7rem;
}


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

html {
  scroll-behavior: smooth;
}


body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body {
  -webkit-user-select: none;
  user-select: none;
}

/* ─────────────────────────────────────────────
   ATMOSPHERIC BACKGROUND
───────────────────────────────────────────── */
.atmo-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.8s ease;
}

/* 让实际内容浮在背景上面 */
.nav,
.page,
footer {
  position: relative;
  z-index: 1;
}

/* 顶部导航不要被背景抢掉 */
.nav {
  background: transparent;
  backdrop-filter: blur(2px);
}


/* 让页面底色更像一层薄雾，而不是实心底 */
body {
  background:
    linear-gradient(180deg, rgb(255, 255, 255) 0%, rgb(255, 255, 255) 100%);
}

/* 三团缓慢流动的色场 */
.blob {
  position: absolute;
  border-radius: 70%;
  will-change: transform, opacity, width, height;
  filter: blur(50px);
  transform: translate(-10%, -10%);
}

/* 蓝色团 */
.blob-a {
  width: 56vw;
  height: 56vw;
  left: 8vw;
  top: 22vh;
  opacity: 0.88;
  background:
    radial-gradient(circle,
      rgba(76, 188, 241, 1) 0%,
      rgba(76, 188, 241, 0.42) 26%,
      rgba(76, 188, 241, 0.14) 50%,
      rgba(76, 188, 241, 0.04) 66%,
      rgba(76, 188, 241, 0.00) 78%);
}

/* 粉色团 */
.blob-b {
  width: 48vw;
  height: 48vw;
  left: 56vw;
  top: 8vh;
  opacity: 0.82;
  background:
    radial-gradient(circle,
      rgba(244, 88, 183, 1) 0%,
      rgba(244, 88, 183, 0.42) 26%,
      rgba(244, 88, 183, 0.12) 50%,
      rgba(244, 88, 183, 0.03) 66%,
      rgba(244, 88, 183, 0.00) 78%);
}

/* 中间过渡雾层 */
.blob-c {
  width: 44vw;
  height: 44vw;
  left: 34vw;
  top: 34vh;
  opacity: 0.24;
  filter: blur(135px);
  background:
    radial-gradient(circle,
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 255, 255, 0.24) 34%,
      rgba(255, 255, 255, 0.07) 56%,
      rgba(192, 208, 233, 0.00) 76%);
}

/* project detail 里的大图不要被背景脏掉太多 */
.project-detail {
  background: transparent;
}

/* mobile 上 blur 和尺寸稍微收一点 */
@media (max-width: 640px) {
  .blob {
    filter: blur(70px);
  }

  .blob-a {
    width: 78vw;
    height: 78vw;
  }

  .blob-b {
    width: 70vw;
    height: 70vw;
  }

  .blob-c {
    width: 64vw;
    height: 64vw;
    filter: blur(90px);
  }

  .atmo-bg {
    opacity: 0.82;
  }
}

/* ─────────────────────────────────────────────
   WRAPPER
───────────────────────────────────────────── */
.wrap {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--edge);
  padding-right: var(--edge);
}

.wrap-wide {
  max-width: var(--content-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--edge);
  padding-right: var(--edge);
}


/* ─────────────────────────────────────────────
   NAV
───────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 1.1rem var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links button {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 400;
  color: var(--mid);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.nav-links button:hover,
.nav-links button.active {
  color: var(--ink);
  font-weight: 500;
}

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
}


/* ─────────────────────────────────────────────
   PAGE SHOW / HIDE
───────────────────────────────────────────── */
.page {
  display: none;
}

.page.active {
  display: block;
  min-height: calc(100vh - 150px);
}


/* ─────────────────────────────────────────────
   PAGE HEADER
───────────────────────────────────────────── */
.page-header {
  text-align: center;
  padding-top: var(--space-lg);
  padding-bottom: 0;
}

.page-header h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* Short centred rule */
.rule-center {
  text-align: center;
  padding: var(--space-md) 0;
}

.rule-center hr {
  display: inline-block;
  width: 180px;
  border: none;
  border-top: 1.5px solid var(--ink);
  opacity: 0.4;
}


/* ─────────────────────────────────────────────
   TEXT BLOCKS
───────────────────────────────────────────── */
.text-block {
  padding-bottom: var(--space-md);
}

.text-block p {
  font-size: var(--text-base);
  line-height: 1.75;
  margin-bottom: 1.1rem;
}

.text-block p:last-child {
  margin-bottom: 0;
}

.text-block.lede p {
  font-size: var(--text-lead);
  line-height: 1.8;
}

.text-block a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: var(--space-sm);
  display: block;
}

/* Optional: slightly stronger project intro */
.project-intro {
  max-width: 1080px;
}

.project-intro p {
  font-size: 22px;
  line-height: 1.85;
}

.publication-note {
  font-size: 18px;
  line-height: 1.5;
  margin-top: 1.5rem;
  color: var(--mid);
}

.publication-note a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ─────────────────────────────────────────────
   HOME / STUDIO
───────────────────────────────────────────── */
.home-hero {
  padding-left: var(--edge);
  padding-right: var(--edge);
  padding-top: var(--space-md);
  padding-bottom: 2rem;
}

.home-hero img {
  display: block;
  width: 100%;
  height: auto;
}


/* ─────────────────────────────────────────────
   PROJECTS LIST
───────────────────────────────────────────── */
.proj-grid {
  padding-bottom: var(--space-xl);
}

.proj-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3.5rem;
  row-gap: 0;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--rule);
}

.proj-pair:last-child {
  border-bottom: 1px solid var(--rule);
}

.proj-item {
  cursor: pointer;
}

.proj-item:hover .proj-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.proj-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 0.85rem;
  background: #ddd8cc;
}

.proj-year {
  font-size: 14px;
  color: var(--mid);
  margin-bottom: 0.15rem;
}

.proj-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.proj-sub {
  font-size: var(--text-sm);
  color: var(--ink);
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.proj-more {
  font-size: 15px;
  color: var(--mid);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ─────────────────────────────────────────────
   PROJECT DETAIL
───────────────────────────────────────────── */
.back-link {
  display: inline-block;
  padding: var(--space-sm) var(--edge) 0;
  font-family: var(--font);
  font-size: 20px;
  color: var(--mid);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-link:hover {
  color: var(--ink);
}

.detail-img-full {
  margin: var(--space-md) auto;
}

.detail-img-full img {
  display: block;
  width: 100%;
  height: auto;
}

.detail-img-pair {
  margin: var(--space-md) auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.detail-img-pair img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Continuous full-width image / video stack */
.detail-img-stack {
  margin: var(--space-md) auto;
}

.detail-img-stack img,
.detail-img-stack video,
.detail-img-stack iframe {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.detail-img-stack iframe {
  aspect-ratio: 16 / 9;
  border: 0;
}

.video-cover {
  position: relative;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
}

.video-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-family: var(--font);
  font-size: 18px;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
}

.video-cover iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* Overlay captions */
.image-overlay-caption {
  position: relative;
}

.image-overlay-caption img {
  display: block;
  width: 100%;
  height: auto;
}

.overlay-caption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.28);
  padding: 0.35rem 0.55rem;
}

.caption-right .overlay-caption {
  left: auto;
  right: 1rem;
}

.project-detail {
  padding-bottom: var(--space-xl);
}

/* Detail page bottom navigation */
.detail-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-top: var(--space-md);
  padding-bottom: var(--space-lg);
  border-top: 1px solid var(--rule);
}

.detail-nav-left {
  justify-self: start;
}

.detail-nav-center {
  justify-self: center;
}

.detail-nav-right {
  justify-self: end;
}

.detail-nav a,
.detail-nav button {
  font-family: var(--font);
  font-size: 18px;
  color: var(--mid);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.detail-nav a:hover,
.detail-nav button:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  .detail-nav {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    text-align: center;
  }

  .detail-nav-left,
  .detail-nav-center,
  .detail-nav-right {
    justify-self: center;
  }
}

/* ─────────────────────────────────────────────
   MY PRACTICE
───────────────────────────────────────────── */
.method-grid {
  padding-bottom: var(--space-xl);
}

.method-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3.5rem;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--rule);
}

.method-pair:last-child {
  border-bottom: 1px solid var(--rule);
}

.method-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.method-img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #e4dfd1;
  margin-bottom: 0.9rem;
}

.method-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 0.9rem;
}

.method-desc {
  font-size: var(--text-sm);
  line-height: 1.8;
}


/* ─────────────────────────────────────────────
   RECOGNITION
───────────────────────────────────────────── */
.recog-block {
  padding-bottom: var(--space-xl);
}

.recog-section {
  margin-bottom: 0;
}

.recog-head {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.4rem;
}

.rec {
  display: flex;
  gap: 1.2rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(26,25,22,0.06);
  font-size: 17px;
  line-height: 1.65;
  align-items: baseline;
}

.rec:last-child {
  border-bottom: none;
}

.rec-yr {
  flex-shrink: 0;
  width: 3rem;
  font-size: 13px;
  color: var(--mid);
}

.rec-body {
  flex: 1;
}

.rec-body em {
  font-style: italic;
}

.rec-body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.recog-divider {
  padding: var(--space-sm) 0;
}

.recog-divider hr {
  border: none;
  border-top: 1px solid var(--rule);
}


/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
footer {
  background: #111;
  padding: 1.4rem var(--edge);
  text-align: center;
  margin-top: 2rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--font);
  font-size: 22px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #fff;
}

.slash {
  color: rgba(255,255,255,0.7);
}


/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */

/* ── Tablet ≤ 900px ── */
@media (max-width: 900px) {
  :root {
    --text-base: 19px;
    --text-lead: 21px;
    --text-sm: 16px;
    --edge: 6vw;
    --space-md: 2.5rem;
    --space-lg: 4rem;
    --space-xl: 5.5rem;
  }

  .nav-links {
    gap: 2rem;
  }

  .nav-links button {
    font-size: 16px;
  }

  .project-intro p {
    font-size: 20px;
  }

  .footer-links {
    font-size: 18px;
  }
}

/* ── Mobile ≤ 640px ── */
@media (max-width: 640px) {
  :root {
    --text-base: 17px;
    --text-lead: 19px;
    --text-sm: 15px;
    --edge: 5vw;
    --space-sm: 1.25rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 4rem;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    padding: 0.5rem 0 1rem;
    border-bottom: 1px solid var(--rule);
    z-index: 99;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links button {
    font-size: 16px;
    padding: 0.7rem var(--edge);
    text-align: left;
  }

  .proj-pair,
  .method-pair {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .detail-img-pair {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .page.active {
    min-height: calc(100vh - 130px);
  }

  .page-header h1 {
    font-size: 26px;
  }

  .proj-title {
    font-size: 20px;
  }

  .rec {
    font-size: 15px;
  }

  .rec-yr {
    width: 2.5rem;
    font-size: 12px;
  }

  .overlay-caption {
    left: 0.75rem;
    bottom: 0.75rem;
    font-size: 12px;
    padding: 0.25rem 0.45rem;
  }

  .footer-links {
    font-size: 16px;
  }
}
