/* Base reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0118;
    --card: rgba(25, 9, 46, 0.8);
    --accent: #7d34ff;
    --accent-2: #35f4ff;
    --text: #e9e7ff;
    --muted: #d1ccff;
    --shadow: 0 0 30px rgba(125, 52, 255, 0.35), 0 0 40px rgba(53, 244, 255, 0.25);
    --radius: 22px;
    --nav-h: 76px;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
    background: radial-gradient(1200px at 10% 20%, rgba(125, 52, 255, 0.14), transparent 50%),
        radial-gradient(1000px at 80% 10%, rgba(53, 244, 255, 0.15), transparent 45%),
        radial-gradient(900px at 50% 90%, rgba(245, 60, 245, 0.12), transparent 50%),
        linear-gradient(135deg, #0b011b 0%, #0b0120 50%, #0d0226 100%);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
}

.mode-page {
    position: relative;
    max-width: 1180px;
    padding: calc(var(--nav-h) + 40px) 32px 120px;
    margin: 0 auto;
    z-index: 2;
}

/* Navbar (loaded via partial) */
.main-nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: rgba(12, 3, 27, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(125, 52, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Audiowide', sans-serif;
    letter-spacing: 0.5px;
    font-size: 18px;
    color: var(--accent-2);
    text-shadow: 0 0 12px rgba(53, 244, 255, 0.8);
}

.brand-icon {
    font-size: 18px;
    color: var(--accent);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 22px;
    font-weight: 700;
    color: var(--muted);
}

.nav-links a {
    position: relative;
    padding: 10px 6px;
    transition: color 0.25s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: var(--shadow);
    transition: width 0.25s ease, left 0.25s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
    color: #fff;
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
    width: 100%;
    left: 0;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 46px;
}

.breadcrumb {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    color: var(--muted);
    opacity: 0.8;
}

.breadcrumb::before {
    content: '✦';
    color: var(--accent-2);
    text-shadow: 0 0 12px rgba(53, 244, 255, 0.7);
}

.hero-title {
    font-family: 'Audiowide', sans-serif;
    font-size: clamp(32px, 4vw, 48px);
    margin-top: 12px;
    color: #e7f5ff;
    text-shadow: 0 0 20px rgba(53, 244, 255, 0.6), 0 0 32px rgba(125, 52, 255, 0.4);
    letter-spacing: 0.5px;
}

/* Home hero (halaman utama) */
.home-page { padding: 0; }
.home-hero {
    min-height: calc(100vh - var(--nav-h));
    display: grid;
    place-items: center;
    text-align: center;
    padding: calc(var(--nav-h) + 20px) 24px 80px;
}

.home-title {
    font-family: 'Audiowide', sans-serif;
    font-size: clamp(48px, 10vw, 120px);
    line-height: 0.9;
    color: #fff;
    position: relative;
    margin: 0 0 18px;
    text-transform: none;
    letter-spacing: 1px;
    -webkit-text-stroke: 2px rgba(79, 50, 255, 0.9);
    text-shadow: 0 0 26px rgba(125, 52, 255, 0.85), 0 0 40px rgba(53, 244, 255, 0.7), 0 8px 30px rgba(0,0,0,0.6);
    color: linear-gradient(90deg,#fff,#d6f6ff);
}

.home-sub {
    font-size: clamp(16px, 2.2vw, 22px);
    color: #f6eefc;
    opacity: 0.95;
    margin-bottom: 28px;
}

.hero-cta {
    display: inline-block;
    padding: 14px 34px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 2px solid rgba(245, 60, 245, 0.6);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 0 26px rgba(245, 60, 245, 0.45), 0 14px 40px rgba(0,0,0,0.6);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-cta:hover { transform: translateY(-4px); box-shadow: 0 0 34px rgba(245,60,245,0.6), 0 18px 46px rgba(0,0,0,0.6); }

/* Hide breadcrumb on home */
.breadcrumb { display: none; }

/* Mode cards */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.mode-card {
    position: relative;
    padding: 26px 22px 28px;
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(29, 10, 52, 0.85), rgba(25, 8, 44, 0.75));
    border: 1px solid rgba(53, 244, 255, 0.22);
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.55), 0 0 30px rgba(53, 244, 255, 0.25);
    overflow: hidden;
    isolation: isolate;
}

.mode-card::before,
.mode-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.mode-card::before {
    border: 1px solid rgba(125, 52, 255, 0.35);
    filter: blur(2px);
}

.mode-card::after {
    background: radial-gradient(circle at 20% 20%, rgba(53, 244, 255, 0.14), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(125, 52, 255, 0.14), transparent 45%);
    opacity: 0.9;
    z-index: -1;
}

.mode-label {
    align-self: flex-start;
    display: inline-block;
    padding: 8px 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(53, 244, 255, 0.18), rgba(125, 52, 255, 0.28));
    border: 1px solid rgba(53, 244, 255, 0.4);
    color: #d4f9ff;
    font-weight: 700;
    letter-spacing: 0.4px;
    box-shadow: 0 0 14px rgba(53, 244, 255, 0.35);
}

