/* ============================================================
   Immersive dark layer inspired by 01 / aboutluca
   深色极简 / 粒子 / 章节滚动 / 伪 3D 景深
   Loaded after style-in-development.css.
   ============================================================ */

:root {
  --im-bg: #070707;
  --im-bg-soft: #0b0b0b;
  --im-panel: rgba(255, 255, 255, 0.035);
  --im-line: rgba(255, 255, 255, 0.14);
  --im-text: #ededed;
  --im-muted: #888888;
  --im-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --bg: var(--im-bg);
  --surface: #0d0d0d;
  --surface-alt: #0a0a0a;
  --text: var(--im-text);
  --muted: var(--im-muted);
  --line: var(--im-line);
  --primary: #ffffff;
  --primary-dark: #d9d9d9;
  --primary-soft: rgba(255, 255, 255, 0.08);
  --accent: #d7e3ff;
  --dark: #050505;
}

html {
  overflow-x: clip;
  background: var(--im-bg);
}

body {
  position: relative;
  overflow-x: clip;
  color: var(--im-text);
  background: var(--im-bg);
}

/* ===================== 环境层 ===================== */
.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, transparent 0%, rgba(0, 0, 0, 0.28) 48%, rgba(0, 0, 0, 0.82) 100%);
}

main,
.site-footer {
  position: relative;
  z-index: 2;
}

main {
  perspective: 1400px;
}

/* ===================== 章节导航 ===================== */
.chapter-rail {
  position: fixed;
  left: 28px;
  top: 50%;
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transform: translateY(-50%);
}

.chapter-rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.32);
  font-family: var(--im-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.35s ease;
}

.chapter-rail a::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: width 0.35s ease;
}

