/* =====================================================================
   WAIFI — Sections (sections.css)
   ---------------------------------------------------------------------
   Page-level layouts: assembles components into real sections.
   Each block is self-contained, Mobile First (min-width overrides).
   Uses components + tokens only — no new primitives.
   Load order: 5th.
   ===================================================================== */

/* ======================================================
   1. HEADER / NAVIGATION
   Sticky bar; transparent over hero, solid on scroll (is-scrolled).
   Mobile: logo + hamburger; desktop: logo + nav + CTA.
====================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background-color: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal),
                background-color var(--transition-normal);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: var(--header-height);
}

/* Mobile: hide inline nav + header CTA; show toggle */
.primary-nav,
.header__cta {
    display: none;
}

.nav-toggle {
    display: inline-flex;          /* shown on mobile */
}

/* Mobile menu: toggle target. Default hidden; JS toggles .is-open.
   Visual pattern: a simple dropdown panel below the header. */
.primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--color-surface);
    box-shadow: var(--shadow-md);
    padding: var(--space-4) var(--space-4) var(--space-5);
    border-top: var(--border);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height var(--transition-normal),
                visibility var(--transition-normal);
}

.primary-nav.is-open {
    display: flex;
    max-height: 80vh;
    overflow-y: auto;
    visibility: visible;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.nav-link {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-body);
    min-height: 44px;           /* a11y touch target (uiux.md §25) */
}

/* Sticky scrolled state — JS adds .is-scrolled to header (placeholder) */
.site-header.is-scrolled {
    box-shadow: var(--shadow-md);
}

/* Desktop ≥1024px: inline nav + CTA, hide hamburger */
@media (min-width: 64rem) {
    .nav-toggle {
        display: none;
    }
    .primary-nav {
        position: static;
        display: flex;
        flex-direction: row;
        background: none;
        box-shadow: none;
        padding: 0;
        border-top: none;
        max-height: none;
        overflow: visible;
        visibility: visible;
    }
    .nav-list {
        flex-direction: row;
        align-items: center;
        gap: var(--space-1);
    }
    .nav-link {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-sm);
    }
    .header__cta {
        display: inline-flex;
    }
}

/* ======================================================
   2. HERO
   Mobile: single column (content, then media).
   Desktop: 2 columns. Warm gradient + dot texture + min-90vh.
   (frontend.md §14: min 90vh, CTA visible without scroll.)
====================================================== */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    align-items: center;
    /* Solid fallback for engines without color-mix(); overridden by the
       token gradient below on modern browsers (last valid wins). */
    background-color: var(--color-secondary-soft);
    background: var(--gradient-hero);
    /* Top padding is breathing room only — the sticky header is in-flow,
       so it NEVER overlaps the hero and needs no clearance offset. Kept
       tight (24px) on mobile/tablet so the badge sits right under the
       navbar instead of 80px down. Desktop is relaxed in the ≥64rem block. */
    padding-top: var(--space-5);
    padding-bottom: var(--space-section);
}

/* Dot-grid texture overlay (uiux.md §11 — subtle pattern, never noisy) */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--texture-dot);
    background-size: var(--texture-dot-size) var(--texture-dot-size);
    opacity: 0.5;
    pointer-events: none;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

/* Curved wave separator at hero base — soft transition into next section */
.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: clamp(2rem, 5vw, 4rem);
    background-color: var(--color-bg-alt); /* matches Features section bg */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 80 L0 40 C 200 0 400 0 600 30 C 800 60 1000 60 1200 30 L1200 80 Z' fill='black'/%3E%3C/svg%3E") no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 80 L0 40 C 200 0 400 0 600 30 C 800 60 1000 60 1200 30 L1200 80 Z' fill='black'/%3E%3C/svg%3E") no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    pointer-events: none;
}

.hero .container,
.hero__inner {
    position: relative;
    z-index: var(--z-base);
}

.hero__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-7);
    align-items: center;
}

.hero__content {
    text-align: center;
    max-width: 40rem;
}

.hero__tagline {
    display: inline-block;
    margin-bottom: var(--space-4);
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    color: var(--color-secondary-hover);
    background-color: var(--color-secondary-soft);
    border-radius: var(--radius-full);
}

.hero__title {
    margin-bottom: var(--space-4);
}

.hero__subtitle {
    color: var(--color-muted);
    font-size: var(--font-size-body-lg);
    margin-bottom: var(--space-6);
}

/* Highlight benefit badges row */
.hero__highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.hero__cta .cta__actions,
.hero__content .cta__actions {
    justify-content: center;
}

/* Hero media — fiber illustration */
.hero__media {
    width: 100%;
    max-width: 32rem;
}
.hero-art {
    width: 100%;
    height: auto;
    display: block;
}
/* Kept for any future raw image placeholder; harmless if unused */
.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    width: 100%;
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius-xl);
    color: var(--color-muted);
    font-size: var(--font-size-sm);
    background-color: var(--color-surface-alt);
}

/* Desktop ≥1024px: 2 columns */
@media (min-width: 64rem) {
    .hero {
        /* Balanced, modern top gap on large screens — tighter than the old
           full section rhythm but still breathable (not cramped). */
        padding-top: var(--space-7);
    }
    .hero__inner {
        flex-direction: row;
        align-items: center;
        text-align: left;
    }
    .hero__content {
        text-align: left;
        flex: 1 1 55%;
    }
    .hero__media {
        flex: 1 1 45%;
        max-width: none;
    }
    .hero__highlights,
    .hero__content .cta__actions {
        justify-content: flex-start;
    }
}

