/* =========================================================
   Rui Sun — Academic Homepage
   Refined Editorial System
   Display: Fraunces (high-contrast elegant serif)
   Body:    Inter (clean grotesque)
   Palette: warm paper · deep ink · navy · terracotta accent
   ========================================================= */

:root {
  --paper:    #F7F4ED;
  --paper-2:  #EFEAE0;
  --ink:      #16130F;
  --muted:    #6E675C;
  --line:     #E2DAC9;
  --navy:     #0C2A4A;
  --navy-2:   #08203A;
  --accent:   #C2542F;   /* terracotta — warm pop against cool ink/navy */
  --accent-2: #9E3F22;
  --gold:     #B8893B;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1180px;
  --gutter: 48px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  /* subtle atmospheric depth — very faint warm radial + cool top wash */
  background-image:
    radial-gradient(120% 80% at 85% -10%, rgba(12, 42, 74, 0.05), transparent 60%),
    radial-gradient(90% 60% at 5% 110%, rgba(194, 84, 47, 0.05), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.brand .dot { color: var(--accent); }
.nav {
  display: flex;
  align-items: center;
  gap: 38px;
}
.nav a {
  position: relative;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 4px 0;
  transition: color 0.2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after,
.nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--ink); }

/* ---------------- Hero ---------------- */
.hero {
  padding: 96px 0 120px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 80px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 26px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(54px, 7vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 22px;
}
.hero .subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.35;
  color: var(--navy);
  margin-bottom: 28px;
}
.rule {
  width: 64px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 28px;
}
.research-line {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 460px;
  margin-bottom: 40px;
}
.research-line strong { color: var(--ink); font-weight: 600; }

.cta-row { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  padding: 15px 28px;
  border-radius: 3px;
  transition: transform 0.18s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(12, 42, 74, 0.7);
}
.btn-primary:hover { background: var(--navy-2); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }

/* portrait with terracotta offset block (warm–cool contrast) */
.portrait {
  position: relative;
  width: min(440px, 100%);
  aspect-ratio: 4 / 5;
  margin-left: auto;
}
.portrait::before {
  content: "";
  position: absolute;
  inset: 22px -22px -22px 22px;
  background: var(--accent);
  border-radius: 4px;
  z-index: 0;
}
.portrait-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 34px 64px -26px rgba(12, 42, 74, 0.4);
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 25% center;
  display: block;
  filter: saturate(1.02) contrast(1.02);
}

/* ---------------- Content pages ---------------- */
.content { padding: 88px 0 110px; }
.content-inner { max-width: 760px; }
.page-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.content h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 22px;
}
.content .rule { margin-bottom: 32px; }
.content .lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 21px;
  line-height: 1.5;
  color: var(--navy);
  margin-bottom: 14px;
}
.content .note {
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}

/* paper entry */
.paper {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.paper:last-child { border-bottom: 1px solid var(--line); }
.paper-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 23px;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 12px;
}
.paper-meta {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}
.paper-meta a {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}
.paper-meta a:hover { border-color: var(--accent); }
.paper-status {
  font-style: italic;
  font-size: 15px;
  color: var(--navy);
  margin-top: 8px;
}

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 34px;
  padding-bottom: 34px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.footer-brand .sq {
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateY(-1px);
}
.footer-meta { font-size: 14px; color: var(--muted); }
.footer-links { display: flex; gap: 24px; align-items: center; }
.footer-links a {
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--ink); }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  :root { --gutter: 28px; }
  .hero { padding: 64px 0 80px; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .portrait { margin: 0 auto; }
  .nav { gap: 22px; }
}
@media (max-width: 560px) {
  .site-header .container { height: auto; flex-direction: column; gap: 14px; padding-top: 16px; padding-bottom: 16px; }
  .nav { flex-wrap: wrap; justify-content: center; gap: 18px; }
  .hero h1 { font-size: 48px; }
}
