/* Mankun Sang — personal site
   Minimal editorial style shared by the English and Chinese versions. */

:root {
  --bg: #fbfaf7;
  --ink: #23211b;
  --muted: #6f6a5e;
  --line: #e6e2d6;
  --font-display: "Fraunces", "Noto Serif SC", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --font-body: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  --maxw: 40rem;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #ede8da; }

a { color: inherit; }

/* ——— Navigation ——— */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.nav-links ul {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.nav-links a.lang {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.75rem;
  transition: border-color 0.15s;
}

.nav-links a.lang:hover { border-color: var(--ink); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.95rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
}

/* ——— Hero ——— */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 15vh 1.5rem 12vh;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.role {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.02rem;
  letter-spacing: 0.08em;
}

.hero-desc {
  margin: 1.6rem auto 0;
  max-width: 33rem;
  color: var(--muted);
}

.hero-links {
  margin-top: 2.4rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 1.25rem;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.hero-links a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ——— Sections ——— */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  border-top: 1px solid var(--line);
}

.label {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.2rem;
}

html[lang="zh-CN"] .label {
  text-transform: none;
  font-size: 0.9rem;
  letter-spacing: 0.4em;
}

.lead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.32rem;
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

.section-intro { color: var(--muted); max-width: 34rem; }

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

/* ——— Research ——— */

.items {
  display: grid;
  gap: 2rem;
}

.item h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  margin-bottom: 0.3rem;
}

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

@media (min-width: 640px) {
  .items { grid-template-columns: repeat(3, 1fr); }
}

/* ——— Archive-style lists (notes, albums) ——— */

.archive-list,
.album-grid,
.contact-list { list-style: none; }

.archive-list { margin-top: 0.5rem; }

.archive-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.9rem 0;
}

.archive-list li + li { border-top: 1px solid var(--line); }

.archive-list .t {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.04rem;
}

.archive-list .d,
.album-grid .d {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.album-grid {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
  border-bottom: 1px solid var(--line);
}

.album-grid li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

/* ——— Contact ——— */

.contact-list {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.contact-list a {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 1.2rem;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.contact-list a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.contact-note {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ——— Footer ——— */

.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.footer a:hover,
.footer a[aria-current="true"] { color: var(--ink); }

/* ——— Motion ——— */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.hero > * { animation: rise 0.7s ease both; }
.hero > *:nth-child(2) { animation-delay: 0.08s; }
.hero > *:nth-child(3) { animation-delay: 0.16s; }
.hero > *:nth-child(4) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero > * { animation: none; }
}

/* ——— Mobile ——— */

@media (max-width: 720px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

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

  .nav-links ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.4rem 1.5rem 1rem;
  }

  .nav-links li { width: 100%; }

  .nav-links a { display: block; padding: 0.5rem 0; }

  .nav-links a.lang {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.05rem 0.75rem;
  }
}

@media (max-width: 560px) {
  .album-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 12vh; }
}

/* ——— Guestbook ——— */

.guestbook { margin-top: 1.8rem; max-width: 34rem; }

.guestbook .field { margin-bottom: 1.1rem; }

.guestbook label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.guestbook .optional { font-size: 0.85em; }

.guestbook input[type="text"],
.guestbook input[type="email"],
.guestbook textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.guestbook textarea { resize: vertical; min-height: 7rem; }

.guestbook input:focus,
.guestbook textarea:focus { outline: none; border-color: var(--ink); }

.guestbook button {
  margin-top: 0.2rem;
  padding: 0.35rem 1.4rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.guestbook button:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.guestbook button:disabled { opacity: 0.5; cursor: default; }

.gotcha {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-status { margin-top: 0.9rem; font-size: 0.9rem; color: var(--muted); }
.form-status.error { color: #a0564a; }
