/* ==========================================================================
   Wally Yang 个人主页 · 浅黄色亮色调主题
   ========================================================================== */

:root {
  --bg: #fffdf2;
  --bg-soft: #fff8dd;
  --bg-card: #fffef9;
  --ink: #3a3000;
  --ink-soft: #6b5d2e;
  --accent: #e8a800;
  --accent-strong: #c98f00;
  --accent-soft: #ffe9a8;
  --line: #f0e3b0;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(180, 140, 0, 0.10);
  --shadow-hover: 0 18px 60px rgba(180, 140, 0, 0.18);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- 无障碍：跳转链接与焦点 ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1.2rem;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 背景装饰 ---------- */

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

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: blob-drift 26s var(--ease-out) infinite alternate;
}

.blob-a {
  width: 42vw;
  height: 42vw;
  top: -12vw;
  right: -10vw;
  background: radial-gradient(circle, #ffe9a8, transparent 70%);
}

.blob-b {
  width: 36vw;
  height: 36vw;
  bottom: 8vh;
  left: -12vw;
  background: radial-gradient(circle, #fff3c4, transparent 70%);
  animation-delay: -8s;
}

.blob-c {
  width: 24vw;
  height: 24vw;
  top: 45vh;
  right: 12vw;
  background: radial-gradient(circle, #ffdf7e, transparent 70%);
  opacity: 0.35;
  animation-delay: -16s;
}

@keyframes blob-drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(4vw, -3vh) scale(1.12);
  }
}

/* ---------- 头部导航 ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.35s, box-shadow 0.35s, backdrop-filter 0.35s;
}

.site-header.is-scrolled {
  background: rgba(255, 253, 242, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}

.site-nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* logo 为白底 PNG，用 multiply 混合让白底融入浅黄背景 */
.brand-logo {
  height: 2.1rem;
  width: auto;
  mix-blend-mode: multiply;
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.2rem 0;
  transition: color 0.25s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

/* ---------- 通用区块 ---------- */

main {
  display: block;
}

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
}

.section-title::before {
  content: "";
  display: block;
  width: 2.6rem;
  height: 5px;
  margin-bottom: 0.9rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 3px;
}

.section-sub {
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
}

/* ---------- 滚动显现 ---------- */

/* 仅在 JS 可用时才先隐藏，无 JS 时内容完整可见（GEO / 无障碍友好） */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}

wg-hero {
  display: block;
  max-width: 720px;
}

.hero-eyebrow {
  color: var(--accent-strong);
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.hero-title {
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 900;
  line-height: 1.15;
  /* 渐变文字的下伸部（y、g）容易被背景裁切，留出底部空间 */
  padding-bottom: 0.14em;
  margin: 0 0 1.26rem;
  background: linear-gradient(115deg, var(--ink) 40%, var(--accent-strong));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

.hero-tagline strong {
  color: var(--ink);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin: 0 0 3.5rem;
  padding: 0;
  list-style: none;
}

.hero-tags li {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 249, 0.7);
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: border-color 0.3s, color 0.3s, transform 0.3s var(--ease-out),
    box-shadow 0.3s;
}

.hero-tags li:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* Hero 入场动画（由 wg-hero 组件触发） */

/* Hero 入场动画（由 wg-hero 组件触发；仅 JS 可用时生效） */

.js [data-hero-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

wg-hero.is-ready [data-hero-reveal] {
  opacity: 1;
  transform: none;
}

wg-hero.is-ready [data-hero-reveal]:nth-child(1) { transition-delay: 0.05s; }
wg-hero.is-ready [data-hero-reveal]:nth-child(2) { transition-delay: 0.2s; }
wg-hero.is-ready [data-hero-reveal]:nth-child(3) { transition-delay: 0.38s; }
wg-hero.is-ready [data-hero-reveal]:nth-child(4) { transition-delay: 0.56s; }
wg-hero.is-ready [data-hero-reveal]:nth-child(5) { transition-delay: 0.85s; }

.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.85rem;
}

.scroll-hint-arrow {
  width: 22px;
  height: 22px;
  border-right: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: rotate(45deg);
  animation: hint-bounce 1.8s ease-in-out infinite;
}

@keyframes hint-bounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 1; }
  50% { transform: rotate(45deg) translate(6px, 6px); opacity: 0.4; }
}

/* ---------- 关于我 ---------- */

.about-lead {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 2.5rem;
}

.about-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.about-card {
  padding: 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}

.about-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.about-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
}

.about-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- 项目 ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.4rem;
}

project-card {
  display: block;
  perspective: 900px;
}

.project-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.35s, border-color 0.35s;
  transform-style: preserve-3d;
  will-change: transform;
}

project-card:hover .project-card {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-soft);
}

.project-kind {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.project-name {
  margin: 0 0 0.8rem;
  font-size: 1.45rem;
  font-weight: 800;
}

.project-desc {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.project-points {
  margin: 0 0 1.6rem;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.project-points li::marker {
  color: var(--accent);
}

.project-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  transition: color 0.25s, gap 0.25s var(--ease-out);
}

.project-link:hover {
  color: var(--accent-strong);
  gap: 0.7rem;
}

.link-arrow {
  transition: transform 0.25s var(--ease-out);
}

.project-link:hover .link-arrow,
.photography-link:hover .link-arrow {
  transform: translateX(3px);
}

/* ---------- 摄影 ---------- */

.photography {
  text-align: center;
}

.photography .section-title::before {
  margin-left: auto;
  margin-right: auto;
}

.photography-text {
  color: var(--ink-soft);
  max-width: 34em;
  margin: 0 auto 1.6rem;
}

.photography-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff8dd;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, background 0.3s;
}

.photography-link:hover {
  background: var(--accent-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 5rem;
  padding: 5rem 1.5rem 3rem;
  text-align: center;
  background: linear-gradient(180deg, transparent, var(--bg-soft));
  border-top: 1px solid var(--line);
}

.site-footer .section-title::before {
  margin-left: auto;
  margin-right: auto;
}

.footer-text {
  color: var(--ink-soft);
  margin: 0 0 1.8rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.4rem;
  justify-content: center;
  margin: 0 0 2.6rem;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-soft);
  transition: border-color 0.25s, color 0.25s;
}

.footer-links a:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.footer-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  .nav-links {
    gap: 1.1rem;
  }

  .nav-links a {
    font-size: 0.88rem;
  }

  .section {
    padding: 5rem 1.2rem 3rem;
  }
}

/* ---------- 尊重减弱动效偏好 ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  [data-reveal],
  [data-hero-reveal] {
    opacity: 1;
    transform: none;
  }
}
