/* ============================================================
   Linqiang Guo — Personal Homepage
   Professional / academic / developer portfolio.
   Edit the tokens in :root to re-theme.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f6fb;
  --surface: #ffffff;
  --text: #14161f;
  --text-soft: #555a6b;
  --border: #e6e8f0;
  --accent: #4f46e5;       /* indigo */
  --accent-soft: #6366f1;
  --accent-2: #0ea5e9;     /* sky   */
  --shadow: 0 10px 40px rgba(20, 22, 60, 0.08);
  --radius: 16px;
  --maxw: 1080px;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-head: "Space Grotesk", "Inter", sans-serif;
}

[data-theme="dark"] {
  --bg: #0d0f17;
  --bg-alt: #141723;
  --surface: #181b28;
  --text: #eef0f7;
  --text-soft: #9aa0b4;
  --border: #262a3a;
  --accent: #818cf8;
  --accent-soft: #6366f1;
  --accent-2: #38bdf8;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; }
img { max-width: 100%; display: block; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s, color 0.18s, border-color 0.18s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3); }
.btn--ghost { border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 8px 16px; font-size: 0.85rem; border-color: var(--border); }
.btn--sm:hover { border-color: var(--accent); color: var(--accent); }
.btn--lg { padding: 15px 34px; font-size: 1.05rem; }

/* ===== Navigation ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent; transition: border-color 0.3s, background 0.3s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.nav__brand { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.3px; }
.nav__brand span { color: var(--accent); }
.nav__links { display: flex; gap: 26px; }
.nav__links a { font-weight: 500; font-size: 0.92rem; color: var(--text-soft); position: relative; transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: var(--accent); transition: width 0.25s; }
.nav__links a:hover::after { width: 100%; }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 1rem; line-height: 1;
  display: grid; place-items: center; transition: transform 0.2s, border-color 0.2s;
}
.theme-toggle:hover { transform: rotate(20deg); border-color: var(--accent); }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

/* ===== Hero ===== */
.hero { padding: 80px 0 60px; }
.hero__inner { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 50px; align-items: center; }
.hero__eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.04em; margin-bottom: 14px; text-transform: uppercase; font-size: 0.82rem; }
.hero__title { font-size: clamp(2.6rem, 6vw, 4.2rem); letter-spacing: -1.5px; margin-bottom: 12px; }
.hero__role { font-size: 1.1rem; color: var(--text-soft); font-weight: 500; margin-bottom: 22px; }
.hero__lead { font-size: 1.05rem; color: var(--text-soft); max-width: 540px; margin-bottom: 30px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.hero__socials { display: flex; gap: 22px; flex-wrap: wrap; }
.hero__socials a { font-size: 0.9rem; font-weight: 500; color: var(--text-soft); transition: color 0.2s; }
.hero__socials a:hover { color: var(--accent); }
.hero__media { position: relative; display: grid; place-items: center; }
.hero__photo-frame {
  position: relative; z-index: 2; width: 270px; height: 320px; border-radius: 22px;
  overflow: hidden; box-shadow: var(--shadow); border: 5px solid var(--surface);
}
.hero__photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero__blob {
  position: absolute; z-index: 1; width: 300px; height: 300px; border-radius: 46% 54% 60% 40%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  filter: blur(10px); opacity: 0.32; animation: blob 9s ease-in-out infinite;
}
@keyframes blob { 0%,100% { border-radius: 46% 54% 60% 40%; transform: rotate(0deg) scale(1); } 50% { border-radius: 60% 40% 45% 55%; transform: rotate(12deg) scale(1.05); } }

/* ===== Stat strip ===== */
.strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.strip__inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 28px 24px; }
.stat { text-align: center; }
.stat__num { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; color: var(--accent); }
.stat__label { font-size: 0.82rem; color: var(--text-soft); letter-spacing: 0.03em; }

