/* ============================================================
   Homepage — section styles. Loaded only on "/".
   Built section-by-section (PR 1.3). Tokens come from style.css.
   ============================================================ */

/* ---------- Hero ---------- */
/* Full-bleed: edge-to-edge width, no container max-width or side padding. The
   fixed site header is cleared with top padding so it doesn't overlap. */
.home-hero-wrap {
    width: 100%;
    padding: var(--header-height) 0 0;
}

.home-hero {
    position: relative;
    width: 100%;
    /* Always dark behind the video — letterbox bars / loading frame must
       read as part of the cinematic hero, not flip with the page theme. */
    background: #000;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - var(--header-height));
}

.home-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .2) 30%, rgba(0, 0, 0, .5) 70%, rgba(0, 0, 0, .7) 100%);
}

.home-hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(255, 90, 0, .18) 0%, transparent 60%);
}

/* LIVE badge — anchored to .home-hero-inner so it aligns to the container. */
.home-hero-live {
    position: absolute;
    top: 16px;
    left: var(--spacing-md);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-hero-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.home-hero-live-text {
    font-size: 10px;
    color: rgba(255, 255, 255, .65);
    letter-spacing: .15em;
}

/* Mute toggle */
.home-hero-mute {
    position: absolute;
    top: 14px;
    right: var(--spacing-md);
    z-index: 3;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.home-hero-mute:hover {
    background: rgba(255, 255, 255, .22);
}

/* Content frame — reuses .container (max-width + centering + gutter) so the
   text/CTAs line up with every other section, while the video runs full-bleed
   behind it. */
.home-hero-inner {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-hero-content {
    max-width: 540px;
}

.home-hero-kicker {
    font-size: 11px;
    color: rgba(255, 90, 0, .95);
    letter-spacing: .2em;
    text-transform: uppercase;
    margin: 0 0 16px;
}

.home-hero-title {
    font-family: var(--font-body);
    font-size: 56px;
    font-weight: 500;
    color: #fff;
    line-height: 1.05;
    letter-spacing: -.02em;
    margin: 0 0 16px;
    max-width: 540px;
}

.home-hero-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, .75);
    line-height: 1.5;
    max-width: 460px;
    margin: 0 0 28px;
}

.home-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.home-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-ghost {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    border: .5px solid rgba(255, 255, 255, .2);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, .18);
}

/* Counters */
.home-hero-stats {
    position: absolute;
    bottom: 20px;
    right: var(--spacing-md); /* align to the .container content right edge */
    z-index: 2;
    display: flex;
    gap: 24px;
    align-items: baseline;
}

.home-hero-stat {
    text-align: right;
}

.home-hero-stat-num {
    display: block;
    font-size: 24px;
    font-weight: 500;
    color: #fff;
    line-height: 1;
}

.home-hero-stat-label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, .6);
    margin-top: 3px;
    letter-spacing: .05em;
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-video {
        display: none;
    }
}

/* ---------- Hero — mobile (portrait, content at the bottom) ---------- */
@media (max-width: 768px) {
    .home-hero-wrap {
        padding: 0;
        max-width: none;
    }

    .home-hero {
        border-radius: 0;
        aspect-ratio: 9 / 14;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .home-hero-overlay {
        background: linear-gradient(0deg, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, 0) 70%);
    }

    .home-hero-glow {
        background: radial-gradient(ellipse at 70% 40%, rgba(255, 90, 0, .18) 0%, transparent 60%);
    }

    .home-hero-live {
        top: 64px;
        left: 16px;
    }

    .home-hero-mute {
        top: 62px;
        right: 16px;
    }

    .home-hero-inner {
        justify-content: flex-end;
    }

    .home-hero-content {
        max-width: none;
    }

    .home-hero-kicker {
        font-size: 10px;
    }

    .home-hero-title {
        font-size: 32px;
    }

    .home-hero-subtitle {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .home-hero-actions {
        gap: 6px;
    }

    .home-hero-cta {
        flex: 1;
        justify-content: center;
    }

    .home-hero-stats {
        position: static;
        margin-top: 14px;
        padding-top: 14px;
        border-top: .5px solid rgba(255, 255, 255, .15);
        gap: 16px;
        justify-content: flex-start;
    }

    .home-hero-stat {
        text-align: left;
    }

    .home-hero-stat-num {
        font-size: 18px;
    }

    .home-hero-stat-label {
        font-size: 9px;
    }
}

/* ---------- Trust-bar ---------- */
.trust-bar {
    margin-bottom: var(--spacing-md);
}

.trust-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding-top: 14px;
    padding-bottom: 14px;
    border-top: 0.5px solid var(--border-soft);
    border-bottom: 0.5px solid var(--border-soft);
}

.trust-bar-label {
    margin: 0;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.trust-bar-list {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trust-bar-item {
    font-family: var(--font-heading);
    font-size: 18px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-light);
    opacity: .65;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.trust-bar-item:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .trust-bar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        border-top: none;
    }

    .trust-bar-label {
        font-size: 10px;
    }

    .trust-bar-list {
        gap: 20px;
        max-width: 100%;
        overflow-x: auto;
        opacity: .65;
        -webkit-overflow-scrolling: touch;
    }

    .trust-bar-item {
        flex: 0 0 auto;
        font-size: 16px;
    }
}

