/* ==========================================================================
   苏炜朝 · 个人主页
   纯静态样式表，无任何外部依赖
   ========================================================================== */

:root {
  --dark: #0B0E14;
  --dark-2: #11151D;
  --light: #FFFFFF;
  --light-2: #F7F8FA;
  --ink: #0F1115;
  --ink-2: #4A5160;
  --ink-3: #868E9C;
  --ink-4: #B4B9C4;
  --line: #E6E8EC;
  --accent: #2563EB;
  --accent-l: #5B9CFF;
  --accent-soft: #EFF4FF;
  --accent-line: #D6E2FF;
  --teal: #0EA5A0;
  --radius: 20px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
          "Noto Sans CJK SC", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
canvas { display: block; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 20px;
  background: var(--dark);
  color: #fff;
  z-index: 200;
}
.skip:focus { left: 12px; top: 12px; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 导航 ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  transition: background .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-solid {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #EDF2FA;
  transition: color .3s ease;
}

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

.nav-links a {
  font-size: 14px;
  color: rgba(237, 242, 250, .68);
  transition: color .25s ease;
}

.nav-links a:hover { color: #fff; }

.nav.is-solid .brand { color: var(--ink); }
.nav.is-solid .nav-links a { color: var(--ink-2); }
.nav.is-solid .nav-links a:hover { color: var(--accent); }

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--dark);
  color: #F5F7FA;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-glow {
  position: absolute;
  width: 760px;
  height: 760px;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(59, 130, 246, .18) 0%, rgba(59, 130, 246, .05) 42%, transparent 68%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 24px 80px;
}

.hero-eyebrow {
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--accent-l);
  opacity: 0;
  animation: fadeUp .8s cubic-bezier(.2, .7, .3, 1) .1s forwards;
}

.hero-title {
  margin: 22px 0 0;
  font-size: clamp(52px, 11vw, 104px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.03em;
  color: #F7F9FC;
}

.hero-title .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(.42em);
  animation: chIn .78s cubic-bezier(.2, .7, .3, 1) forwards;
}

@keyframes chIn {
  to { opacity: 1; transform: none; }
}

.hero-sub {
  margin-top: 26px;
  font-size: clamp(16px, 2vw, 19px);
  color: #9AA4B2;
  max-width: 620px;
  opacity: 0;
  animation: fadeUp .8s cubic-bezier(.2, .7, .3, 1) .42s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 40px;
  opacity: 0;
  animation: fadeUp .8s cubic-bezier(.2, .7, .3, 1) .54s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform .25s ease, background .25s ease, border-color .25s ease, color .25s ease;
}

.btn-primary {
  background: #F2F6FD;
  color: #0B0E14;
}

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

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

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, .48);
  color: #fff;
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 56px;
  margin-top: 76px;
  opacity: 0;
  animation: fadeUp .8s cubic-bezier(.2, .7, .3, 1) .68s forwards;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-stats strong {
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
  color: #F7F9FC;
  font-variant-numeric: tabular-nums;
}

.hero-stats span {
  font-size: 12.5px;
  letter-spacing: .04em;
  color: #7F8A9A;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  width: 1px;
  height: 56px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.hero-scroll span {
  display: block;
  width: 1px;
  height: 20px;
  background: var(--accent-l);
  animation: scrollDown 2.1s ease-in-out infinite;
}

@keyframes scrollDown {
  0% { transform: translateY(-22px); }
  60%, 100% { transform: translateY(58px); }
}

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

.section { padding: 120px 0; }
.section-alt { background: var(--light-2); }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--accent);
}

.section-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.section-title {
  margin-top: 18px;
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -.015em;
  color: var(--ink);
}

.section-lead {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 620px;
}

.section-dark {
  background: var(--dark);
  color: #E8EEF8;
}

.section-dark .section-label { color: var(--accent-l); }
.section-dark .section-title { color: #F7F9FC; }
.section-dark .section-lead { color: #8C97A6; }

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

.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 72px;
  margin-top: 48px;
  align-items: start;
}

.about-text p {
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-2);
  margin-bottom: 20px;
}

.about-text p:first-child {
  font-size: 17px;
  color: var(--ink);
}

.about-text p:last-child { margin-bottom: 0; }

.skill-list li {
  display: flex;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.skill-list li:first-child { border-top: 1px solid var(--line); }

.skill-list span {
  flex: 0 0 84px;
  color: var(--ink-3);
  font-size: 12.5px;
  letter-spacing: .04em;
}

/* ---------- 作品 ---------- */

.work-list {
  display: grid;
  gap: 20px;
  margin-top: 52px;
}

.work-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .3s ease, transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .4s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.work-card:hover {
  border-color: var(--accent-line);
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, .22);
}

