/* ============================================
   Jiang Li — Portfolio
   Minimal, white, black serif type, whitespace.
   ============================================ */

:root {
  --max-width: 1100px;
  --text: #000000;
  --muted: #666666;
  --faint: #999999;
  --bg: #ffffff;
  --gap: 2rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.65;
  opacity: 0;
  animation: fadeIn 0.9s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
    opacity: 1;
  }
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------- Site Header / Nav (interior pages) ---------- */

.site-header {
  padding: 3rem 0 1rem;
}

.site-header .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.brand {
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}

.brand a {
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.site-nav a.active {
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
}

/* ---------- Home ---------- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
}

.hero-name {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0;
}

.hero-role {
  margin-top: 0.75rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.hero-menu {
  margin-top: 4rem;
}

.hero-menu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.hero-menu a {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* ---------- Page Title (interior pages) ---------- */

.page-title {
  text-align: center;
  margin: 5rem 0 4rem;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.03em;
}

main {
  padding-bottom: 6rem;
}

/* ---------- Works Grid ---------- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 5rem 3rem;
}

.work-item {
  display: flex;
  flex-direction: column;
}

.placeholder-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f2f2f2;
  position: relative;
  overflow: hidden;
}

.placeholder-img::after {
  content: attr(data-index);
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.05em;
}

.work-title {
  margin-top: 1.5rem;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.work-meta {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.work-desc {
  margin-top: 0.9rem;
  font-size: 0.95rem;
  color: var(--text);
  max-width: 42ch;
}

/* ---------- Prose pages (Statement / CV / Contact) ---------- */

.prose {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem;
}

.prose p {
  margin: 0 0 1.4rem;
}

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

/* ---------- CV ---------- */

.cv-section {
  max-width: 680px;
  margin: 0 auto 4.5rem;
  padding: 0 1rem;
}

.cv-section:last-child {
  margin-bottom: 0;
}

.cv-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 400;
  margin: 0 0 1.75rem;
  color: var(--muted);
}

.cv-entry {
  display: flex;
  gap: 1.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid #ececec;
}

.cv-entry:last-child {
  border-bottom: 1px solid #ececec;
}

.cv-year {
  flex: 0 0 4.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.cv-detail {
  flex: 1;
}

.cv-detail .cv-title {
  display: block;
}

.cv-detail .cv-place {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ---------- Contact ---------- */

.contact-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
}

.contact-list {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-list a {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 3rem 0 2.5rem;
  font-size: 0.8rem;
  color: var(--faint);
  letter-spacing: 0.03em;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }

  .container {
    padding: 0 1.25rem;
  }

  .hero {
    padding: 2rem 1.25rem;
  }

  .hero-menu ul {
    gap: 1.25rem 1.75rem;
  }

  .page-title {
    margin: 3.5rem 0 3rem;
  }

  .works-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .cv-entry {
    flex-direction: column;
    gap: 0.25rem;
  }

  .cv-year {
    flex: none;
  }
}