/* ---------- Shared section heads ---------- */
.home-section-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.home-section-link:hover {
    opacity: .85;
}

.home-section-sub {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 540px;
    margin: 0;
}

.home-services-head,
.home-reviews-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.home-process-head {
    margin-bottom: 20px;
}

.home-services-head .section-title,
.home-reviews-head .section-title,
.home-process-head .section-title {
    margin-bottom: 8px;
}

.home-services-intro {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 540px;
    margin: 0 0 18px;
}

/* ---------- Services ---------- */
.home-services-grid {
    display: grid;
    gap: 12px;
}

.home-services-grid--large {
    grid-template-columns: repeat(3, 1fr);
}

.home-services-grid--small {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 12px;
}

.service-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius-lg);
    text-decoration: none;
    background-color: var(--service-card-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 0.5px solid var(--service-card-border);
    transition: transform .2s ease;
}

.service-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 20%, rgba(255, 90, 0, .16) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card--large {
    aspect-ratio: 4 / 3;
}

.service-card--small {
    aspect-ratio: 16 / 6;
}

.service-card-body {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    background: linear-gradient(0deg, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, 0) 100%);
}

.service-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.service-card--small .service-card-title {
    font-size: 16px;
}

.service-card-sub {
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, .75);
}

.service-card--small .service-card-sub {
    font-size: 11px;
}

/* ---------- Process ---------- */
.home-process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-process-step {
    padding: 18px;
    background: var(--surface-1);
    border: .5px solid var(--border-soft);
    border-radius: var(--radius-lg);
}

.home-process-num {
    display: block;
    margin-bottom: 12px;
    font-family: var(--font-heading);
    font-size: 28px;
    line-height: 1;
    color: rgba(255, 90, 0, .95);
}

.home-process-step-title {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

.home-process-step-text {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ---------- Reviews ---------- */
.home-reviews-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.home-review {
    margin: 0;
    padding: 18px;
    background: var(--surface-1);
    border: .5px solid var(--border-soft);
    border-radius: var(--radius-lg);
}

.home-review-stars {
    margin-bottom: 10px;
    color: #ffb400;
    font-size: 13px;
    letter-spacing: 2px;
    line-height: 1;
}

.home-review-text {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-light);
}

.home-review-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-review-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 90, 0, .16);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}

img.home-review-avatar {
    object-fit: cover;
}

.home-review-meta {
    display: flex;
    flex-direction: column;
}

.home-review-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
}

.home-review-name a {
    color: inherit;
    text-decoration: none;
}

.home-review-name a:hover {
    text-decoration: underline;
}

.home-review-car {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---------- CTA + contacts ---------- */
.home-cta-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 28px 32px;
    color: var(--cta-card-text);
    background: var(--cta-card-bg);
    border: 0.5px solid var(--cta-card-border);
    border-radius: var(--radius-lg);
}

.home-cta-title {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--cta-card-text);
}

.home-cta-sub {
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--cta-card-muted);
}

.home-cta-actions {
    display: flex;
    gap: 8px;
}

.home-cta-actions .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-whatsapp {
    background: #25d366;
    color: #fff;
}

.btn-whatsapp:hover {
    background: #20bd5a;
}

.home-cta-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding-left: 24px;
    border-left: .5px solid var(--cta-card-border);
}

.home-cta-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--cta-card-text);
}

.home-cta-info-item a {
    color: var(--cta-card-text);
    text-decoration: none;
}

.home-cta-info-item a:hover {
    color: var(--primary);
}

.home-cta-info-icon {
    font-size: 15px;
}

