/* ==================================================
   Fonts — 像素签名（自托管） + 中文系统字体栈
================================================== */

@font-face {
  font-family: "Press Start 2P";
  src: url("assets/fonts/press-start-2p.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


:root {
  --bg: #0a1628;
  --panel: #1c3a5e;
  --panel-hover: #274870;
  --text: #f5f1e8;
  --text-soft: #d8cdb8;
  --muted: #a89c86;
  --accent: #dcb86e;
  --line: rgba(216, 205, 184, 0.45);
  --line-soft: rgba(216, 205, 184, 0.14);

  --serif:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    "STSong",
    "SimSun",
    serif;

  --sans:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans SC",
    Arial,
    sans-serif;

  --pixel:
    "Press Start 2P",
    "Courier New",
    monospace;

  --detail-media-max-height: 420px;
}


* {
  box-sizing: border-box;
}


html {
  scroll-behavior: smooth;
}


body {
  margin: 0;
  overflow-x: hidden;

  background:
    radial-gradient(
      circle at 78% 8%,
      rgba(39, 72, 112, 0.4),
      transparent 42%
    ),
    linear-gradient(
      150deg,
      #0a1628 0%,
      #0c1c30 52%,
      #10253d 100%
    );
  background-color: var(--bg);

  color: var(--text);
  font-family: var(--serif);

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


h1, h2, h3, h4 {
  margin: 0;
}


a {
  color: inherit;
  text-decoration: none;
}


::selection {
  background: rgba(220, 184, 110, 0.32);
}


/* ==================================================
   Main
================================================== */

.site-shell {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
  padding: 30px 0 80px;
}


/* ==================================================
   Site Nav — 顶部锚点导航（克制、编辑感）
================================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;

  background: rgba(10, 22, 40, 0.94);

  border-bottom: 1px solid var(--line-soft);
}


.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: min(1120px, calc(100% - 64px));
  height: 52px;
  margin: 0 auto;
}


.nav-brand {
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--accent);
  opacity: 0.85;
  text-decoration: none;
}


.nav-links {
  display: flex;
  gap: 28px;

  margin: 0;
  padding: 0;
  list-style: none;
}


.nav-links a {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  text-decoration: none;

  transition: color 0.2s ease;
}


.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent);
}


/* 锚点目标留出导航高度，避免被 sticky 遮挡 */
#profile,
#featured,
#projects,
#contact {
  scroll-margin-top: 64px;
}


/* ==================================================
   Profile
================================================== */

.profile {
  display: flex;
  align-items: flex-start;
  gap: 40px;

  padding-bottom: 27px;
  border-bottom: 1px solid var(--line);
}


.avatar {
  width: 154px;
  aspect-ratio: 1;
  flex-shrink: 0;

  overflow: hidden;

  background: #e8e2d9;

  border: 1px solid rgba(216, 205, 184, 0.28);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}


.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.profile-copy {
  flex: 1;
  min-width: 0;
}


.profile h1 {
  font-size: 44px;
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: 0.04em;
}


.positioning {
  margin: 10px 0 0;
  font-size: 21px;
  line-height: 1.5;
  color: var(--text);
}


.experience {
  margin: 14px 0 0;

  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}


.bio {
  max-width: 680px;
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-soft);
}


/* 设计哲学 — 引述式金句 */

.philosophy {
  max-width: 680px;
  margin: 20px 0 0;
  padding: 2px 0 2px 16px;

  border-left: 2px solid var(--accent);

  font-size: 17px;
  line-height: 1.75;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--text);
}


/* 技能栈 — 克制的编辑感小标签 */

.skill-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  max-width: 680px;
  margin: 18px 0 0;
  padding: 0;

  list-style: none;
}


.skill-stack li {
  padding: 4px 12px;

  border: 1px solid var(--line-soft);

  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}


.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;

  margin-top: 22px;
}


.btn {
  display: inline-block;

  padding: 10px 22px;

  border: 1px solid transparent;
  border-radius: 0;

  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}


.btn-primary {
  background: var(--accent);
  color: #0a1628;
  font-weight: 600;
}


.btn-primary:hover {
  background: #e8c98a;
  transform: translateY(-1px);
}


