/* ============================================
   eracle.me — Modern Dark Theme
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2234;
  --bg-card-hover: #1f2a3f;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.15);
  --accent-glow: rgba(45, 212, 191, 0.3);
  --border: #1e293b;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1100px;
  --nav-height: 60px;
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.8;
}

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

ul {
  list-style: none;
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
  max-width: 600px;
}

/* --- Fade-in Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav.scrolled {
  background: rgba(10, 14, 23, 0.95);
}

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

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--accent);
  opacity: 1;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: var(--transition);
  border-radius: 1px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 50% 50%, var(--accent-dim) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, -2%) scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero .title {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 24px;
}

.hero .summary {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.8;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}

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

.btn-primary:hover {
  opacity: 1;
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-dim);
  opacity: 1;
}

/* --- Journey (Storytelling Spotlights) --- */
.journey {
  background: var(--bg-secondary);
}

.journey-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.journey-intro .section-title {
  margin-bottom: 16px;
}

.journey-intro p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
}

.spotlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}

.spotlight:last-child {
  margin-bottom: 0;
}

.spotlight:nth-child(even) .spotlight-image {
  order: 2;
}

.spotlight:nth-child(even) .spotlight-content {
  order: 1;
}

.spotlight-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
}

.spotlight-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spotlight-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.spotlight-content .spotlight-period {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.spotlight-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.spotlight-content p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .spotlight {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 48px;
  }

  .spotlight:nth-child(even) .spotlight-image,
  .spotlight:nth-child(even) .spotlight-content {
    order: unset;
  }

  .spotlight-content h3 {
    font-size: 1.2rem;
  }
}

/* --- About --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

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

.about-detail-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
}

.about-detail-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.about-detail-card + .about-detail-card {
  margin-top: 20px;
}

.about-detail-card ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-detail-card li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding-left: 16px;
  position: relative;
}

.about-detail-card li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* --- Skills --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-category {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.skill-category:hover {
  border-color: var(--accent-dim);
}

.skill-category h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.skill-tag {
  background: var(--accent-dim);
  color: var(--text-primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

/* --- Experience Timeline --- */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

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

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

.timeline-item::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  z-index: 1;
}

.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.timeline-company {
  font-size: 1.2rem;
  font-weight: 700;
}

.timeline-role {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.timeline-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timeline-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.timeline-highlights {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-highlights li {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
}

.timeline-highlights li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* --- Projects --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-card h3 a {
  color: var(--text-primary);
}

.project-card h3 a:hover {
  color: var(--accent);
  opacity: 1;
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
}

/* --- Publications --- */
.publication {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.publication:last-child {
  margin-bottom: 0;
}

.publication h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.5;
}

.publication h3 a {
  color: var(--text-primary);
}

.publication h3 a:hover {
  color: var(--accent);
  opacity: 1;
}

.publication .pub-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.publication p:last-child {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Community --- */
.community-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.community-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  text-align: center;
}

.community-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.community-card .role {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* --- Footer --- */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
  transform: translateY(-2px);
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

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

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

  .community-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    padding: 14px 24px;
    font-size: 1rem;
  }

  .nav-toggle {
    display: block;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

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

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

  .timeline {
    padding-left: 32px;
  }

  .timeline-item::before {
    left: -32px;
    width: 12px;
    height: 12px;
  }

  .timeline::before {
    left: 5px;
  }

  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 100px 16px 60px;
  }

  .container {
    padding: 0 16px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
    max-width: 280px;
  }
}
