/* ============================================================
   1. CSS RESET & GLOBAL STYLES
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #000;
  color: #fff;
  font-family: 'Libre Baskerville', serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Reset default link styling */
a {
  text-decoration: none;
  color: inherit;
}

/* Prevent anchor links from being hidden behind sticky header */
section {
  scroll-margin-top: 80px;
}

/* Snap scrolling — only for pages that need it */
.snap-page {
  scroll-snap-type: y proximity;
}

.snap-page .hero,
.snap-page .main-header {
  scroll-snap-align: start;
}

/* ============================================================
   2. TYPOGRAPHY & FONT FAMILIES
   ============================================================ */

/* UI & Metadata — Montserrat, all caps */
.nav-btn,
.categories a,
.metadata,
.btn-login,
.read-more {
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 500;
  font-size: 0.75rem;
}

/* Brand & Headings — Playfair Display */
.brand,
h1, h2, h3,
.post-info h3 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #1a1a1a;
}

/* Overlap text (hero) */
.overlap-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 900;
  text-transform: lowercase;
  font-size: 4rem;
  position: absolute;
  bottom: 40px;
  right: -70px;
  z-index: 2;
  pointer-events: none;
  text-shadow: 10px 10px 30px rgba(0, 0, 0, 0.8);
  color: white;
  display: flex;
  flex-direction: column;
  line-height: 0.9;
}

/* ============================================================
   3. HERO SECTION (BLACK BACKGROUND)
   ============================================================ */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hero-container {
  display: flex;
  align-items: flex-end;
  gap: 120px;
}

.photo-wrapper {
  position: relative;
}

.main-photo {
  width: 300px;
  height: 450px;
  object-fit: cover;
  border-radius: 20px;
  display: block;
}

/* Sidebar buttons — height matches photo */
.button-sidebar {
  display: flex;
  flex-direction: column;
  width: 400px;
  height: 450px;
}

.nav-btn {
  flex: 1;
  color: #888;
  border-top: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.3s ease;
  padding: 0 5px;
}

.nav-btn:last-child {
  border-bottom: 1px solid #333;
}

.nav-btn:hover {
  color: #fff;
  letter-spacing: 5px;
  padding-left: 15px;
}

/* ============================================================
   4. MAIN HEADER & NAVIGATION (WHITE BACKGROUND)
   ============================================================ */
.main-header {
  position: sticky;
  top: 0;
  background: #fff;
  color: #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  border-bottom: 1px solid #eee;
  z-index: 100;
}

.main-header a {
  text-decoration: none !important;
}

.brand {
  font-size: 1.3rem;
  color: #000;
}

.categories {
  display: flex;
  align-items: center;
}

.categories a {
  margin-left: 25px;
  color: #888;
  transition: 0.3s;
}

.categories a:hover {
  color: #000;
}

/* Lock icon link */
.lock-link {
  display: flex;
  align-items: center;
  margin-left: 30px;
}

.lock-icon {
  width: 16px;
  height: auto;
  filter: grayscale(100%);
  opacity: 0.4;
  transition: 0.3s ease;
}

.lock-link:hover .lock-icon {
  filter: grayscale(0%);
  opacity: 1;
  transform: translateY(-1px);
}

/* Hamburger menu (hidden by default) */
.menu-toggle,
.burger-icon {
  display: none;
}

/* ============================================================
   5. ARTICLE LIST & CONTENT (WHITE BACKGROUND)
   ============================================================ */
.content-section {
  background: #fff;
  color: #000;
  padding: 80px 20px;
}

.container {
  max-width: 850px;
  margin: auto;
}

/* Post card layout */
.post-card {
  display: flex;
  gap: 40px;
  margin-bottom: 80px;
  align-items: flex-start;
}

.post-image-mini {
  width: 240px;
  flex-shrink: 0;
}

.post-image-mini img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 12px;
  filter: grayscale(100%);
  transition: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover img {
  filter: grayscale(0%);
  transform: scale(1.03);
}

.post-content {
  flex: 1;
}

.post-title {
  font-size: 2rem;
  color: #1a1a1a;
  margin-bottom: 15px;
  line-height: 1.1;
}