.btn-ghost {
  border-color: rgba(216, 205, 184, 0.35);
  color: var(--text);
}


.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}


.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}


/* ==================================================
   Cosmic Earth — 像素签名
================================================== */

.cosmic-earth {
  position: relative;

  width: 280px;
  height: 220px;

  flex-shrink: 0;
}


.earth {
  position: absolute;

  width: 160px;
  height: 160px;

  right: 35px;
  top: 30px;

  border-radius: 50%;
  overflow: hidden;
  z-index: 1;

  background:
    radial-gradient(
      circle at 35% 30%,
      #55c8ff,
      #087bb8 72%
    );
  box-shadow:
    inset -10px -8px 0 rgba(0, 40, 90, 0.22),
    0 0 42px rgba(85, 200, 255, 0.22);

  animation: earthFloat 8s ease-in-out infinite;
}


.earth-map {
  width: 100%;
  height: 100%;

  background-image: url("assets/earth.png");
  background-repeat: repeat-x;
  background-size: auto 100%;

  image-rendering: pixelated;

  animation: earthRotate 20s linear infinite;
}


.orbit {
  position: absolute;

  width: 240px;
  height: 120px;

  right: 0;
  top: 50px;
  z-index: 2;

  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;

  transform: rotate(-35deg);

  animation: moonOrbit 10s ease-in-out infinite alternate;
}


.moon {
  position: absolute;

  width: 34px;
  height: 34px;

  right: -17px;
  top: 50%;

  transform: translateY(-50%);

  border-radius: 50%;

  background:
    radial-gradient(
      circle at 34% 30%,
      #f5e6c8 0%,
      #e8c98a 62%,
      #d4a85a 100%
    );
  box-shadow:
    inset -4px -3px 0 rgba(120, 90, 40, 0.22),
    0 0 16px rgba(220, 184, 110, 0.4);
}


.moon::before,
.moon::after {
  content: "";
  position: absolute;

  background: rgba(150, 120, 70, 0.38);
}


.moon::before {
  width: 7px;
  height: 7px;
  left: 7px;
  top: 8px;

  box-shadow: 10px 8px 0 -1px rgba(150, 120, 70, 0.28);
}


.moon::after {
  width: 5px;
  height: 5px;
  right: 7px;
  bottom: 8px;
}


@keyframes earthFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}


@keyframes earthRotate {
  from { background-position-x: 0; }
  to   { background-position-x: -480px; }
}


@keyframes moonOrbit {
  from { transform: rotate(-35deg) rotate(-20deg); }
  to   { transform: rotate(-35deg) rotate(40deg); }
}


/* ==================================================
   Section Heading
================================================== */

.section-heading {
  padding: 20px 0 14px;

  text-align: center;

  border-bottom: 1px solid var(--line);
}


.section-kicker {
  display: block;

  margin-bottom: 6px;

  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.32em;

  color: var(--accent);
  opacity: 0.85;
}


.section-heading h2 {
  font-size: 24px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
}


/* ==================================================
   Featured Projects
================================================== */

.featured-grid {
  display: flex;
  flex-direction: column;
  gap: 48px;

  margin-top: 28px;
}


.featured-project {
  position: relative;
  min-width: 0;
}


/* 代表作卡片：通栏横排，封面与信息左右展开 */

.featured-project .project-card {
  display: grid;
  grid-template-columns: 1.18fr 1fr;

  width: 100%;
  max-width: none;
  margin: 0;

  min-height: 300px;
}


.featured-project .project-cover {
  aspect-ratio: auto;
  height: 100%;
}


.featured-project .project-info {
  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 32px 40px;
}


.featured-project .project-title {
  font-size: 26px;
}


.featured-project .project-role {
  margin-top: 6px;
  font-size: 13px;
}


.featured-project .project-period {
  font-size: 13px;
}


.featured-project .platform {
  font-size: 12px;
}


.featured-project .project-expand-hint {
  font-size: 11px;
}


/* 偶数行镜像：信息在左、封面在右，形成 Z 形节奏 */

.featured-project:nth-child(even) .project-card {
  grid-template-columns: 1fr 1.18fr;
}


