/* ── Tokens ── */
:root {
  --bg:            #0A0E1A;
  --bg-deep:       #060A12;
  --bg-card:       #0D1017;
  --bg-card-sel:   #0E1B2E;
  --text-1:        #E8E8E8;
  --text-2:        #C0C5CE;
  --text-3:        #8A8F98;
  --text-4:        #4A5568;
  --accent:        #4A90A4;
  --border:        #1E2435;
  --border-hov:    #2A3A50;
  --glow:          rgba(74, 144, 164, 0.15);
  --glow-sm:       rgba(74, 144, 164, 0.08);
  --serif:         'Noto Serif SC', 'Source Han Serif SC', serif;
  --sans:          'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  --mono:          'JetBrains Mono', 'Courier New', monospace;
  --ease:          cubic-bezier(0.25, 0, 0, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Stars Canvas ── */
#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

section, nav, main, footer { position: relative; z-index: 1; }

/* ── Utility ── */
.section-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* ── Hero ── */
#hero {
  padding: 140px 24px 120px;
  text-align: center;
}

.hero-quote {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--accent);
  letter-spacing: 7px;
  margin-bottom: 40px;
}

.hero-title {
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
  max-width: 900px;
  margin: 0 auto 20px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-3);
  margin-bottom: 64px;
}

.hero-desc {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.hero-desc p {
  font-size: 15px;
  line-height: 2.0;
  color: var(--text-3);
  margin-bottom: 18px;
}
.hero-desc p:last-child { margin-bottom: 0; }
.hero-desc-lead { color: var(--text-2) !important; }

/* ── Lens Nav ── */
#lens-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
}

#lens-cards {
  display: flex;
  justify-content: center;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Planet item ── */
.planet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  max-width: 180px;
  user-select: none;
}

/* Sphere */
.planet-sphere {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: box-shadow 350ms var(--ease), transform 350ms var(--ease);
  will-change: transform;
}

.planet-item:hover .planet-sphere {
  transform: translateY(-3px);
}

/* One full spin on click */
.planet-sphere.spinning {
  animation: planet-spin 700ms cubic-bezier(0.33, 0, 0.22, 1) forwards;
}

@keyframes planet-spin {
  0%   { transform: rotate(0deg)   translateY(0); }
  50%  { transform: rotate(180deg) translateY(-4px); }
  100% { transform: rotate(360deg) translateY(0); }
}

/* Selected: halo ring */
.planet-item.selected .planet-sphere {
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.08),
    0 0 20px var(--planet-glow, var(--glow)),
    0 0 50px var(--planet-glow-far, rgba(74,144,164,0.12));
}

/* 5 planet appearances — cold-palette, no neon */
.planet-sphere[data-pid="0"] {
  /* 时间的朋友：冰蓝冻星 */
  background: radial-gradient(circle at 37% 30%, #8BBDD4, #2A5A72 52%, #0C1E2C);
  --planet-glow:     rgba(74, 144, 164, 0.5);
  --planet-glow-far: rgba(74, 144, 164, 0.15);
}
.planet-sphere[data-pid="1"] {
  /* 裂痕中的光：紫灰气态巨星 */
  background: radial-gradient(circle at 37% 30%, #9080C0, #2A1E5C 52%, #100C26);
  --planet-glow:     rgba(120, 100, 180, 0.45);
  --planet-glow-far: rgba(100, 80, 160, 0.12);
}
.planet-sphere[data-pid="2"] {
  /* 创作者变形记：暗岩荒星 */
  background: radial-gradient(circle at 37% 30%, #8A7E6E, #3A2E22 52%, #141008);
  --planet-glow:     rgba(138, 126, 110, 0.4);
  --planet-glow-far: rgba(100, 90, 70, 0.1);
}
.planet-sphere[data-pid="3"] {
  /* 授人以Skill：深青海洋星 */
  background: radial-gradient(circle at 37% 30%, #40A898, #124840 52%, #061E18);
  --planet-glow:     rgba(64, 168, 152, 0.45);
  --planet-glow-far: rgba(50, 140, 120, 0.12);
}
.planet-sphere[data-pid="4"] {
  /* 人心测量仪：暖雾淡红星 */
  background: radial-gradient(circle at 37% 30%, #A08090, #3A1E2E 52%, #160A10);
  --planet-glow:     rgba(160, 128, 144, 0.42);
  --planet-glow-far: rgba(140, 100, 120, 0.1);
}

/* Labels */
.planet-label {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.4;
  transition: color 300ms var(--ease);
}

.planet-item.selected .planet-label { color: var(--text-1); }
.planet-item:hover    .planet-label { color: var(--text-2); }

.planet-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-4);
  transition: color 300ms var(--ease);
}

.planet-item.selected .planet-count { color: var(--accent); }

/* Skeleton: 5 ghost circles */
.planet-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 180px;
}

.planet-skeleton-sphere {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #131b2e 0%, #1e2a40 50%, #131b2e 100%);
  background-size: 200% 200%;
  animation: shimmer 1.8s ease-in-out infinite;
}

.planet-skeleton-label {
  width: 60px;
  height: 10px;
  border-radius: 4px;
  background: #131b2e;
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Main Content Fade ── */
#main-content {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 400ms var(--ease), transform 400ms var(--ease);
}

#main-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Intro ── */
#intro-section {
  padding: 80px 24px;
}

.intro-container {
  max-width: 680px;
  margin: 0 auto;
}

#intro-lens-name {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 32px;
}

