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

:root {
  /* Colors */
  --primary: #A04040;
  --primary-light: #C86060;
  --primary-bg: rgba(160, 64, 64, 0.06);
  --accent: #185FA5;
  --accent-light: #378ADD;
  --accent-bg: rgba(55, 138, 221, 0.06);
  --green: #0F6E56;
  --green-bg: rgba(15, 110, 86, 0.06);
  --amber: #BA7517;
  --amber-bg: rgba(186, 117, 23, 0.06);
  --pink: #993556;
  --pink-bg: rgba(153, 53, 86, 0.06);
  --bg: #FAF8F5;
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-warm: #F5F0EB;
  --text-primary: #2C2C2A;
  --text-secondary: #5F5E5A;
  --text-muted: #6F6D67;
  --border: rgba(44, 44, 42, 0.10);
  --border-hover: rgba(44, 44, 42, 0.22);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --nav-height: 64px;
  --section-padding: 100px 0;
  --container-width: 1100px;
  --gap: 24px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  /* Prevent text-first rendering: invisible until .page-loaded */
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Show page after background ready */
body.page-loaded {
  opacity: 1;
}

/* Fade-out state during navigation */
body.page-leaving {
  opacity: 0;
  pointer-events: none;
}

/* Background texture — HKU cinematic architectural (inner pages) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image: url('../assets/inner-bg.webp');
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  opacity: 0.38;
  filter: saturate(0.9);
}

/* Light warm overlay tint on background */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 20%, rgba(255,250,245,0.15), transparent),
    linear-gradient(to bottom, rgba(250,248,245,0.2) 0%, rgba(250,248,245,0.45) 70%, rgba(250,248,245,0.55) 100%);
}

/* ========== PAGE TRANSITION ========== */

/* Transition overlay — slides in during navigation */
.page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: var(--bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ========== NAVIGATION ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(250, 248, 245, 0.85);
  border-bottom: 0.5px solid var(--border);
  transition: box-shadow 0.3s ease;
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 500;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--primary);
  border-radius: 1px;
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.nav-hamburger span {
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.nav-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 5px);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -5px);
}

/* ========== LAYOUT ========== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

.section {
  padding: var(--section-padding);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--text-muted);
}

.section-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

/* ========== CARDS ========== */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  padding: 28px;
  transition: all 0.3s ease;
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.card-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-block;
}

.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 8px;
  line-height: 1.3;
}

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

/* Glassmorphism card */
.card-glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 28px;
}

/* ========== TAGS ========== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 400;
  border-radius: 20px;
  border: 0.5px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tag:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.tag-primary { background: var(--primary-bg); color: var(--primary); border-color: rgba(160, 64, 64, 0.15); }
.tag-accent { background: var(--accent-bg); color: var(--accent); border-color: rgba(55, 138, 221, 0.15); }
.tag-green { background: var(--green-bg); color: var(--green); border-color: rgba(15, 110, 86, 0.15); }
.tag-amber { background: var(--amber-bg); color: var(--amber); border-color: rgba(186, 117, 23, 0.15); }
.tag-pink { background: var(--pink-bg); color: var(--pink); border-color: rgba(153, 53, 86, 0.15); }

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

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(160, 64, 64, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 0.5px solid var(--border-hover);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.03);
}

/* ========== SCROLL REVEAL ========== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

/* ========== CURSOR GLOW ========== */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(160, 64, 64, 0.04), transparent 70%);
  transform: translate(-50%, -50%);
  transition: left 0.15s ease, top 0.15s ease;
}

/* ========== HERO (Home) ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
}

.hero-content {
  max-width: 720px;
}

.hero-greeting {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 72px);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-tagline {
  font-size: 20px;
  color: var(--primary);
  font-weight: 400;
  margin-bottom: 12px;
  line-height: 1.5;
}

.hero-motto {
  font-size: 16px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 36px;
  padding-left: 16px;
  border-left: 2px solid var(--primary);
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Metric row */
.hero-metrics {
  display: flex;
  gap: 40px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 0.5px solid var(--border);
}

.metric-item {
  text-align: left;
}

.metric-number {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

/* Decorative elements */
.hero-decoration {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 400px;
  opacity: 0.5;
}

.hero-circle-1 {
  position: absolute;
  right: 80px;
  top: 25%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 0.5px solid rgba(160, 64, 64, 0.12);
}

.hero-circle-2 {
  position: absolute;
  right: 160px;
  top: 35%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(160, 64, 64, 0.03);
}

/* ========== PROJECTS PAGE ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-top: 40px;
}

.project-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  padding: 32px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.project-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.project-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
}

.project-type {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.project-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 8px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.project-title-en {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.project-org {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.project-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  flex: 1;
  overflow-wrap: anywhere;
}

.project-desc p {
  margin: 0;
}

.project-desc-en {
  margin-top: 8px !important;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.project-stat {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  min-width: 0;
}

/* ========== TIMELINE PAGE ========== */
.timeline-wrapper {
  margin-top: 48px;
  position: relative;
  padding-left: 40px;
}

.timeline-line {
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -34px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-muted);
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(160, 64, 64, 0.12);
}

.timeline-item.highlight .timeline-dot {
  border-color: var(--primary);
  background: var(--primary);
  width: 12px;
  height: 12px;
  left: -35px;
  top: 5px;
}

.timeline-date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 6px;
}

.timeline-subtitle {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* ========== SKILLS PAGE ========== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: 40px;
}

.skill-category {
  background: var(--bg-card);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  padding: 28px;
  transition: all 0.3s ease;
}

.skill-category:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.skill-cat-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-cat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.skill-list {
  list-style: none;
}

.skill-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.04);
  font-size: 14px;
}

.skill-list li:last-child {
  border-bottom: none;
}

