/* ===================================================
   STYLE.CSS — Portofolio Rahmat Haikal
   =================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.7;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.no-scroll {
  overflow: hidden;
}

/* ===================================================
   TEMA: Light Mode (Default)
   =================================================== */
body {
  --bg-primary:       #f8f9fa;
  --bg-secondary:     #ffffff;
  --bg-alt:           #eef2f7;
  --text-primary:     #1a1a2e;
  --text-secondary:   #4a5568;
  --text-muted:       #718096;
  --accent:           #2563eb;
  --accent-hover:     #1d4ed8;
  --accent-light:     #dbeafe;
  --border:           #e2e8f0;
  --shadow:           rgba(0, 0, 0, 0.08);
  --shadow-md:        rgba(0, 0, 0, 0.15);
  --navbar-bg:        rgba(255, 255, 255, 0.95);
  --card-bg:          #ffffff;
  --timeline-line:    #2563eb;
  --footer-bg:        #1a1a2e;
  --footer-text:      #a0aec0;

  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* ===================================================
   TEMA: Dark Mode
   =================================================== */
body.dark {
  --bg-primary:       #0f172a;
  --bg-secondary:     #1e293b;
  --bg-alt:           #162032;
  --text-primary:     #f1f5f9;
  --text-secondary:   #cbd5e1;
  --text-muted:       #94a3b8;
  --accent:           #60a5fa;
  --accent-hover:     #3b82f6;
  --accent-light:     #1e3a5f;
  --border:           #334155;
  --shadow:           rgba(0, 0, 0, 0.4);
  --shadow-md:        rgba(0, 0, 0, 0.6);
  --navbar-bg:        rgba(15, 23, 42, 0.97);
  --card-bg:          #1e293b;
  --timeline-line:    #60a5fa;
  --footer-bg:        #020617;
  --footer-text:      #64748b;

  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* ===================================================
   UTILITIES
   =================================================== */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

ul {
  list-style: none;
}

/* ===================================================
   NAVBAR
   =================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 5%;
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  padding: 0.6rem 5%;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px var(--shadow);
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  text-decoration: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-item {
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after,
.nav-link:hover::after {
  width: 70%;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  color: var(--text-primary);
}

.dark-mode-toggle:hover {
  background: var(--accent-light);
  transform: rotate(20deg);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.bar {
  display: block;
  width: 25px;
  height: 2.5px;
  background: var(--text-primary);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.hamburger.active .bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger.active .bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ===================================================
   SECTIONS (common)
   =================================================== */
.section {
  padding: 90px 0 70px;
}

.section.alt-background {
  background-color: var(--bg-alt);
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
  color: var(--text-primary);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===================================================
   HERO SECTION
   =================================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-alt) 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

.hero-section .container {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.hero-content {
  flex: 1;
  min-width: 280px;
}

.hero-content h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 1.8rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.profile-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--accent);
  box-shadow: 0 0 0 8px var(--accent-light), 0 20px 60px var(--shadow-md);
  flex-shrink: 0;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn:not(.btn-secondary) {
  background: var(--accent);
  color: #fff;
}

.btn:not(.btn-secondary):hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* ===================================================
   ABOUT
   =================================================== */
.about-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  max-width: 780px;
  text-align: justify;
}

/* ===================================================
   EXPERIENCE / TIMELINE
   =================================================== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  margin-bottom: 1.8rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item:hover {
  transform: translateX(6px);
  box-shadow: 0 8px 30px var(--shadow-md);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.6rem;
  top: 1.8rem;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent);
}

.timeline-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.timeline-item .date {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.timeline-item ul {
  list-style: disc;
  padding-left: 1.2rem;
}

.timeline-item ul li {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

/* ===================================================
   EDUCATION
   =================================================== */
.education-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.education-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  border-left: 4px solid var(--accent);
}

.education-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow-md);
}

.education-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.education-item .date {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.education-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===================================================
   GALLERY
   =================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}

