/* ==========================================================
   StapeTech — Page sections
   ========================================================== */

/* ---------- Home hero ---------- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: max(640px, 100svh);
    padding: calc(var(--header-h) + 3rem) 0 5rem;
    overflow: hidden;
    color: var(--text);
    isolation: isolate;
}

/* Theme switch: whole-page cross-fade in browsers with View Transitions */
.theme-vt::view-transition-old(root),
.theme-vt::view-transition-new(root) {
    animation-duration: 0.8s;
    animation-timing-function: ease;
}

.hero__grid-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 70% at 70% 45%, #000 15%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 45%, #000 15%, transparent 70%);
}

.hero__inner {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.hero__content {
    max-width: 660px;
    pointer-events: auto;
}

.hero__eyebrow {
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.08em;
}

.pulse-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
}

.pulse-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #34d399;
    animation: ping 2s var(--ease) infinite;
}

.hero__title {
    margin-bottom: 1.5rem;
    font-size: var(--fs-hero);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.035em;
    color: var(--heading);
}

.hero__lead {
    max-width: 560px;
    margin-bottom: 2.25rem;
    font-size: var(--fs-lg);
    line-height: 1.6;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 3rem;
}

.hero__scroll {
    position: absolute;
    left: 50%;
    bottom: 1.75rem;
    width: 26px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    transform: translateX(-50%);
}

.hero__scroll span {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    border-radius: 2px;
    background: var(--surface);
    transform: translateX(-50%);
    animation: scroll-cue 1.8s var(--ease) infinite;
}

@keyframes scroll-cue {
    0% { opacity: 0; transform: translate(-50%, 0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, 14px); }
}

@media (max-width: 899px) {
    /* Reserve the top of the hero for the 3D object */
    .hero {
        align-items: flex-end;
        padding-top: calc(var(--header-h) + 40vh);
    }

    .hero__scroll {
        display: none;
    }
}

/* ---------- Process ---------- */
.process {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.process__step {
    position: relative;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    background: linear-gradient(180deg, var(--surface-alt), var(--surface));
}

.process__step .icon {
    margin-bottom: 1.25rem;
    color: var(--c-brand);
}

.process__num {
    position: absolute;
    top: 1.5rem;
    right: 1.75rem;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--c-brand-100);
}

.process__step h3 {
    font-size: var(--fs-xl);
}

.process__step p {
    margin: 0;
    color: var(--c-muted);
}

