/* =========================================================
   PORTFOLIO - Muhammad Dhiya Ulhaq Zuhdi
   Palet warna: hijau tua #1b4332 / hijau #40916c / hijau muda #74c69d
   Font: 'Montserrat', sans-serif
   ========================================================= */

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

:root {
  --dark: #12181b;
  --dark-2: #1b2a23;
  --primary: #40916c;
  --primary-dark: #1b4332;
  --primary-light: #74c69d;
  --accent: #d8f3dc;
  --text: #2f3b36;
  --text-light: #6b7a74;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(18, 24, 27, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
}

.section-tag {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 60px auto;
}

.section-head p {
  color: var(--text-light);
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.3s ease;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(64, 145, 108, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--primary-dark);
  transform: translateY(-3px);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 22px 0;
  transition: 0.35s ease;
  background: transparent;
}

.navbar.scrolled {
  padding: 14px 0;
  background: rgba(18, 24, 27, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
}

.nav-brand span {
  color: var(--primary-light);
}

.nav-menu {
  display: flex;
  gap: 36px;
}

.nav-menu a {
  color: var(--white);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
  transition: 0.25s;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--primary-light);
  transition: 0.3s;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a:hover {
  color: var(--primary-light);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1100;
}

.nav-toggle span {
  width: 26px;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: 0.3s;
}

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

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

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

/* ---------- Home / Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 55%, var(--primary-dark) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(116, 198, 157, 0.18) 0%, transparent 70%);
  top: -150px;
  right: -150px;
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.hero-text {
  flex: 1 1 480px;
  color: var(--white);
}

.hero-text .greet {
  color: var(--primary-light);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.hero-text h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-text h2 {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--primary-light);
  margin-bottom: 20px;
}

.hero-text p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 480px;
  margin-bottom: 34px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-photo {
  flex: 1 1 320px;
  display: flex;
  justify-content: center;
}

.hero-photo .frame {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  padding: 8px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--dark-2);
}

.scroll-down {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--white);
  opacity: 0.75;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.scroll-down .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: bounceDown 1.6s infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: 0.4; }
}

/* ---------- Tentang Saya ---------- */
.about {
  background: var(--white);
}

.about .container {
  display: flex;
  gap: 60px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.about-text {
  flex: 1 1 520px;
}

.about-text p {
  margin-bottom: 18px;
  color: var(--text-light);
}

.about-info {
  flex: 1 1 320px;
  background: var(--accent);
  border-radius: 16px;
  padding: 32px;
}

.about-info ul li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(27, 67, 50, 0.12);
  font-size: 0.95rem;
}

.about-info ul li:last-child {
  border-bottom: none;
}

.about-info ul li span:first-child {
  font-weight: 600;
  color: var(--primary-dark);
}

.about-info ul li span:last-child {
  color: var(--text);
  text-align: right;
}

/* ---------- Pendidikan (timeline) ---------- */
.education {
  background: #f4f9f6;
}

.timeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(64, 145, 108, 0.25);
}

.timeline-item {
  position: relative;
  padding: 0 0 44px 60px;
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--primary);
}

.timeline-item .year {
  display: inline-block;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.timeline-item h3 {
  font-size: 1.15rem;
  color: var(--dark);
  margin-bottom: 4px;
}

.timeline-item p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ---------- Keahlian ---------- */
.skills {
  background: var(--white);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 60px;
  max-width: 860px;
  margin: 0 auto;
}

.skill-item .skill-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--dark);
}

.skill-bar {
  width: 100%;
  height: 10px;
  border-radius: 6px;
  background: #e6efe9;
  overflow: hidden;
}

.skill-bar .fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 1.4s ease;
}

/* ---------- Portofolio ---------- */
.portfolio {
  background: #f4f9f6;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.portfolio-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 0.35s ease;
}

.portfolio-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(18, 24, 27, 0.15);
}

.portfolio-card .thumb {
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--dark);
}

.portfolio-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s ease;
}