.work-visual {
  position: relative;
  background: #0C1017;
  overflow: hidden;
}

.work-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(91, 156, 255, .05), transparent 55%);
  pointer-events: none;
}

.work-visual canvas {
  width: 100%;
  height: 100%;
  min-height: 208px;
}

.work-body {
  padding: 30px 32px 28px;
  position: relative;
}

.work-body::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .35s ease;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(37, 99, 235, .07), transparent 65%);
  pointer-events: none;
}

.work-card:hover .work-body::before { opacity: 1; }

.work-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.work-head h3 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--ink);
}

.work-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.work-body p {
  margin: 14px 0 18px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tags li {
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 12px;
  color: #545B69;
  background: #F4F6F8;
  border: 1px solid var(--line);
}

/* ---------- 文章 ---------- */

.write-list {
  margin-top: 48px;
  border-top: 1px solid var(--line);
}

.write-list li { border-bottom: 1px solid var(--line); }

.write-list a {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 24px 6px;
  transition: background .25s ease;
}

.write-list a:hover { background: var(--light-2); }

.write-idx {
  font-size: 12.5px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}

.write-main { min-width: 0; }

.write-title {
  display: block;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  transition: color .25s ease, transform .25s ease;
}

.write-list a:hover .write-title {
  color: var(--accent);
  transform: translateX(4px);
}

.write-col {
  display: block;
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .02em;
}

.write-arrow {
  font-size: 16px;
  color: #9AA1AD;
  transition: color .25s ease, transform .25s ease;
}

.write-list a:hover .write-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

.write-more { margin-top: 36px; }

.link-plain {
  font-size: 14.5px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color .25s ease;
}

.link-plain:hover { border-bottom-color: var(--accent); }

/* ---------- 联系 ---------- */

.contact-list {
  margin-top: 52px;
  max-width: 620px;
}

.contact-list li {
  display: flex;
  align-items: baseline;
  gap: 28px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.contact-list li:first-child { border-top: 1px solid rgba(255, 255, 255, .09); }

.contact-key {
  flex: 0 0 62px;
  font-size: 12.5px;
  letter-spacing: .12em;
  color: rgba(232, 238, 248, .42);
}

.contact-list a {
  font-size: 17px;
  color: #E8EEF8;
  transition: color .25s ease;
}

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

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

.foot {
  background: var(--dark-2);
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.foot-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.foot p {
  font-size: 13px;
  color: rgba(232, 238, 248, .5);
}

.foot-note {
  font-size: 12.5px !important;
  color: rgba(232, 238, 248, .4) !important;
}

.foot-legal {
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: .02em;
  color: rgba(232, 238, 248, .34);
}

.foot-legal a {
  color: inherit;
  transition: color .25s ease;
}

.foot-legal a:hover { color: rgba(232, 238, 248, .7); }

/* ---------- 滚动进场 ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .75s cubic-bezier(.2, .7, .3, 1), transform .75s cubic-bezier(.2, .7, .3, 1);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 900px) {
  .section { padding: 92px 0; }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 44px;
    margin-top: 36px;
  }
  .work-list { margin-top: 40px; }
  .work-card { grid-template-columns: 1fr; }
  .work-visual canvas { min-height: 168px; }
  .work-body { padding: 24px 24px 26px; }
  .hero-stats { gap: 40px; margin-top: 60px; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 20px; }
  .nav-inner { padding: 0 20px; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 13px; }
  .section { padding: 76px 0; }
  .hero-inner { padding: 88px 20px 72px; }
  .hero-stats { gap: 28px; margin-top: 52px; }
  .hero-stats strong { font-size: 26px; }
  .hero-stats span { font-size: 11.5px; }
  .hero-actions { flex-wrap: wrap; }
  .btn { height: 44px; padding: 0 22px; }
  .write-list a {
    grid-template-columns: 32px 1fr auto;
    gap: 14px;
    padding: 20px 2px;
  }
  .write-title { font-size: 15.5px; }
  .contact-list li { gap: 18px; }
  .contact-list a { font-size: 15.5px; word-break: break-all; }
  .section-lead { font-size: 14.5px; }
  .work-body p { font-size: 14px; }
}

/* ---------- 减少动态效果 ---------- */

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

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

  .hero-eyebrow,
  .hero-sub,
  .hero-actions,
  .hero-stats,
  .hero-title .ch {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hero-scroll { display: none; }

  .js .reveal { opacity: 1; transform: none; }
}