@media (min-width: 640px) { .process { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .process { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Why us ---------- */
.why {
    display: grid;
    gap: 3rem;
    align-items: center;
}

.why__intro p {
    font-size: var(--fs-lg);
    margin-bottom: 2rem;
}

.why__list {
    display: grid;
    gap: 1rem;
}

.why__item {
    display: flex;
    gap: 1.25rem;
    padding: 1.6rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    transition: background-color var(--dur), border-color var(--dur);
}

.why__item:hover {
    border-color: rgba(66, 139, 202, 0.5);
    background: rgba(66, 139, 202, 0.08);
}

.why__item h3 {
    margin-bottom: 0.35rem;
}

.why__item p {
    margin: 0;
}

.why__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--g-brand);
    color: var(--c-white);
}

@media (min-width: 900px) {
    .why { grid-template-columns: 5fr 6fr; gap: 5rem; }
}

/* ---------- Stats & values ---------- */
.stat-band {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
}

.stat-band strong {
    display: block;
    font-family: var(--font-display);
    font-size: var(--fs-3xl);
    font-weight: 800;
    line-height: 1.1;
    color: var(--c-white);
}

.stat-band span {
    font-size: var(--fs-sm);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@media (min-width: 768px) { .stat-band { grid-template-columns: repeat(4, 1fr); } }

.value-grid {
    display: grid;
    gap: 1.25rem;
}

.value {
    padding: 2rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.value .icon {
    margin-bottom: 1rem;
    color: var(--c-brand);
}

.value p {
    margin: 0;
    color: var(--c-muted);
}

@media (min-width: 640px) { .value-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .value-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Detail pages ---------- */
.detail-cover {
    margin: 0 0 2.5rem;
}

.detail-cover img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

.detail-subtitle {
    margin-top: 3rem;
    font-size: var(--fs-xl);
}

/* ---------- Article ---------- */
.article-hero__title {
    font-size: var(--fs-3xl);
    color: var(--c-white);
}

.article-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin: 0;
    font-size: var(--fs-sm);
}

.article-hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.article-hero .container {
    position: relative;
    z-index: 1;
}

.article-cover {
    margin: -3rem 0 3rem;
    position: relative;
    z-index: 2;
}

.article-cover img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.article .container--narrow:last-child {
    padding-bottom: var(--space-section);
}

/* ---------- Contact ---------- */
.contact-info h2 {
    font-size: var(--fs-2xl);
}

.contact-info > p {
    color: var(--c-muted);
}

.contact-cards {
    display: grid;
    gap: 1rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.contact-cards li {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.contact-cards h3 {
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.contact-cards a,
.contact-cards p {
    display: block;
    margin: 0;
    font-weight: 600;
    text-decoration: none;
}

.contact-cards__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--g-brand);
    color: var(--c-white);
}

.contact-cards__icon--wa {
    background: #25d366;
}

.contact-cards__icon--tg {
    background: #1f94cf;
}

/* ---------- Legal ---------- */
.legal-toc {
    display: grid;
    gap: 1.25rem;
    padding: 1.5rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    background: var(--surface-alt);
    font-size: var(--fs-sm);
}

.legal-toc__title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--c-heading);
}

.legal-toc ol {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.2rem;
}

.legal-toc a {
    color: var(--c-muted);
    text-decoration: none;
}

.legal-toc a:hover {
    color: var(--c-brand-700);
}

@media (min-width: 900px) {
    .legal-toc { position: sticky; top: calc(var(--header-h) + 24px); }
}

.legal h2 {
    padding-top: 0.5rem;
}

.legal ol[type] li::marker {
    font-weight: 600;
    color: var(--c-brand);
}

.legal-notice {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--c-warning-bg);
    font-weight: 700;
    color: var(--c-warning);
}

.legal-summary {
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--c-brand);
    border-radius: var(--radius-sm);
    background: rgba(66, 139, 202, 0.1);
    color: var(--c-heading);
}

.legal-rights dt {
    margin-top: 1.25rem;
    font-weight: 700;
    color: var(--c-heading);
}

.legal-rights dd {
    margin: 0.3rem 0 0;
}

/* ---------- Error & message pages ---------- */
.section--center {
    background: var(--g-dark);
    color: rgba(255, 255, 255, 0.78);
}

.section--center h1 {
    color: var(--c-white);
}

.error-page__code {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(5rem, 3rem + 10vw, 9rem);
    font-weight: 800;
    line-height: 1;
    background: var(--g-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.section--center .btn--outline {
    --btn-fg: var(--c-white);
    --btn-border: rgba(255, 255, 255, 0.3);
}

/* ==========================================================
   Immersive sections (particle choreography)
   ========================================================== */

/* HUD corner brackets */
.hud {
    position: relative;
}

.hud::before,
.hud::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid var(--c-cyan);
    opacity: 0.7;
    pointer-events: none;
}

.hud::before {
    top: -1px;
    left: -1px;
    border-right: 0;
    border-bottom: 0;
}

.hud::after {
    right: -1px;
    bottom: -1px;
    border-left: 0;
    border-top: 0;
}

.index-label {
    font-family: var(--font-display);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--c-cyan);
}

/* ---------- Our results (sticky, 4 steps) ---------- */
.results {
    position: relative;
    height: 420vh;
}

.results__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

.results__head {
    position: absolute;
    top: calc(var(--header-h) + 2.5vh);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.results__panels {
    position: absolute;
    inset: calc(var(--header-h) + 7vh) 0 auto;
    height: 46vh;
}

.result {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    filter: blur(8px);
    transition: opacity 0.7s var(--ease), transform 0.9s var(--ease), filter 0.7s var(--ease);
}

.result.is-active {
    opacity: 1;
    transform: none;
    filter: none;
}

.result__value {
    position: relative;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(6rem, 3rem + 13vw, 13rem);
    font-weight: 200;
    line-height: 0.9;
    letter-spacing: -0.06em;
    background: linear-gradient(180deg, #ffffff 30%, rgba(143, 193, 234, 0.55));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.result__value sup {
    position: absolute;
    top: 0.2em;
    margin-left: 0.05em;
    font-size: 0.32em;
    font-weight: 300;
    letter-spacing: 0;
    color: var(--c-cyan);
    -webkit-text-fill-color: var(--c-cyan);
}

.result__label {
    margin: 0.75rem 0 0.4rem;
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--c-white);
}

.result__text {
    max-width: 460px;
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--c-muted);
}

