/* ==========================================================
   Zhuoran Liu — personal site
   Colours come from the portrait: navy backdrop, the royal-blue
   hood, and the champagne-gold tie as the accent.
   ========================================================== */

@font-face { font-family: "Sora";  src: url("fonts/sora.woff2") format("woff2");  font-weight: 100 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --ink:      #171b2e;   /* deepest navy: nav, dark sections   */
  --ink-2:    #20253d;   /* hero background                    */
  --ink-3:    #2a3050;   /* cards on dark                      */
  --paper:    #f4f2ee;   /* light sections                     */
  --white:    #ffffff;
  --text:     #eceaf0;   /* text on dark                       */
  --muted:    #a8aec6;   /* secondary text on dark             */
  --body:     #2b2f42;   /* text on light                      */
  --body-2:   #5c6178;   /* secondary text on light            */
  --gold:     #e9bd72;   /* accent                             */
  --gold-ink: #2a2110;   /* text on gold                       */
  --blue:     #2a3bd0;   /* links and details on light         */
  --line-d:   rgba(255, 255, 255, .16);
  --line-l:   rgba(23, 27, 46, .14);

  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --sans:    "Inter", "Segoe UI", system-ui, sans-serif;

  --wrap: 1240px;
  --nav-h: 68px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(32, 37, 61, 0);
  transition: background .25s ease, box-shadow .25s ease;
}
.nav.is-stuck { background: rgba(23, 27, 46, .94); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line-d); }

.nav__inner {
  max-width: var(--wrap); height: 100%; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__brand { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--white); text-decoration: none; letter-spacing: -.01em; }

.nav__links { display: flex; gap: 6px; }
.nav__links a {
  font-family: var(--display); font-weight: 600; font-size: 14.5px;
  color: var(--text); text-decoration: none;
  padding: 8px 12px; border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.nav__links a:hover { color: var(--gold); }
.nav__links a.is-active { color: var(--gold); }

.nav__progress { position: absolute; left: 0; bottom: -3px; height: 3px; width: 0; background: var(--gold); }

.nav__toggle { display: none; width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer; }
.nav__toggle span { display: block; height: 2px; margin: 5px 0; background: var(--white); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 700; font-size: 15px;
  color: var(--gold-ink); background: var(--gold);
  padding: 12px 18px; border-radius: 8px; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: #f2cb88; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(233, 189, 114, .25); }
.btn svg { width: 18px; height: 18px; }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4); }
.btn--ghost:hover { background: rgba(255, 255, 255, .08); color: var(--white); box-shadow: inset 0 0 0 1.5px var(--gold); }


/* ---------- Hero ---------- */

.hero { background: var(--ink-2); color: var(--text); overflow: hidden; }

.hero__inner {
  position: relative;
  max-width: var(--wrap); margin: 0 auto; padding: 0 32px;
  height: min(100vh, 860px); min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
}

.hero__name { position: relative; z-index: 2; padding-bottom: 60px; }
.hero__name h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(60px, 7.2vw, 110px);
  line-height: .98; letter-spacing: -.035em;
  color: var(--white);
}
.hero__name .dot { color: var(--gold); }
.hero__say { margin-top: 22px; font-size: 15px; font-style: italic; color: var(--muted); }

.hero__photo { position: relative; z-index: 1; align-self: end; height: 100%; }
.hero__photo img {
  position: absolute; bottom: 0; left: 50%;
  height: 80%; width: auto; max-width: none;
  transform: translateX(-53%);
}

