/* ============================================================
   Solin Zhang — Portfolio
   Design tokens + styles generated from the Ardot canvas design
   (photographer minimal / black-grey-white)
   ============================================================ */

/* ---------- Design Tokens ----------
   Single source of truth. Change a value here and the whole
   site follows. Mirrors the Ardot design file's palette.
   ------------------------------------------------------- */
:root {
  /* Color — black / grey / white, gallery-paper ground */
  --color-bg:        #F7F7F5;   /* page          */
  --color-ink:       #111111;   /* primary text  */
  --color-ink-soft:  #3B3B3B;   /* body copy     */
  --color-mid:       #6E6E6E;   /* secondary     */
  --color-faint:     #8A8A88;   /* tertiary/meta */
  --color-rule:      #E4E4E0;   /* hairlines     */
  --color-footer:    #ECECE9;   /* footer band   */
  --color-white:     #FFFFFF;
  --color-placeholder:     #E4E4E0; /* image placeholder block */
  --color-placeholder-ink: #A8A8A4; /* placeholder label text    */

  /* Type */
  --font-display: "Playfair Display", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-serif:   "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body:    "Noto Sans SC", -apple-system, BlinkMacSystemFont,
                  "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* Spacing — 1440 canvas, 1200 content column */
  --page-x:      120px;
  --section-y:   120px;
  --gap-projects: 48px;
  --gap-photos:   24px;
  --gap-about:    80px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.section {
  padding: var(--section-y) var(--page-x);
}

/* ---------- Section header (kicker + title + intro) ---------- */
.kicker {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-faint);
}

.section-title {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--color-ink);
}

.section-intro {
  margin: 0;
  max-width: 62ch;
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-mid);
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 var(--page-x);
  border-bottom: 1px solid var(--color-rule);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav__logo {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.nav__logo-en {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav__logo-cn {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--color-faint);
}

.nav__links {
  display: flex;
  gap: 40px;
}

.nav__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
  transition: color 0.25s var(--ease);
}

.nav__links a:hover { color: var(--color-faint); }

/* ---------- Hero ---------- */
.hero {
  padding: 120px var(--page-x) 80px;
}

.hero__kicker {
  margin: 0 0 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-faint);
}

.hero__name {
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-size: clamp(56px, 8.3vw, 120px);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.01em;
}

.hero__sub {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
}

.hero__name-cn {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
}

.hero__role {
  font-size: 20px;
  color: var(--color-mid);
}

.hero__line {
  margin: 0 0 28px;
  max-width: 30ch;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.55;
  color: var(--color-ink-soft);
}

.hero__meta {
  margin: 0;
  font-size: 14px;
  color: var(--color-faint);
}

.hero__image {
  margin-top: 56px;
  width: 100%;
  height: 600px;
  background: var(--color-placeholder);
}

/* ---------- Works ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-projects);
  margin-top: 56px;
}

.project { display: flex; flex-direction: column; gap: 14px; }

.project__cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-placeholder);
  overflow: hidden;
}

.project__title-en {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}

.project__title-cn {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--color-mid);
}

.project__meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-faint);
}

/* ---------- Photography ---------- */
.photo-grid {
  display: flex;
  gap: var(--gap-photos);
  margin-top: 56px;
}

.photo-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap-photos);
  min-width: 0;
}

.photo {
  width: 100%;
  background: var(--color-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.35s var(--ease);
}

.photo__label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--color-mid);
}

/* interactive filtering */
.photo.is-hidden { display: none; }

.series-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.tag {
  padding: 7px 16px;
  border: 1px solid var(--color-rule);
  border-radius: 9999px;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--color-mid);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.tag:hover { border-color: var(--color-faint); color: var(--color-ink); }

.tag.is-active {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-white);
}

/* ---------- About ---------- */
.about__body {
  display: flex;
  gap: var(--gap-about);
  margin-top: 56px;
}

.about__portrait {
  flex: 0 0 420px;
  width: 420px;
  height: 560px;
  background: var(--color-placeholder);
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-width: 0;
}

.about__lead-en {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
}

.about__lead-cn {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.45;
  color: var(--color-ink-soft);
}

.about__bio {
  margin: 0;
  max-width: 64ch;
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-mid);
}

.about__bio + .about__bio { margin-top: -8px; }

.about__meta {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-faint);
}

/* ---------- Writing ---------- */
.article-list { margin-top: 56px; border-top: 1px solid var(--color-rule); }

.article {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--color-rule);
}

.article__text { display: flex; flex-direction: column; gap: 6px; }

.article__title-en {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}

.article__title-cn {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--color-mid);
}

.article__meta {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-faint);
}

