/* ============================================
   RAYEN DHAHRI — Anime-Dark Theme
   Pure CSS, no dependencies
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #10101c;
  --bg-card: rgba(16, 16, 32, 0.65);
  --bg-card-hover: rgba(24, 24, 48, 0.8);
  --text-primary: #e4e4f0;
  --text-secondary: #9898b8;
  --text-muted: #6a6a8a;
  --accent-blue: #00d4ff;
  --accent-purple: #8b5cf6;
  --accent-pink: #f472b6;
  --accent-cyan: #22d3ee;
  --accent-green: #34d399;
  --glow-blue: 0 0 20px rgba(0, 212, 255, 0.3);
  --glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);
  --glow-pink: 0 0 20px rgba(244, 114, 182, 0.3);
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 212, 255, 0.15);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-display: 'Outfit', var(--font-main);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition), text-shadow var(--transition);
}

a:hover {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

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

::selection {
  background: rgba(139, 92, 246, 0.35);
  color: #fff;
}

/* --- Background Effects --- */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
}

.bg-glow-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-purple);
  top: -200px;
  right: -150px;
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-blue);
  bottom: -150px;
  left: -100px;
}

.bg-glow-3 {
  width: 400px;
  height: 400px;
  background: var(--accent-pink);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.06;
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0 2rem;
  transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border-glass), 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.nav-logo:hover {
  color: var(--accent-blue);
  text-shadow: var(--glow-blue);
}

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

.nav-logo .logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-blue);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

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

.nav-links a {
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-blue);
  background: rgba(0, 212, 255, 0.06);
  text-shadow: none;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--accent-blue);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
}

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

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

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

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

/* --- Layout --- */
.main-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: 70px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
}

.section-header {
  margin-bottom: 3rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.75rem;
}

.section-label::before {
  content: '//';
  color: var(--accent-blue);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  max-width: 600px;
}

/* --- Hero Section --- */
.hero {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  position: relative;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  z-index: 1;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-purple);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-greeting .wave {
  display: inline-block;
  animation: wave 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-name .name-gradient {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-shift 4s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-title {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero-title .typed-text {
  color: var(--accent-cyan);
  border-right: 2px solid var(--accent-cyan);
  padding-right: 3px;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  50% { border-color: transparent; }
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: var(--transition);
}

.social-icon:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: var(--glow-blue);
  transform: translateY(-2px);
  text-shadow: none;
}

/* Hero Visual */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-avatar-wrapper {
  position: relative;
  width: 340px;
  height: 340px;
}

.hero-avatar-ring {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: conic-gradient(from 0deg, var(--accent-blue), var(--accent-purple), var(--accent-pink), var(--accent-blue)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.hero-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.2), 0 0 80px rgba(0, 212, 255, 0.1);
}

.hero-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  border: 3px solid var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.2), 0 0 80px rgba(0, 212, 255, 0.1);
}

.hero-goku-gif {
  width: 120%;
  height: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 25px rgba(0, 212, 255, 0.4)) drop-shadow(0 0 50px rgba(139, 92, 246, 0.2));
  animation: goku-float 4s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes goku-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-12px); }
}

