/* ============================================================
   Saefurrohman — Portfolio Styles
   Dark theme · slate/black base · indigo/violet accents
   ============================================================ */

:root {
  --ink-800: #0a0a0f;
  --ink-700: #0f0f17;
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
}

html { scroll-padding-top: 5rem; }

body { -webkit-font-smoothing: antialiased; }

/* ===== Ambient backgrounds ===== */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(99, 102, 241, 0.18) 0%, transparent 60%),
    radial-gradient(55% 45% at 85% 20%, rgba(139, 92, 246, 0.16) 0%, transparent 55%),
    radial-gradient(50% 50% at 50% 100%, rgba(99, 102, 241, 0.10) 0%, transparent 60%),
    var(--ink-800);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

/* ===== Navbar ===== */
#navbar { background: transparent; }
#navbar.scrolled {
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-link {
  position: relative;
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  color: rgb(148, 163, 184); /* slate-400 */
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.nav-link.active { color: #fff; }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-violet));
}

/* ===== Text gradient ===== */
.text-gradient {
  background: linear-gradient(120deg, #818cf8 0%, #a78bfa 50%, #c084fc 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, var(--accent-indigo), var(--accent-violet));
  box-shadow: 0 8px 30px -8px rgba(99, 102, 241, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 12px 36px -8px rgba(139, 92, 246, 0.7); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(139, 92, 246, 0.5); transform: translateY(-2px); }

/* ===== Section headers ===== */
.section-label {
  display: inline-flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-violet);
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
}

/* ===== Stat cards ===== */
.stat-card {
  padding: 1.25rem;
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(120deg, #fff, #a78bfa);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { margin-top: 0.35rem; font-size: 0.8rem; color: rgb(148, 163, 184); }

/* ===== Skill cards & pills ===== */
.skill-card {
  padding: 1.5rem;
  border-radius: 1.1rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.skill-card:hover { border-color: rgba(139, 92, 246, 0.4); transform: translateY(-3px); }

.skill-icon {
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.75rem;
  font-size: 1.25rem;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgb(226, 232, 240);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}
.pill:hover {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.12);
}

.pill-sm {
  display: inline-flex;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgb(148, 163, 184);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* ===== Timeline ===== */
.timeline-rail {
  position: absolute;
  left: 19px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-indigo), var(--accent-violet), transparent);
  opacity: 0.35;
}
@media (min-width: 768px) {
  .timeline-rail { left: 23px; }
}

.timeline-item { position: relative; padding-left: 3.5rem; }
@media (min-width: 768px) {
  .timeline-item { padding-left: 4rem; }
}

.timeline-dot {
  position: absolute;
  left: 0; top: 0;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink-700);
  border: 2px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 4px rgba(10, 10, 15, 0.9), 0 0 24px -6px rgba(139, 92, 246, 0.6);
  font-size: 1.05rem;
  z-index: 1;
}
@media (min-width: 768px) {
  .timeline-dot { width: 48px; height: 48px; font-size: 1.2rem; }
}

.timeline-card {
  padding: 1.5rem;
  border-radius: 1.1rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.timeline-card:hover { border-color: rgba(139, 92, 246, 0.35); transform: translateX(4px); }

.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent-violet);
  background: rgba(139, 92, 246, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.bullet {
  position: relative;
  padding-left: 1.25rem;
}
.bullet::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-violet);
  opacity: 0.7;
}

/* ===== Project cards ===== */
.project-card {
  padding: 1.75rem;
  border-radius: 1.1rem;
  background: linear-gradient(165deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-5px);
  box-shadow: 0 20px 50px -20px rgba(99, 102, 241, 0.4);
}
.project-emoji {
  display: grid; place-items: center;
  width: 3.5rem; height: 3.5rem;
  border-radius: 1rem;
  font-size: 1.75rem;
  background: linear-gradient(160deg, rgba(99,102,241,0.18), rgba(139,92,246,0.12));
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* ===== Education ===== */
.edu-card {
  padding: 1.75rem;
  border-radius: 1.1rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.3s ease;
}
.edu-card:hover { border-color: rgba(139, 92, 246, 0.4); }
.edu-icon {
  display: grid; place-items: center;
  width: 3.5rem; height: 3.5rem; flex-shrink: 0;
  border-radius: 1rem;
  font-size: 1.6rem;
  background: linear-gradient(160deg, rgba(99,102,241,0.18), rgba(139,92,246,0.12));
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* ===== Contact cards ===== */
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1.1rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01));
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.contact-card:hover { border-color: rgba(139, 92, 246, 0.45); transform: translateY(-3px); }
.contact-icon {
  display: grid; place-items: center;
  width: 3rem; height: 3rem; flex-shrink: 0;
  border-radius: 0.9rem;
  color: var(--accent-violet);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
  transition: color 0.3s ease;
}
.contact-card:hover .contact-icon { color: #fff; }

/* ===== Mouse scroll cue ===== */
.mouse-cue {
  width: 22px; height: 36px;
  border: 2px solid currentColor;
  border-radius: 14px;
  position: relative;
  opacity: 0.6;
}
.mouse-cue::after {
  content: "";
  position: absolute;
  top: 6px; left: 50%;
  width: 3px; height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: currentColor;
  animation: scrollWheel 1.6s ease-in-out infinite;
}
@keyframes scrollWheel {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ===== Typing cursor ===== */
.typed-cursor {
  color: var(--accent-violet);
  font-weight: 400;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== Reveal-on-scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
