/* ============================================ */
/* CERRUDO2 — Enhanced Portfolio Stylesheet     */
/* Inspired by Odysseus UI + extra animations   */
/* ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:       #282c34;
  --bg2:      #1e2228;
  --panel:    #111;
  --panel2:   #1e2228;
  --fg:       #9cdef2;
  --heading:  #9cdef2;
  --muted:    #6b8a94;
  --border:   #355a66;
  --accent:   #e06c75;
  --accent2:  #f0989e;
  --green:    #50fa7b;
  --gold:     #f0ad4e;
  --radius:   8px;
  --glow:     0 0 20px rgba(224,108,117,0.3);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  scrollbar-color: var(--accent) var(--panel);
  scrollbar-width: thin;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent2); }
::selection { background: rgba(224,108,117,0.3); color: var(--fg); }


/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--accent), var(--accent2)); border-radius: 4px; border: 2px solid var(--panel); }
::-webkit-scrollbar-thumb:hover { background-color: var(--accent2); }

/* ── Animated Background (tsParticles) ── */
#tsparticles {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: 0.65;
}

/* Gradient overlays — drawn on top of canvas */
body::before {
  content: '';
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 550px at 82% -10%, rgba(224,108,117,0.14), transparent 60%),
    radial-gradient(1000px 550px at 0% 0%, rgba(53,90,102,0.35), transparent 55%),
    radial-gradient(800px 400px at 50% 100%, rgba(224,108,117,0.08), transparent 50%);
}

/* ── Layout ── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; position: relative; z-index: 1; }

/* ── Nav ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(17,17,17,0.85);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
nav.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,0.3); border-bottom-color: var(--accent); }
nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: 0.2px;
  color: var(--heading); text-decoration: none;
}
.brand img {
  height: 32px; width: auto;
  filter: brightness(0) saturate(100%) invert(88%) sepia(18%) saturate(1312%) hue-rotate(159deg) brightness(98%) contrast(93%);
  transition: filter 0.3s ease, transform 0.3s ease;
}
.brand:hover img { filter: brightness(0) saturate(100%) invert(56%) sepia(15%) saturate(1750%) hue-rotate(307deg) brightness(92%) contrast(93%); transform: scale(1.08); }

.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a {
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: color 0.15s ease; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--accent); }

/* Language toggle */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; font-size: 13px; background: var(--panel);
}
.lang-toggle button {
  background: none; border: none; color: var(--muted);
  padding: 5px 10px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-toggle button:hover { color: var(--fg); }
.lang-toggle button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

/* Hamburger (mobile) */
.hamburger-btn {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--fg); cursor: pointer;
  transition: border-color 0.15s ease;
}
.hamburger-btn:hover { border-color: var(--accent); }

.mobile-menu {
  display: none; position: fixed;
  top: 60px; left: 0; right: 0;
  background: rgba(17,17,17,0.98);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  padding: 16px 22px; flex-direction: column; gap: 8px;
  z-index: 99;
  animation: slideDown 0.3s cubic-bezier(.2,.7,.2,1);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: var(--muted); padding: 10px 12px; border-radius: 6px;
  font-size: 15px; transition: color 0.15s ease, background 0.15s ease;
}
.mobile-menu a:hover { color: var(--fg); background: rgba(156,222,242,0.06); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: none; }
}

/* ── Buttons ── */
/*
 * Liquid glass effect:
 * Multi-layer approach — translucent background + noise-free backdrop blur
 * + top-edge highlight + inner shadow for depth.
 * Works best over the animated particle background.
 */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px;
  font-weight: 600; font-size: 14px; font-family: inherit;
  cursor: pointer; position: relative; overflow: hidden;
  /* Glass base */
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--fg);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  /* Depth */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),   /* top edge highlight */
    inset 0 -1px 0 rgba(0,0,0,0.15),         /* bottom inner shadow */
    0 4px 20px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
/* Refraction sheen on hover */
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 55%, rgba(255,255,255,0.04) 100%);
  border-radius: inherit; pointer-events: none;
  transition: opacity 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.12),
    0 8px 30px rgba(0,0,0,0.3),
    0 0 20px rgba(156,222,242,0.12);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: rgba(224, 108, 117, 0.35);
  border: 1px solid rgba(224, 108, 117, 0.55);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 4px 20px rgba(224,108,117,0.25);
}
.btn-primary::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(255,255,255,0.04) 100%);
}
.btn-primary:hover {
  background: rgba(224, 108, 117, 0.48);
  border-color: rgba(240, 152, 158, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -1px 0 rgba(0,0,0,0.15),
    0 8px 30px rgba(224,108,117,0.4),
    0 0 24px rgba(224,108,117,0.2);
}

/* ── Sections ── */
section {
  padding: 90px 0;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
}
section.in { opacity: 1; transform: none; }

/* Alternating subtle backgrounds */
section:nth-of-type(odd)::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(17,17,17,0.25); z-index: -1;
}
section { position: relative; }