.mode-icon {
    width: 96px;
    height: 96px;
    margin: 26px auto 10px;
    color: #d6e7ff;
    filter: drop-shadow(0 0 18px rgba(53, 244, 255, 0.6));
}

.mode-card h2 {
    text-align: center;
    font-size: 26px;
    margin: 6px 0 10px;
    color: #9be7ff;
    text-shadow: 0 0 14px rgba(53, 244, 255, 0.6);
}

.mode-card p {
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
    color: #f5f4ff;
    opacity: 0.9;
    margin-bottom: 22px;
}

.primary-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid rgba(245, 60, 245, 0.5);
    background: linear-gradient(120deg, rgba(245, 60, 245, 0.7), rgba(116, 56, 255, 0.8));
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.2px;
    box-shadow: 0 0 20px rgba(245, 60, 245, 0.5), 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 30px rgba(245, 60, 245, 0.65), 0 12px 34px rgba(0, 0, 0, 0.55);
}

/* Background decoration */
.bg-glow {
    position: fixed;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

.bg-glow-1 {
    top: -140px;
    left: -120px;
    background: rgba(53, 244, 255, 0.45);
}

.bg-glow-2 {
    bottom: -180px;
    right: -120px;
    background: rgba(245, 60, 245, 0.4);
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.35;
    mix-blend-mode: screen;
    z-index: 0;
    pointer-events: none;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    :root { --nav-h: 68px; }
    .main-nav { padding: 0 18px; }
    .nav-links { gap: 14px; font-size: 14px; }
    .mode-page { padding: calc(var(--nav-h) + 26px) 18px 80px; }
    .mode-card { padding: 22px 18px 26px; }
    .mode-card h2 { font-size: 22px; }
    .primary-btn { font-size: 15px; }
}

@media (max-width: 520px) {
    .nav-links { display: none; }
    .hero-title { font-size: 32px; }
    .mode-icon { width: 82px; height: 82px; }
}

/* Form card styles used by Mode 1 and Mode 2 pages */
.form-hero {
    min-height: calc(100vh - var(--nav-h));
    display: grid;
    place-items: start center;
    padding: calc(var(--nav-h) + 36px) 20px 80px;
}

.form-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(125,52,255,0.24);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 0 30px rgba(125,52,255,0.12) inset;
    position: relative;
    color: var(--text);
}

.form-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #e7e4ff;
}

.form-field {
    display: block;
    margin-bottom: 12px;
}

.form-field label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--muted);
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(10,6,20,0.35);
    color: var(--text);
    outline: none;
    transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.form-field input:focus, .form-field textarea:focus {
    box-shadow: 0 6px 20px rgba(125,52,255,0.18);
    border-color: rgba(125,52,255,0.5);
}

.mood-row { margin: 6px 0 14px; }
.mood-row .mood-labels {
    display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px;
}

