/* ==========================================================================
   BFI Library | public site (Beranda, Tentang Kami, Kontak Bantuan)
   ========================================================================== */
body.site { background: var(--paper); }

html { scroll-padding-top: 84px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--cream);
    border-bottom: 1px solid transparent; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(29, 27, 38, .4); }
.site-nav { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.site-menu { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-links a {
    position: relative; display: inline-flex; padding: 8px 12px; border-radius: 8px;
    color: var(--ink-2); font-weight: 700; font-size: .93rem; text-decoration: none;
}
.nav-links a:hover { color: var(--ink); background: rgba(29, 27, 38, .05); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--ink);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-login { padding: 8px 10px; color: var(--ink); font-weight: 800; font-size: .93rem; text-decoration: none; }
.nav-login:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-toggle {
    display: none; width: 44px; height: 44px; margin-left: auto; border: 1.5px solid var(--ink); border-radius: 10px;
    background: var(--paper); align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.nav-toggle span { width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(48px, 8vw, 92px) 0 0; background: var(--cream); overflow: hidden; }
.hero-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 5vw, 72px); }
.hero-copy { display: grid; justify-items: start; gap: 18px; padding: 18px 0 48px; text-align: left; }
.site .display, .site .h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.035em; }
/* One clear H1, then section H2, then feature H3: each level visibly smaller than the one above. */
.site .display { font-size: clamp(2.2rem, 4.2vw, 3.4rem); line-height: 1.08; }
.site .h-feature { font-size: clamp(1.5rem, 2.6vw, 2.05rem); line-height: 1.15; }
.hero-copy .display { max-width: 18ch; }
.hero-copy .lead { max-width: 50ch; }
.hero-request { display: grid; width: min(480px, 100%); gap: 8px; margin-top: 10px; }
.hero-form-label { color: var(--ink-2); font-size: 1rem; font-weight: 700; }
.hero-form {
    display: flex; width: 100%; margin-top: 0; border: 1.5px solid var(--ink); border-radius: 10px;
    background: var(--paper); overflow: hidden; box-shadow: 4px 4px 0 var(--ink);
}
.hero-form input { flex: 1; min-width: 0; min-height: 52px; padding: 0 16px; border: 0; background: transparent; font-size: 1rem; }
.hero-form input:focus { outline: none; }
.hero-form:focus-within { box-shadow: 4px 4px 0 var(--accent); }
.hero-form .btn { border-radius: 0; border: 0; border-left: 1.5px solid var(--ink); min-height: 52px; box-shadow: none; transform: none; }
.hero-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; column-gap: 6px; row-gap: 0; color: var(--muted); font-size: .95rem; line-height: 1.4; }
.hero-note .link-arrow { gap: 6px; font-size: .95rem; }
.hero-art { width: 100%; align-self: end; }
.hero-art img { width: 100%; height: auto; }

/* Desktop hero: copy on the left, illustration on the right. The desktop illustration is a two-row version of
   the wide scene (about 1.2:1), so it fills the column at a height that matches the copy. */
.hero-art picture { display: block; }
@media (min-width: 901px) {
    .hero-layout { align-items: center; }
    .hero-copy { padding: 0 0 clamp(32px, 4vw, 56px); }
    .hero-art { align-self: center; padding-bottom: clamp(16px, 3vw, 40px); }
    .hero-art img { width: 100%; max-width: 600px; max-height: min(520px, 62vh); object-fit: contain; margin-inline: auto; }
    /* Flipped features put the visual first: give it the wider column there too. */
    .feature--flip .feature-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
}

.format-strip {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 34px;
    padding: 28px 0 40px; color: var(--muted); font-weight: 800; font-size: .95rem; letter-spacing: -.01em;
}
.format-strip span { display: inline-flex; align-items: center; gap: 8px; opacity: .85; }
.format-strip svg { width: 20px; height: 20px; }

