/*
Theme Name: Monica Portfolio
Theme URI: http://ren.jinktech.com
Author: 任佳琦 Monica·cHa
Description: 任佳琦个人作品集主题 — 深邃黑 + 极光流光 / Bento Grid / 玻璃拟态
Version: 1.0.0
Text Domain: monica-portfolio
*/
/* ==========================================================
   任佳琦 · 作品集 — 深邃黑 + 极光流光 / Bento / 玻璃拟态
   ========================================================== */
:root {
  --bg: #05060b;
  --ink: #f2f4f9;
  --muted: #99a1b6;
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-hi: rgba(255, 255, 255, 0.09);
  --aur1: #4f8dff;   /* 电光蓝 */
  --aur2: #a86bff;   /* 星云紫 */
  --aur3: #2fd4c2;   /* 极光青 */
  --radius: 22px;
  --font-cn: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --font-en: -apple-system, "SF Pro Display", "Helvetica Neue", Arial, var(--font-cn);
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(79, 141, 255, 0.4); }

/* ---------- 极光背景 ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.aurora-blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5;
  will-change: transform;
}
.a1 { width: 55vw; height: 55vw; background: radial-gradient(circle, var(--aur1), transparent 65%);
      top: -20vw; left: -12vw; animation: drift1 26s ease-in-out infinite alternate; }
.a2 { width: 46vw; height: 46vw; background: radial-gradient(circle, var(--aur2), transparent 65%);
      top: 6vw; right: -16vw; animation: drift2 32s ease-in-out infinite alternate; }
.a3 { width: 42vw; height: 42vw; background: radial-gradient(circle, var(--aur3), transparent 65%);
      bottom: -18vw; left: 22vw; opacity: 0.34; animation: drift3 38s ease-in-out infinite alternate; }
.a4 { width: 30vw; height: 30vw; background: radial-gradient(circle, #ff6ba8, transparent 65%);
      bottom: 26vh; right: 4vw; opacity: 0.16; animation: drift1 44s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(9vw, 7vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-8vw, 10vh) scale(0.92) rotate(20deg); } }
@keyframes drift3 { to { transform: translate(6vw, -8vh) scale(1.2); } }
.noise {
  position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* ---------- 渐变文字 ---------- */
.grad-text {
  background: linear-gradient(115deg, var(--aur1), var(--aur2) 45%, var(--aur3) 90%);
  background-size: 220% 220%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: gradShift 7s ease-in-out infinite alternate;
}
@keyframes gradShift { to { background-position: 100% 60%; } }

/* ---------- 导航 ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 60; width: min(1160px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px; border-radius: 100px;
  background: rgba(10, 12, 20, 0.55);
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--line);
  transition: box-shadow 0.4s, background 0.4s;
}
.nav.scrolled { background: rgba(8, 10, 17, 0.78); box-shadow: 0 12px 40px rgba(0,0,0,0.45); }
.nav-logo { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.14em; font-size: 14px; }
.nav-logo .dot { color: var(--aur3); }
.nav-links { display: flex; gap: 26px; font-size: 14px; color: var(--muted); }
.nav-links a { transition: color 0.25s; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--ink); }
.nav-cta {
  font-size: 13px; padding: 7px 16px; border-radius: 100px;
  border: 1px solid rgba(79, 141, 255, 0.5);
  background: linear-gradient(120deg, rgba(79,141,255,0.18), rgba(168,107,255,0.18));
  transition: background 0.3s, transform 0.3s;
}
.nav-cta:hover { background: linear-gradient(120deg, rgba(79,141,255,0.34), rgba(168,107,255,0.34)); transform: translateY(-1px); }

/* ---------- HERO ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 20px 60px; position: relative;
}
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.42em;
  color: var(--muted); margin-bottom: 26px;
}
.hero-title { font-family: var(--font-en); line-height: 1.02; }
.hero-title .line { display: block; overflow: hidden; }
.hero-title .word { display: inline-block; transform: translateY(110%); }
.hero-title .line:first-child { font-size: clamp(56px, 11vw, 150px); font-weight: 800; letter-spacing: 0.06em; }
.hero-en .word {
  font-size: clamp(40px, 8.5vw, 118px); font-weight: 800; letter-spacing: 0.08em;
}
.hero-sub { margin-top: 30px; color: var(--muted); font-size: clamp(14px, 1.6vw, 17px); }
.hero-tags { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hero-tags span {
  font-size: 13px; color: var(--muted); padding: 7px 16px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 40px; border: 1.5px solid rgba(255,255,255,0.28); border-radius: 14px;
}
.scroll-hint span {
  position: absolute; top: 7px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 3px; background: var(--aur3);
  animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint { 50% { transform: translateY(14px); opacity: 0.2; } }

/* ---------- 区块 ---------- */
.section { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 110px 0 30px; }
.section-head { margin-bottom: 44px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.4em;
  color: var(--aur3); margin-bottom: 12px;
}
.section-head h2, .contact-title { font-size: clamp(32px, 5vw, 54px); font-weight: 700; letter-spacing: 0.04em; line-height: 1.2; }
.section-sub { color: var(--muted); margin-top: 12px; font-size: 15px; }

