/* ============================================================
   Linqiang Guo — Editorial homepage (Option 2)
   Unified dark theme. A full-page interactive dot grid sits
   behind all content and reacts to the cursor everywhere.
   ============================================================ */

:root {
  --ink: #0c0c0e;          /* near-black base                  */
  --paper: #f4f1ea;        /* light text                       */
  --paper-soft: rgba(244,241,234,0.82);
  --line: rgba(244,241,234,0.13);
  /* iridescent palette used by the cursor effects */
  --c1: #ff2e9a;  --c2: #7c4dff;  --c3: #18c7ff;  --c4: #ffd23f;
  --radius: 22px;
  --maxw: 1180px;
  --font-display: "Anton", "Archivo", sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  /* cursor position (updated by JS, viewport px) */
  --mx: 50%; --my: 40%;
}

/* ---- Light / day theme ---- */
[data-theme="light"] {
  --ink: #f4f1ea;        /* light base (used as background) */
  --paper: #18181d;      /* dark text                       */
  --paper-soft: rgba(24,24,29,0.82);
  --line: rgba(24,24,29,0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1; letter-spacing: 0.01em; }

/* ===== Intro loader ===== */
.loader {
  position: fixed; inset: 0; z-index: 10000; background: var(--ink);
  display: grid; place-items: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { text-align: center; }
.loader__name {
  display: block; font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 3rem); letter-spacing: 0.04em; text-transform: uppercase;
  background: linear-gradient(120deg, var(--c1), var(--c2), var(--c3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.loader__bar { display: block; width: 180px; height: 2px; margin: 18px auto 0; background: var(--line); border-radius: 2px; overflow: hidden; }
.loader__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c1), var(--c3)); animation: load 1s ease forwards; }
@keyframes load { to { width: 100%; } }

/* ===== Custom cursor (enabled by JS on fine-pointer devices) ===== */
.cursor-dot, .cursor-ring { display: none; }
.has-custom-cursor { cursor: none; }
.has-custom-cursor a, .has-custom-cursor button, .has-custom-cursor .portrait { cursor: none; }
.has-custom-cursor .cursor-dot, .has-custom-cursor .cursor-ring {
  display: block; position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  border-radius: 50%; transform: translate(-50%, -50%); will-change: transform;
}
.has-custom-cursor .cursor-dot { width: 6px; height: 6px; background: var(--paper); }
.has-custom-cursor .cursor-ring {
  width: 34px; height: 34px; border: 1.5px solid color-mix(in srgb, var(--paper) 50%, transparent);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.has-custom-cursor .cursor-ring.is-hover { width: 56px; height: 56px; border-color: transparent; background: rgba(124,77,255,0.2); }

/* full-page dot-grid canvas behind everything */
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
/* meteor cursor canvas — above all content */
.meteor-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 9990; pointer-events: none; }
/* keep all real content above the canvas */
.nav, main, .footer { position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--font-body); font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--paper-soft);
}

.bigtitle { font-size: clamp(1.9rem, 5vw, 3.6rem); text-transform: uppercase; margin-bottom: 8px; }
.section__head { margin-bottom: 44px; }
.section__head .eyebrow { display: block; margin-bottom: 14px; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.04em; cursor: pointer; border: 1.5px solid transparent;
  transition: transform 0.18s, box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  color: #0c0c0e;
  background: linear-gradient(120deg, var(--c1), var(--c2), var(--c3));
  background-size: 200% 200%; box-shadow: 0 10px 30px rgba(124,77,255,0.35);
  animation: shift 6s ease infinite;
}
@keyframes shift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn--ghost { border-color: var(--line); color: var(--paper); }
.btn--ghost:hover { border-color: var(--paper); }
.btn--sm { padding: 8px 16px; font-size: 0.78rem; border-color: var(--line); }
.btn--sm:hover { border-color: var(--paper); }
.btn--lg { padding: 16px 36px; font-size: 1rem; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__brand { display: inline-flex; align-items: center; }
.brandmark-img { display: block; width: 40px; height: 40px; transition: transform 0.2s ease; }
.nav__brand:hover .brandmark-img { transform: translateY(-1px) rotate(-3deg); }
/* day / night logo swap */
.brandmark-img.logo-light { display: none; }
[data-theme="light"] .brandmark-img.logo-dark { display: none; }
[data-theme="light"] .brandmark-img.logo-light { display: block; }
.nav__links { display: flex; gap: 26px; }
.nav__links a {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--paper-soft); position: relative; transition: color 0.2s;
}
.nav__links a:hover { color: var(--paper); }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: linear-gradient(90deg, var(--c1), var(--c3)); transition: width 0.25s; }
.nav__links a:hover::after { width: 100%; }
.nav__actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--paper); cursor: pointer; font-size: 0.95rem;
  line-height: 1; display: grid; place-items: center;
  transition: border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { border-color: var(--paper); transform: rotate(18deg); }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__burger span { width: 24px; height: 2px; background: var(--paper); border-radius: 2px; }