.eyebrow {
  color: var(--accent); font-weight: 700; font-size: 13px;
  letter-spacing: 0.12em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ''; width: 20px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.section-title {
  font-size: clamp(26px, 3.6vw, 36px);
  margin: 10px 0 14px; letter-spacing: -0.01em;
  color: var(--heading); font-weight: 700;
}
.section-sub { color: var(--muted); max-width: 620px; font-size: 15px; }

/* ── Hero ── */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding: 80px 0 60px; text-align: center;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
  position: relative; z-index: 1;
}
.hero.in { opacity: 1; transform: none; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--border);
  background: var(--panel); padding: 5px 14px; border-radius: 999px;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s 0.2s both;
}
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 8px var(--gold); }
  50%      { box-shadow: 0 0 18px var(--gold), 0 0 30px rgba(240,173,78,0.3); }
}

.hero-logo-wrapper {
  display: flex; justify-content: center; margin: 0 auto 20px;
  animation: floatLogo 3s ease-in-out infinite, fadeInUp 0.8s 0.3s both;
}
.hero-logo-img {
  display: block; width: 100px; height: auto;
  filter: brightness(0) saturate(100%) invert(88%) sepia(18%) saturate(1312%) hue-rotate(159deg) brightness(98%) contrast(93%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
}
.hero-logo-img:hover {
  transform: scale(1.15) rotate(-5deg);
  filter: brightness(0) saturate(100%) invert(56%) sepia(15%) saturate(1750%) hue-rotate(307deg) brightness(92%) contrast(93%) drop-shadow(0 8px 25px rgba(224,108,117,0.4));
}
@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.08; margin: 0 0 8px;
  letter-spacing: -0.02em; font-weight: 700;
  color: var(--heading);
  animation: fadeInUp 0.8s 0.4s both;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--heading), var(--accent), var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 8s ease-in-out infinite alternate;
}
@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 100% center; }
}

.hero .subtitle {
  font-size: clamp(15px, 2vw, 18px); color: var(--accent);
  font-weight: 500; margin-bottom: 12px;
  animation: fadeInUp 0.8s 0.5s both;
}
.hero .tagline {
  font-size: clamp(14px, 2.2vw, 17px);
  color: var(--muted); max-width: 680px; margin: 0 auto 30px;
  animation: fadeInUp 0.8s 0.6s both;
}

.hero-cta {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  animation: fadeInUp 0.8s 0.7s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* Terminal */
.term {
  max-width: 640px; margin: 40px auto 0; text-align: left;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  animation: fadeInUp 0.8s 0.8s both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.term:hover { transform: translateY(-3px); box-shadow: 0 30px 70px rgba(0,0,0,0.5); }
.term-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: #20242c;
}
.term-bar .dots { display: flex; gap: 6px; }
.term-bar .dots span { width: 10px; height: 10px; border-radius: 50%; }
.term-bar .dots span:nth-child(1) { background: #e06c75; }
.term-bar .dots span:nth-child(2) { background: var(--gold); }
.term-bar .dots span:nth-child(3) { background: var(--green); }
.term-bar .title { color: var(--muted); font-size: 12px; }
.term pre {
  margin: 0; padding: 18px 16px;
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 13.5px; color: var(--fg); line-height: 1.7;
  white-space: pre-wrap;
}
.term .prompt { color: var(--green); }
.term .comment { color: #828997; }
.term .val { color: var(--accent); }
.term .cursor {
  display: inline-block; color: var(--fg);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Typing animation for terminal */
.term-line {
  overflow: hidden; white-space: nowrap;
  border-right: 2px solid transparent;
}
.term-line.typing {
  animation: typing 1.5s steps(40) forwards;
  width: 0;
}
@keyframes typing { to { width: 100%; } }

/* ── About ── */
.about-grid {
  display: grid; grid-template-columns: 1fr 1.4fr;
  gap: 40px; align-items: start; margin-top: 32px;
}
.about-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; text-align: center;
  position: relative; overflow: hidden;
  transition: border-color 0.2s ease;
}
.about-card:hover { border-color: var(--accent); }
/* Glow corner effect */
.about-card::before {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(224,108,117,0.12), transparent 70%);
  pointer-events: none;
}
.about-card .avatar {
  width: 130px; height: 130px; border-radius: 50%;
  border: 2px solid var(--accent);
  margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(224,108,117,0.12), rgba(53,90,102,0.22));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(224,108,117,0.2);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.about-card:hover .avatar { box-shadow: 0 0 40px rgba(224,108,117,0.35); transform: scale(1.03); }
.about-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.about-card .name { font-size: 20px; font-weight: 700; color: var(--heading); }
.about-card .role { color: var(--accent); font-size: 13px; margin-top: 4px; }
.about-card .location { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 4px; }

.social-links { display: flex; gap: 10px; margin-top: 16px; justify-content: center; }
.social-link {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2); border: 1px solid var(--border); color: var(--muted);
  transition: all 0.2s ease;
}
.social-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); box-shadow: var(--glow); }

