:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --accent: #2563eb;
  --ring: #93c5fd;
}

* { box-sizing: border-box }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  backdrop-filter: saturate(1.2) blur(6px);
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.15);
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

button, .ghost {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
  transition: 0.2s transform ease, 0.2s opacity ease, 0.2s background ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

button:active {
  transform: translateY(1px);
}

.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.muted { color: var(--muted); }

main {
  height: 100%;
  position: relative;
  overflow: hidden;
}

.stage {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
}

.slide {
  width: min(1100px, 96vw);
  height: min(640px, 86vh);
  background: var(--card);
  border-radius: 28px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.15);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: 0.45s ease;
  visibility: hidden;
  position: absolute;
  z-index: 0;
}

.slide.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  position: relative;
  z-index: 10;
}

.left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.title {
  font-weight: 800;
  font-size: clamp(22px, 3.2vw, 36px);
  letter-spacing: 0.3px;
}

.bullets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: clamp(14px, 2.2vw, 20px);
}

.bullets li {
  margin-left: 1.2em;
}

.note {
  font-size: clamp(12px, 1.8vw, 16px);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
  width: max-content;
}

.imgwrap {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: #eef2ff;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4; /* Tetap 3:4 */
  width: 100%;
  height: auto;
  max-height: 100%; /* Batasi tinggi agar nggak mendorong */
}

.imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ganti ke contain biar nggak potong */
  display: block;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  gap: 10px;
}

.progress {
  height: 8px;
  flex: 1;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress .bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
}

/* Existing Media Query (900px) */
@media (max-width: 900px) {
  .slide {
    grid-template-columns: 1fr;
    height: 86vh;
  }
  .imgwrap {
    order: -1;
    aspect-ratio: 3 / 4;
    height: auto;
    max-height: 40vh; /* Batasi tinggi di tablet */
  }
}

/* Revised Media Query for Mobile (< 767px) */
@media (max-width: 767px) {
  header {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }

  .brand {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .brand .dot {
    width: 8px;
    height: 8px;
  }

  .toolbar {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
  }

  button, .ghost {
    width: auto;
    padding: 6px 10px;
    font-size: 14px;
  }

  .slide {
    width: 90vw;
    height: auto;
    padding: 15px;
    gap: 12px;
    overflow-y: auto; /* Tambah scroll kalau konten ke luar */
  }

  .tag {
    font-size: 12px;
    padding: 4px 8px;
  }

  .title {
    font-size: clamp(16px, 5vw, 22px);
  }

  .bullets {
    font-size: clamp(12px, 3vw, 16px);
    gap: 6px;
  }

  .imgwrap {
    height: auto;
    order: -1;
    aspect-ratio: 3 / 4;
    max-height: 35vh; /* Batasi tinggi di mobile */
  }

  .imgwrap img {
    object-fit: contain;
  }

  footer {
    padding: 8px 10px;
  }

  .progress {
    height: 6px;
  }
}
