/*
=====================================================================
AMIABLE IMPEX — HOMEPAGE HERO (textured obsidian)
Dark brushed-metal canvas with a fine engineering grid, grain and a
soft copper light; framed factory film with blueprint corner ticks;
glass trust bar. Sits directly under the white sticky menu.
Uses tokens from nx-theme.css. Markup: resources/views/home.php (.hm)
=====================================================================
*/

.hm {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 96px 0 72px;
    color: var(--nx-bone);
    background-color: #0c0e12;
    background-image:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 6px),
        linear-gradient(180deg, #11141a 0%, #0b0c0f 100%);
}

/* ---------- Texture layers ---------- */
.hm-texture { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hm-texture > span { position: absolute; inset: 0; }

/* Fine engineering grid, faded toward the edges */
.hm-tex-grid {
    background-image:
        linear-gradient(rgba(243, 238, 230, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 238, 230, .055) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: -1px -1px;
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 60% 40%, #000 0%, transparent 78%);
            mask-image: radial-gradient(ellipse 75% 70% at 60% 40%, #000 0%, transparent 78%);
}

/* Film grain */
.hm-tex-grain {
    opacity: .2;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Copper light behind the film + a cool floor */
.hm-tex-glow {
    background:
        radial-gradient(640px 460px at 78% 38%, rgba(229, 52, 59, .22), transparent 70%),
        radial-gradient(520px 380px at 6% 100%, rgba(229, 52, 59, .08), transparent 70%);
}

/* Copper hairline under the menu */
.hm::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(166, 207, 63, .55) 30%, rgba(166, 207, 63, .55) 70%, transparent);
}

.hm-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 64px;
}

/* ---------- Copy ---------- */
.hm-copy { display: grid; justify-items: start; max-width: 600px; }

.hm-kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px 9px 14px;
    font: 600 11px/1.3 var(--nx-sans);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--nx-copper-2);
    background: rgba(229, 52, 59, .08);
    border: 1px solid rgba(166, 207, 63, .28);
    border-radius: 999px;
}
.hm-kicker::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--nx-copper-2);
    box-shadow: 0 0 0 4px rgba(166, 207, 63, .15);
}

html body.nx-ui main .hm-title {
    --h-ff: var(--nx-serif);
    --h-fs: clamp(26px, 2.3vw, 34px);
    --h-lh: 1.2;
    --h-fw: 400;
    --h-ls: -.015em;
    margin-top: 26px;
    color: #f6f2eb !important;
}
.hm-title span { font-style: normal; color: var(--nx-copper-2); }

.hm-tagline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
    font: 600 14.5px/1.5 var(--nx-sans);
    letter-spacing: .01em;
    color: #f6f2eb;
}
.hm-tagline::before { content: ""; width: 28px; height: 1px; background: var(--nx-copper); }

.hm-lead {
    margin-top: 12px !important;
    max-width: 540px;
    font-size: 15px !important;
    line-height: 1.8 !important;
    color: rgba(243, 238, 230, .66) !important;
}

.hm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 38px; }

.hm-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: 500 14.5px/1 var(--nx-sans);
    text-decoration: none;
    transition: background .35s var(--nx-ease), color .35s var(--nx-ease), border-color .35s var(--nx-ease), box-shadow .35s var(--nx-ease);
}
.hm-btn > span { transition: transform .35s var(--nx-ease); }
.hm-btn:hover > span { transform: translateX(3px); }
.hm-btn--ghost:hover > span { transform: translateY(2px); }
.hm-btn:focus-visible { outline: 2px solid var(--nx-copper-2); outline-offset: 4px; }