.about-info { display: flex; flex-direction: column; gap: 12px; }
.about-info-item {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.about-info-item:hover { border-color: var(--accent); transform: translateX(6px); box-shadow: -4px 0 20px rgba(224,108,117,0.1); }
.about-info-item .icon {
  width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(224,108,117,0.18), rgba(53,90,102,0.28));
  border: 1px solid var(--border); color: var(--accent); flex-shrink: 0;
}
.about-info-item h4 { font-size: 14px; color: var(--heading); margin-bottom: 3px; }
.about-info-item p { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── Experience (Timeline) ── */
.timeline { position: relative; margin-top: 36px; padding-left: 30px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--border), transparent);
}
.timeline-item {
  position: relative; margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.15s ease;
  opacity: 0; transform: translateX(-20px);
}
.timeline-item.in { opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.5s ease; }
.timeline-item:hover { border-color: var(--accent); transform: translateX(4px); }
.timeline-item::before {
  content: ''; position: absolute; left: -26px; top: 24px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  box-shadow: 0 0 10px rgba(224,108,117,0.4);
}
.timeline-item .date {
  font-size: 11px; color: var(--accent); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 4px;
}
.timeline-item h4 { font-size: 15px; color: var(--heading); margin-bottom: 2px; }
.timeline-item .company { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.timeline-item ul { padding-left: 16px; }
.timeline-item li {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  margin-bottom: 4px; list-style-type: '▸ ';
}
.timeline-item li::marker { color: var(--accent); }

/* ── Projects ── */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; margin-top: 32px;
}
.project-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative; overflow: hidden;
  /* Domino cascade */
  opacity: 0; transform: translateY(20px);
}
.project-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
/* Accent gradient on hover */
.project-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--gold));
  opacity: 0; transition: opacity 0.2s ease;
}
.project-card:hover::after { opacity: 1; }

section.in .project-card { animation: domino-in 0.5s cubic-bezier(.2,.7,.2,1) forwards; }
section.in .project-card:nth-child(1) { animation-delay: 0.05s; }
section.in .project-card:nth-child(2) { animation-delay: 0.10s; }
section.in .project-card:nth-child(3) { animation-delay: 0.15s; }
section.in .project-card:nth-child(4) { animation-delay: 0.20s; }
section.in .project-card:nth-child(5) { animation-delay: 0.25s; }
section.in .project-card:nth-child(6) { animation-delay: 0.30s; }

@keyframes domino-in { to { opacity: 1; transform: none; } }

