/* ============================================================
   Finity Scrollytelling Landing Page Styles (Enhanced Version)
   Theme: "Perahu Finity - Menjaga Nahkoda & Keuangan Rumah Tangga"
   Color Tokens: Strictly enforce prompt design specification
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-25..200&display=swap');

:root {
  --primary: #4682A9;
  --primary-soft: #E3EFF6;
  --secondary: #749BC2;
  --accent: #91C8E4;
  --accent-soft: #D9EDF7;
  --canvas: #F6F4EB;
  --surface: #FFFFFF;
  --line: #EAE6DB;
  
  /* Helper tokens derived from palette */
  --ink: #1E3A4A;
  --muted: #5E7787;
  --danger: #CE8A7C;
  --danger-soft: #F9EBE8;
  --success: #5E9C8A;
  --success-soft: #E8F4F1;
  --warning: #D9A05B;
  --warning-soft: #FCF4EB;
  
  --shadow-soft: 0 12px 36px -6px rgba(70, 130, 169, 0.15), 0 4px 14px -2px rgba(30, 58, 74, 0.06);
  --shadow-elevated: 0 30px 90px -15px rgba(30, 58, 74, 0.28), 0 0 0 1px rgba(70, 130, 169, 0.12);
  --shadow-glow: 0 0 35px rgba(70, 130, 169, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.88);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--canvas);
  color: var(--ink);
  overflow-x: hidden;
}

body {
  position: relative;
  width: 100%;
  background: var(--canvas);
  overflow-x: hidden;
  color: var(--ink);
}

/* Material Symbols */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 24px;
  line-height: 1;
  user-select: none;
  display: inline-block;
}
.ms-fill {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

h1, h2, h3, h4, .font-head {
  font-family: 'Geist', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.025em;
}

.font-mono, .tabular {
  font-family: 'Geist Mono', monospace;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Hide Telemetry Bar UI completely */
.telemetry-bar {
  display: none !important;
}

/* Floating Audio Toggle Button */
.floating-audio-corner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  box-shadow: var(--shadow-soft);
}

.audio-btn {
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
}

.audio-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1) rotate(6deg);
  box-shadow: var(--shadow-glow);
}

/* Canvas Background & FX Layer */
#canvas-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}

/* Header & Progress Indicator */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(246, 244, 235, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 6px 16px rgba(70, 130, 169, 0.35);
  animation: pulseBrand 3s infinite alternate ease-in-out;
}

@keyframes pulseBrand {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.brand-name {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.brand-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--accent);
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 10px 24px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(70, 130, 169, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: #386f93;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(70, 130, 169, 0.45);
}

.scroll-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.1s linear;
}

/* Chapter Progress Bar (Sticky Top Indicator) */
.chapter-stepper {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 18px;
  border-radius: 99px;
  box-shadow: var(--shadow-soft);
}

.step-item {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-item.active {
  color: var(--primary);
  font-weight: 700;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  transition: all 0.25s ease;
}

.step-item.active .step-dot {
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

/* Floating Parallax BG Elements */
.floating-bg-element {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  animation: floatMotion 6s infinite ease-in-out alternate;
}

.float-1 { animation-duration: 7s; }
.float-2 { animation-duration: 9s; animation-delay: -2s; }
.float-3 { animation-duration: 6s; animation-delay: -4s; }

@keyframes floatMotion {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-25px) rotate(12deg); }
}

/* Hero Section */
main {
  position: relative;
  z-index: 2;
}

.scrolly-section {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px;
  overflow: hidden;
}

.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding-top: 140px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}

.hero-title {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
  max-width: 980px;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(16px, 2.2vw, 22px);
  color: var(--muted);
  max-width: 740px;
  line-height: 1.6;
  margin-bottom: 40px;
}

.hero-illustration {
  position: relative;
  width: 100%;
  max-width: 860px;
  height: 380px;
  margin-top: 20px;
}

/* Rocking Boat SVG Animation */
.hero-boat-svg {
  width: 100%;
  height: 100%;
}

.rocking-boat {
  transform-origin: 350px 220px;
  animation: rockingBoat 4s infinite ease-in-out alternate;
}