/* ===== Sections ===== */
.section { padding: 84px 0; }
.section--alt { background: var(--bg-alt); }
.section__eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; font-size: 0.78rem; margin-bottom: 10px; }
.section__title { font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -0.6px; margin-bottom: 40px; max-width: 760px; }

/* ===== About ===== */
.about { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; }
.about__text p { color: var(--text-soft); margin-bottom: 16px; font-size: 1.03rem; }
.about__facts { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.about__facts li { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 0.95rem; }
.about__facts span { font-size: 1.1rem; }
.about__edu-title { font-size: 1.1rem; margin-bottom: 20px; }
.edu { list-style: none; position: relative; }
.edu::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.edu__item { position: relative; padding-left: 30px; padding-bottom: 24px; }
.edu__item:last-child { padding-bottom: 0; }
.edu__dot { position: absolute; left: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.edu__date { font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.edu__item h4 { font-size: 1rem; margin: 4px 0 2px; }
.edu__item p { color: var(--text-soft); font-size: 0.9rem; }

/* ===== Skills ===== */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skill-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.skill-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.skill-card__icon { font-size: 1.9rem; margin-bottom: 12px; }
.skill-card h3 { font-size: 1.15rem; margin-bottom: 16px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 0.78rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }

/* ===== Publications ===== */
.pubs { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.pub { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: start; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.pub:hover { transform: translateX(4px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.pub__body h3 { font-size: 1.08rem; margin-bottom: 6px; line-height: 1.35; }
.pub__authors { color: var(--text-soft); font-size: 0.92rem; }
.pub__authors strong { color: var(--text); }
.pub__note { color: var(--text-soft); font-size: 0.85rem; font-style: italic; margin-top: 4px; }
.badge { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 6px 12px; border-radius: 8px; background: var(--bg-alt); color: var(--text-soft); border: 1px solid var(--border); white-space: nowrap; }
.badge--accent { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-color: transparent; }
.badge--muted { opacity: 0.85; }

/* ===== Timeline (experience) ===== */
.timeline { list-style: none; position: relative; max-width: 800px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline__item { position: relative; padding-left: 40px; padding-bottom: 34px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot { position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.timeline__date { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.timeline__item h3 { font-size: 1.15rem; margin: 5px 0 3px; }
.timeline__org { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 12px; }
.timeline__points { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.timeline__points li { position: relative; padding-left: 18px; color: var(--text-soft); font-size: 0.96rem; }
.timeline__points li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* ===== Projects ===== */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.project-card__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.project-card__top h3 { font-size: 1.15rem; }
.project-card__date { font-size: 0.8rem; color: var(--text-soft); white-space: nowrap; }
.project-card p { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 16px; }

/* ===== Contact ===== */
.section--contact { text-align: center; padding: 100px 0; }
.section--contact .section__title { margin: 0 auto 16px; }
.contact__lead { color: var(--text-soft); font-size: 1.1rem; max-width: 540px; margin: 0 auto 30px; }
.contact__socials { display: flex; justify-content: center; gap: 24px; margin-top: 36px; flex-wrap: wrap; }
.contact__socials a { font-weight: 500; color: var(--text-soft); transition: color 0.2s; }
.contact__socials a:hover { color: var(--accent); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 26px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer p { color: var(--text-soft); font-size: 0.88rem; }
.footer__right { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__right a { font-size: 0.85rem; color: var(--text-soft); font-weight: 500; transition: color 0.2s; }
.footer__right a:hover { color: var(--accent); }
.footer__top { color: var(--accent) !important; }

/* ===== Reveal on scroll ===== */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__cta, .hero__socials { justify-content: center; }
  .hero__lead { margin-left: auto; margin-right: auto; }
  .hero__media { order: -1; margin-bottom: 16px; }
  .about { grid-template-columns: 1fr; gap: 36px; }
  .about__facts { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .strip__inner { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .pub { grid-template-columns: 1fr; gap: 10px; }

  .nav__links {
    position: fixed; inset: 66px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 10px 24px; transform: translateY(-130%); transition: transform 0.3s ease;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .nav__burger { display: flex; }
}

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