/* ==========================================================================
   Clopix — How It Works
   Editorial layout: left-aligned header, timeline steps.
   ========================================================================== */

/* ── Shell ──────────────────────────────────────────────────────────────── */
.hiw {
    position: relative;
    background: var(--color-black);
    padding-block: clamp(3rem, 5vw, 4.5rem) clamp(4rem, 8vw, 7rem);
    overflow: hidden;
}

/* Top edge separator — subtle glow line between hero and this section */
.hiw::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right,
        transparent         0%,
        rgba(201,169,122,0.08) 15%,
        rgba(201,169,122,0.22) 50%,
        rgba(201,169,122,0.08) 85%,
        transparent        100%
    );
}

/* Soft ambient glow behind the line */
.hiw::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 80px;
    background: radial-gradient(
        ellipse 60% 100% at 50% 0%,
        rgba(201,169,122,0.04) 0%,
        transparent 100%
    );
    pointer-events: none;
}

.hiw__inner {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.hiw__header {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
    margin-bottom: var(--space-12);
}
.hiw.is-armed:not(.is-visible) .hiw__header {
    opacity: 0;
    transform: translateY(16px);
}
.hiw.is-visible .hiw__header { opacity: 1; transform: none; }

.hiw__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-6);
}
.hiw__eyebrow-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    flex-shrink: 0;
}

.hiw__heading {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.8vw, 3.25rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--color-white);
    white-space: nowrap;
    margin-bottom: var(--space-4);
}

.hiw__subtitle {
    font-size: var(--fs-md);
    color: rgba(255, 255, 255, 0.38);
    line-height: var(--lh-normal);
    max-width: 52ch;
}

/* ── Steps ──────────────────────────────────────────────────────────────── */
.hiw__steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1rem, 2vw, 1.5rem);
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.hiw__step {
    position: relative;
    padding: clamp(1.75rem, 3vw, 2.5rem);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(201, 169, 122, 0.22);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35),
                0 0 0 1px rgba(201, 169, 122, 0.06);
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease,
                border-color 0.35s ease, background 0.35s ease,
                box-shadow 0.35s ease;
}
.hiw.is-armed:not(.is-visible) .hiw__step {
    opacity: 0;
    transform: translateY(24px);
}
.hiw.is-visible .hiw__step               { opacity: 1; transform: none; }
.hiw.is-visible .hiw__step[data-step="1"] { transition-delay: 0.12s; }
.hiw.is-visible .hiw__step[data-step="2"] { transition-delay: 0.24s; }

.hiw__step:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(201, 169, 122, 0.38);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45),
                0 0 0 1px rgba(201, 169, 122, 0.12);
    transform: translateY(-3px);
}

/* Gold top accent line — always visible, breathes on hover */
.hiw__step-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--color-accent);
    opacity: 0.45;
    transition: opacity 0.35s ease;
}
.hiw__step:hover .hiw__step-accent {
    opacity: 1;
    animation: hiwAccentPulse 1.8s ease-in-out infinite;
}

@keyframes hiwAccentPulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

/* Step number — large ghost numeral, decorative backdrop */
.hiw__step-num {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(4.5rem, 7vw, 7rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: -0.04em;
    line-height: 0.85;
    color: transparent;
    -webkit-text-stroke: 1px rgba(201, 169, 122, 0.18);
    text-stroke: 1px rgba(201, 169, 122, 0.18);
    margin-bottom: var(--space-6);
    transition: -webkit-text-stroke-color 0.35s ease;
    user-select: none;
}
.hiw__step:hover .hiw__step-num {
    -webkit-text-stroke-color: rgba(201, 169, 122, 0.35);
}

/* Title */
.hiw__step-title {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 2vw, 1.75rem);
    font-weight: 400;
    color: var(--color-white);
    line-height: 1.2;
    margin-bottom: var(--space-4);
    transition: color 0.3s ease;
}
.hiw__step:hover .hiw__step-title { color: var(--color-accent); }

/* Description */
.hiw__step-desc {
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.75;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hiw__heading { white-space: normal; }
    .hiw__steps {
        grid-template-columns: 1fr;
        gap: var(--space-4);
        max-width: 480px;
    }
    .hiw__step:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hiw__header,
    .hiw__step {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hiw__step-accent { transition: none; }
    .hiw__step-title  { transition: none; }
}