@keyframes rockingBoat {
  0% { transform: translateY(0px) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
  100% { transform: translateY(-2px) rotate(-2deg); }
}

.scroll-indicator-down {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.arrow-bounce {
  animation: arrowBounce 1.8s infinite ease-in-out;
  color: var(--primary);
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* Story Chapter Pin Section */
.story-chapter-pin {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
  position: relative;
}

@media (max-width: 991px) {
  .story-chapter-pin {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.narrative-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chapter-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chapter-heading {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}

.chapter-desc {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.problem-card {
  background: var(--surface);
  border-left: 4px solid var(--danger);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  margin-top: 10px;
}

.problem-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.problem-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.solution-bridge {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
  margin-top: 8px;
}

.solution-badge {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  border: 1px solid var(--accent);
}

/* Device Col & 3D Phone Shell */
.device-col {
  display: flex;
  justify-content: center;
  perspective: 1000px;
}

.phone-frame {
  width: 100%;
  max-width: 380px;
  height: 720px;
  background: var(--canvas);
  border-radius: 44px;
  box-shadow: 0 35px 90px -20px rgba(30, 58, 74, 0.45), 0 0 0 10px #ffffff, 0 0 0 12px var(--line);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease;
}

.phone-frame:hover {
  transform: translateY(-10px) rotateX(4deg) rotateY(-4deg) scale(1.02);
  box-shadow: var(--shadow-elevated);
}

/* Phone Inner Screen UI */
.phone-statusbar {
  height: 44px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--canvas);
  flex-shrink: 0;
}

.phone-screen {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.phone-screen::-webkit-scrollbar { display: none; }

.phone-bottom-nav {
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  padding: 0 8px;
  flex-shrink: 0;
}

.nav-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab-item.active {
  color: var(--primary);
}

.house-pill {
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 5px 14px;
  border-radius: 99px;
  font-weight: 600;
}

/* Glow Cards & Micro-interactions */
.ui-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  transition: all 0.3s ease;
}

.glow-card:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.ui-hero-card {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 14px 35px rgba(70, 130, 169, 0.4);
}

.ui-badge-pill {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.count-up-val {
  font-family: 'Geist Mono', monospace;
  font-size: 30px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: -0.02em;
}

.ui-stat-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.ui-stat-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
}

.ui-stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
}

.ui-stat-val {
  font-family: 'Geist Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}

/* User Wallet / Pocket List */
.pocket-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  transition: all 0.25s ease;
}

.interactive-hover:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.avatar-circle.husband {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
}

.pocket-info { flex: 1; }
.pocket-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.pocket-role { font-size: 10px; font-weight: 700; background: var(--primary-soft); color: var(--primary); padding: 2px 6px; border-radius: 99px; margin-left: 6px; }
.pocket-amount { font-family: 'Geist Mono', monospace; font-weight: 700; font-size: 14px; color: var(--ink); }

/* Billing Item Card & Pulse Badges */
.bill-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  transition: all 0.25s ease;
}

.bill-status {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}

.bill-status.due { background: var(--danger-soft); color: var(--danger); }
.bill-status.paid { background: var(--success-soft); color: var(--success); }

.pulse-badge { animation: pulseRed 2s infinite ease-in-out; }
@keyframes pulseRed {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); box-shadow: 0 0 12px rgba(206, 138, 124, 0.4); }
}

/* Tasks / Calendar Item Card */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.25s ease;
}

.task-title.strike {
  text-decoration: line-through;
  color: var(--muted);
}

.task-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-checkbox.checked {
  background: var(--primary);
  color: white;
}

/* Liquid Wave Bar Chart */
.chart-bar-group {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 140px;
  padding-top: 20px;
  margin-top: 10px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  background: var(--primary-soft);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.chart-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(0deg, var(--primary), var(--secondary));
  border-radius: 10px;
  transition: height 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-label { font-size: 11px; font-weight: 700; color: var(--muted); }

/* Story Finale Call to Action Section */
.cta-section {
  min-height: 90vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cta-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 36px;
  padding: 60px 40px;
  max-width: 820px;
  width: 100%;
  box-shadow: var(--shadow-elevated);
  position: relative;
  overflow: hidden;
}

.cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 16px;
  border-radius: 99px;
  margin-bottom: 20px;
}

.cta-heading {
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 800;
  margin-bottom: 18px;
  color: var(--ink);
}

.cta-sub {
  font-size: 18px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* Footer */
footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 40px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  position: relative;
  z-index: 10;
}

/* Responsiveness */
@media (max-width: 768px) {
  .top-nav { padding: 12px 16px; }
  .brand-tag, .chapter-stepper { display: none; }
  .scrolly-section { padding: 80px 16px; }
  .phone-frame { height: 640px; border-radius: 32px; }
  .cta-box { padding: 40px 20px; border-radius: 28px; }
}