.results__station {
    position: absolute;
    left: 50%;
    bottom: 2vh;
    width: min(980px, 94vw);
    height: 44vh;
    transform: translateX(-50%);
}

.results__station .station {
    height: 100%;
    aspect-ratio: auto;
}

.results__rail {
    position: absolute;
    top: 50%;
    right: max(1.5rem, calc((100vw - var(--container)) / 2));
    display: grid;
    gap: 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
    transform: translateY(-50%);
}

.results__rail li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: var(--fs-xs);
    letter-spacing: 0.15em;
    color: var(--c-subtle);
    transition: color var(--dur);
}

.results__rail li::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
    transition: width var(--dur) var(--ease);
}

.results__rail li.is-active {
    color: var(--c-cyan);
}

.results__rail li.is-active::before {
    width: 36px;
}

@media (max-width: 767px) {
    .results {
        height: 360vh;
    }

    .results__rail {
        display: none;
    }
}

/* ---------- Service journey ---------- */
.journey {
    display: grid;
}

.journey__item {
    display: grid;
    align-items: center;
    gap: 1.5rem;
    min-height: 82vh;
    padding-block: 4rem;
    border-top: 1px solid var(--c-border);
}

.journey__item:last-child {
    border-bottom: 1px solid var(--c-border);
}

.journey__content {
    max-width: 540px;
}

.journey__index {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.journey__index::after {
    content: "";
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, var(--c-cyan), transparent);
}

.journey__title {
    font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
    font-weight: 300;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.journey__title a {
    color: inherit;
    text-decoration: none;
}

.journey__summary {
    font-size: var(--fs-lg);
    color: var(--c-muted);
}

.journey__features {
    display: grid;
    gap: 0.5rem;
    margin: 1.5rem 0 2rem;
    padding: 0;
    list-style: none;
}

.journey__features li {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--c-border);
    font-size: var(--fs-sm);
    color: var(--c-text);
}

.journey__features li::before {
    content: "+";
    color: var(--c-cyan);
}

.journey__station .station {
    aspect-ratio: auto;
    height: clamp(280px, 38vw, 520px);
}

@media (min-width: 900px) {
    .journey__item {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }

    .journey__item:nth-child(even) .journey__station {
        order: -1;
    }
}

@media (max-width: 899px) {
    .journey__item {
        min-height: auto;
        padding-block: 2.5rem 3.5rem;
    }

    .journey__station {
        order: -1;
    }

    .journey__station .station {
        height: 36vh;
    }
}

/* ---------- Tech stack ---------- */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    border-top: 1px solid var(--c-border);
    border-left: 1px solid var(--c-border);
}

.stack-cell {
    position: relative;
    display: grid;
    gap: 0.35rem;
    padding: 1.75rem 1.5rem;
    border-right: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    transition: background-color var(--dur);
}

.stack-cell:hover {
    background: rgba(66, 139, 202, 0.08);
}

.stack-cell__name {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--c-white);
}

.stack-cell__type {
    font-size: var(--fs-xs);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-subtle);
}

/* ---------- Process with station ---------- */
.process-layout {
    display: grid;
    gap: 2rem;
    align-items: center;
}

.process-layout .process {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .process-layout .process {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .process-layout {
        grid-template-columns: 1.4fr 1fr;
        gap: 3rem;
    }
}

.process__step .icon {
    color: var(--c-cyan);
}

/* Sitemap page */
.sitemap-list ul { columns: 2 16rem; column-gap: 2.5rem; margin: 0 0 1.5rem; padding-left: 1.2rem; }
.sitemap-list li { break-inside: avoid; margin: 0 0 0.45rem; }
.sitemap-list__note { margin-top: 2rem; font-size: 0.92rem; color: var(--c-muted); }
