:root {
  color-scheme: dark;
  --ink: #fffafc;
  --muted: rgba(255, 250, 252, 0.76);
  --glass: rgba(26, 20, 28, 0.14);
  --glass-light: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.14);
  --pink: #ff9ec1;
  --blue: #9fd8ff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  --radius: 18px;
  --radius-lg: 24px;
  --pill: 999px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #151015;
  overflow-x: hidden;
}

body {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: url("assets/chengshan-gg-wallpaper-4k-source.png") center / cover no-repeat;
  filter: none;
  transform: translate3d(calc(var(--mx, 0) * -10px), calc(var(--my, 0) * -8px), 0) scale(1.025);
  image-rendering: auto;
  animation: wallpaper-drift 24s ease-in-out infinite alternate;
}

.shade {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: rgba(20, 12, 18, 0.04);
  box-shadow: inset 0 -120px 140px rgba(0, 0, 0, 0.18), inset 0 90px 130px rgba(255, 255, 255, 0.04);
}

.petal-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.petal {
  position: absolute;
  top: -10vh;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 0.58);
  border-radius: 999px 999px 999px 2px;
  background: rgba(255, 174, 202, 0.74);
  box-shadow: 0 0 18px rgba(255, 210, 226, 0.38);
  opacity: var(--alpha);
  transform: rotate(var(--rotate));
  animation: petal-fall var(--duration) linear var(--delay) infinite;
}

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

svg {
  display: block;
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
}

.glass {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px) saturate(1.08);
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease;
}

.home {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 430px;
  gap: 52px;
  align-items: center;
  min-height: 100vh;
  width: min(1180px, calc(100% - 72px));
  margin: 0 auto;
  padding: 56px 0;
}

.hero-panel {
  display: grid;
  gap: 28px;
  align-content: center;
  animation: float-in 680ms ease both;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 20px;
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.34);
}

.avatar-mark {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: rgba(255, 158, 193, 0.8);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 38px;
  font-weight: 950;
  animation: avatar-breathe 4.8s ease-in-out infinite;
}

.eyebrow {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(56px, 8vw, 92px);
  line-height: 0.98;
  letter-spacing: 0;
  animation: title-rise 780ms ease 120ms both;
}

h2 {
  margin-bottom: 10px;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: 16px;
  letter-spacing: 0;
}

.quote-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  max-width: 620px;
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(28, 20, 28, 0.12);
  animation: float-soft 6s ease-in-out infinite;
}

.quote-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
}

.quote-mark {
  color: rgba(255, 255, 255, 0.72);
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
}

.quote-mark.end {
  align-self: end;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.round-link {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: #3a2933;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, background 180ms ease;
}

.right-panel {
  display: grid;
  gap: 18px;
  animation: float-in 760ms ease 100ms both;
}

.status-card {
  padding: 22px 24px;
  background: rgba(25, 20, 30, 0.1);
}

.status-card p {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.status-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 48px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.status-card span {
  color: var(--muted);
}

.motto-card {
  padding: 24px;
  background: rgba(25, 20, 30, 0.1);
}

.motto-card p {
  color: var(--ink);
  line-height: 1.7;
}

.motto-card b {
  display: block;
  color: rgba(255, 255, 255, 0.86);
  text-align: right;
}

.link-area h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(30, 24, 34, 0.13);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 850;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(5px) saturate(1.05);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.link-card:hover,
.round-link:hover,
.github-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.link-card svg {
  color: var(--tone);
  font-size: 20px;
}

.content-strip {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100% - 72px));
  margin: 0 auto 72px;
}

.story-card {
  padding: 26px;
  background: rgba(26, 20, 28, 0.16);
}

.story-card p {
  color: var(--muted);
  line-height: 1.78;
}

.story-card p:last-child {
  margin-bottom: 0;
}

.work-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.work-card {
  position: relative;
  display: grid;
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.work-card span {
  color: var(--tone);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.work-card strong {
  font-size: 21px;
}

.work-card p {
  margin: 0;
}

.work-card i {
  position: absolute;
  top: 16px;
  right: 16px;
  font-style: normal;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chips span {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 760;
}

@keyframes wallpaper-drift {
  from {
    background-position: 48% 50%;
  }

  to {
    background-position: 52% 49%;
  }
}

@keyframes petal-fall {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(var(--rotate));
  }

  50% {
    transform: translate3d(var(--sway), 54vh, 0) rotate(calc(var(--rotate) + 150deg));
  }

  100% {
    transform: translate3d(calc(var(--sway) * -0.35), 112vh, 0) rotate(calc(var(--rotate) + 320deg));
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes title-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes avatar-breathe {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.035);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .petal-layer {
    display: none;
  }
}

.load-error {
  width: min(720px, calc(100% - 32px));
  margin: 80px auto;
  border-radius: var(--radius);
  padding: 28px;
  background: var(--glass);
  color: var(--ink);
  line-height: 1.8;
  box-shadow: var(--shadow);
}

@media (max-width: 920px) {
  .home {
    grid-template-columns: 1fr;
    width: min(100% - 32px, 760px);
    gap: 28px;
  }

  .content-strip {
    width: min(100% - 32px, 760px);
  }

  .work-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .home {
    min-height: auto;
    padding-top: 34px;
  }

  .logo-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .avatar-mark {
    width: 70px;
    height: 70px;
  }

  h1 {
    font-size: 48px;
  }

  .quote-card {
    grid-template-columns: 1fr;
  }

  .quote-mark.end {
    display: none;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }
}