/* ---------- Bento ---------- */
.bento {
  display: grid; gap: 18px;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 96px;
  grid-auto-flow: dense;
}
.card {
  grid-column: span var(--cs, 4); grid-row: span var(--rs, 2);
  position: relative; border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  transform-style: preserve-3d; perspective: 900px;
  will-change: transform;
  transition: border-color 0.4s;
}
/* 呼吸光：流转描边 + 光晕 */
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--ga, 0deg),
    transparent 0 12%, rgba(79,141,255,0.75) 22%, rgba(168,107,255,0.75) 32%,
    rgba(47,212,194,0.65) 42%, transparent 52% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.5s;
  animation: ringSpin 5s linear infinite paused;
  pointer-events: none;
}
.card::after {
  content: ""; position: absolute; inset: -14%; border-radius: inherit; z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(96,130,255,0.22), transparent 70%);
  opacity: 0; animation: breath 4.2s ease-in-out infinite;
  transition: opacity 0.5s; pointer-events: none;
}
.card:hover::before, .card.expanded-src::before { opacity: 1; animation-play-state: running; }
.card:hover::after { opacity: 1; }
@property --ga { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes ringSpin { to { --ga: 360deg; } }
@keyframes breath { 50% { transform: scale(1.06); opacity: 0.85; } }

.card-inner {
  position: relative; height: 100%; border-radius: inherit; overflow: hidden;
  transform: translateZ(24px);
}
.card-inner.pad { padding: 26px; display: flex; flex-direction: column; justify-content: center; }
.card-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.34em;
  color: var(--muted); margin-bottom: 16px;
}
/* 高光层（tilt 跟随） */
.glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(255,255,255,0.14), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.card:hover .glare { opacity: 1; }

