/* ============================================================
   吃一点 · 个人站点
   设计令牌 + 组件样式
   ============================================================ */

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-glow: rgba(20, 184, 166, 0.10);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ededed;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;
  --accent: #14b8a6;
  --accent-soft: rgba(20, 184, 166, 0.14);
  --glass: rgba(10, 10, 11, 0.72);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f5f1;
  --bg-glow: rgba(15, 118, 110, 0.08);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-hover: #ffffff;
  --border: rgba(17, 17, 17, 0.08);
  --border-strong: rgba(17, 17, 17, 0.16);
  --text: #111113;
  --text-secondary: #52525b;
  --text-muted: #8b8b93;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.10);
  --glass: rgba(246, 245, 241, 0.78);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.6;
  background:
    radial-gradient(1200px 620px at 88% -12%, var(--bg-glow), transparent 62%),
    radial-gradient(900px 520px at -5% 102%, var(--bg-glow), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

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

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 36px);
  height: 64px;
}

.brand {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex: none;
}
.brand-dot { color: var(--accent); }

.nav {
  display: flex;
  gap: clamp(12px, 2.2vw, 26px);
  margin-left: auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  position: relative;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 6px 0;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
}

.theme-toggle {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }

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

.hero {
  padding: clamp(56px, 10vw, 118px) 0 clamp(34px, 5vw, 60px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 6px 13px 6px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

.hero-title {
  margin: 24px 0 16px;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 600;
}
.hero-title .accent { color: var(--accent); }

.hero-lead {
  font-size: clamp(1.05rem, 2.2vw, 1.38rem);
  color: var(--text-secondary);
  max-width: 32ch;
  letter-spacing: -0.01em;
}

.tags {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tag-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tag-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: none;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-list li {
  font-size: 13px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: var(--surface);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tag-list li:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------- Bento ---------------- */

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: clamp(20px, 4vw, 42px);
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 32px);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    background-color 0.35s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    360px 220px at var(--mx, 50%) var(--my, 0%),
    var(--accent-soft),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.card:hover::before { opacity: 1; }

.card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.card h3 {
  margin: 14px 0 8px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.75;
}

.card--about {
  grid-column: span 7;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 30px);
}
.card--c1 { grid-column: span 5; }
.card--c2 { grid-column: span 5; }
.card--c3 { grid-column: span 4; }
.card--c4 { grid-column: span 4; }
.card--c5 { grid-column: span 4; }

.avatar {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--accent);
  border-radius: 26px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(145deg, var(--accent-soft), transparent 72%);
}

.about-body h2 {
  margin: 10px 0 12px;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.about-body p { max-width: 46ch; }

/* ---------------- 精选作品 ---------------- */

.featured { margin: clamp(48px, 8vw, 88px) 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.link-arrow {
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease);
}
.link-arrow:hover { color: var(--accent); }

.work-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    background-color 0.35s var(--ease);
}
.work-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--surface-hover);
}
.work-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    420px 240px at var(--mx, 50%) var(--my, 0%),
    var(--accent-soft),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.work-card:hover::before { opacity: 1; }

.work-card h3 {
  margin: 12px 0 8px;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.work-card p {
  color: var(--text-secondary);
  font-size: 0.93rem;
  max-width: 54ch;
}

.work-arrow {
  flex: none;
  font-size: 1.5rem;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}
.work-card:hover .work-arrow { transform: translateX(6px); }

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

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 26px;
  padding-bottom: 38px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer-note a { color: var(--text-muted); }
.footer-note a:hover { color: var(--accent); }

/* ---------------- 入场动效 ---------------- */

html.js .reveal { opacity: 0; }
html.js .reveal.is-visible {
  animation: rise 0.65s var(--ease) both;
  animation-delay: var(--reveal-delay, 0ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html.js .reveal { opacity: 1; }
}

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

@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .card--about,
  .card--c1,
  .card--c2,
  .card--c3,
  .card--c4,
  .card--c5 {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .header-inner { height: 58px; }
  .nav { gap: 13px; font-size: 0.82rem; }
  .tag-label { width: 100%; }
  .tag-group { gap: 10px; }
  .section-head { align-items: center; }
  .work-card { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; }
}

/* ---------------- 内页 ---------------- */

.page { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }

.page-head {
  margin-bottom: clamp(32px, 5vw, 52px);
  max-width: 62ch;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.page-title {
  margin: 14px 0 12px;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.page-lead {
  color: var(--text-secondary);
  font-size: 1rem;
}

.section-block { margin-bottom: clamp(36px, 6vw, 56px); }

.block-title {
  margin: 12px 0 18px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.row-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.row-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.row-card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 600;
}

.row-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 52ch;
}

.row-meta {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.skill-grid li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.skill-name { font-size: 0.94rem; font-weight: 500; }

.skill-level {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.works-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.work-tile,
.contact-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    background-color 0.35s var(--ease);
}
.work-tile:hover,
.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--surface-hover);
}
.work-tile::before,
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    360px 220px at var(--mx, 50%) var(--my, 0%),
    var(--accent-soft),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.work-tile:hover::before,
.contact-card:hover::before { opacity: 1; }

.work-tile h3,
.contact-card h3 {
  margin: 12px 0 4px;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.work-tile p,
.contact-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.contact-card h3 { word-break: break-all; }

.tile-link {
  margin-top: 14px;
  font-size: 0.86rem;
  color: var(--accent);
}

.work-tile--placeholder {
  border-style: dashed;
  background: transparent;
}
.work-tile--placeholder h3,
.work-tile--placeholder p { color: var(--text-muted); }
.work-tile--placeholder:hover {
  transform: none;
  border-color: var(--border);
  background: transparent;
}

@media (max-width: 640px) {
  .row-card { flex-direction: column; gap: 10px; }
}