/* Articles are inert until a real URL exists (no href). The hover
   affordance is scoped to [href], so the moment a link is filled in
   the row becomes interactive with no CSS change needed. */
.article.is-pending { cursor: default; }

.article[href] { transition: padding-left 0.3s var(--ease); }
.article[href]:hover { padding-left: 10px; }

.article__title-en { transition: color 0.25s var(--ease); }
.article[href]:hover .article__title-en { color: var(--color-mid); }

/* ---------- Empty placeholders ----------
   Slots Solin hasn't filled yet (projects, articles). Content is
   deliberately blank so nothing half-written or confidential ships.
   Every empty slot prints 占位 NN — a numbered label that maps 1:1
   to 项目01…项目06 in the content library, so an anonymous block
   never needs guessing. Covers get a hairline frame. Drop .is-empty
   and write real text when content lands.
   --------------------------------------- */

.project.is-empty .project__cover {
  border: 1px solid var(--color-rule);
}

/* placeholder text sits one step quieter than real content, so a
   filled slot visibly outranks an empty one at a glance */
.project__title-en.is-empty,
.project__meta.is-empty,
.article__title-en.is-empty,
.article__title-cn.is-empty,
.article__meta.is-empty {
  color: var(--color-placeholder-ink);
}

/* the slot number is the one part worth reading — keep it legible */
.project__title-en.is-empty,
.article__title-en.is-empty {
  letter-spacing: 0.02em;
}

/* inline blank inside a sentence — a number or fact that still needs
   confirming. Same grey as the block placeholders so every "to be
   filled" spot on the page reads as one system. */
.fill-in {
  display: inline-block;
  width: 30px;
  height: 0.82em;
  margin: 0 2px;
  background: var(--color-rule);
  border-radius: 2px;
  vertical-align: -0.08em;
}

@media (max-width: 560px) {
  .article__title-en.is-empty { width: 190px; }
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 120px var(--page-x) 64px;
  background: var(--color-footer);
}

.footer__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 600;
  line-height: 1.17;
}

.footer__email {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  border-bottom: 1px solid var(--color-ink);
  padding-bottom: 2px;
  align-self: flex-start;
  transition: opacity 0.25s var(--ease);
}

.footer__email:hover { opacity: 0.6; }

.footer__links { display: flex; gap: 32px; }

.footer__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-mid);
  transition: color 0.25s var(--ease);
}

.footer__links a:hover { color: var(--color-ink); }

/* link known but URL not supplied yet — rendered inert, no href so it
   doesn't jump to top of page when clicked */
.footer__links a.is-pending {
  color: var(--color-faint);
  cursor: default;
  text-decoration: none;
}

.footer__links a.is-pending:hover { color: var(--color-faint); }

.footer__bottom {
  font-size: 13px;
  color: var(--color-faint);
}

/* ---------- Image layers ----------
   Every media slot is a placeholder block by default.
   Once a real file exists at the referenced path the <img>
   covers the block; if the file is missing, onerror hides the
   img and the labelled placeholder shows through.
   ------------------------------------------------------- */
.hero__image,
.project__cover,
.photo,
.about__portrait {
  position: relative;
}

.hero__image img,
.project__cover img,
.photo img,
.about__portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* paint above the placeholder label / slot index underneath, so a
     loaded image always wins and a failed one reveals the fallback */
  z-index: 1;
}

.about__links {
  margin: 4px 0 0;
}

.about__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: 3px;
  transition: border-color 0.25s var(--ease);
}