.portfolio-card:hover .thumb img {
  transform: scale(1.08);
}

.portfolio-body {
  padding: 24px;
}

.portfolio-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.portfolio-body h3 {
  font-size: 1.2rem;
  color: var(--dark);
  margin-bottom: 8px;
}

.portfolio-body p {
  color: var(--text-light);
  font-size: 0.92rem;
}

/* ---------- Kontak ---------- */
.contact {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
  color: var(--white);
}

.contact .section-title,
.contact .section-tag {
  color: var(--white);
}

.contact .section-tag {
  color: var(--primary-light);
}

.contact .section-head p {
  color: rgba(255, 255, 255, 0.7);
}

.contact-wrap {
  display: flex;
  gap: 50px;
  flex-wrap: wrap;
}

.contact-info {
  flex: 1 1 280px;
}

.contact-info .item {
  display: flex;
  gap: 16px;
  margin-bottom: 26px;
}

.contact-info .icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(116, 198, 157, 0.15);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.contact-info .item h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--primary-light);
}

.contact-info .item p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.92rem;
}

.contact-form {
  flex: 1 1 420px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  transition: 0.25s;
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.1);
}

.form-error {
  color: #ff8a8a;
  font-size: 0.82rem;
  margin-top: 6px;
  display: none;
}

.contact-form button {
  width: 100%;
  border: none;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 26px 0;
  font-size: 0.88rem;
}

.footer span {
  color: var(--primary-light);
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: 0.3s ease;
  z-index: 900;
  box-shadow: var(--shadow);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
}

/* ---------- Fade-in animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about .container,
  .contact-wrap {
    flex-direction: column;
  }

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

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

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

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 260px;
    background: var(--dark-2);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    transition: 0.35s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-text h1 {
    font-size: 2.2rem;
  }

  .hero .container {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }

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

  .hero-photo .frame {
    width: 220px;
    height: 220px;
  }

  .section-title {
    font-size: 1.7rem;
  }
}

@media (max-width: 480px) {
  .hero-photo .frame {
    width: 180px;
    height: 180px;
  }

  .contact-form,
  .about-info {
    padding: 22px;
  }
}

/* =========================================================
   ADMIN - Login & Dashboard
   ========================================================= */

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 55%, var(--primary-dark) 100%);
  padding: 24px;
}

.login-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 44px;
  max-width: 420px;
  width: 100%;
  color: var(--white);
  text-align: center;
}

.login-brand {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 1.5rem;
}

.login-card h1 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.login-hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 22px;
}

.login-hint strong {
  color: var(--primary-light);
}

.login-error {
  background: rgba(255, 138, 138, 0.15);
  color: #ff8a8a;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.login-form {
  text-align: left;
}

.login-submit {
  width: 100%;
  border: none;
  margin-top: 6px;
}

.login-back {
  display: inline-block;
  margin-top: 22px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  transition: 0.25s;
}

.login-back:hover {
  color: var(--primary-light);
}

/* ---------- Admin Navbar ---------- */
.admin-navbar {
  position: relative;
  background: var(--dark);
  padding: 18px 0;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--white);
  font-size: 0.92rem;
}

.admin-logout-btn {
  padding: 10px 22px;
  font-size: 0.88rem;
}

/* ---------- Admin Dashboard ---------- */
.admin-dashboard {
  min-height: 100vh;
  padding-top: 140px;
  background: var(--accent);
}

.admin-head {
  margin-bottom: 40px;
}

.admin-table-wrap {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(18, 24, 27, 0.08);
  font-size: 0.92rem;
}

.admin-table th {
  color: var(--dark);
  font-weight: 700;
  background: var(--accent);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table td:nth-child(4) {
  max-width: 320px;
}

.admin-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-light);
}

@media (max-width: 600px) {
  .admin-navbar .container {
    flex-wrap: wrap;
    gap: 10px;
  }

  .admin-user {
    width: 100%;
    justify-content: space-between;
  }
}