.project-card .project-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(224,108,117,0.18), rgba(53,90,102,0.28));
  border: 1px solid var(--border); color: var(--accent);
  margin-bottom: 14px; font-size: 20px;
}
.project-card h3 { font-size: 16.5px; margin-bottom: 6px; color: var(--heading); }
.project-card p { color: var(--muted); font-size: 14px; flex: 1; line-height: 1.6; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.project-tag {
  font-size: 11px; color: var(--fg);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 10px; background: var(--bg2);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.project-tag:hover { border-color: var(--accent); color: var(--accent); }
.project-links { display: flex; gap: 10px; margin-top: 14px; }
.project-links a { font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 4px; }
.project-links a:hover { color: var(--accent2); }

/* ── Skills ── */
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; margin-top: 32px;
}
.skill-category {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  opacity: 0; transform: translateY(16px);
}
.skill-category:hover { border-color: var(--accent); box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
section.in .skill-category { animation: domino-in 0.5s cubic-bezier(.2,.7,.2,1) forwards; }
section.in .skill-category:nth-child(1) { animation-delay: 0.05s; }
section.in .skill-category:nth-child(2) { animation-delay: 0.13s; }
section.in .skill-category:nth-child(3) { animation-delay: 0.21s; }
section.in .skill-category:nth-child(4) { animation-delay: 0.29s; }
section.in .skill-category:nth-child(5) { animation-delay: 0.37s; }
section.in .skill-category:nth-child(6) { animation-delay: 0.45s; }

.skill-category h3 {
  font-size: 15px; color: var(--accent); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-item {
  font-size: 12.5px; color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 12px; background: var(--bg2);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.skill-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* ── Education ── */
.edu-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px; margin-top: 32px;
}
.edu-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
  opacity: 0; transform: translateY(16px);
}
.edu-card:hover { border-color: var(--accent); transform: translateY(-3px); }
section.in .edu-card { animation: domino-in 0.5s cubic-bezier(.2,.7,.2,1) forwards; }
section.in .edu-card:nth-child(1) { animation-delay: 0.05s; }
section.in .edu-card:nth-child(2) { animation-delay: 0.12s; }
section.in .edu-card:nth-child(3) { animation-delay: 0.19s; }

.edu-card .date { font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: 0.06em; margin-bottom: 6px; }
.edu-card h4 { font-size: 15px; color: var(--heading); margin-bottom: 4px; }
.edu-card .institution { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.edu-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.edu-card .grade {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 4px 10px;
  border: 1px solid var(--gold); border-radius: 999px;
  font-size: 11px; color: var(--gold); font-weight: 600;
}

/* ── Publications ── */
.pub-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-top: 32px;
  transition: border-color 0.2s ease;
  position: relative; overflow: hidden;
}
.pub-card:hover { border-color: var(--accent); }
.pub-card::before {
  content: '"'; position: absolute; top: -10px; right: 20px;
  font-size: 120px; color: rgba(224,108,117,0.06);
  font-family: serif; line-height: 1;
}
.pub-card h4 { font-size: 15px; color: var(--heading); margin-bottom: 6px; }
.pub-card .authors { font-size: 13px; color: var(--muted); margin-bottom: 4px; font-style: italic; }
.pub-card .journal { font-size: 12px; color: var(--accent); margin-bottom: 8px; }
.pub-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.pub-card .doi { font-size: 12px; color: var(--accent); margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; }

/* ── Contact ── */
.contact-content {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 32px; margin-top: 32px;
}
.contact-info { display: flex; flex-direction: column; gap: 14px; }
.contact-item {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.contact-item:hover { border-color: var(--accent); transform: translateX(6px); box-shadow: -4px 0 20px rgba(224,108,117,0.1); }
.contact-item .icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(224,108,117,0.18), rgba(53,90,102,0.28));
  border: 1px solid var(--border); color: var(--accent); flex-shrink: 0;
}
.contact-item h4 { font-size: 14px; color: var(--heading); margin-bottom: 2px; }
.contact-item p { font-size: 13px; color: var(--muted); }
.contact-item a { color: var(--accent); font-size: 13px; }

.contact-form {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.contact-form h3 { color: var(--heading); font-size: 16px; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.08em;
}
.form-group input,
.form-group textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--fg);
  font-family: inherit; font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 12px rgba(224,108,117,0.15); }
.form-group textarea { resize: vertical; min-height: 100px; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border); padding: 30px 0;
  color: var(--muted); font-size: 13px; position: relative; z-index: 1;
}
footer .wrap {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 12px;
}
footer .footer-links { display: flex; gap: 16px; }
footer .footer-links a { color: var(--muted); font-size: 13px; }
footer .footer-links a:hover { color: var(--accent); }

/* ── Scroll-to-top Button ── */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 50;
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.scroll-top.visible { opacity: 1; transform: none; pointer-events: auto; }
.scroll-top:hover { border-color: var(--accent); box-shadow: var(--glow); }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .hero, section, .project-card, .skill-category, .edu-card, .timeline-item { opacity: 1 !important; transform: none !important; }
  #bg-canvas { display: none; }
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger-btn { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-content { grid-template-columns: 1fr; }
  .timeline { padding-left: 24px; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: 28px; }
  section { padding: 60px 0; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .term { margin: 28px auto 0; }
}