.chapter-rail a span {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.chapter-rail a:hover,
.chapter-rail a.is-active {
  color: #ffffff;
}

.chapter-rail a:hover span,
.chapter-rail a.is-active span {
  opacity: 1;
  transform: translateX(0);
}

.chapter-rail a.is-active::before {
  width: 40px;
}

.chapter-readout {
  position: fixed;
  left: 28px;
  bottom: 24px;
  z-index: 130;
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--im-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chapter-readout-number {
  color: #ffffff;
  font-size: 13px;
}

/* ===================== 顶部导航 ===================== */
.site-header {
  background: rgba(7, 7, 7, 0.74);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.site-header.is-scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.brand {
  color: #ffffff;
}

.brand span {
  color: rgba(255, 255, 255, 0.46);
  font-family: var(--im-mono);
}

.nav-link {
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--im-mono);
}

.nav-link::after {
  background: #ffffff;
}

.nav-link:hover,
.nav-link.is-active {
  color: #ffffff;
}

.nav-toggle {
  border-color: rgba(255, 255, 255, 0.5);
}

.nav-toggle span {
  background: #ffffff;
}

.site-nav {
  background: rgba(7, 7, 7, 0.96);
}

.nav-link {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ===================== 通用章节 ===================== */
.section {
  color: var(--im-text);
  background: rgba(7, 7, 7, 0.76);
  border-top-color: rgba(255, 255, 255, 0.1);
  transform-style: preserve-3d;
}

.section-alt,
#experience,
#personality {
  background: rgba(10, 10, 10, 0.8);
}

#portfolio,
#contact {
  background: rgba(3, 3, 3, 0.88);
}

.section > .container {
  position: relative;
  z-index: 2;
}

.section[data-chapter]::before {
  content: attr(data-chapter);
  position: absolute;
  top: clamp(30px, 6vw, 80px);
  right: 3vw;
  z-index: 0;
  color: rgba(255, 255, 255, 0.035);
  font-family: var(--display);
  font-size: clamp(120px, 22vw, 300px);
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.section-kicker,
.time,
.company,
.project-tag,
.portfolio-info .portfolio-meta,
.contact-item small,
.tag-group-title,
.education-body h3 span {
  color: var(--im-muted);
  font-family: var(--im-mono);
}

.section-head h2,
.subsection-head h3,
.about-card h3,
.timeline-body h3,
.skill-card h3,
.project-content h3,
.portfolio-category-title,
.personality-title,
.education-body h3,
.video-modal-info h3 {
  color: #ffffff;
}

.section-lead,
.about-card p,
.timeline-body li,
.project-content > p,
.education-body p,
.contact-item strong,
.personality-meta,
.portfolio-category-meta {
  color: #b4b4b4;
}

.subsection-head {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* ===================== 首屏 ===================== */
.hero {
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 38%, rgba(125, 155, 255, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(7, 7, 7, 0.72) 0%, rgba(11, 11, 11, 0.8) 100%);
}

.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 40%;
  z-index: 0;
  width: min(760px, 82vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 155, 255, 0.16) 0%, rgba(125, 155, 255, 0) 64%);
  filter: blur(10px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -16%;
  height: 48%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 80px 80px;
  transform: perspective(620px) rotateX(66deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  z-index: 1;
}

.hero-art {
  z-index: 1;
}

.hero-copy,
.hero-stats,
.hero-scroll {
  z-index: 3;
}

.hero h1 {
  color: var(--im-muted);
  font-family: var(--im-mono);
  letter-spacing: 0.18em;
}

.hero h1 span {
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 0%, #8c95a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 70px rgba(150, 180, 255, 0.18);
  transform: perspective(900px)
    rotateY(calc(var(--pointer-x, 0) * 2.8deg))
    rotateX(calc(var(--pointer-y, 0) * -2.2deg));
  transition: transform 0.35s ease;
}

.hero-subtitle {
  color: #b7bec9;
}

.btn-primary {
  color: #050505;
  background: #ffffff;
}

.btn-primary:hover {
  color: #050505;
  background: #d7e3ff;
}

.btn-ghost {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-ghost:hover {
  color: #050505;
  border-color: #ffffff;
  background: #ffffff;
}

.hero-stats {
  border-top-color: rgba(255, 255, 255, 0.55);
}

.hero-stats .stat {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.hero-stats .stat:nth-child(odd) {
  border-right-color: rgba(255, 255, 255, 0.14);
}

.hero-stats strong {
  color: #ffffff;
}

.hero-stats span {
  color: var(--im-muted);
  font-family: var(--im-mono);
}

.hero-orbit {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 1;
  width: min(680px, 74vw);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateX(68deg);
  animation: orbit-turn 28s linear infinite;
  pointer-events: none;
}

.hero-orbit::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px dashed rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}

@keyframes orbit-turn {
  from { transform: translate(-50%, -50%) rotateX(68deg) rotateZ(0deg); }
  to { transform: translate(-50%, -50%) rotateX(68deg) rotateZ(360deg); }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 64px;
  min-height: calc(100vh - 180px);
  z-index: 2;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  text-align: center;
}

.hero .eyebrow {
  margin-bottom: 30px;
}

.hero h1 {
  margin: 0;
  color: #ffffff;
  font-family: var(--display);
  font-size: clamp(96px, 18vw, 260px);
  font-weight: 600;
  line-height: 0.82;
  letter-spacing: -0.08em;
  text-transform: none;
}

.hero h1 span {
  display: block;
  color: #ffffff;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  background: linear-gradient(180deg, #ffffff 0%, #7f8b9e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 90px rgba(150, 180, 255, 0.22);
  transform: perspective(900px)
    rotateY(calc(var(--pointer-x, 0) * 2.5deg))
    rotateX(calc(var(--pointer-y, 0) * -2deg));
  transition: transform 0.35s ease;
}

.hero-role {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  color: #ffffff;
  font-family: var(--im-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-role span + span::before {
  content: "/";
  margin-right: 14px;
  color: rgba(255, 255, 255, 0.35);
}

.hero-subtitle {
  max-width: 680px;
  margin-top: 24px;
  text-align: center;
}

.hero-actions {
  justify-content: center;
  margin-top: 32px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: 1100px;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
}

.hero-stats .stat,
.hero-stats .stat:nth-child(odd),
.hero-stats .stat:nth-child(even) {
  padding: 22px 24px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 0;
  text-align: center;
}

.hero-stats .stat:last-child {
  border-right: 0;
}

.hero-stats strong {
  font-size: clamp(24px, 2.6vw, 38px);
}

.hero-stats span {
  display: block;
  margin-top: 8px;
}

.hero-scroll {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.hero-art::before,
.hero-art::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  transform: rotateX(70deg);
  animation: ring-spin 18s linear infinite;
}

.hero-art::after {
  inset: 24%;
  border-color: rgba(150, 180, 255, 0.28);
  animation-direction: reverse;
  animation-duration: 12s;
}

.cube-face {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 34px rgba(140, 170, 255, 0.12);
}

@keyframes ring-spin {
  from { transform: rotateX(70deg) rotateZ(0deg); }
  to { transform: rotateX(70deg) rotateZ(360deg); }
}

.hero-scroll {
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--im-mono);
}

.marquee {
  width: 100%;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.72);
  background: #050505;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.marquee-track span {
  font-family: var(--im-mono);
}

/* ===================== 关于我 ===================== */
.priority-card {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 0 60px rgba(120, 150, 255, 0.06);
}

.priority-label {
  border-color: rgba(255, 255, 255, 0.42);
  color: #ffffff;
}

.priority-value {
  color: #ffffff;
}

.about-grid,
.skill-grid,
.portfolio-accordion,
.personality-accordion {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.about-card {
  border-right-color: rgba(255, 255, 255, 0.12);
}

.education-block {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.card-icon::before,
.about-card .card-icon::before,
.personality-card .card-icon::before {
  color: #ffffff;
}

.project-visual {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.project-content > p,
.project-metrics span {
  color: #9b9b9b;
}

.project-metrics strong {
  color: #ffffff;
}

.project-metrics {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* ===================== 工作经历 ===================== */
.timeline-item {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.timeline-body li {
  color: #adadad;
}

.timeline-body li::before {
  background: #ffffff;
}

/* ===================== 专业能力 ===================== */
.skill-card {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.skill-card:nth-child(odd) {
  border-right-color: rgba(255, 255, 255, 0.12);
}

.tag-list li {
  border-color: rgba(255, 255, 255, 0.18);
  color: #c9c9c9;
}

/* ===================== 作品集 ===================== */
.portfolio-category {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.portfolio-category:hover,
.portfolio-category:focus-within,
.portfolio-category.is-open {
  background: rgba(255, 255, 255, 0.045);
}

.portfolio-category-toggle {
  color: #ffffff;
}

.portfolio-category-index,
.portfolio-category-meta,
.portfolio-category-hint {
  color: rgba(255, 255, 255, 0.44);
  font-family: var(--im-mono);
}

.portfolio-category-icon::before,
.portfolio-category-icon::after {
  background: #ffffff;
}

.portfolio-card {
  color: #ffffff;
}

.portfolio-info strong {
  color: #ffffff;
}

.portfolio-info .portfolio-meta {
  color: rgba(255, 255, 255, 0.45);
}

.portfolio-info .portfolio-description {
  color: rgba(255, 255, 255, 0.7);
}

.portfolio-thumb {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* ===================== 个人标签 ===================== */
#personality {
  background: rgba(10, 10, 10, 0.82);
}

.personality-item {
  border-bottom-color: rgba(255, 255, 255, 0.12);
  background: transparent;
}

.personality-item:hover,
.personality-item:focus-within,
.personality-item.is-open {
  background: rgba(255, 255, 255, 0.04);
}

.personality-toggle {
  color: #ffffff;
}

.personality-index,
.personality-meta,
.personality-hint {
  color: rgba(255, 255, 255, 0.44);
  font-family: var(--im-mono);
}

.personality-icon::before,
.personality-icon::after {
  background: #ffffff;
}

.tag-group + .tag-group {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.media-item {
  background: #111111;
}

.media-item span {
  color: #b7b7b7;
}

/* ===================== 联系方式 ===================== */
#contact {
  background: rgba(3, 3, 3, 0.9);
}

.contact-info {
  border-top-color: rgba(255, 255, 255, 0.18);
}

.contact-item {
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

.contact-item strong {
  color: #ffffff;
}

.contact-icon {
  border-color: rgba(255, 255, 255, 0.3);
}

.contact-icon::before {
  color: #ffffff;
}

.contact-form input,
.contact-form textarea {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.25);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.contact-form label span {
  color: #ffffff;
}

.contact-form .btn-primary {
  color: #050505;
  background: #ffffff;
}

/* ===================== 页脚与工具 ===================== */
.site-footer {
  color: rgba(255, 255, 255, 0.42);
  background: #050505;
  border-top-color: rgba(255, 255, 255, 0.1);
}

.back-to-top {
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  background: rgba(7, 7, 7, 0.82);
  backdrop-filter: blur(12px);
}

.back-to-top:hover {
  color: #050505;
  background: #ffffff;
}

.toast {
  color: #050505;
  background: #ffffff;
}

.video-modal-panel {
  border-color: rgba(255, 255, 255, 0.2);
  background: #050505;
}

/* ===================== 伪 3D 动效 ===================== */
.reveal {
  opacity: 0;
  transform: translate3d(0, 42px, -90px) rotateX(4deg);
  transform-origin: center bottom;
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotateX(0deg);
}

@media (hover: hover) {
  .project-card.reveal.is-visible:hover,
  .portfolio-card.reveal.is-visible:hover,
  .about-card.reveal.is-visible:hover {
    transform: perspective(900px) rotateX(1.3deg) rotateY(-1.3deg) translateY(-5px);
  }
}

/* ===================== 响应式 ===================== */
@media (max-width: 1024px) {
  .chapter-rail,
  .chapter-readout {
    display: none;
  }

  .hero-inner {
    gap: 48px;
    min-height: 0;
  }

  .hero-orbit {
    top: 38%;
    width: 82vw;
  }

  .section[data-chapter]::before {
    font-size: clamp(90px, 20vw, 180px);
  }
}

@media (max-width: 640px) {
  .ambient-vignette {
    background:
      radial-gradient(circle at 50% 40%, transparent 0%, rgba(0, 0, 0, 0.35) 52%, rgba(0, 0, 0, 0.9) 100%);
  }

  .hero::after {
    background-size: 52px 52px;
  }

  .hero h1 {
    font-size: clamp(72px, 24vw, 110px);
  }

  .hero-role {
    flex-direction: column;
    gap: 8px;
  }

  .hero-role span + span::before {
    content: none;
  }

  .hero-orbit {
    top: 36%;
    width: 88vw;
    opacity: 0.7;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats .stat {
    padding: 16px 12px;
  }

  .hero-stats .stat:nth-child(2) {
    border-right: 0;
  }

  .hero-stats .stat:nth-child(1),
  .hero-stats .stat:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .section[data-chapter]::before {
    top: 24px;
    right: 12px;
    font-size: 88px;
  }

  .project-visual,
  .portfolio-thumb {
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art::before,
  .hero-art::after {
    animation: none;
  }

  .hero h1 span {
    transform: none;
    transition: none;
  }
}
