/* ==========================================================================
   数字群岛 · 岛主个人门户 (Daozhu Portfolio 2026)
   Master Design System - Rico UI Visual Language × Daozhu Island Soul
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Noto+Serif+SC:wght@400;500;600;700;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Light Mode Tokens (Clean Modern Studio & Warm Terracotta) */
  --bg-primary: #FAF9F6;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F4EFEA;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(250, 249, 246, 0.85);

  --text-primary: #181512;
  --text-secondary: #4A443D;
  --text-muted: #82786D;
  --text-inverse: #FAF9F6;

  /* Daozhu Signature Clay & Editorial Accents */
  --brand-primary: #B45A3C;            /* 故事陶土棕 */
  --brand-primary-hover: #96442A;
  --brand-primary-soft: rgba(180, 90, 60, 0.08);
  --brand-primary-border: rgba(180, 90, 60, 0.20);
  --brand-glow: rgba(180, 90, 60, 0.16);

  --brand-secondary: #2C4A3E;          /* 森林苔绿 */
  --brand-secondary-soft: rgba(44, 74, 62, 0.08);
  --brand-cyan: #2A9D8F;
  --brand-gold: #D4883A;
  --brand-blue: #3B72DE;

  --border-line: rgba(180, 90, 60, 0.14);
  --border-subtle: rgba(24, 21, 18, 0.07);
  --border-dark: #243757;

  --shadow-sm: 0 2px 6px rgba(24, 21, 18, 0.04);
  --shadow-md: 0 10px 28px -8px rgba(70, 45, 30, 0.09);
  --shadow-lg: 0 24px 50px -12px rgba(70, 45, 30, 0.14);
  --shadow-glow: 0 0 45px -10px var(--brand-glow);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: 'Noto Serif SC', 'Songti SC', serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Tokens (Deep Space Obsidian & Ember Terracotta) */
html.dark {
  --bg-primary: #0A0E17;
  --bg-secondary: #111726;
  --bg-tertiary: #172033;
  --bg-card: rgba(17, 23, 38, 0.88);
  --bg-glass: rgba(10, 14, 23, 0.86);

  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --text-inverse: #0A0E17;

  --brand-primary: #E07A5F;            /* 亮丽故事余烬橙 */
  --brand-primary-hover: #F28C70;
  --brand-primary-soft: rgba(224, 122, 95, 0.15);
  --brand-primary-border: rgba(224, 122, 95, 0.28);
  --brand-glow: rgba(224, 122, 95, 0.28);

  --brand-secondary: #52B788;
  --brand-secondary-soft: rgba(82, 183, 136, 0.14);
  --brand-cyan: #48CAE4;
  --brand-gold: #F4A261;
  --brand-blue: #60A5FA;

  --border-line: rgba(224, 122, 95, 0.20);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-dark: #1E293B;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 26px 60px -12px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 50px -10px var(--brand-glow);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease-smooth), color 0.4s var(--ease-smooth);
}

::selection {
  background: var(--brand-primary);
  color: #FFFFFF;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.25s var(--ease-smooth);
}

img, svg, video {
  display: block;
  max-width: 100%;
}

button, input {
  font: inherit;
}

/* Atmospheric Background Grid Pattern (Rico UI Signature) */
.ambient-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1000px;
  background-size: 36px 36px;
  background-image: 
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 65%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 65%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

.ambient-glow-top {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, 92vw);
  height: 520px;
  background: radial-gradient(50% 50% at 50% 50%, var(--brand-glow) 0%, transparent 80%);
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
}

/* Common Container */
.container {
  width: 100%;
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 4.5vw, 44px);
  padding-right: clamp(20px, 4.5vw, 44px);
  position: relative;
  z-index: 10;
}

/* Typography Helpers */
.font-serif {
  font-family: var(--font-serif);
}

.font-mono {
  font-family: var(--font-mono);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 1.1rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 0.9rem;
}

.section-subtitle {
  font-size: clamp(1.02rem, 1.4vw, 1.16rem);
  color: var(--text-secondary);
  max-width: 660px;
  line-height: 1.8;
  margin-bottom: 3.4rem;
}