.featured-project:nth-child(even) .project-info {
  order: -1;
}


/* ==================================================
   Project Card
================================================== */

.project-card {
  display: block;

  width: calc(100% - 72px);
  max-width: 440px;

  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 0;

  background: var(--panel);
  color: inherit;

  font: inherit;
  text-align: left;

  cursor: pointer;

  overflow: hidden;

  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}


.project-card:hover {
  transform: translateY(-3px);
  background: var(--panel-hover);
}


.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}


/* ==================================================
   Cover
================================================== */

.project-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;

  background: rgba(216, 205, 184, 0.04);
}


.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;

  transition: transform 0.35s ease;
}


.project-card:hover .project-cover img {
  transform: scale(1.02);
}


/* ==================================================
   Project Info
================================================== */

.project-info {
  padding: 12px 15px 14px;
}


.project-title {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 500;
}


.project-role {
  margin-top: 3px;

  color: var(--muted);

  font-family: var(--sans);
  font-size: 11px;
}


.project-meta {
  margin-top: 7px;
}


.project-period {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}


.project-period::before {
  content: "";

  display: inline-block;

  width: 7px;
  height: 7px;
  margin-right: 8px;

  vertical-align: 1px;

  background: var(--accent);
}


/* ==================================================
   Expand Hint
================================================== */

.project-expand-hint {
  margin-top: 10px;

  color: var(--muted);

  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.12em;

  opacity: 0.55;

  transition: opacity 0.2s ease;
}


.project-card:hover .project-expand-hint,
.project-card:focus-visible .project-expand-hint,
.project-card[aria-expanded="true"] .project-expand-hint {
  opacity: 1;
}


/* ==================================================
   Platforms
================================================== */

.platforms {
  margin-top: 9px;

  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}


.platform {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  color: var(--text-soft);

  font-family: var(--sans);
  font-size: 11px;
}


.platform img {
  width: auto;
  height: 18px;
  object-fit: contain;
}


/* ==================================================
   Project Detail — grid 0px/1fr 展开，无高度上限
================================================== */

.project-detail {
  height: 0;
  overflow: hidden;

  margin-top: 0;

  opacity: 0;

  transition:
    height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    margin-top 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}


.project-detail > .detail-inner {
  min-height: 0;
}


.project-detail.is-open {
  margin-top: 18px;

  opacity: 1;
}


/* 代表作 Detail — 横排卡片下方全宽展开 */

.featured-project .project-detail {
  width: 100%;
}


/* 全宽行下文字段控制行宽，保证阅读节奏 */

.featured-project .detail-section,
.featured-project .detail-links {
  max-width: 720px;
}


.featured-project .detail-media img {
  max-height: 520px;
}


/* 普通作品 Detail */

.project .project-detail {
  width: calc(100% - 72px);
  max-width: 440px;
}


.timeline-team .project .project-detail {
  margin-left: 28px;
  margin-right: auto;
}


.timeline-personal .project .project-detail {
  margin-left: auto;
  margin-right: 28px;
}


/* ==================================================
   Detail Content
================================================== */

.detail-section {
  padding: 0 4px 20px;
}


.detail-section h4 {
  margin: 0 0 7px;

  color: var(--text);

  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
}


.detail-section p {
  margin: 0 0 8px;

  color: var(--text-soft);

  font-size: 13px;
  line-height: 1.8;
}


.detail-section p:last-child {
  margin-bottom: 0;
}


/* ==================================================
   Detail Media
================================================== */

.detail-media {
  width: fit-content;
  max-width: 100%;

  margin: 0 auto 22px;
}


.detail-media img {
  display: block;

  width: auto;
  max-width: 100%;
  max-height: var(--detail-media-max-height);
  height: auto;

  margin: 0 auto;

  background: var(--panel);
}


.detail-media figcaption {
  margin-top: 7px;

  color: var(--muted);

  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.5;
}


/* ==================================================
   Detail Links
================================================== */

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  padding: 2px 4px 22px;
}


.detail-links a {
  display: inline-block;

  padding: 7px 12px;

  border: 1px solid rgba(216, 205, 184, 0.3);

  color: var(--text);

  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.05em;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}


