/* ═══════════════════════════════════════════════════════════
   site.css — index.html layout & components only.
   Requires tokens.css loaded first. No token redefinition here.
═══════════════════════════════════════════════════════════ */

/* ── LAYOUT ── */
main {
  max-width: 640px;
  margin-inline: auto;
  padding-inline: var(--space-24);
}

main > section,
main > article { padding-block: var(--space-48); }
main > section:first-child { padding-top: var(--space-96); }

.section-label {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-24);
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }

h1, h2 { color: var(--color-text); font-weight: 500; }

/* ── HERO ── */
#hero header {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

#hero figure {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-surface);
  display: grid;
  place-items: center;
  cursor: var(--cursor-clickable);
}
#hero figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
#hero figure figcaption { font-family: var(--font-mono); font-size: var(--text-lg); color: var(--color-text-muted); }

.identity-name { font-family: var(--font-mono); font-size: var(--text-base); font-weight: 500; color: var(--color-text); }
.identity-handle { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-4); }

#hero > p { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 52ch; line-height: 1.75; }

/* ── RECENT COMMITS — muted, small ── */
.commit-ticker {
  list-style: none;
  margin-bottom: var(--space-48);
  max-height: 96px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.commit-ticker li {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding-block: var(--space-4);
  display: flex;
  gap: var(--space-8);
  align-items: baseline;
}
.commit-ticker time { flex-shrink: 0; margin-left: auto; }

/* ── FEATURED — vertical list, no card chrome ── */
#featured ol { list-style: none; }

.project-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-16);
  align-items: start;
  padding-block: var(--space-24);
  border-bottom: 1px solid var(--color-border);
}
#featured ol > li:first-child .project-item { border-top: 1px solid var(--color-border); }

.project-name { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
@media (prefers-reduced-motion: no-preference) {
  .project-name { transition: color var(--dur-fast) var(--ease-out); }
}
.project-item:hover .project-name { color: var(--color-accent); }

.project-desc { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.55; margin-top: var(--space-4); }

.project-meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-4); flex-shrink: 0; }
.stars { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.stars > b { color: var(--color-accent); font-weight: 400; }
.project-lang { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); }

/* ── RECOMMENDED ── */
#recommended article { padding-top: var(--space-24); }
.recommended-name { font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 500; color: var(--color-text); }
@media (prefers-reduced-motion: no-preference) {
  .recommended-name { transition: color var(--dur-fast) var(--ease-out); }
}
#recommended-card:hover .recommended-name { color: var(--color-accent); }
.recommended-desc { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-8); }

/* ── LATEST THOUGHT ── */
#thought time { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); display: block; margin-bottom: var(--space-16); }
#thought h2 { font-size: var(--text-xl); margin-bottom: var(--space-16); }
#thought p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.8; }
.read-more {
  display: inline-block;
  margin-top: var(--space-16);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1px;
}
@media (prefers-reduced-motion: no-preference) {
  .read-more { transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
}
.read-more:hover { color: var(--color-accent); border-bottom-color: var(--color-accent); }

/* ═══════════════════════════════════════════════════════════
   FOOTER — dark exploratory zone. Forces dark tokens locally
   regardless of system preference, since this is a fixed
   dark section by design (index.txt: "通往外部世界的出口").
═══════════════════════════════════════════════════════════ */
footer {
  color-scheme: dark;
  --color-bg:         oklch(11%  0.003 260);
  --color-surface:    oklch(16%  0.004 260);
  --color-border:     oklch(24%  0.005 260);
  --color-text-muted: oklch(60%  0.008 260);
  --color-text:       oklch(88%  0.008 260);

  background: var(--color-bg);
  color: var(--color-text-muted);
  padding-top: var(--space-48);
}

footer .section-label { color: var(--color-text-muted); }
footer .section-label::after { background: var(--color-border); }

#music {
  max-width: 640px;
  margin-inline: auto;
  padding-inline: var(--space-24);
  padding-bottom: var(--space-48);
  overflow: hidden;
}

.music-scroller {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-inline: calc(-1 * var(--space-24));
  padding-inline: var(--space-24);
  scroll-snap-type: x mandatory;
}
.music-scroller::-webkit-scrollbar { display: none; }

.music-row { display: flex; gap: var(--space-16); width: max-content; padding-bottom: var(--space-4); }
.music-card { flex-shrink: 0; width: 112px; scroll-snap-align: start; }
.music-cover {
  width: 112px; height: 112px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  margin-bottom: var(--space-8);
}
@media (prefers-reduced-motion: no-preference) {
  .music-cover { transition: border-color var(--dur-fast) var(--ease-out); }
}
.music-cover:hover { border-color: var(--color-text-muted); }
.music-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.music-track { font-size: var(--text-xs); color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-artist { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: var(--space-4); }

/* ── ALL PROJECTS — full-bleed horizontal ticker ── */
.ticker-band {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  padding-block: var(--space-12);
}
.ticker-track { display: flex; width: max-content; }
@media (prefers-reduced-motion: no-preference) {
  .ticker-track { animation: ticker 32s linear infinite; }
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.ticker-item {
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em;
  color: var(--color-text-muted); white-space: nowrap; padding-inline: var(--space-24);
  display: flex; align-items: center; gap: var(--space-8);
}
.ticker-item::after { content: '·'; color: var(--color-border); }
@media (prefers-reduced-motion: no-preference) {
  .ticker-item a { transition: color var(--dur-fast) var(--ease-out); }
}
.ticker-item a:hover { color: var(--color-accent); }

/* ── CONNECT ── */
#connect {
  max-width: 640px;
  margin-inline: auto;
  padding-inline: var(--space-24);
  padding-block: var(--space-48);
}

.connect-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-24); margin-bottom: var(--space-32); }
.connect-list a {
  font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
@media (prefers-reduced-motion: no-preference) {
  .connect-list a { transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
}
.connect-list a:hover { color: var(--color-accent); border-bottom-color: var(--color-accent); }

.prompt-line { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-text); }
.prompt { color: var(--color-accent); margin-right: var(--space-8); }
.prompt-cursor {
  display: inline-block;
  width: 7px; height: 1em;
  background: var(--color-text);
  vertical-align: text-bottom;
  margin-left: var(--space-4);
}
@media (prefers-reduced-motion: no-preference) {
  .prompt-cursor { animation: blink 1s step-end infinite; }
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── SKELETON ── */
.skeleton {
  display: inline-block;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--color-surface) 0%, var(--color-border) 50%, var(--color-surface) 100%);
  background-size: 200% 100%;
  color: transparent;
  user-select: none;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.6s ease-in-out infinite; }
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── AVATAR SECRET OVERLAY ── */
.avatar-secret-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: var(--cursor-clickable);
}
.avatar-secret-text {
  color: #fff;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
}

/* ── CONFETTI CANVAS ── */
.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   SEASONAL THEMES — atmosphere only, layout unchanged
   (index.txt §14)
═══════════════════════════════════════════════════════════ */
body.season-winter { --color-bg: #ffffff; }
body.season-spring footer { border-top: 3px solid #7c9a5e; }
body.season-summer { --color-accent: oklch(55% 0.15 240); }
body.season-autumn { --color-accent: oklch(55% 0.15 40); }

/* ── RESPONSIVE ── */
@media (max-width: 540px) {
  #hero header { gap: var(--space-12); }
  .project-item { grid-template-columns: 1fr; }
  .project-meta { flex-direction: row; align-items: center; }
}