/* ---------- Generic sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--cream { background: var(--cream); }
.section-head { display: grid; gap: 14px; max-width: 700px; margin-bottom: 44px; }
.section-head.is-center { margin-inline: auto; text-align: center; justify-items: center; }

/* ---------- Feature split ---------- */
.features-intro { padding: clamp(64px, 8vw, 104px) 0 0; }
.features-intro .section-head { margin-bottom: 0; }
.feature { padding: clamp(56px, 8vw, 104px) 0; }
.feature-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(32px, 6vw, 96px); }
.feature--flip .feature-copy { order: 2; }
.feature-copy { display: grid; gap: 18px; align-content: center; }
.feature-points { display: grid; gap: 10px; margin: 4px 0 6px; padding: 0; list-style: none; }
.feature-points li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.feature-points li::before {
    content: ""; flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%;
    background: var(--mint-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='%231F7A4D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.feature-visual {
    position: relative; display: grid; align-content: end; gap: 0; min-height: 420px; padding: 44px 36px 0;
    border-radius: 16px; background: var(--cream); overflow: hidden;
}
.feature-visual img { width: 100%; max-width: 560px; margin: 18px auto 0; }

.mock-card {
    position: relative; z-index: 1; width: min(400px, 100%); margin: 0 auto; padding: 18px 18px 16px;
    border-radius: 12px; background: var(--paper); box-shadow: 0 18px 40px -18px rgba(29, 27, 38, .35), 0 2px 6px rgba(29, 27, 38, .06);
}
.mock-title { font-weight: 800; font-size: 1.04rem; line-height: 1.35; letter-spacing: -.01em; }
.mock-meta { margin-top: 6px; color: var(--muted); font-size: .84rem; }
.mock-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.mock-answer { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--cream); font-size: .9rem; color: var(--ink-2); line-height: 1.5; }
.mock-answer strong { color: var(--ink); }
.mock-ref { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: .7rem; font-weight: 800; vertical-align: 1px; }
.mock-list { display: grid; gap: 8px; margin-top: 12px; }
.mock-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .9rem; }
.mock-item b { flex: 1; font-weight: 700; }
.mock-item small { color: var(--muted); font-weight: 600; }
.mock-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--lavender-soft); color: #4A3A9A; flex: 0 0 auto; }
.mock-icon svg { width: 17px; height: 17px; }
.mock-toggle { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); flex: 0 0 auto; }
.mock-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.mock-toggle.is-on { background: var(--ink); }
.mock-toggle.is-on::after { transform: translateX(14px); }
.mock-log { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.mock-log:last-child { border-bottom: 0; }
.mock-log time { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-block: 1px solid var(--line-strong); counter-reset: step; }
.step { position: relative; display: grid; align-content: start; gap: 12px; padding: 26px 24px 30px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; }
.step:last-child { border-right: 0; }
.step::before {
    counter-increment: step; content: counter(step);
    color: var(--accent); font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1;
}
.step h3 { font-size: 1.12rem; }
.step p { color: var(--ink-2); }

/* ---------- Notice ---------- */
.notice {
    display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 22px;
    margin-top: 28px; padding: 26px 28px; border-radius: 16px; background: var(--night); color: var(--cream);
}
.notice h3 { color: var(--cream); font-size: 1.2rem; }
.notice p { color: rgba(251, 246, 239, .78); margin-top: 6px; }
.notice-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--butter); color: var(--ink); }
.notice-icon svg { width: 26px; height: 26px; }
.notice .btn { --btn-bg: var(--cream); --btn-fg: var(--ink); --btn-border: var(--cream); }

/* ---------- Download / install ---------- */
.download { background: var(--cream); }
.download-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.install-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.install-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; padding: 22px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper); }
.install-card-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--sky-soft); }
.install-card:nth-child(2) .install-card-icon { background: var(--coral-soft); }
.install-card-icon svg { width: 24px; height: 24px; }
.install-card h3 { font-size: 1.1rem; }
.install-card p { color: var(--muted); font-size: .92rem; }
.install-card .btn { margin-top: 6px; justify-self: start; }
.install-status { min-height: 1.4em; margin-top: 14px; color: var(--success); font-weight: 700; }
.download-art img { width: 100%; max-width: 560px; margin-inline: auto; }
.install-steps { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: install; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.install-steps li::before {
    counter-increment: install; content: counter(install); flex: 0 0 28px; display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%; background: var(--lavender-soft); color: #4A3A9A; font-weight: 800; font-size: .85rem;
}
.install-url { display: flex; gap: 8px; margin-top: 14px; }
.install-url input { flex: 1; min-width: 0; }

/* ---------- CTA band ---------- */
.cta-band { padding: clamp(56px, 8vw, 96px) 0; text-align: center; }
.cta-band .container { display: grid; justify-items: center; gap: 18px; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }

/* ---------- Page hero (about / contact) ---------- */
.page-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(24px, 4vw, 48px); background: var(--cream); overflow: hidden; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center; gap: clamp(28px, 5vw, 64px); }
.page-hero-copy { display: grid; gap: 18px; padding-bottom: clamp(16px, 4vw, 48px); }
.page-hero-art img { width: 100%; max-width: 760px; margin-left: auto; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 22px; border-radius: 14px; background: var(--cream); }
.stat strong { display: block; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.03em; }
.stat span { color: var(--muted); font-weight: 600; font-size: .92rem; }

.pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pillar { display: grid; gap: 12px; padding: 28px; border-radius: 16px; background: var(--pillar-bg, var(--lavender-soft)); }
.pillar:nth-child(2) { --pillar-bg: var(--mint-soft); }
.pillar:nth-child(3) { --pillar-bg: var(--coral-soft); }
.pillar:nth-child(4) { --pillar-bg: var(--sky-soft); }
.pillar-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--paper); }
.pillar-icon svg { width: 24px; height: 24px; }
.pillar h3 { font-size: 1.2rem; }
.pillar p { color: var(--ink-2); }