.detail-links a:hover {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--accent);
}


.detail-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ==================================================
   Other Works
================================================== */

.column-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
}


.column-labels > div {
  padding: 14px 0 12px;

  text-align: center;

  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;

  color: var(--muted);
}


/* ==================================================
   Timelines
================================================== */

.timelines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 80px;
}


.timeline {
  position: relative;

  min-height: 600px;

  padding: 24px 0 36px;
}


.timeline-team {
  border-left: 1px solid var(--line);
}


.timeline-personal {
  border-right: 1px solid var(--line);
}


/* ==================================================
   Project
================================================== */

.project {
  position: relative;

  width: 100%;

  padding-bottom: 42px;
}


/* 时间节点 */

.project::before {
  content: "";
  position: absolute;
  top: 20px;

  width: 10px;
  height: 10px;

  border-radius: 50%;

  background: var(--accent);

  z-index: 3;
}


.timeline-team .project::before {
  left: -5px;
}


.timeline-personal .project::before {
  right: -5px;
}


/* ==================================================
   Date
================================================== */

.project-date {
  position: absolute;
  top: 0;

  font-size: 15px;
  line-height: 1.4;

  white-space: nowrap;
}


.timeline-team .project-date {
  left: -64px;
}


.timeline-personal .project-date {
  right: -64px;
}


/* ==================================================
   Timeline Card Position
================================================== */

.timeline-team .project-card {
  margin-left: 28px;
  margin-right: auto;
}


.timeline-personal .project-card {
  margin-left: auto;
  margin-right: 28px;
}


/* ==================================================
   Footer
================================================== */

footer {
  margin-top: 34px;
}


.footer-line {
  height: 1px;
  background: var(--line);
}


.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding-top: 18px;

  color: var(--muted);

  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
}


.footer-label {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.22em;

  color: var(--muted);
}


.contact-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}


.contact-links a:hover {
  color: var(--accent);
}


.contact-sep {
  opacity: 0.5;
}


/* ==================================================
   Responsive — 单断点：≤900px 全部转单列
================================================== */

@media (max-width: 900px) {

  .site-shell {
    width: calc(100% - 32px);
  }


  .site-nav-inner {
    width: calc(100% - 32px);
  }


  .nav-links {
    gap: 18px;
  }


  /* 首屏：隐藏地球装饰，避免挤压文字 */

  .cosmic-earth {
    display: none;
  }


  .profile {
    gap: 18px;
  }


  .avatar {
    width: 104px;
  }


  .profile h1 {
    font-size: 32px;
  }


  .positioning {
    font-size: 17px;
  }


  .experience {
    font-size: 11px;
  }


  .bio {
    font-size: 14px;
  }


  .philosophy {
    margin-top: 16px;
    font-size: 15px;
  }


  .skill-stack {
    margin-top: 16px;
  }


  .hero-actions {
    margin-top: 18px;
  }


  .btn {
    padding: 9px 18px;
    font-size: 12px;
  }


  /* 代表作：横排回退为上图下文 */

  .featured-grid {
    gap: 32px;
  }


  .featured-project .project-card,
  .featured-project:nth-child(even) .project-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }


  .featured-project:nth-child(even) .project-info {
    order: 0;
  }


  .featured-project .project-cover {
    aspect-ratio: 16 / 9;
    height: auto;
  }


  .featured-project .project-info {
    padding: 14px 16px 16px;
  }


  .featured-project .project-title {
    font-size: 20px;
  }


  /* 其他作品 */

  .column-labels {
    display: none;
  }


  .timelines {
    display: block;
  }


  .timeline {
    min-height: auto;
    padding: 28px 0 8px;
  }


  .timeline-team,
  .timeline-personal {
    border-left: 1px solid var(--line);
    border-right: 0;
  }


  .project {
    padding-left: 28px;
  }


  .project::before {
    left: -5px !important;
    right: auto !important;
  }


  .project-date {
    position: static;
    margin-bottom: 8px;
  }


  .project-card,
  .project .project-detail {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }


  /* 页脚 */

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}


/* ==================================================
   Reduced Motion
================================================== */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }


  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