/* ===== Hero ===== */
.hero { position: relative; padding: 64px 0 84px; }
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 46px; align-items: center; }
.hero__eyebrow { color: var(--paper-soft); margin-bottom: 18px; }
.hero__eyebrow b { color: var(--paper); }
/* giant name filled with cursor-following iridescent colour (toned down in size) */
.hero__name {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700; font-optical-sizing: auto; font-style: normal;
  font-size: clamp(1.4rem, 5.4vw, 3.4rem); line-height: 1.2; letter-spacing: -0.015em;
  text-transform: none; white-space: nowrap; margin-bottom: 14px; padding-bottom: 0.1em;
  overflow: visible;
  background: radial-gradient(circle 340px at var(--mx) var(--my),
              var(--c1) 0%, var(--c2) 26%, var(--c3) 50%, var(--paper) 74%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero__alias { font-family: "Archivo", sans-serif; font-size: 0.85em; font-weight: 700; font-style: italic; }
.hero__role { font-size: 1.08rem; color: var(--paper-soft); font-weight: 500; max-width: 520px; margin-bottom: 16px; }
.hero__lede { font-size: 1rem; color: var(--paper-soft); max-width: 520px; 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.85rem; font-weight: 600; letter-spacing: 0.04em; color: var(--paper-soft); transition: color 0.2s; }
.hero__socials a:hover { color: var(--paper); }

/* portrait — full colour with a subtle iridescent frame */
.hero__media { display: grid; place-items: center; }
.portrait {
  width: 300px; height: 360px; border-radius: 24px; padding: 3px;
  background: linear-gradient(135deg, var(--c1), var(--c2), var(--c3));
  box-shadow: 0 30px 70px rgba(0,0,0,0.5); overflow: hidden;
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 18%;
  border-radius: 21px; display: block; transition: transform 0.5s ease;
}
.portrait:hover img { transform: scale(1.04); }

/* ===== Sections (all transparent so the dot grid shows through) ===== */
.section { padding: 84px 0; position: relative; }
.section + .section, .section--paper { border-top: 1px solid var(--line); }

/* ===== About / statement ===== */
.statement { font-size: clamp(1.5rem, 3.6vw, 2.7rem); line-height: 1.15; max-width: 920px; font-family: var(--font-display); text-transform: uppercase; }
.statement em { font-style: normal; background: linear-gradient(120deg, var(--c1), var(--c2), var(--c3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; margin-top: 44px; }
.about-grid p { color: var(--paper-soft); margin-bottom: 16px; }
.about-grid strong { color: var(--paper); }
.facts { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.facts li { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 0.95rem; }

/* timeline (education / experience) */
.tl-title { font-family: var(--font-display); font-size: 1.4rem; text-transform: uppercase; margin-bottom: 22px; }
.tl { list-style: none; position: relative; }
.tl::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--paper); opacity: 0.14; }
.tl__item { position: relative; padding-left: 30px; padding-bottom: 26px; }
.tl__item:last-child { padding-bottom: 0; }
.tl__dot { position: absolute; left: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(120deg, var(--c1), var(--c3)); }
.tl__date { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; color: var(--paper-soft); }
.tl__item h4 { font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; margin: 4px 0 2px; }
.tl__item p { font-size: 0.92rem; color: var(--paper-soft); }
.tl__points { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.tl__points li { position: relative; padding-left: 16px; font-size: 0.94rem; color: var(--paper-soft); }
.tl__points li::before { content: "▹"; position: absolute; left: 0; color: var(--c3); }

/* ===== Skills ===== */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.skill { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; background: rgba(255,255,255,0.02); transition: transform 0.25s, border-color 0.25s; }
.skill:hover { transform: translateY(-5px); border-color: rgba(244,241,234,0.3); }
.skill__icon { font-size: 1.8rem; margin-bottom: 12px; }
.skill h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.1rem; margin-bottom: 16px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 0.76rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--c2) 18%, transparent); color: #c7b8ff; }
[data-theme="light"] .tags li { background: rgba(124,77,255,0.14); color: #4a2fb8; }

/* ===== Publications — numbered editorial list ===== */
.pubs { list-style: none; counter-reset: pub; }
.pub { counter-increment: pub; display: grid; grid-template-columns: 64px 150px 1fr; gap: 20px; align-items: start; padding: 24px 0; border-top: 1px solid var(--line); transition: padding-left 0.3s; }
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub:hover { padding-left: 10px; }
.pub__no { font-family: var(--font-display); font-size: 1.6rem; opacity: 0.4; }
.pub__no::before { content: counter(pub, decimal-leading-zero); }
.pub__venue .badge { display: inline-block; font-family: var(--font-body); font-size: 0.72rem; font-weight: 700; padding: 6px 12px; border-radius: 8px; white-space: nowrap; }
.badge--hot { background: linear-gradient(120deg, var(--c1), var(--c2)); color: #fff; }
.badge--soft { border: 1px solid var(--line); color: var(--paper-soft); }
a.badge { text-decoration: none; transition: color 0.2s ease, border-color 0.2s ease; }
a.badge--soft:hover { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.pub__body h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.08rem; line-height: 1.35; margin-bottom: 6px; }
.pub__authors { font-size: 0.92rem; color: var(--paper-soft); }
.pub__authors strong { color: var(--paper); }
.pub__note { font-size: 0.84rem; font-style: italic; color: var(--paper-soft); margin-top: 4px; }

/* ===== News ===== */
.news { list-style: none; }
.news__item { display: grid; grid-template-columns: 130px 1fr; gap: 22px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); }
.news__item:last-child { border-bottom: 1px solid var(--line); }
.news__date { position: relative; padding-left: 18px; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; color: var(--paper); white-space: nowrap; }
.news__date::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(120deg, var(--c1), var(--c3)); }
.news__text { color: var(--paper-soft); font-size: 1rem; }
.news__text strong { color: var(--paper); font-weight: 700; }
.news__text em { font-style: normal; background: linear-gradient(120deg, var(--c1), var(--c2), var(--c3)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }

/* ===== Life portal (homepage entry to the life gallery) ===== */
.portal {
  display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: rgba(255,255,255,0.02); text-decoration: none; color: inherit;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.portal:hover { border-color: color-mix(in srgb, var(--paper) 30%, transparent); transform: translateY(-4px); box-shadow: 0 24px 60px rgba(0,0,0,0.28); }
.portal__media { overflow: hidden; }
.portal__media img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; display: block; transition: transform 0.6s ease; }
.portal:hover .portal__media img { transform: scale(1.05); }
.portal__body { padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; }
.portal__title { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1; text-transform: uppercase; margin-bottom: 16px; }
.portal__text { color: var(--paper-soft); margin-bottom: 24px; max-width: 360px; }
.portal__cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.04em; color: var(--paper); }
.portal__arrow { transition: transform 0.3s ease; }
.portal:hover .portal__arrow { transform: translate(4px, -4px); }
@media (max-width: 760px) { .portal { grid-template-columns: 1fr; } }

/* ===== Life gallery (life.html) ===== */
.life-gallery { columns: 3 260px; column-gap: 18px; }
.life-shot { position: relative; break-inside: avoid; margin: 0 0 18px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); animation: lifeIn 0.6s ease both; }
.life-shot:nth-child(2) { animation-delay: 0.07s; }
.life-shot:nth-child(3) { animation-delay: 0.14s; }
.life-shot:nth-child(4) { animation-delay: 0.21s; }
.life-shot:nth-child(5) { animation-delay: 0.28s; }
@keyframes lifeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.life-shot img { width: 100%; display: block; transition: transform 0.6s ease; }
.life-shot:hover img { transform: scale(1.05); }
.life-shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px;
  font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.65));
  opacity: 0; transform: translateY(8px); transition: opacity 0.3s ease, transform 0.3s ease;
}
.life-shot:hover figcaption { opacity: 1; transform: none; }