/* ---------- Sections — mobile ---------- */
@media (max-width: 768px) {
    .home-services-grid--large {
        grid-template-columns: 1fr;
    }

    .service-card--large {
        aspect-ratio: 16 / 9;
    }

    .service-card--small {
        aspect-ratio: 1 / 1;
    }

    .home-process-steps {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .home-process-step {
        display: flex;
        gap: 14px;
        align-items: flex-start;
        padding: 14px;
    }

    .home-process-num {
        margin-bottom: 0;
        min-width: 32px;
        flex-shrink: 0;
        font-size: 22px;
    }

    .home-reviews-list {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .home-review {
        flex: 0 0 280px;
        padding: 14px;
    }

    .home-review-text {
        font-size: 13px;
    }

    .home-cta-box {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 18px;
    }

    .home-cta-title {
        font-size: 24px;
    }

    /* Stack the CTAs: side-by-side they (esp. WhatsApp) don't shrink below their
       uppercase min-content width and push the column past the viewport. */
    .home-cta-actions {
        flex-direction: column;
    }

    .home-cta-actions .btn {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    .home-cta-info {
        padding-left: 0;
        padding-top: 16px;
        border-left: none;
        border-top: .5px solid var(--cta-card-border);
    }
}

/* ---------- Instagram gallery ---------- */
.home-instagram {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.home-ig-tile {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: var(--media-tile-bg);
    background-size: cover;
    background-position: center;
    transition: transform .2s ease;
}

.home-ig-tile:hover {
    transform: scale(1.02);
}

/* Tinted placeholders until real media URLs (inline background-image) override. */
.home-ig-tile:nth-child(1) { background-image: linear-gradient(135deg, #1a1f3a, #0e1020); }
.home-ig-tile:nth-child(2) { background-image: linear-gradient(135deg, #3a1a1f, #20100e); }
.home-ig-tile:nth-child(3) { background-image: linear-gradient(135deg, #1a3a25, #0e2014); }
.home-ig-tile:nth-child(4) { background-image: linear-gradient(135deg, #3a2a1a, #20160e); }

.home-ig-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: rgba(255, 255, 255, .85);
}

/* Reel/video posts autoplay (muted) right in the tile. */
.home-ig-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .home-instagram {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .home-ig-icon {
        width: 14px;
        height: 14px;
    }
}

/* Instagram post viewer (on-site carousel; click a tile to open) */
.igv-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .9);
}

.igv-overlay.is-open { display: flex; }

.igv-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: min(92vw, 540px);
}

.igv-media {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 78vh;
}

.igv-el {
    max-width: 100%;
    max-height: 78vh;
    border-radius: var(--radius-md);
    display: block;
}

.igv-close,
.igv-prev,
.igv-next {
    position: absolute;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    border: none;
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
}

.igv-close {
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    font-size: 22px;
}

.igv-prev,
.igv-next {
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    font-size: 26px;
}

.igv-prev { left: -54px; }
.igv-next { right: -54px; }

.igv-dots { display: flex; gap: 6px; }

.igv-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .35);
}

.igv-dot.is-on { background: #fff; }

.igv-open {
    color: #fff;
    font-size: .85rem;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
}

.igv-open:hover { background: rgba(255, 255, 255, .12); }

@media (max-width: 768px) {
    .igv-prev { left: 4px; }
    .igv-next { right: 4px; }
    .igv-close { top: -8px; right: 4px; }
}

/* Featured projects (pinned portfolio cases) */
.home-featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; }
.home-featured-card { position: relative; min-height: 260px; display: flex; align-items: flex-end; padding: 18px; border-radius: var(--radius-md, 12px); background-color: var(--media-tile-bg); background-image: url("/assets/images/placeholder.svg"); background-size: cover; background-position: center; text-decoration: none; overflow: hidden; border: .5px solid var(--border-soft); transition: transform var(--transition-fast, .15s ease), border-color .15s ease; }
.home-featured-card:hover { transform: translateY(-3px); border-color: rgba(255,90,0,.4); }
/* The bottom dark wash makes the title legible regardless of the photo —
   keep it dark in both themes; the text sits on the photo, not the page bg. */
.home-featured-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,10,10,.92), rgba(10,10,10,.15)); }
.home-featured-body { position: relative; display: flex; flex-direction: column; gap: 2px; color: #fff; }
.home-featured-brand { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,90,0,.95); }
.home-featured-title { font-weight: 600; }
@media (max-width: 768px) {
    .home-featured-grid { grid-template-columns: 1fr; }
}

/* Trust-bar uploaded logos (Phase 7-admin-C): height-constrained, muted to
   match the text marks; brighten on hover. */
.trust-bar-logo {
    height: 26px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    opacity: .55;
    filter: grayscale(1);
    transition: opacity .2s, filter .2s;
}
.trust-bar-item:hover .trust-bar-logo { opacity: 1; filter: none; }

/* Uploaded review avatar (Phase 7-admin-C): same circle as the initials span. */
img.home-review-avatar { object-fit: cover; }

/* ---- AI Wrap Preview demo (MASTER §3.6) ---------------------------------- */
.wrap-demo-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
}
.wrap-demo-stage {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--media-tile-bg);
    /* The stage owns the box; both image layers are absolute inside it. */
    aspect-ratio: 16 / 10;
}
.wrap-demo-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Cross-dissolve: only the front layer is opaque; the cycler fades the next
       colour in on the back layer. Backgrounds are identical → the photo looks
       perfectly static, only the car colour transitions. */
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
    will-change: opacity;
}
.wrap-demo-img.is-front { opacity: 1; }
.wrap-demo-badge {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    backdrop-filter: blur(6px);
}
.wrap-demo-color { font-family: var(--font-heading); font-size: 1.05rem; letter-spacing: 0.02em; }
.wrap-demo-counter { font-size: 0.75rem; opacity: 0.7; }
.wrap-demo-sub { color: var(--text-muted); margin: 12px 0 20px; max-width: 46ch; }
.wrap-demo-cta { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
    .wrap-demo-img { transition: none; }
}

@media (min-width: 880px) {
    .wrap-demo-inner { grid-template-columns: 1.4fr 1fr; gap: 40px; }
}