/* ---------- About 卡 ---------- */
.about-avatar .card-inner { padding: 0; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.avatar-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 16px;
  background: linear-gradient(transparent, rgba(4,5,10,0.88));
  display: flex; flex-direction: column;
}
.avatar-cap strong { font-size: 17px; }
.avatar-cap span { font-size: 13px; color: var(--muted); }
.about-intro h3 { font-size: clamp(20px, 2.6vw, 27px); margin-bottom: 14px; letter-spacing: 0.03em; }
.about-intro p { color: var(--muted); font-size: 15px; }
.exp-list { list-style: none; }
.exp-list li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: baseline;
  padding: 13px 0; border-bottom: 1px dashed rgba(255,255,255,0.1);
}
.exp-list li:last-child { border-bottom: none; }
.exp-time { font-family: var(--font-mono); font-size: 12px; color: var(--aur1); letter-spacing: 0.04em; }
.exp-list strong { font-size: 15px; }
.exp-list em { font-style: normal; font-size: 13px; color: var(--muted); }
.skill-list { list-style: none; }
.skill-list li { margin-bottom: 13px; }
.skill-list span { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; }
.bar { display: block; height: 5px; border-radius: 5px; background: rgba(255,255,255,0.09); overflow: hidden; }
.bar b {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--aur1), var(--aur2), var(--aur3));
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Works 卡 ---------- */
.work-card { cursor: pointer; }
.work-card .cover { position: absolute; inset: 0; }
.work-card .cover img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.001); transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.work-card:hover .cover img { transform: scale(1.06); }
.work-card .work-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 56px 20px 16px;
  background: linear-gradient(transparent, rgba(3,4,9,0.9));
  transform: translateY(8px); opacity: 0.92;
  transition: transform 0.5s, opacity 0.5s;
}
.work-card:hover .work-meta { transform: translateY(0); opacity: 1; }
.work-meta h3 { font-size: 18px; letter-spacing: 0.03em; }
.work-meta p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.work-cat {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.14em;
  padding: 5px 12px; border-radius: 100px; color: #dfe6ff;
  background: rgba(8, 10, 18, 0.55); border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

/* ---------- 数据卡 ---------- */
.num { font-family: var(--font-en); font-size: clamp(38px, 4.6vw, 58px); font-weight: 800; line-height: 1; display: flex; align-items: baseline; gap: 4px; }
.num .counter {
  background: linear-gradient(115deg, var(--aur1), var(--aur2) 55%, var(--aur3));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.num i { font-style: normal; font-size: 18px; color: var(--muted); }
.num-label { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { text-align: center; padding-bottom: 0; }
.contact-title { font-family: var(--font-en); font-size: clamp(52px, 10vw, 130px); font-weight: 800; letter-spacing: 0.02em; }
.contact-sub { color: var(--muted); margin-top: 14px; }
.contact-grid {
  margin: 46px auto 0; display: grid; gap: 16px;
  grid-template-columns: repeat(4, 1fr); max-width: 1000px;
}
.contact-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 22px 24px; border-radius: 18px; cursor: pointer; text-align: left;
  transition: transform 0.35s, background 0.35s;
}
.contact-card:hover { transform: translateY(-4px); background: var(--glass-hi); }
.c-label { font-size: 12px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.12em; }
.contact-card strong { font-size: 16px; letter-spacing: 0.02em; }
.contact-card.copied strong { color: var(--aur3); }
.footer { padding: 70px 0 36px; color: rgba(255,255,255,0.3); font-size: 13px; }

/* ---------- 详情层 ---------- */
.viewer { position: fixed; inset: 0; z-index: 100; visibility: hidden; }
.viewer.open { visibility: visible; }
.viewer-backdrop {
  position: absolute; inset: 0; background: rgba(3, 4, 9, 0.62);
  backdrop-filter: blur(26px) saturate(1.3); -webkit-backdrop-filter: blur(26px) saturate(1.3);
  opacity: 0; transition: opacity 0.45s;
}
.viewer.open .viewer-backdrop { opacity: 1; }
.viewer-panel {
  position: absolute; inset: 0; margin: auto;
  width: min(1060px, 100%); height: 100%;
  display: flex; justify-content: center;
}
.viewer-scroll {
  width: 100%; height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(70px, 9vh, 110px) clamp(18px, 4vw, 56px) 80px;
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.5s 0.1s, transform 0.6s 0.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.viewer.open .viewer-scroll { opacity: 1; transform: none; }
.viewer-head { max-width: 720px; margin-bottom: 36px; }
.viewer-head h2 { font-size: clamp(30px, 4.6vw, 46px); letter-spacing: 0.03em; line-height: 1.25; }
.viewer-en { font-family: var(--font-mono); color: var(--aur1); font-size: 13px; letter-spacing: 0.2em; margin-top: 8px; text-transform: uppercase; }
.viewer-desc { color: var(--muted); margin-top: 18px; font-size: 15.5px; }
.viewer-gallery { display: flex; flex-direction: column; gap: 22px; }
.viewer-gallery img {
  width: 100%; border-radius: 16px; border: 1px solid var(--line);
  opacity: 0; transform: translateY(34px);
  transition: opacity 0.7s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.viewer-gallery img.vin { opacity: 1; transform: none; }
.viewer-close {
  position: absolute; top: 20px; right: 22px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(15, 17, 26, 0.6); color: var(--ink); font-size: 16px; cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform 0.3s, background 0.3s;
}
.viewer-close:hover { transform: rotate(90deg); background: rgba(255,255,255,0.14); }
/* FLIP 飞行图 */
.flip-ghost {
  position: fixed; z-index: 120; object-fit: cover; border-radius: var(--radius);
  pointer-events: none; will-change: transform, width, height;
}
body.viewer-lock { overflow: hidden; }

/* ---------- 入场 reveal ---------- */
.reveal, .card { opacity: 0; transform: translateY(34px); }
.in .reveal, .reveal.in, .card.in { opacity: 1; transform: none; }
.reveal, .card { transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.4s; }
.hero .reveal { transition-delay: var(--d, 0s); }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 88px; }
  .card { grid-column: span min(var(--cs-t, var(--cs, 6)), 6); }
  .about-avatar { --cs-t: 3; grid-row: span 4; }
  .about-intro { --cs-t: 3; grid-row: span 4; }
  .about-exp { --cs-t: 6; }
  .about-skill { --cs-t: 6; grid-row: span 3; }
  .num-card { --cs-t: 3; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  .nav { padding: 8px 10px 8px 18px; }
  .nav-logo { font-size: 12.5px; letter-spacing: 0.1em; }
  .nav-cta { font-size: 12px; padding: 6px 12px; white-space: nowrap; }
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .card { grid-column: 1 / -1 !important; grid-row: auto !important; min-height: 120px; }
  .work-card, .about-avatar { min-height: 240px; aspect-ratio: 16 / 10; }
  .about-avatar { aspect-ratio: 4 / 5; }
  .num-card, .about-exp, .about-skill, .about-intro { min-height: 0; }
  .card-inner.pad { padding: 22px; }
  .contact-grid { grid-template-columns: 1fr; }
  .section { padding-top: 80px; }
}

/* ---------- 无动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal, .card { opacity: 1; transform: none; }
}