.contact-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
/* Icon, title, text, action: the text row grows so every card's action lines up at the bottom. */
.contact-option { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; padding: 26px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper); }
.contact-option .pillar-icon { background: var(--butter-soft); }
.contact-option:nth-child(2) .pillar-icon { background: var(--sky-soft); }
.contact-option:nth-child(3) .pillar-icon { background: var(--mint-soft); }
.contact-option h3 { font-size: 1.12rem; }
.contact-option p { color: var(--muted); }
.contact-option .btn, .contact-option .link-arrow { justify-self: start; margin-top: 4px; }

.faq { display: grid; gap: 12px; max-width: 820px; margin-inline: auto; }
.faq details { border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--paper); transition: border-color .2s; }
.faq details[open] { border-color: var(--ink); }
.faq summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px;
    font-weight: 800; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 20px 18px; color: var(--ink-2); }

/* ---------- Dialog ---------- */
.dialog {
    width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1.5px solid var(--ink); border-radius: 16px;
    background: var(--paper); color: var(--ink); box-shadow: 8px 8px 0 var(--ink);
}
.dialog::backdrop { background: rgba(29, 27, 38, .45); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialog-in .28s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 6px; }
.dialog-head h2 { font-size: 1.35rem; }
.dialog-head p { margin-top: 6px; color: var(--muted); font-size: .94rem; }
.dialog-close { flex: 0 0 auto; width: 44px; height: 44px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--paper); font-size: 1.3rem; line-height: 1; }
.dialog-close:hover { border-color: var(--ink); }
.dialog-body { display: grid; gap: 14px; padding: 16px 24px 24px; overflow: auto; }
.dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-status { padding: 11px 13px; border-radius: 10px; font-size: .92rem; font-weight: 600; background: var(--danger-soft); color: var(--danger); }
.form-status.is-success { background: var(--success-soft); color: var(--success); }

/* ---------- Footer ---------- */
.site-footer { padding: 64px 0 28px; background: var(--ink); color: rgba(251, 246, 239, .82); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; }
.footer-brand { display: grid; gap: 14px; align-content: start; }
.footer-brand .brand { color: var(--cream); }
.footer-brand p { max-width: 34ch; font-size: .94rem; }
.site-footer h4 { margin-bottom: 14px; color: var(--cream); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.site-footer ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: rgba(251, 246, 239, .82); text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; text-underline-offset: 4px; }
.site-footer p { font-size: .94rem; }
.footer-meta {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
    margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(251, 246, 239, .14); font-size: .86rem;
}
.footer-meta a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .site-nav { gap: 12px; }
    .nav-toggle { display: inline-flex; }
    .site-menu {
        position: fixed; inset: 72px 0 auto 0; z-index: 49; display: grid; gap: 18px; padding: 18px 20px 26px;
        background: var(--cream); border-bottom: 1.5px solid var(--ink); box-shadow: 0 30px 40px -30px rgba(29, 27, 38, .5);
        transform: translateY(-12px); opacity: 0; visibility: hidden; transition: opacity .22s var(--ease), transform .22s var(--ease), visibility 0s .22s;
        max-height: calc(100dvh - 72px); overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .site-menu.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
    .site-menu { justify-content: stretch; align-items: stretch; }
    .nav-links { display: grid; gap: 4px; }
    .nav-links a { display: flex; padding: 13px 12px; font-size: 1.05rem; }
    .nav-links a[aria-current="page"] { background: var(--paper); }
    .nav-links a[aria-current="page"]::after { display: none; }
    .nav-actions { flex-wrap: wrap; }
    .nav-actions .btn { flex: 1; }
    .feature-grid, .download-grid, .page-hero-grid, .hero-layout { grid-template-columns: 1fr; }
    .hero-copy { padding: 0; }
    .hero-art { width: min(680px, 100%); margin: 0 auto; }
    .feature--flip .feature-copy { order: 0; }
    .feature-visual { min-height: 0; padding: 32px 20px 0; }
    .steps, .contact-options { grid-template-columns: 1fr; }
    .step { padding: 20px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
    .step:last-child { border-bottom: 0; }
    .notice { grid-template-columns: 1fr; text-align: left; }
    .page-hero-art img { margin: 0 auto; }
}

@media (max-width: 600px) {
    .container { width: calc(100% - 32px); }
    .hero-form { flex-direction: column; box-shadow: 3px 3px 0 var(--ink); }
    .hero-form .btn { border-left: 0; border-top: 1.5px solid var(--ink); }
    .hero-art { padding: 0; margin-top: 18px; }
    .hero-art img { width: calc(100% + 32px); max-width: none; margin-left: -16px; }
    .format-strip { gap: 10px 20px; font-size: .86rem; }
    .install-cards, .pillars, .dialog-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .stat-row { grid-template-columns: 1fr 1fr; }
    .mock-log { grid-template-columns: 44px 1fr; }
    .mock-log .chip { grid-column: 2; justify-self: start; }
    .dialog-actions { flex-direction: column-reverse; }
    .dialog-actions .btn { width: 100%; }
}