.hm-btn--solid {
    min-height: 52px;
    padding: 0 28px;
    color: #fff;
    background: var(--nx-copper-grad);
    border-radius: 999px;
    box-shadow: 0 14px 34px -14px rgba(229, 52, 59, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.hm-btn--solid:hover { color: #fff; box-shadow: 0 18px 40px -12px rgba(229, 52, 59, .85), inset 0 1px 0 rgba(255, 255, 255, .35); }

.hm-btn--ghost {
    min-height: 52px;
    padding: 0 24px;
    color: #f6f2eb;
    border: 1px solid rgba(243, 238, 230, .24);
    border-radius: 999px;
}
.hm-btn--ghost:hover { color: var(--nx-copper-2); border-color: rgba(166, 207, 63, .6); background: rgba(229, 52, 59, .06); }

/* ---------- Media ---------- */
.hm-media {
    position: relative;
    margin: 0;
    justify-self: end;
    width: min(100%, 720px);
    padding: 14px;
}

/* Offset copper outline plate for depth */
.hm-backplate {
    position: absolute;
    inset: 14px;
    transform: translate(22px, 22px);
    border: 1px solid rgba(166, 207, 63, .32);
    border-radius: 22px;
    background: linear-gradient(140deg, rgba(229, 52, 59, .12), transparent 55%);
}

/* Blueprint corner ticks */
.hm-tick { position: absolute; width: 18px; height: 18px; border-color: var(--nx-copper-2); border-style: solid; border-width: 0; }
.hm-tick--tl { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.hm-tick--tr { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.hm-tick--bl { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.hm-tick--br { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }

.hm-frame {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 20px;
    background: #1a1d23 url("../images/homepage/hero-video-poster.png") center / cover no-repeat;
    box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(243, 238, 230, .08);
}
.hm-frame::after { /* soft vignette for legibility of the chips */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(11, 12, 15, .45));
    pointer-events: none;
    transition: opacity .4s var(--nx-ease);
}
.hm-media.is-playing .hm-frame::after { opacity: 0; }
.hm-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.hm-play {
    position: absolute;
    left: 50%; top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 78px; height: 78px;
    margin: -39px 0 0 -39px;
    padding-left: 4px;
    font-size: 18px;
    color: #fff;
    background: var(--nx-copper-grad);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 10px rgba(166, 207, 63, .18), 0 18px 40px -12px rgba(0, 0, 0, .6);
    transition: transform .4s var(--nx-ease), box-shadow .4s var(--nx-ease);
}
.hm-play:hover { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(166, 207, 63, .22), 0 18px 40px -12px rgba(0, 0, 0, .6); }
.hm-play:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.hm-media.is-playing .hm-play { left: auto; top: auto; right: 18px; bottom: 18px; margin: 0; width: 46px; height: 46px; padding: 0; font-size: 13px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6); }

.hm-note {
    position: absolute;
    left: 18px;
    top: 18px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    font: 500 12px/1.3 var(--nx-sans);
    color: #f6f2eb;
    background: rgba(11, 12, 15, .55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 238, 230, .14);
    border-radius: 999px;
    transition: opacity .4s var(--nx-ease);
}
.hm-media.is-playing .hm-note { opacity: 0; }
.hm-note i { width: 6px; height: 6px; border-radius: 50%; background: var(--nx-red); box-shadow: 0 0 0 3px rgba(227, 38, 47, .25); }

/* Statement card overlapping the film */
.hm-caption {
    position: absolute;
    left: -44px;
    bottom: 48px;
    z-index: 3;
    margin: 0;
}
.hm-impact {
    display: block;
    padding: 18px 22px 18px 20px;
    font: 400 16px/1.35 var(--nx-serif);
    color: var(--nx-ink);
    background: #faf8f4;
    border-left: 2px solid var(--nx-copper);
    border-radius: 4px 14px 14px 4px;
    box-shadow: 0 26px 50px -22px rgba(0, 0, 0, .75);
}

/* ---------- Trust bar ---------- */
.hm-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 88px;
    background: rgba(243, 238, 230, .035);
    border: 1px solid rgba(243, 238, 230, .1);
    border-radius: 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.hm-stats::before { /* copper seam on the top edge */
    content: "";
    position: absolute;
    left: 24px; right: 24px; top: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--nx-copper-2), transparent);
}
.hm-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 26px 22px;
}
.hm-stat + .hm-stat { border-left: 1px solid rgba(243, 238, 230, .08); }
.hm-stat-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    font: 600 10.5px/1 var(--nx-sans);
    letter-spacing: .02em;
    color: var(--nx-copper-2);
    background: rgba(229, 52, 59, .08);
    border: 1px solid rgba(166, 207, 63, .3);
    border-radius: 12px;
}
.hm-stat strong { display: block; font: 400 21px/1 var(--nx-serif); color: #f6f2eb; }
.hm-stat small { display: block; margin-top: 7px; font: 500 10.5px/1.4 var(--nx-sans); letter-spacing: .08em; text-transform: uppercase; color: rgba(243, 238, 230, .55); }

/* ---------- Entrance ---------- */
.hm-in { animation: hm-rise .9s var(--nx-ease) var(--d, 0s) both; }
@keyframes hm-rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .hm-grid { gap: 64px; }
    .hm-caption { left: -24px; }
    .hm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hm-stat:nth-child(4) { border-left: 0; }
    .hm-stat:nth-child(n+4) { border-top: 1px solid rgba(243, 238, 230, .08); }
}

@media (max-width: 1000px) {
    .hm { padding: 72px 0 64px; }
    .hm-grid { grid-template-columns: 1fr; gap: 56px; }
    .hm-copy { max-width: 640px; }
    .hm-media { justify-self: start; width: 100%; }
    .hm-frame { aspect-ratio: 16 / 10; }
    .hm-caption { left: auto; right: -8px; bottom: -22px; }
}

@media (max-width: 640px) {
    .hm { padding: 56px 0 48px; }
    .hm-tex-grid { background-size: 44px 44px; }
    .hm-actions { gap: 12px; }
    .hm-btn--solid, .hm-btn--ghost { min-height: 48px; padding: 0 22px; }
    .hm-media { padding: 10px; }
    .hm-backplate { inset: 10px; transform: translate(12px, 12px); }
    .hm-frame { aspect-ratio: 16 / 10; border-radius: 16px; }
    .hm-play { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
    .hm-note { left: 12px; top: 12px; }
    .hm-caption { position: relative; right: auto; bottom: auto; margin: -28px 18px 0 auto; width: max-content; max-width: 80%; }
    .hm-impact { font-size: 15px; padding: 14px 18px; }
    .hm-stats { grid-template-columns: 1fr 1fr; margin-top: 56px; }
    .hm-stat { padding: 18px 14px; border-left: 0 !important; border-top: 1px solid rgba(243, 238, 230, .08); }
    .hm-stat:nth-child(even) { border-left: 1px solid rgba(243, 238, 230, .08) !important; }
    .hm-stat:nth-child(-n+2) { border-top: 0; }
    .hm-stat:last-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .hm-in { animation: none !important; }
}

/* ---------- YouTube factory video (loads into the frame on play) ---------- */
.hm-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hm-media.is-yt .hm-play,
.hm-media.is-yt .hm-note { opacity: 0; visibility: hidden; pointer-events: none; }
.hm-media.is-yt .hm-frame { background: #000; } /* keep the same (large) frame size while playing */
.hm-media.is-yt .hm-video { z-index: 3; }
.hm-caption { transition: opacity .4s var(--nx-ease), visibility .4s; }
.hm-media.is-yt .hm-caption { opacity: 0; visibility: hidden; } /* nothing covers the playing video */