/* Animated Blur-in Text (Rico UI Signature) */
.animated-text {
  display: inline;
}

.animated-text .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  filter: blur(10px);
  transition: opacity 0.65s var(--ease-spring), transform 0.65s var(--ease-spring), filter 0.65s var(--ease-spring);
  will-change: transform, filter, opacity;
}

.animated-text.in .word {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Designer Artboard Corner Markers (case-square from Rico UI) */
.case-solid {
  position: relative;
}

.case-square {
  position: absolute;
  width: 9px;
  height: 9px;
  background-color: var(--bg-primary);
  border: 2px solid var(--brand-primary);
  z-index: 25;
  transition: all 0.3s ease;
}

.case-square.top-l { top: -4px; left: -4px; }
.case-square.top-r { top: -4px; right: -4px; }
.case-square.bot-l { bottom: -4px; left: -4px; }
.case-square.bot-r { bottom: -4px; right: -4px; }

/* Micro-Tag Badges */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary-border);
  transition: all 0.25s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 9999px;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s var(--ease-smooth);
}

.btn-primary {
  background: var(--brand-primary);
  color: #FFFFFF;
  box-shadow: 0 6px 22px -4px var(--brand-glow);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -6px var(--brand-glow);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-2px);
}

/* ── 右侧旅程导航 (Journey Navigation from v2) ── */
.journey-nav {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 70;
}

.journey-dot {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--text-muted);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: all 0.35s var(--ease-spring);
}

.journey-dot::after {
  content: attr(data-label);
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  font-family: var(--font-serif);
  transition: opacity 0.25s ease;
}

.journey-dot:hover::after {
  opacity: 1;
}

.journey-dot.active {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  transform: scale(1.3);
}

.journey-dot.active::after {
  opacity: 1;
  color: var(--brand-primary);
  font-weight: 600;
}

@media (max-width: 1024px) {
  .journey-nav {
    display: none;
  }
}

/* ── 海岛环境音乐播放按钮 (Ambient Music from v2) ── */
.music-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 75;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-line);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-spring);
}

.music-btn:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--brand-primary);
}

.music-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
  fill: none;
  stroke-width: 1.8;
}

.music-btn.playing {
  border-color: var(--brand-primary);
  background: var(--brand-primary-soft);
}

.music-btn.playing svg {
  stroke: var(--brand-primary);
}

.music-btn .music-bars {
  display: none;
  gap: 2px;
  align-items: flex-end;
  height: 16px;
}

.music-btn.playing .music-bars {
  display: flex;
}

.music-btn.playing .music-icon-note {
  display: none;
}

.music-bars span {
  width: 2.5px;
  background: var(--brand-primary);
  border-radius: 2px;
  animation: soundEq 1s ease-in-out infinite;
}

.music-bars span:nth-child(1) { height: 6px; animation-delay: 0s; }
.music-bars span:nth-child(2) { height: 14px; animation-delay: 0.2s; }
.music-bars span:nth-child(3) { height: 9px; animation-delay: 0.4s; }
.music-bars span:nth-child(4) { height: 16px; animation-delay: 0.1s; }

@keyframes soundEq {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* ── v2 经典漂浮海岛插图动效 (Island & Wave Animation) ── */
.island-scene {
  width: min(320px, 80vw);
  margin: 0 auto;
}

.island-scene .wave {
  animation: waveMove 6s ease-in-out infinite;
}

.island-scene svg {
  animation: islandFloat 7s var(--ease-smooth) infinite;
}

@keyframes waveMove {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-8px); }
}

@keyframes islandFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── Rico UI 社交卡片悬叠交互 (Social Cards Stacking) ── */
.social-cards-wrapper {
  margin-top: 1.8rem;
  margin-bottom: 1.8rem;
}

.social-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.social-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  box-shadow: var(--shadow-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s var(--ease-smooth);
}

.social-item:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.social-item svg {
  width: 15px;
  height: 15px;
}

/* Back to Top Floating Button */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 80px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.35s var(--ease-spring);
  z-index: 60;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
  transform: translateY(-3px) scale(1.05);
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease-smooth), transform 0.65s var(--ease-smooth);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