#intro-text {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--text-2);
  line-height: 2.2;
}

#intro-text p {
  margin-bottom: 24px;
}

#intro-text p:last-of-type {
  margin-bottom: 0;
}

.intro-disclaimer {
  margin-top: 40px !important;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-4);
  line-height: 1.8;
}

/* ── Quote Wall ── */
#quote-section {
  background: var(--bg-deep);
  /* Break out of any ancestor padding to full viewport width */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 64px 0;
}

#quote-wall {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0 max(32px, 5vw) 8px;
  scrollbar-width: none;
}

#quote-wall::-webkit-scrollbar { display: none; }

.quote-item {
  flex: 0 0 auto;
  width: clamp(280px, 30vw, 380px);
  scroll-snap-align: start;
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(13, 16, 23, 0.7);
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}

.quote-item:hover {
  border-color: var(--border-hov);
  box-shadow: 0 0 20px var(--glow-sm);
}

.quote-text {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text-1);
  line-height: 1.75;
  margin-bottom: 20px;
}

.quote-source {
  font-size: 13px;
  color: var(--text-4);
  line-height: 1.5;
}

/* ── Reading List ── */
#reading-section {
  padding: 64px 24px 80px;
  max-width: 900px;
  margin: 0 auto;
}

.reading-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}

.reading-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-4);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  text-decoration: none;
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease);
  gap: 20px;
}

.article-card:hover {
  border-color: var(--border-hov);
  box-shadow: 0 0 20px var(--glow-sm);
}

.article-card:hover .article-arrow { opacity: 1; }

.article-body { flex: 1; min-width: 0; }

.article-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.5;
  margin-bottom: 6px;
}

.article-summary {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.article-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-4);
  white-space: nowrap;
}

.article-arrow {
  font-size: 14px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

#show-all-btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  background: transparent;
  border: 1px solid rgba(74, 144, 164, 0.3);
  border-radius: 8px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 300ms var(--ease), background 300ms var(--ease);
}

#show-all-btn:hover {
  border-color: var(--accent);
  background: rgba(74, 144, 164, 0.05);
}

/* ── About ── */
#about {
  border-top: 1px solid var(--border);
  padding: 80px 24px 120px;
}

.about-container {
  max-width: 640px;
  margin: 0 auto;
}

.about-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text-1);
  margin-bottom: 32px;
}

.about-text p {
  font-size: 15px;
  color: var(--text-3);
  line-height: 2.0;
  margin-bottom: 18px;
}

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

/* ── Mobile ── */
@media (max-width: 900px) {
  #lens-nav { padding: 16px 20px; }
  #lens-cards { gap: 16px; }
  .planet-sphere { width: 52px; height: 52px; }
  .planet-label { font-size: 11px; }
}

@media (max-width: 768px) {
  #hero { padding: 80px 24px 80px; }

  .hero-quote {
    font-size: 19px;
    letter-spacing: 4px;
  }

  .hero-title { font-size: 32px; }

  /* Nav: horizontal scroll row on mobile */
  #lens-nav {
    position: static;
    padding: 16px 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #lens-cards {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 20px;
    padding: 0 24px;
    scrollbar-width: none;
  }

  #lens-cards::-webkit-scrollbar { display: none; }

  .planet-item {
    flex: 0 0 auto;
    max-width: 90px;
  }

  .planet-sphere { width: 48px; height: 48px; }
  .planet-label { font-size: 11px; }

  /* Intro */
  #intro-section { padding: 56px 24px; }
  #intro-lens-name { font-size: 22px; margin-bottom: 24px; }
  #intro-text { font-size: 15px; line-height: 2.0; }

  /* Quote wall */
  .quote-text { font-size: 18px; }
  .quote-item { width: 80vw; min-width: 260px; }

  /* Reading list */
  #reading-section { padding: 48px 24px 64px; }
}

@media (max-width: 480px) {
  .hero-quote { font-size: 16px; letter-spacing: 3px; }
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 14px; }
}