/* ======================================================
   3. FEATURES (Keunggulan)
   Bento grid: two hero features (Full Fiber Optic, Unlimited)
   span wider; four standard cards fill the rest. Alternates
   the icon-chip accent for editorial rhythm.
   Mobile: 1 col · Tablet: 2 col · Desktop: 3-col bento.
====================================================== */
.features {
    background-color: var(--color-bg-alt);
}
.features-grid {
    display: grid;
    grid-template-columns: 1fr;   /* mobile */
    gap: var(--space-5);
    margin-top: var(--space-6);
}
.feature-card {
    height: 100%;
    justify-content: flex-start;
    text-align: left;
    align-items: flex-start;
}
/* Hero feature — larger icon + bolder, accent chip */
.feature-card--lg {
    padding: var(--space-6);
}
.feature-card--lg .icon-wrap {
    width: 56px;
    height: 56px;
}
.feature-card--lg .icon {
    width: 28px;
    height: 28px;
}
.feature-card--lg .feature-card__title {
    font-size: var(--font-size-h3);
}

/* Tablet: 2 equal columns (hero features still read large) */
@media (min-width: 48rem) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 6-col track. Each standard card = 2 cols, hero = 3 cols,
   producing a modular bento rhythm (3+3, then 2+2+2). */
@media (min-width: 64rem) {
    .features-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .feature-card {
        grid-column: span 2;
    }
    .feature-card--lg {
        grid-column: span 3;
    }
}

/* ======================================================
   4. PRICING (Paket)
   Cards in a responsive grid; centered, max 2 across.
====================================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin-top: var(--space-6);
}

.pricing-card__benefits {
    margin-block: var(--space-4);
    text-align: left;
    width: 100%;
}

@media (min-width: 48rem) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 48rem;
        margin-inline: auto;
    }
}

/* ======================================================
   5. COVERAGE (Area Layanan)
   Centered badge row + note.
====================================================== */
.coverage {
    text-align: center;
}
.coverage .section__head {
    margin-inline: auto;
    text-align: center;
}
.coverage-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.coverage__note {
    color: var(--color-muted);
    max-width: 40rem;
    margin-inline: auto;
}

/* ======================================================
   6. STEPS / TIMELINE (Cara Berlangganan)
   Mobile: vertical stack. Desktop: horizontal 4 columns.
====================================================== */
.steps {
    background-color: var(--color-bg-alt);
}
.timeline {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-top: var(--space-6);
    counter-reset: none; /* numbers live in markup */
}
.timeline__item {
    align-items: flex-start;
    gap: var(--space-4);
}
/* Reuse numbered icon-wrap as the step marker */
.timeline__num {
    position: relative;
    z-index: var(--z-base);            /* sit above the desktop connector */
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-lg);
}
.timeline__title {
    font-size: var(--font-size-h4);
    margin-bottom: var(--space-1);
}
.timeline__text {
    color: var(--color-muted);
    font-size: var(--font-size-sm);
}

/* Tablet (768–1023px): 2 columns — uses horizontal space well without
   cramming 4 steps into cards too narrow for the step text. */
@media (min-width: 48rem) and (max-width: 63.9375rem) {
    .timeline {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 64rem) {
    .timeline {
        position: relative;
        grid-template-columns: repeat(4, 1fr);
        align-items: stretch;
    }
    /* Horizontal connector line linking the step markers (dashed brand line).
       Sits behind the numbered markers; the card backgrounds are opaque, so
       the line only shows in the gutters between cards. */
    .timeline::before {
        content: "";
        position: absolute;
        top: calc(48px / 2);              /* align to center of the 48px marker */
        left: calc(100% / 8);             /* center of the first card */
        right: calc(100% / 8);            /* center of the last card */
        height: 0;
        border-top: var(--border-width) dashed var(--color-secondary);
        z-index: 0;
    }
    .timeline__item {
        position: relative;
        align-items: center;
        text-align: center;
    }
}

/* ======================================================
   7. FAQ
   Narrow container centers the accordion.
====================================================== */
.faq .section__head {
    margin-inline: auto;
    text-align: center;
}

/* ======================================================
   8. CONTACT
   3 contact cards + CTA. Alt background.
====================================================== */
.contact {
    background-color: var(--color-bg-alt);
}
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin-top: var(--space-6);
}
.contact-card {
    height: 100%;
}
@media (min-width: 48rem) {
    .contact-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ======================================================
   9. FOOTER
   Dark background; responsive columns; border-top rule.
====================================================== */
.site-footer {
    background-color: var(--color-footer);
    padding-block: var(--space-9);
}
.footer__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid #2a3344; /* fallback; overridden by color-mix below on modern engines */
    border-bottom: 1px solid color-mix(in srgb, var(--color-text-on-dark) 15%, transparent);
}
.footer__brand {
    max-width: 24rem;
}
.footer-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.footer__copyright {
    margin-top: var(--space-6);
}

@media (min-width: 48rem) {
    .footer__inner {
        grid-template-columns: 2fr 1fr 1fr;
        align-items: start;
    }
}

/* ======================================================
   10. FLOATING ACTIONS
   Fixed bottom-right; stacked vertically (no overlap, review R12).
   Back-to-top hidden until JS adds .is-visible.
====================================================== */
.floating-btn {
    position: fixed;
    right: var(--space-4);
    z-index: var(--z-floating);
}
.floating-btn--whatsapp {
    bottom: var(--space-4);
}
.floating-btn--top {
    bottom: calc(var(--space-4) + 56px + var(--space-3)); /* above WA btn */
    opacity: 0;
    visibility: hidden;
    transform: translateY(var(--space-2));
    transition: opacity var(--transition-normal),
                visibility var(--transition-normal),
                transform var(--transition-normal);
}
.floating-btn--top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ======================================================
   11. SECTION VISUAL RHYTHM
   Alternate backgrounds create clear section separation.
   Body sections inherit .section spacing from layout.css.
====================================================== */
