/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
  --bg-primary: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.03);
  --text-primary: #e4e4e8;
  --text-secondary: #8888a0;
  --text-muted: #5a5a72;
  --accent: #c9a96e;
  --accent-dim: rgba(201, 169, 110, 0.15);
  --accent-glow: rgba(201, 169, 110, 0.3);
  --border: rgba(255, 255, 255, 0.06);
  --border-active: rgba(255, 255, 255, 0.12);
  --font-cn: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-en: "SF Pro Display", "Inter", system-ui, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-cn);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Scroll Container
   ======================================== */
.scroll-container {
  width: 100%;
  height: 100%;
}

/* ========================================
   Section Common
   ======================================== */
.section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.section-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  padding: 0 40px;
}

.section-title {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 60px;
  text-align: center;
}

/* ========================================
   Section: Home
   ======================================== */
.section-home .section-inner {
  text-align: center;
}

.home-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 30px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  letter-spacing: 0;
}

.home-name {
  font-family: var(--font-en);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 12px;
  opacity: 0;
}

.home-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  margin-bottom: 36px;
  opacity: 0;
}

.home-divider {
  width: 40px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
  margin: 0 auto 36px;
}

.home-motto {
  font-size: 15px;
  line-height: 2;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  cursor: pointer;
  user-select: none;
  transition: color 0.4s;
}

.home-motto:hover {
  color: var(--text-secondary);
}

.home-motto p {
  margin: 0;
}

.home-motto-main {
  opacity: 0;
}

.home-motto-alt {
  display: none;
}

.home-email {
  display: inline-block;
  margin-top: 32px;
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  padding: 8px 20px;
  border: 1px solid var(--accent-dim);
  border-radius: 100px;
  transition: background 0.4s, border-color 0.4s;
}

.home-email:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* Typewriter Cursor */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: baseline;
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ========================================
   Scroll Hint
   ======================================== */
.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  z-index: 2;
  animation: hintPulse 2.4s ease-in-out infinite;
}

.scroll-hint-text {
  font-size: 11px;
  letter-spacing: 0.2em;
}

.scroll-hint-arrow {
  opacity: 0.6;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(6px); }
}

/* ========================================
   Section: Experience
   ======================================== */
.section-experience .section-inner {
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-experience .section-title {
  margin-bottom: 24px;
}

/* Experience Card */
.exp-card-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 48px;
  height: 340px;
}

.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  max-height: 100%;
  overflow-y: auto;
  transition: border-color 0.6s, box-shadow 0.6s;
}

.exp-card::-webkit-scrollbar {
  width: 4px;
}

.exp-card::-webkit-scrollbar-track {
  background: transparent;
}

.exp-card::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 2px;
}

.exp-card.is-active {
  border-color: var(--accent-dim);
  box-shadow: 0 0 40px rgba(201, 169, 110, 0.05);
}

.exp-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.exp-card-period {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
  padding: 3px 10px;
  background: var(--accent-dim);
  border-radius: 4px;
}

.exp-card-role {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.exp-card-company {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.exp-card-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: 16px;
}

.exp-card-body {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.exp-card-body ul {
  list-style: none;
  padding: 0;
}

.exp-card-body li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 4px;
}

.exp-card-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.exp-card-achievements {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.exp-card-achievements .label {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

/* Timeline Area */
.timeline-area {
  position: relative;
  width: 100%;
  height: 100px;
  overflow: hidden;
}

.timeline-scroll-track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 180%;
  display: flex;
  align-items: center;
  will-change: transform;
}

.timeline-rail {
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 1px;
  background: var(--border);
  transform: translateY(-0.5px);
}

.timeline-node {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: default;
}

.node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-active);
  border: 2px solid var(--bg-primary);
  transition: background 0.4s, box-shadow 0.4s;
}

.timeline-node.is-active .node-dot {
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.node-label {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: color 0.4s;
}

.timeline-node.is-active .node-label {
  color: var(--accent);
}

/* Character */
.character {
  position: absolute;
  bottom: 38px;
  left: 0;
  z-index: 2;
  will-change: transform;
}

.character-shadow {
  width: 16px;
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  margin: 2px auto 0;
}

.character.walking .arm-left,
.character.walking .arm-right {
  animation: armSwing 0.5s ease-in-out infinite alternate;
}

.character.walking .arm-right {
  animation-delay: -0.25s;
}

.character.walking .leg-left,
.character.walking .leg-right {
  animation: legSwing 0.5s ease-in-out infinite alternate;
}

.character.walking .leg-right {
  animation-delay: -0.25s;
}

@keyframes armSwing {
  0% { transform: rotate(-8deg); transform-origin: 20px 23px; }
  100% { transform: rotate(8deg); transform-origin: 20px 23px; }
}

@keyframes legSwing {
  0% { transform: rotate(8deg); transform-origin: 20px 33px; }
  100% { transform: rotate(-8deg); transform-origin: 20px 33px; }
}

.timeline-hint {
  position: absolute;
  bottom: 28px;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  animation: hintFade 2s ease-in-out infinite;
}

@keyframes hintFade {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ========================================
   Section: Interests
   ======================================== */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 640px;
  margin: 0 auto;
}

.interest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  text-align: center;
  transition: border-color 0.5s, transform 0.5s;
}

.interest-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.interest-icon {
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.interest-card h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}

.interest-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========================================
   Section: Hobbies
   ======================================== */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 640px;
  margin: 0 auto;
}

.hobby-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 16px 28px;
  text-align: center;
  transition: border-color 0.5s, transform 0.5s;
}

.hobby-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.hobby-icon {
  font-size: 36px;
  margin-bottom: 14px;
  line-height: 1;
}

.hobby-card h3 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* ========================================
   Navigation Dots
   ======================================== */
.nav-dots {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 100;
}

.nav-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-active);
  border: none;
  cursor: pointer;
  transition: background 0.5s, transform 0.3s, box-shadow 0.5s;
  padding: 0;
}

.nav-dots .dot:hover {
  background: var(--text-secondary);
  transform: scale(1.3);
}

.nav-dots .dot.is-active {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: scale(1.2);
}

.section.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .section-inner {
    padding: 0 24px;
  }

  .interests-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hobbies-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .exp-card-container {
    height: 280px;
    margin-bottom: 32px;
  }

  .exp-card {
    padding: 20px 20px;
  }

  .timeline-scroll-track {
    width: 240%;
  }

  .nav-dots {
    right: 12px;
  }

  .home-name {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .hobbies-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hobby-card {
    padding: 24px 12px 20px;
  }

  .hobby-icon {
    font-size: 28px;
  }
}