.about__links a:hover { border-color: var(--color-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  :root { --page-x: 64px; --gap-about: 56px; }
  .section-title { font-size: 46px; }
}

@media (max-width: 1024px) {
  .about__body { flex-direction: column; }
  .about__portrait { flex: none; width: 100%; max-width: 420px; height: 480px; }
  .projects { gap: 36px; }
}

@media (max-width: 860px) {
  :root { --page-x: 28px; --section-y: 80px; }

  .nav { height: auto; gap: 0; flex-direction: column; align-items: stretch; padding-top: 12px; }
  .nav__logo { min-height: 40px; flex-wrap: wrap; }
  .nav__links { gap: 20px; overflow-x: auto; min-width: 0; scrollbar-width: thin; }
  .nav__links li { flex: 0 0 auto; }
  .nav__links a { display: flex; align-items: center; min-height: 44px; font-size: 14px; white-space: nowrap; }

  .hero { padding: 72px var(--page-x) 56px; }
  .hero__name-cn { font-size: 26px; }
  .hero__role { font-size: 17px; }
  .hero__line { font-size: 19px; max-width: none; }
  .hero__image { height: 360px; margin-top: 40px; }

  .section-title { font-size: 38px; }
  .projects { grid-template-columns: 1fr; gap: 40px; margin-top: 40px; }
  .photo-grid { gap: 16px; margin-top: 40px; }
  .photo-col { gap: 16px; }
  .article-list { margin-top: 40px; }
  .article { flex-direction: column; gap: 8px; }

  .footer { padding: 80px var(--page-x) 48px; }
  .footer__title { font-size: 34px; }
  .footer__email { font-size: 20px; }
}

@media (max-width: 560px) {
  :root { --page-x: 20px; --section-y: 56px; --gap-about: 28px; }
  .hero { padding: 40px var(--page-x) 32px; }
  .hero__kicker { font-size: 14px; letter-spacing: 0.025em; margin-bottom: 20px; }
  .hero__name { font-size: clamp(2.6rem, 11vw, 3.8rem); margin-bottom: 20px; }
  .hero__sub { flex-direction: column; gap: 8px; margin-bottom: 20px; }
  .hero__name-cn { font-size: 24px; }
  .hero__role { font-size: 16px; }
  .hero__line { font-size: 18px; margin-bottom: 20px; }
  .hero__image { height: auto; aspect-ratio: 4 / 3; margin-top: 28px; }
  .section-title { font-size: 32px; margin-bottom: 16px; }
  .kicker { margin-bottom: 12px; }
  .projects { margin-top: 28px; gap: 32px; }
  .project { gap: 10px; }
  .project h3, .project p { margin: 0; }
  .project__title-en { font-size: 22px; }
  .photo-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 24px; }
  .photo-col { display: contents; }
  .photo { height: auto !important; min-height: 180px; aspect-ratio: 4 / 3; }
  .photo:has(img.is-loaded) { aspect-ratio: auto; min-height: 0; }
  .photo img.is-loaded { position: relative; height: auto; object-fit: contain; }
  .photo:has(img.is-loaded) .photo__label { display: none; }
  .series-tags { gap: 8px; margin-top: 24px; }
  .tag { min-height: 44px; padding: 10px 14px; font-size: 14px; letter-spacing: 0; }
  .about__body { margin-top: 28px; }
  .about__portrait { height: auto; aspect-ratio: 3 / 4; max-width: 320px; }
  .about__lead-en { font-size: 28px; line-height: 1.3; }
  .about__lead-cn { font-size: 20px; }
  .about__text { gap: 20px; }
  .about__bio { line-height: 1.85; }
  .article-list { margin-top: 28px; }
  .article { padding: 22px 0; gap: 10px; }
  .article__title-en { font-size: 20px; }
  .article__title-en.is-empty { width: auto; }
  .footer { padding: 56px var(--page-x) 32px; gap: 24px; }
  .footer__title { font-size: 30px; }
  .footer__email { max-width: 100%; overflow-wrap: anywhere; }
  .footer__links { flex-wrap: wrap; gap: 12px 24px; }
  .footer__links a, .about__links a { display: inline-flex; align-items: center; min-height: 44px; }
  .project__meta, .article__meta, .footer__bottom, .kicker, .photo__label { font-size: 14px; }
}

/* Keep anchor headings below the sticky navigation and long content inside its column. */
[id] { scroll-margin-top: 96px; }
.nav__logo, .hero__sub, .project, .article__text { min-width: 0; }
.hero, .section, .footer { overflow-wrap: break-word; }
@media (max-width: 860px) {
  [id] { scroll-margin-top: 116px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.managed-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.managed-gallery .photo-col { display: contents; }
.managed-gallery .photo { height: auto !important; aspect-ratio: 4 / 3; }
.managed-gallery .photo:has(img.is-loaded) { aspect-ratio: auto; }
.managed-gallery img.is-loaded { position: relative; height: auto; }
.managed-gallery .photo:has(img.is-loaded) .photo__label { display: none; }
.reading { max-width: 780px; margin: 0 auto; padding: 64px 24px 96px; overflow-wrap: anywhere; }
.reading-back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 32px; }
.reading h1 { font-family: var(--font-serif); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.3; margin: 16px 0 24px; }
.reading-summary { color: var(--color-mid); border-bottom: 1px solid var(--color-rule); padding-bottom: 28px; margin-bottom: 32px; }
.reading article { font-size: 18px; line-height: 1.9; }
.reading article p { margin: 0 0 1.5em; }
.reading article h2, .reading article h3 { line-height: 1.4; margin: 2em 0 1em; }
.preview-banner { padding: 12px 20px; background: #e5eee8; color: #163f31; margin: 0; text-align: center; }
@media(max-width:860px) { .managed-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) { .managed-gallery { grid-template-columns: minmax(0,1fr); } .reading { padding: 28px 20px 56px; } .reading article { font-size: 16px; } }
