/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #f5c842;
  --accent-dim: rgba(245, 200, 66, 0.15);
  --border: #222222;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: auto;
  background: var(--bg-primary);
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ===== Particle Canvas ===== */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Custom Cursor ===== */
.custom-cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: width 0.2s, height 0.2s, background 0.2s;
  transform: translate(-50%, -50%);
}

.custom-cursor.hovering {
  width: 40px;
  height: 40px;
  background: var(--accent-dim);
  mix-blend-mode: normal;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition), padding var(--transition);
}

.nav.scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 48px;
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

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

.nav-links a:hover::after {
  width: 100%;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.7) 40%,
    rgba(0, 0, 0, 0.3) 70%,
    transparent 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 48px;
}

.hero-text {
  max-width: 700px;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-name-line {
  display: block;
}

.hero-name-accent {
  color: var(--accent);
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  min-height: 1.8em;
  margin-bottom: 40px;
  font-weight: 300;
}

.hero-tagline .cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== Hero CTA ===== */
.hero-cta {
  position: relative;
}

.btn-magnetic {
  display: inline-block;
  position: relative;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.btn-arrow {
  transition: transform var(--transition);
}

.btn-primary:hover .btn-arrow {
  transform: translateY(2px);
}

/* ===== Section Shared ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 120px 0;
  background: var(--bg-primary);
}

.section-dark {
  background: var(--bg-secondary);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
}

.section-header {
  margin-bottom: 64px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-line {
  width: 60px;
  height: 2px;
  background: var(--accent);
}

/* ===== About - Year Tabs ===== */
.year-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.year-tab {
  padding: 10px 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.year-tab:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.year-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

/* ===== Year Panels ===== */
.year-panels {
  max-width: 700px;
  margin: 0 auto;
}

.year-panel {
  display: none;
}

.year-panel.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-year {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 32px;
  font-family: var(--font-mono);
}

/* ===== Event List ===== */
.event-list {
  list-style: none;
  position: relative;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.event-item {
  position: relative;
  padding: 0 0 36px 24px;
}

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

.event-dot {
  position: absolute;
  left: -29px;
  top: 4px;
  width: 10px;
  height: 10px;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  border-radius: 50%;
}

.event-content {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
}

.event-content::after {
  content: '→';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  opacity: 0;
  transition: all var(--transition);
}

.event-content:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 0 20px rgba(245, 200, 66, 0.08);
}

.event-content:hover::after {
  opacity: 1;
  right: 16px;
  color: var(--accent);
}

.event-name {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  padding-right: 24px;
}

.event-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== Contact ===== */
.contact-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  min-width: 240px;
  flex: 1;
  max-width: 320px;
}

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

.contact-icon {
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-card h4 {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.contact-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== Social Links ===== */
.social-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.social-link {
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color var(--transition);
  font-weight: 500;
}

.social-link:hover {
  color: var(--accent);
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  padding: 32px 48px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ===== Hero Parallax ===== */
.hero-bg-img {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all var(--transition);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-4px);
}

/* ===== Page Transition ===== */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg-primary);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.page-transition.active {
  opacity: 1;
}

/* ===== Rich Text (event detail) ===== */
.rich-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.9;
}
.rich-text p {
  margin-bottom: 1.2em;
}
.rich-text p:last-child {
  margin-bottom: 0;
}
.rich-text blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-primary);
  font-style: italic;
}
.rich-text .highlight {
  background: linear-gradient(120deg, transparent 0%, var(--accent-dim) 40%, var(--accent-dim) 60%, transparent 100%);
  padding: 0 8px;
  border-radius: 4px;
  color: var(--accent);
  font-weight: 500;
}
.rich-text img {
  border-radius: var(--radius-md);
  margin: 32px auto;
  border: 1px solid var(--border);
}
.rich-text p > code {
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* ===== Gallery Image Loading ===== */
.gallery-item .img-placeholder {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.gallery-item img.loaded {
  animation: imgReveal 0.3s ease-out;
}
@keyframes imgReveal {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.gallery-item img.error-fallback {
  object-fit: none;
  padding: 24px;
  opacity: 0.4;
}

/* ===== Gallery Grid Entrance ===== */
.gallery-item {
  opacity: 0;
  transform: translateY(20px);
  animation: galleryEnter 0.4s ease-out forwards;
}
.gallery-item:nth-child(1) { animation-delay: 0.02s; }
.gallery-item:nth-child(2) { animation-delay: 0.06s; }
.gallery-item:nth-child(3) { animation-delay: 0.10s; }
.gallery-item:nth-child(4) { animation-delay: 0.14s; }
.gallery-item:nth-child(5) { animation-delay: 0.18s; }
.gallery-item:nth-child(6) { animation-delay: 0.22s; }
.gallery-item:nth-child(7) { animation-delay: 0.26s; }
.gallery-item:nth-child(8) { animation-delay: 0.30s; }
@keyframes galleryEnter {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Scroll Animation ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
/* ===== Touch Feedback ===== */
@media (hover: none) {
  .event-content:active,
  .contact-card:active,
  .gallery-item:active {
    transform: scale(0.97);
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 20px 24px;
  }
  .nav.scrolled {
    padding: 14px 24px;
  }
  .hero-content {
    padding: 0 24px;
  }
  .container {
    padding: 0 24px;
  }

  .section {
    padding: 80px 0;
  }

  .nav-links {
    gap: 20px;
  }

  .year-tab {
    padding: 8px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .nav-links a {
    font-size: 0.8rem;
  }
  .hero-content {
    padding: 0 20px;
  }
  .social-links {
    gap: 20px;
  }
}