/* Credly Badges */
.credly-badges {
  margin: 1rem 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.credly-badge-link {
  text-decoration: none;
  color: inherit;
}

.credly-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.credly-badge:hover {
  border-color: #76b900;
  box-shadow: 0 0 20px rgba(118, 185, 0, 0.15), 0 4px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.credly-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(118, 185, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.credly-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.credly-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.credly-issuer {
  font-size: 0.8rem;
  color: #76b900;
  font-weight: 500;
}

/* Floating badges around avatar */
.floating-badge {
  position: absolute;
  padding: 0.4rem 0.75rem;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  animation: float 3s ease-in-out infinite;
}

.floating-badge:nth-child(3) {
  top: 10%;
  right: -30px;
  animation-delay: 0s;
}

.floating-badge:nth-child(4) {
  bottom: 15%;
  left: -40px;
  animation-delay: 1s;
}

.floating-badge:nth-child(5) {
  bottom: 5%;
  right: -20px;
  animation-delay: 2s;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 212, 255, 0.4);
  color: #fff;
  text-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: var(--glow-blue);
  text-shadow: none;
}

/* --- Cards --- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), transparent, rgba(139, 92, 246, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.glass-card:hover::before {
  opacity: 1;
}

/* --- Highlights / Stats Section --- */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.highlight-card {
  text-align: center;
  padding: 2rem;
}

.highlight-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.highlight-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

/* --- Featured Project Cards --- */
.featured-projects {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.featured-card {
  padding: 0;
  overflow: hidden;
  border-left: 3px solid var(--accent-blue);
}

.featured-content {
  padding: 2.5rem;
}

.featured-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-green);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.featured-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.featured-card:hover .featured-title {
  color: var(--accent-blue);
}

.featured-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.featured-desc strong {
  color: var(--text-primary);
}

.featured-metrics {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.metric {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: var(--radius-sm);
  min-width: 120px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.2rem;
}

.featured-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

/* --- Project Cards --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.project-card {
  padding: 2rem;
}

.project-category {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-org {
  font-size: 0.85rem;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.12);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-blue);
}

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

.project-link svg {
  transition: transform var(--transition);
}

.project-link:hover svg {
  transform: translateX(3px);
}

/* --- Category Filter --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-blue);
  border-color: rgba(0, 212, 255, 0.3);
}

/* --- Blog Cards --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  padding: 2rem;
}

.blog-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.blog-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  transition: color var(--transition);
}

.blog-card:hover .blog-title {
  color: var(--accent-blue);
}

.blog-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.blog-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-top: 1rem;
}

/* --- Publications --- */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-card {
  padding: 2rem;
}

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-purple);
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pub-venue {
  font-size: 0.9rem;
  color: var(--accent-blue);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.pub-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.pub-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pub-link {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  transition: var(--transition);
}

.pub-link:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  text-shadow: none;
}

/* --- CV / Timeline --- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-purple), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 1.5rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent-blue);
  z-index: 1;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.timeline-item:hover .timeline-dot {
  background: var(--accent-blue);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.timeline-desc li {
  margin-bottom: 0.25rem;
  list-style: none;
  position: relative;
  padding-left: 1.25rem;
}

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

/* --- Skills Grid --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.skill-card {
  padding: 1.25rem;
  text-align: center;
}

.skill-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.08);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.12);
}

/* --- Blog Post Page --- */
.post-header {
  padding: 4rem 0 2rem;
  text-align: center;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  max-width: 800px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-content {
  max-width: 750px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.post-content h2,
.post-content h3 {
  font-family: var(--font-display);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.post-content h2 {
  font-size: 1.5rem;
}

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

.post-content p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15rem 0.4rem;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 4px;
  color: var(--accent-cyan);
}

.post-content blockquote {
  border-left: 3px solid var(--accent-purple);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(139, 92, 246, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-glass);
  padding: 3rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

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

.footer-text .heart {
  color: var(--accent-pink);
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent-blue);
}

/* --- Animations (scroll reveal) --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.35s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(9) { transition-delay: 0.45s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(10) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* --- About Page --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

.about-photo-wrapper {
  position: relative;
}

.about-photo {
  width: 100%;
  border-radius: var(--radius);
  border: 2px solid var(--border-glass);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.about-photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.about-info h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--accent-blue);
}

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

.about-info p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-info ul {
  list-style: none;
  padding: 0;
}

.about-info ul li {
  color: var(--text-secondary);
  padding: 0.3rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.about-info ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-purple);
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* --- Education Section on CV --- */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.edu-card {
  padding: 1.75rem;
}

.edu-degree {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.edu-school {
  font-size: 0.9rem;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
}

.edu-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Page Header (for inner pages) --- */
.page-hero {
  padding: 5rem 0 3rem;
  text-align: center;
}

/* --- Anime Decorative Elements --- */
.anime-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  border-radius: 2px;
  margin: 1rem 0;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.anime-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent-blue);
  opacity: 0.15;
}

.anime-corner.tl {
  top: -5px;
  left: -5px;
  border-right: none;
  border-bottom: none;
}

.anime-corner.br {
  bottom: -5px;
  right: -5px;
  border-left: none;
  border-top: none;
}

/* Kanji watermark */
.kanji-watermark {
  position: fixed;
  font-size: 15rem;
  font-weight: 900;
  color: rgba(139, 92, 246, 0.02);
  z-index: 0;
  pointer-events: none;
  writing-mode: vertical-rl;
  right: 5%;
  top: 20%;
  user-select: none;
}

/* --- Responsive --- */
@media (max-width: 968px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-text {
    order: 2;
  }

  .hero-visual {
    order: 1;
  }

  .hero-desc {
    margin: 0 auto 2rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-socials {
    justify-content: center;
  }

  .hero-avatar-wrapper {
    width: 250px;
    height: 250px;
  }

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

  .about-photo-wrapper {
    max-width: 300px;
    margin: 0 auto;
  }

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

  .featured-metrics {
    gap: 1rem;
  }

  .metric {
    min-width: 100px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 18, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

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

  .nav-links a {
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .container {
    padding: 0 1.25rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .floating-badge {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

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

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

/* --- Loading Animation --- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-ring {
  width: 50px;
  height: 50px;
  border: 3px solid transparent;
  border-top-color: var(--accent-blue);
  border-right-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin-loader 0.8s linear infinite;
}

@keyframes spin-loader {
  to { transform: rotate(360deg); }
}

/* --- Utility --- */
.text-gradient {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