/* ===== Contact ===== */
.contact { text-align: center; }
.contact .bigtitle { font-size: clamp(2.4rem, 7vw, 5rem); background: radial-gradient(circle 380px at var(--mx) var(--my), var(--c1), var(--c2) 30%, var(--c3) 55%, var(--paper) 78%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact__lead { color: var(--paper-soft); font-size: 1.1rem; max-width: 540px; margin: 14px auto 30px; }
.contact__socials { display: flex; justify-content: center; gap: 24px; margin-top: 36px; flex-wrap: wrap; }
.contact__socials a { font-weight: 600; color: var(--paper-soft); transition: color 0.2s; }
.contact__socials a:hover { color: var(--paper); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer p { color: var(--paper-soft); font-size: 0.86rem; }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a { font-size: 0.82rem; color: var(--paper-soft); font-weight: 600; transition: color 0.2s; }
.footer__links a:hover { color: var(--paper); }

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

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__cta, .hero__socials { justify-content: center; }
  .hero__role, .hero__lede { margin-left: auto; margin-right: auto; }
  .hero__media { order: -1; margin-bottom: 18px; }
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .facts { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: 8px; }
  .pub__no { font-size: 1.2rem; }
  .pub__venue { grid-column: auto; }
  .news__item { grid-template-columns: 1fr; gap: 4px; }

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

@media (max-width: 480px) {
  /* let the long name wrap instead of overflowing on small phones */
  .hero__name { white-space: normal; }
  .container { padding: 0 18px; }
  .section { padding: 64px 0; }
  .hero { padding: 48px 0 60px; }
  .nav__inner { height: 60px; }
  .nav__actions { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .fx-canvas { display: none; }
  .meteor-canvas { display: none; }
  .loader { display: none; }
}
