/* me.yayafan.cn — black + amber
   ----------------------------------------------------------
   Palette is amber-on-ink, with dim text for less weight.
   The WebGL canvas sits fixed under everything (z-index 0).
*/

:root {
  --bg: #0b0b0b;
  --bg-2: #131313;
  --ink: #ededed;
  --ink-dim: #9a9a9a;
  --ink-mute: #5e5e5e;
  --amber: #f5a524;
  --amber-soft: rgba(245, 165, 36, 0.65);
  --amber-glow: rgba(245, 165, 36, 0.18);
  --line: rgba(245, 165, 36, 0.22);
  --max: 1100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; overflow-x: hidden; }

#glbg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

/* Subtle vignette to focus content. Sits above canvas, below content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%,
      transparent 0%, transparent 40%,
      rgba(11,11,11,0.45) 80%, rgba(11,11,11,0.85) 100%);
}

/* ------ top bar ------ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(11,11,11,0.72), rgba(11,11,11,0.0));
}
.brand {
  color: var(--amber);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  font-size: 15px;
}
.nav {
  display: flex;
  gap: 22px;
}
.nav a {
  color: var(--ink-dim);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}
.nav a:hover { color: var(--amber); }

/* ------ layout ------ */
main {
  position: relative;
  z-index: 5;
}

.panel {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 28px 48px;
}

.section-title {
  font-size: 14px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 500;
  margin: 0 0 22px;
  position: relative;
  padding-left: 18px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber-glow);
}

/* ------ hero ------ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}
.hero-inner { max-width: 880px; }
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  margin-bottom: 28px;
}
.dot {
  width: 6px; height: 6px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--amber);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.name {
  font-size: clamp(48px, 8vw, 96px);
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.05;
}
.tagline {
  margin: 18px 0 8px;
  font-size: clamp(18px, 2.4vw, 24px);
  color: var(--amber);
  letter-spacing: 0.18em;
}
.subtitle {
  margin: 0 0 36px;
  color: var(--ink-dim);
  font-size: 15px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.btn.primary {
  background: var(--amber);
  color: #0b0b0b;
  font-weight: 600;
}
.btn.primary:hover {
  box-shadow: 0 0 24px var(--amber-glow);
  transform: translateY(-1px);
}
.btn.ghost {
  border-color: var(--line);
  color: var(--ink-dim);
}
.btn.ghost:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1px solid var(--ink-mute);
  border-radius: 12px;
}
.scroll-hint span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 6px;
  background: var(--amber);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDown 1.6s infinite;
}
@keyframes scrollDown {
  0% { opacity: 0; transform: translate(-50%, 0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* ------ skills ------ */
.skills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skills li {
  display: grid;
  grid-template-columns: 130px 1fr 1.4fr;
  align-items: center;
  gap: 24px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.skills li:last-child { border-bottom: 1px solid var(--line); }
.skill-name {
  color: var(--amber);
  font-size: 14px;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.skill-note {
  color: var(--ink-dim);
  font-size: 13px;
}
.bar {
  height: 4px;
  background: rgba(245, 165, 36, 0.1);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), #ffd58a);
  border-radius: 2px;
  position: relative;
}
.bar span::after {
  content: "";
  position: absolute;
  right: 0; top: -2px;
  width: 8px; height: 8px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--amber);
}

/* ------ timeline ------ */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 110px;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
}
.job {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  padding: 20px 0;
  position: relative;
}
.job::before {
  content: "";
  position: absolute;
  left: 106px;
  top: 36px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}
.when {
  color: var(--amber);
  font-size: 13px;
  letter-spacing: 0.06em;
  padding-top: 6px;
}
.where {
  color: var(--ink);
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 8px;
}
.what {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-dim);
}
.what li {
  margin: 3px 0;
  font-size: 14px;
}

/* ------ projects ------ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: linear-gradient(180deg, rgba(245,165,36,0.04), rgba(245,165,36,0.0));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
}
.card-when {
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.card-title {
  margin: 0 0 14px;
  font-size: 19px;
  color: var(--ink);
  font-weight: 600;
}
.card p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.55;
}
.card-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.card-tags span {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--amber);
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 100px;
}

/* ------ contact ------ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
}
.sub {
  color: var(--ink);
  font-size: 16px;
  margin: 0 0 12px;
  font-weight: 500;
}
.muted { color: var(--ink-mute); font-size: 13px; }
.contacts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.contacts li {
  display: grid;
  grid-template-columns: 90px 1fr;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.contacts li:last-child { border-bottom: 1px solid var(--line); }
.contacts .k {
  color: var(--ink-mute);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.contacts a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed var(--ink-mute);
}
.contacts a:hover { color: var(--amber); border-color: var(--amber); }

/* ------ footer ------ */
.footer {
  text-align: center;
  padding: 36px 24px 28px;
  color: var(--ink-mute);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* ------ scroll reveal ------ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------ responsive ------ */
@media (max-width: 720px) {
  .topbar { padding: 14px 18px; }
  .nav { gap: 14px; }
  .nav a { font-size: 13px; }
  .panel { padding: 48px 20px 40px; }
  .skills li {
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto auto;
    row-gap: 8px;
  }
  .skill-note {
    grid-column: 1 / -1;
    font-size: 12px;
  }
  .timeline::before { left: 18px; }
  .job {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-left: 36px;
  }
  .job::before { left: 14px; top: 32px; }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .scroll-hint { display: none; }
  #glbg { opacity: 0.4; }
}