.post-excerpt {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.05rem;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.read-more {
  font-weight: 700;
  border-bottom: 2px solid #000;
  padding-bottom: 5px;
  transition: 0.3s;
}

.read-more:hover {
  letter-spacing: 5px;
}

/* Full article body styling */
.article-body {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.article-body p {
  margin-bottom: 25px;
}

/* ============================================================
   6. CV PAGE STYLES
   ============================================================ */
.cv-page {
  background-color: #fff !important;
  color: #000 !important;
}

.cv-content {
  padding-top: 120px;
  max-width: 900px;
  margin: 0 auto;
}

.cv-section {
  margin-bottom: 120px;
}

.last-section {
  margin-bottom: 0;
}

/* Intro layout */
.cv-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 100px;
  gap: 50px;
}

.cv-title-box {
  flex: 1;
}

.cv-main-title {
  position: static;
  color: #000;
  font-size: 5rem;
  text-shadow: none;
  line-height: 0.8;
  margin: 0;
  margin-bottom: 30px;
}

.name-display {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.cv-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #666;
}

/* CV Photo (3:4 ratio) */
.cv-photo {
  width: 240px;
  height: 320px;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 20px;
}

.cv-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Skill groups & progress bars */
.skill-group {
  margin-bottom: 30px;
}

.skill-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.progress-bg {
  width: 100%;
  height: 2px;
  background-color: #eee;
  margin-top: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: #000;
  width: 0;
  animation: cookProgress 2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  animation-delay: 0.5s;
}

/* ============================================================
   7. ANIMATIONS & KEYFRAMES
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes cookProgress {
  from {
    width: 0;
  }
  to {
    width: var(--target-width);
  }
}

/* Hero photo entrance */
.main-photo {
  animation: fadeInUp 1.2s ease forwards;
}

/* Overlap text staggered animation */
.overlap-text span {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.overlap-text span:nth-child(1) { animation-delay: 0.5s; }
.overlap-text span:nth-child(2) { animation-delay: 0.7s; }
.overlap-text span:nth-child(3) { animation-delay: 0.9s; }

/* Sidebar buttons entrance */
.nav-btn {
  opacity: 0;
  animation: fadeInRight 0.8s ease forwards;
}

.nav-btn:nth-child(1) { animation-delay: 1.1s; }
.nav-btn:nth-child(2) { animation-delay: 1.3s; }
.nav-btn:nth-child(3) { animation-delay: 1.5s; }

/* ============================================================
   8. LOGIN PAGE
   ============================================================ */

.nav-btn.login-submit {
    background: #fff; /* Tombol putih solid di background hitam */
    color: #000;
    border: 1px solid #fff;
    width: 100%;
    padding: 18px;
    margin-top: 40px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Jarak antara teks dan panah */
    transition: all 0.3s ease;
    border-radius: 0; /* Siku tajam untuk kesan serius/akademik */
}

.nav-btn.login-submit:hover {
    background: transparent;
    color: #fff;
    letter-spacing: 4px; /* Merenggang sedikit saja agar tetap elegan */
}

/* Animasi Panah */
.nav-btn.login-submit span {
    transition: transform 0.3s ease;
}

.nav-btn.login-submit:hover span {
    transform: translateX(8px);
}

/* ============================================================
   9. RESPONSIVE STYLES (MOBILE)
   ============================================================ */
@media (max-width: 768px) {
  /* Disable snap scrolling on mobile */
  html.snap-page,
  body {
    scroll-snap-type: none !important;
    overflow-y: visible !important;
  }

  /* --- Hero mobile adjustments --- */
  .hero {
    height: auto;
    min-height: 100vh;
    padding: 60px 20px;
    scroll-snap-align: none !important;
  }

  .hero-container {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .main-photo {
    width: 280px;
    height: 380px;
    margin: 0 auto;
    position: relative;
  }

  .overlap-text {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: -50px;
    text-align: center;
    font-size: 3.5rem;
    z-index: 5;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  }

  .button-sidebar {
    width: 100%;
    max-width: 350px;
    height: auto;
    margin-top: 40px;
    gap: 0;
  }

  .nav-btn {
    padding: 20px 10px;
    justify-content: center;
  }

  /* --- Sticky header & burger menu --- */
  .main-header {
    position: sticky;
    top: 0;
    z-index: 10000;
    scroll-snap-align: none !important;
  }

  .burger-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10002;
    cursor: pointer;
  }

  .burger-icon span {
    display: block;
    width: 25px;
    height: 2px;
    background: #000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .menu-toggle:checked ~ .burger-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-toggle:checked ~ .burger-icon span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
  }
  .menu-toggle:checked ~ .burger-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .categories {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 50px;
    transition: 0.5s ease;
    z-index: 10001;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  }

  .menu-toggle:checked ~ .categories {
    right: 0;
  }

  .categories a {
    margin-left: 0 !important;
    font-size: 1.2rem;
    letter-spacing: 5px;
  }

  /* --- Article list mobile --- */
  .post-card {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 60px;
  }

  .post-image-mini {
    width: 100%;
  }

  .post-image-mini img {
    aspect-ratio: 16 / 9;
  }

  .post-content {
    padding: 0 5px;
  }

  .post-title {
    font-size: 1.8rem;
  }

  .full-article .post-title {
    font-size: 2.2rem !important;
    line-height: 1.1;
    margin-bottom: 30px;
  }

  .article-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #222;
    text-align: left;
  }

  .article-body p {
    margin-bottom: 20px;
  }

  .full-article img {
    border-radius: 10px;
    margin-bottom: 30px;
  }

  .read-more {
    display: inline-block;
    margin-top: 40px;
    font-size: 0.8rem;
  }

  .container {
    padding: 0 25px;
    width: 100%;
  }

  /* --- CV mobile adjustments --- */
  .cv-header {
    margin-top: 40px;
    margin-bottom: 50px;
    text-align: left;
  }

  .cv-header h1.overlap-text {
    font-size: 3rem !important;
    line-height: 1;
  }

  .skill-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cv-intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
    margin-bottom: 60px;
  }

  .cv-photo {
    order: -1;
    margin-top: 0 !important;
    width: 200px;
    height: 266px;
  }

  .cv-main-title {
    font-size: 3.2rem !important;
    line-height: 1.1;
    position: static;
    margin: 0 auto;
    letter-spacing: -1px;
  }

  .name-display {
    font-size: 1.8rem;
    margin-top: 15px;
  }

  .cv-subtitle {
    font-size: 0.8rem;
    padding: 0 20px;
  }

  .cv-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .cv-content {
    padding-top: 80px;
    padding-left: 25px;
    padding-right: 25px;
  }

  .cv-section {
    margin-bottom: 80px;
  }

  .nav-btn.login-submit {
        padding: 15px;
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
}