.mood-slider {
    -webkit-appearance: none; width: 100%; height: 8px; border-radius: 999px; background: linear-gradient(90deg,#6e2bff,#34f0ff); outline: none;
}
.mood-slider::-webkit-slider-thumb{ -webkit-appearance:none; width:18px;height:18px;border-radius:50%; background:#fff; box-shadow:0 0 18px rgba(53,244,255,0.6); border: 3px solid rgba(125,52,255,0.85); margin-top: -5px; }
.mood-slider::-moz-range-thumb{ width:18px;height:18px;border-radius:50%; background:#fff; box-shadow:0 0 18px rgba(53,244,255,0.6); border: 3px solid rgba(125,52,255,0.85); }

.small-note { font-size:13px; color:var(--muted); margin-bottom:8px; }

.cta-lg {
    display: inline-block; width:100%; padding:12px 18px; border-radius:12px; text-align:center; font-weight:800; color:#fff; background: linear-gradient(90deg,#8a4bff,#ff4bff); border:1px solid rgba(245,60,245,0.6); box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 30px rgba(245,60,245,0.25);
}

@media (max-width: 520px) {
    .form-card { max-width: 92%; padding: 16px; }
    .home-title { font-size: 46px; }
}

/* Homepage sections */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section-title { font-family: 'Audiowide', sans-serif; color: #dcecff; margin-bottom: 18px; text-align:center; }

.features { padding: 36px 0 12px; }
.features-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; }
.feature-card { background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); padding:18px; border-radius:12px; border:1px solid rgba(125,52,255,0.14); text-align:center; box-shadow: 0 8px 30px rgba(0,0,0,0.45); }
.feature-icon { font-size:28px; margin-bottom:10px; display:block; }
.feature-card h3 { margin:6px 0 8px; color:#e9f6ff; }
.feature-card p { color:var(--muted); font-size:14px; }

.latest { padding: 22px 0; }
.entries-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; }
.entry-card { background: linear-gradient(180deg, rgba(10,6,20,0.5), rgba(8,4,20,0.5)); padding:16px; border-radius:12px; border:1px solid rgba(255,255,255,0.03); }
.entry-card h4 { margin:0 0 8px; color:#fff; }
.entry-card p { color:var(--muted); font-size:14px; }

.testimonials { padding: 8px 0 40px; }
.testimonials-grid { display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }
.testimonial { max-width:420px; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); padding:16px; border-radius:12px; border:1px solid rgba(125,52,255,0.14); }
.testimonial p { margin:0 0 8px; color:#f1f3ff; }
.testimonial cite { color:var(--muted); font-size:13px; }

.site-footer { padding:28px 0 60px; border-top:1px solid rgba(125,52,255,0.06); }
.footer-inner { display:flex; justify-content:space-between; gap:12px; align-items:center; color:var(--muted); }

@media (max-width:768px){
    .footer-inner{ flex-direction:column; gap:8px; }
}

/* Loading overlay and result modal */
#api-loading-overlay {
    position: fixed; inset: 0; display:flex; align-items:center; justify-content:center; pointer-events:none; opacity:0; transition:opacity .18s ease; z-index:9999;
}
#api-loading-overlay.show { pointer-events:auto; opacity:1; }
#api-loading-overlay .loader-box { background:rgba(6,3,18,0.75); padding:22px 24px; border-radius:12px; display:flex; gap:14px; align-items:center; border:1px solid rgba(125,52,255,0.25); box-shadow:0 10px 40px rgba(0,0,0,0.6); }
.spinner { width:36px; height:36px; border-radius:50%; border:4px solid rgba(255,255,255,0.06); border-top-color: #7d34ff; animation: spin 1s linear infinite; box-shadow: 0 0 18px rgba(125,52,255,0.35); }
.loader-text { color:#fff; font-weight:700; }
@keyframes spin{ to{ transform:rotate(360deg);} }

#result-modal { position: fixed; inset: 0; display:flex; align-items:center; justify-content:center; padding:28px; z-index:10000; pointer-events:none; opacity:0; transition: opacity .18s ease; }
#result-modal.open {
    pointer-events: auto;
    opacity: 1;
    background: rgba(8,4,24,0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
#result-modal .modal-inner { width:100%; max-width:720px; background: linear-gradient(180deg, rgba(16,6,36,0.9), rgba(10,4,28,0.9)); border-radius:14px; padding:22px; border:1px solid rgba(125,52,255,0.28); box-shadow: 0 20px 60px rgba(0,0,0,0.7); color:var(--text); }
/* result modal: make a neat card with header + scrollable content */
#result-modal .modal-inner { width:100%; max-width:640px; background: transparent; padding:14px; border-radius:12px; color:var(--text); }
#result-modal .result-card { background: linear-gradient(180deg, rgba(22,8,44,0.92), rgba(11,3,28,0.92)); border-radius:12px; padding:18px; border:1px solid rgba(125,52,255,0.22); box-shadow: 0 18px 54px rgba(0,0,0,0.7); }
#result-modal .modal-close { position:absolute; right:22px; top:22px; background:transparent; border:none; color:var(--muted); font-size:18px; cursor:pointer; }
#result-modal .result-header { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
#result-modal .modal-title { font-size:20px; margin:0; color:#fff; font-weight:800; }
#result-modal .modal-poem { white-space:pre-wrap; font-family: 'Plus Jakarta Sans', sans-serif; font-size:16px; line-height:1.8; background: rgba(255,255,255,0.02); padding:16px; border-radius:10px; border:1px solid rgba(255,255,255,0.03); max-height:60vh; overflow:auto; box-shadow: inset 0 2px 6px rgba(0,0,0,0.4); }
#result-modal .modal-actions { display:flex; justify-content:flex-end; margin-top:12px; }
#result-modal .modal-copy { padding:10px 14px; border-radius:10px; background:linear-gradient(90deg,#8a4bff,#ff4bff); border:none; color:#fff; font-weight:700; cursor:pointer; }

/* Typewriter caret while typing */
#result-modal.typing .modal-poem::after,
#result-modal .typing .modal-poem::after {
    content: '\a0';
    display: inline-block;
    width: 10px;
    height: 20px;
    margin-left: 6px;
    background: linear-gradient(180deg, #fff, rgba(255,255,255,0.6));
    opacity: 0.95;
    animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