.skill-name {
  color: var(--text-primary);
}

.skill-level {
  display: flex;
  gap: 3px;
}

.skill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.skill-dot.filled {
  background: var(--primary);
}

/* Radar chart area */
.radar-container {
  margin-top: 40px;
  text-align: center;
}

.radar-canvas {
  max-width: 400px;
  margin: 0 auto;
}

/* ========== INTERESTS PAGE ========== */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: 40px;
}

.interest-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  padding: 32px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: default;
}

.interest-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.interest-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}

.interest-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 6px;
}

.interest-detail {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.interest-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========== READING PAGE ========== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  margin-top: 40px;
}

.book-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  padding: 24px;
  transition: all 0.3s ease;
  display: flex;
  gap: 16px;
}

.book-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.book-cover {
  width: 60px;
  height: 80px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.book-info {
  flex: 1;
  min-width: 0;
}

.book-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 4px;
  line-height: 1.3;
}

.book-author {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.book-quote {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.book-status {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* ========== NOW PAGE ========== */
.now-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-top: 40px;
}

.now-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  padding: 28px;
  transition: all 0.3s ease;
}

.now-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.now-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
}

.now-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 8px;
}

.now-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.now-updated {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 40px;
  text-align: center;
}

/* ========== ABOUT PAGE ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 40px;
  align-items: start;
}

.about-photo {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 12px;
  object-fit: cover;
  border: 0.5px solid var(--border);
}

.about-text h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 16px;
  margin-top: 28px;
}

.about-text h3:first-child {
  margin-top: 0;
}

.about-text p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.about-quote {
  font-size: 18px;
  color: var(--primary);
  font-style: italic;
  padding: 20px 24px;
  border-left: 3px solid var(--primary);
  margin: 24px 0;
  line-height: 1.6;
}

.edu-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.04);
}

.edu-year {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  min-width: 80px;
}

.edu-detail {
  font-size: 14px;
}

.edu-school {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.edu-program {
  color: var(--text-secondary);
}

/* ========== CONTACT PAGE ========== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 40px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.contact-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.contact-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.contact-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ========== FOOTER ========== */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 0.5px solid var(--border);
  margin-top: 80px;
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-text a {
  color: var(--primary);
  text-decoration: none;
}

.footer-text a:hover {
  text-decoration: underline;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-card.featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .interests-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .now-grid {
    grid-template-columns: 1fr;
  }
  .hero-decoration {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --section-padding: 64px 0;
    --gap: 16px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: rgba(250, 248, 245, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 32px;
    flex-direction: column;
    gap: 4px;
    border-bottom: 0.5px solid var(--border);
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: flex;
    width: 100%;
    padding: 12px 2px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 0.5px solid rgba(44,44,42,0.07);
  }

  .nav-links li:last-child a {
    border-bottom: 0;
  }

  .nav-hamburger {
    display: flex;
  }

  .hero-name {
    font-size: 40px;
  }

  .hero-tagline {
    font-size: 17px;
  }

  .hero-metrics {
    flex-direction: column;
    gap: 20px;
  }

  .section-title {
    font-size: 28px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

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

  .container {
    padding: 0 20px;
  }

  .section-desc,
  .card-text,
  .detail-event-desc {
    line-height: 1.75;
  }

  .detail-back {
    margin-bottom: 28px;
  }

  .detail-title {
    font-size: 34px;
  }

  .detail-subtitle {
    font-size: 16px;
    margin-bottom: 24px;
  }

  .detail-location {
    margin-bottom: 32px;
    align-items: flex-start;
  }

  .detail-narrative {
    font-size: 15.5px;
    line-height: 1.85;
    margin-bottom: 40px;
  }

  .detail-event {
    padding: 18px;
  }

  .detail-reflection {
    padding: 22px;
  }

  .detail-reflection p {
    font-size: 16px;
  }
}

/* ========== PRINT ========== */
@media print {
  .nav, .cursor-glow, .hero-decoration {
    display: none;
  }
  body::before,
  body::after {
    display: none;
  }
  .section {
    padding: 32px 0;
  }
}

/* ========== TIMELINE DETAIL PAGE ========== */

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s, gap 0.3s;
}

.detail-back:hover {
  color: var(--text-primary);
  gap: 12px;
}

.detail-back svg {
  width: 18px;
  height: 18px;
}

.detail-period {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.15;
  margin-bottom: 8px;
}

.detail-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 32px;
}

.detail-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.detail-location svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

/* Photo Gallery */
.detail-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.detail-photo-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 0.5px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.detail-photo-card img {
  width: 100%;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.detail-photo-caption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Photo placeholder (when no real photo yet) */
.detail-photo-placeholder {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--bg-warm), var(--bg));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.detail-photo-placeholder svg {
  width: 28px;
  height: 28px;
  opacity: 0.3;
}

/* Narrative section */
.detail-narrative {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 720px;
  margin-bottom: 48px;
}

.detail-narrative strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Separator */
.detail-separator {
  width: 48px;
  height: 1px;
  background: var(--border-hover);
  margin: 0 0 24px;
}

.detail-section-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 24px;
}

/* Event list */
.detail-events {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}

.detail-event {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  border: 0.5px solid var(--border);
  padding: 20px 24px;
  transition: border-color 0.3s, transform 0.3s;
}

.detail-event:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.detail-event-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.detail-event-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 4px;
}

.detail-event-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.detail-event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* Reflection section */
.detail-reflection {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 0.5px solid var(--border);
  padding: 32px;
  max-width: 640px;
  margin-bottom: 48px;
}

.detail-reflection p {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.detail-reflection p strong {
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 900px) {
  .detail-photos {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .detail-photos {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .detail-title { font-size: 32px; }
  .detail-narrative { font-size: 15px; }
}
