:root {
  --red: #7B2D26;
  --gold: #D4A017;
  --teal: #19647E;
  --ivory: #F2E8CF;
  --dark: #1F1F1F;
}

/* ====== BASE ====== */
body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--ivory);
  color: var(--dark);
  margin: 0;
  padding: 0;
  transition: background-color 0.4s, color 0.4s;
}

/* ====== HEADER ====== */
header {
  background-color: var(--red);
  padding: 15px 0;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

nav a {
  background: var(--gold);
  color: var(--dark);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 3px #b68900;
  transition: all 0.2s ease;
}

nav a:hover {
  transform: translateY(-2px);
  background: #f2c94c;
}

/* ====== SECTIONS ====== */
main {
  padding: 40px 20px;
  text-align: center;
}

section {
  display: none;
  animation: fadeIn 0.6s ease;
}

section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== HOME ====== */
.profile-photo {
  width: 200px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  margin: 20px 0;
  transition: transform 0.4s;
}
.profile-photo:hover { transform: scale(1.05); }

/* ====== ABOUT ====== */
.about-card {
  max-width: 600px;
  margin: 20px auto;
  background-color: #fff7e6;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  padding: 20px;
  text-align: left;
}

.data-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dotted #ccc;
  flex-wrap: wrap; /* biar otomatis turun kalau teks panjang */
  word-wrap: break-word;
  overflow-wrap: anywhere; /* biar email panjang tidak keluar kotak */
}
.data-row span {
  font-weight: bold;
  color: var(--red);
  width: 45%;
  min-width: 120px;
}
.data-row p {
  margin: 0;
  text-align: right;
  width: 50%;
  word-break: break-word;
}

/* ====== HOBI & SKILL ====== */
.hobi-list, .skill-list {
  list-style: none;
  padding: 0;
  text-align: center;
}
.hobi-list li, .skill-list li {
  display: inline-block;
  background: var(--gold);
  color: var(--dark);
  margin: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
}

/* ====== PORTFOLIO ====== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 30px;
  justify-items: center;
}
.card {
  background: white;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 300px;
}
.card img {
  width: 100%;
  border-radius: 8px;
  height: 180px;
  object-fit: cover;
}
.card p {
  margin-top: 10px;
  color: var(--teal);
  font-weight: 500;
}

/* ====== FORM ====== */
form {
  max-width: 400px;
  margin: 30px auto;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  text-align: left;
}
label {
  font-weight: 600;
}
input, textarea {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
}
button {
  background-color: var(--teal);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}
button:hover {
  background-color: var(--red);
  transform: scale(1.03);
}

/* ====== FLOATING BUTTONS ====== */
.floating-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.floating-buttons button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 20px;
  background-color: var(--gold);
  color: var(--dark);
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.floating-buttons button:hover {
  background-color: var(--red);
  color: #fff;
}

/* ====== FOOTER ====== */
footer {
  background-color: var(--red);
  color: var(--ivory);
  text-align: center;
  padding: 15px;
  margin-top: 40px;
}

/* ====== DARK MODE FIX ====== */
body.dark-mode {
  background-color: #1B1B1B;
  color: #f0f0f0;
}
body.dark-mode header, body.dark-mode footer {
  background-color: var(--teal);
  color: white;
}
body.dark-mode nav a {
  background-color: var(--gold);
  color: var(--dark);
  box-shadow: 0 3px #c29100;
}
body.dark-mode nav a:hover {
  background-color: #e0b200;
  color: #111;
}
body.dark-mode .about-card,
body.dark-mode .card,
body.dark-mode form {
  background-color: #2a2a2a;
  color: #fff;
}
body.dark-mode .data-row span {
  color: var(--gold);
}
body.dark-mode .hobi-list li,
body.dark-mode .skill-list li {
  background-color: var(--gold);
  color: var(--dark);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  nav a { padding: 8px 14px; font-size: 15px; }
  .profile-photo { width: 150px; }
  .about-card { width: 90%; }
  .card img { height: 160px; }
}
@media (max-width: 480px) {
  .data-row { flex-direction: column; align-items: start; }
  .data-row p { text-align: left; }
}