.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 32px var(--shadow-md);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(37, 99, 235, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay i {
  color: #fff;
  font-size: 2rem;
}

/* ===================================================
   MODAL
   =================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(6px);
}

.modal-content {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: zoomIn 0.3s ease;
}

#caption {
  color: #fff;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.close {
  position: fixed;
  top: 1.2rem;
  right: 1.8rem;
  font-size: 2.4rem;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}

.close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* ===================================================
   SOCIAL MEDIA
   =================================================== */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.social-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

.social-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px var(--shadow-md);
}

.card-image-wrapper {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.social-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.social-card:hover .social-image {
  transform: scale(1.06);
}

.card-content {
  padding: 1.2rem;
}

.card-content i {
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.card-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.card-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Social brand colors */
.social-card.whatsapp .card-content i   { color: #25D366; }
.social-card.instagram .card-content i  { color: #E1306C; }
.social-card.telegram .card-content i   { color: #0088cc; }
.social-card.facebook .card-content i   { color: #1877F2; }
.social-card.youtube .card-content i    { color: #FF0000; }
.social-card.linkedin .card-content i   { color: #0A66C2; }
.social-card.tiktok .card-content i     { color: #010101; }
.social-card.github .card-content i     { color: var(--text-primary); }

/* ===================================================
   SKILLS
   =================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.4rem;
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1rem;
  text-align: center;
  box-shadow: 0 4px 14px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px var(--shadow-md);
  border-color: var(--accent);
}

.skill-icon {
  width: 80px;
  height: 60px;
  object-fit: contain;
  margin: 0 auto 1rem;
  border-radius: 6px;
}

.skill-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.4;
}

/* ===================================================
   CONTACT
   =================================================== */
.contact-intro {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}

.contact-info p {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  color: var(--text-secondary);
}

.contact-info i {
  color: var(--accent);
  width: 20px;
  text-align: center;
}

.contact-info a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.contact-info a:hover {
  color: var(--accent);
}

.signature {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.8;
}

/* ===================================================
   FOOTER
   =================================================== */
.footer {
  background: var(--footer-bg);
  padding: 1.6rem 0;
  text-align: center;
}

.footer p {
  color: var(--footer-text);
  font-size: 0.88rem;
}

/* ===================================================
   ANIMATIONS
   =================================================== */
@keyframes zoomIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

@keyframes fadeInUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(50px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-50px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* Initial hidden state for animated elements */
.section-title,
.about-content p,
.timeline-item,
.education-item,
.contact-intro,
.contact-info,
.signature,
.gallery-item,
.social-card,
.skill-card {
  opacity: 0;
}

.fade-in {
  animation: fadeIn 0.7s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.7s ease forwards;
}

.slide-in-right {
  animation: slideInRight 0.7s ease forwards;
}

.slide-in-left {
  animation: slideInLeft 0.7s ease forwards;
}

/* Hero immediate animations (no scroll needed) */
.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* ===================================================
   RESPONSIVE — Mobile
   =================================================== */
@media (max-width: 768px) {

  /* Navbar */
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.3rem;
    background: var(--bg-secondary);
    padding: 2rem 1.5rem;
    box-shadow: -4px 0 30px var(--shadow-md);
    transition: right 0.35s ease;
    z-index: 999;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-link {
    font-size: 1rem;
    padding: 0.6rem 0.5rem;
    width: 100%;
  }

  /* Hero */
  .hero-section .container {
    flex-direction: column;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 0.97rem;
  }

  .hero-buttons {
    justify-content: center;
  }

  .profile-photo {
    width: 170px;
    height: 170px;
  }

  /* Section title */
  .section-title {
    font-size: 1.6rem;
  }

  /* Timeline */
  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-item::before {
    left: -2.1rem;
  }

  /* Gallery & grids */
  .gallery-grid,
  .social-grid,
  .skills-grid,
  .education-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.6rem;
  }

  .profile-photo {
    width: 140px;
    height: 140px;
  }

  .btn {
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
  }
}