.hero__intro { position: relative; z-index: 2; padding-left: 56px; padding-bottom: 110px; }
.hero__intro h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(22px, 2vw, 29px); line-height: 1.28; letter-spacing: -.015em;
  color: var(--white);
  padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .45);
}
.hero__intro ul { margin: 22px 0 28px; }
.hero__intro li { position: relative; padding-left: 16px; margin: 7px 0; font-size: 15px; line-height: 1.55; color: #d5d8e6; }
.hero__intro li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

.hero__social { position: absolute; left: 32px; bottom: 36px; z-index: 2; display: flex; gap: 16px; }
.hero__social a, .footer__rule a { color: #c9cde0; font-size: 32px; line-height: 0; transition: color .15s ease, transform .15s ease; }
.hero__social a:hover, .footer__rule a:hover { color: var(--gold); transform: translateY(-2px); }

/* ---------- Sections ---------- */

.section { padding: 104px 0 112px; }
.section--dark  { background: var(--ink);   color: var(--text); }
.section--light { background: var(--paper); color: var(--body); }

.section__title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(38px, 4.4vw, 58px); line-height: 1.1; letter-spacing: -.03em;
  padding-bottom: 20px; margin-bottom: 48px;
  border-bottom: 1px solid var(--line-l);
}
.section--dark .section__title { color: var(--white); border-color: var(--line-d); }
.section--light .section__title { color: var(--ink-2); }

/* ---------- About ---------- */

.about { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; align-items: start; }

.about__text p { color: #cfd3e2; margin-bottom: 18px; font-size: 16.5px; }
.about__text .lead { font-family: var(--display); font-size: 25px; line-height: 1.35; color: var(--white); margin-bottom: 24px; letter-spacing: -.01em; }
.about__text .lead em { color: var(--gold); font-style: italic; }

.edu { background: var(--ink-3); border: 1px solid var(--line-d); border-radius: 14px; padding: 30px 30px 14px; }
.edu__label { font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.edu h3 { font-family: var(--display); font-size: 23px; line-height: 1.25; color: var(--white); letter-spacing: -.01em; }
.edu__degree { margin-top: 4px; color: var(--text); font-weight: 500; }
.edu__meta { margin-top: 2px; font-size: 14px; color: var(--muted); }
.edu dl { margin-top: 20px; }
.edu dl div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-d); }
.edu dt { font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.edu dd { font-size: 15px; color: var(--text); line-height: 1.6; }

/* ---------- Blog ---------- */

.soon {
  border: 1.5px dashed rgba(23, 27, 46, .28); border-radius: 14px;
  padding: 64px 32px; text-align: center;
}
.soon__tag {
  display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-ink); background: var(--gold); padding: 5px 12px; border-radius: 999px;
}
.soon h3 { margin-top: 18px; font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.02em; color: var(--ink); line-height: 1.2; }
.soon p { margin-top: 8px; color: var(--body-2); }

.section--light a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.section--light a:hover { text-decoration-thickness: 2px; }

/* ---------- Resume ---------- */

.section__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-bottom: 20px; margin-bottom: 48px; border-bottom: 1px solid var(--line-d);
}
.section__head .section__title { padding: 0; margin: 0; border: 0; }
.section__head .btn { margin-bottom: 6px; white-space: nowrap; }

.sheet {
  display: block; max-width: 860px; margin: 0 auto;
  background: var(--white); border-radius: 6px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  transition: transform .2s ease, box-shadow .2s ease;
}
.sheet:hover { transform: translateY(-4px); box-shadow: 0 30px 70px rgba(0, 0, 0, .55); }
.sheet img { width: 100%; height: auto; }
.sheet__note { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }

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

.footer { background: var(--ink-2); color: var(--text); text-align: center; padding: 72px 0 40px; }
.footer__rule { display: flex; align-items: center; gap: 24px; margin-bottom: 36px; }
.footer__rule::before, .footer__rule::after { content: ""; flex: 1; height: 1px; background: var(--line-d); }
.footer h2 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4vw, 48px); letter-spacing: -.03em; color: var(--white); line-height: 1.1; }
.footer p { margin: 12px 0 26px; color: var(--muted); }
.footer__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.footer .footer__copy { margin: 56px 0 0; font-size: 13.5px; }

/* ---------- Reveal on scroll (only when JS is running) ---------- */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .sheet, .hero__social a { transition: none; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1080px) {
  .hero__inner {
    height: auto; min-height: 0; padding: calc(var(--nav-h) + 40px) 32px 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "name name" "intro photo";
    column-gap: 24px; row-gap: 36px; align-items: end;
  }
  .hero__name  { grid-area: name; padding-bottom: 0; }
  .hero__intro { grid-area: intro; padding: 0 0 96px; align-self: start; }
  .hero__photo { grid-area: photo; height: auto; }
  .hero__photo img { position: static; transform: none; height: auto; width: 100%; max-width: 420px; margin-left: auto; }
  .hero__name h1 { font-size: clamp(60px, 12vw, 104px); }
  .hero__social { left: 32px; bottom: 32px; }

  .about { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Phone ---------- */

@media (max-width: 720px) {
  :root { --nav-h: 60px; }
  .wrap, .nav__inner { padding: 0 22px; }

  .nav { background: rgba(23, 27, 46, .94); backdrop-filter: blur(10px); }
  .nav__toggle { display: block; margin-right: -10px; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 22px 18px;
    background: rgba(23, 27, 46, .98); border-bottom: 1px solid var(--line-d);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 13px 0; font-size: 16px; border-bottom: 1px solid var(--line-d); border-radius: 0; }
  .nav__links a:last-child { border-bottom: 0; }

  .hero__inner {
    padding: calc(var(--nav-h) + 36px) 22px 0;
    grid-template-columns: 1fr; grid-template-areas: "name" "intro" "photo";
    row-gap: 28px;
  }
  .hero__name h1 { font-size: clamp(56px, 17vw, 84px); }
  .hero__say { margin-top: 16px; }
  .hero__intro { padding: 0; }
  .hero__intro h2 { font-size: 21px; }
  .hero__photo img { max-width: 330px; margin: 0 auto; }
  .hero__social { position: static; grid-row: 2; grid-column: 1; align-self: end; justify-self: end; margin-bottom: 4px; }

  .section { padding: 68px 0 76px; }
  .section__title { margin-bottom: 34px; padding-bottom: 16px; }

  .about__text .lead { font-size: 22px; }
  .edu { padding: 24px 22px 8px; }




  .soon { padding: 48px 22px; }
  .section__head { flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 34px; }
  .section__head .btn { margin-bottom: 0; }
  .sheet { border-radius: 4px; }

  .footer { padding: 56px 0 32px; }
}
