/*
=====================================================================
AMIABLE IMPEX — SHARED INNER-PAGE BASE (round 2 design system)
Base type, wrap, section, headings, buttons + dark textured page
banner (.ph). Load after partials.global-styles on inner pages.
Body class: "nx-ui nx-inner <page>".
Logo palette tokens live in nx-theme.css (copper = red, copper-2 = lime).
=====================================================================
*/

/* ---------- Base ---------- */
body.nx-ui {
    margin: 0;
    background: var(--nx-paper);
    color: var(--nx-text);
    font-family: var(--nx-sans);
    font-size: 15.5px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.nx-ui main { display: block; }
body.nx-ui main p { margin: 0; }
body.nx-ui main img { max-width: 100%; }
body.nx-ui ::selection { background: var(--nx-copper); color: #fff; }

/* Neutralise the global h1–h4 !important sizes; each heading sets its own vars */
html body.nx-ui main :is(h1, h2, h3, h4) {
    margin: 0;
    font-family: var(--h-ff, var(--nx-serif)) !important;
    font-size: var(--h-fs, 18px) !important;
    line-height: var(--h-lh, 1.3) !important;
    font-weight: var(--h-fw, 600) !important;
    letter-spacing: var(--h-ls, -.005em);
    color: inherit;
}

.nx-wrap { position: relative; z-index: 1; max-width: var(--nx-wrap); margin: 0 auto; padding: 0 28px; }
.nx-section { position: relative; padding: 112px 0; }
.nx-dark { background: var(--nx-ink); color: var(--nx-bone); }
.nx-br { display: inline; }

.nx-kicker--dark { color: var(--nx-copper-3); }

.nx-h2 {
    --h-ff: var(--nx-serif);
    --h-fs: clamp(27px, 2.6vw, 38px);
    --h-lh: 1.15;
    --h-fw: 400;
    --h-ls: -.018em;
}
.nx-h2 em { font-style: normal; color: var(--nx-copper-3); }
.nx-dark .nx-h2 em { color: var(--nx-copper-2); }

.nx-head { display: grid; gap: 22px; margin-bottom: 64px; }
.nx-head p { max-width: 640px; color: var(--nx-muted); font-size: 16px; }
.nx-dark .nx-head p { color: var(--nx-muted-d); }
.nx-head--center { justify-items: center; text-align: center; max-width: 900px; margin-left: auto; margin-right: auto; }
.nx-head--center p { max-width: 780px; }
.nx-head--split {
    grid-template-columns: minmax(200px, 300px) 1fr;
    align-items: start;
    column-gap: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--nx-line);
}
.nx-dark .nx-head--split { border-top-color: var(--nx-line-d); }
.nx-head--split .nx-kicker { padding-top: 14px; }

/* ---------- Buttons ---------- */
.nx-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 28px;
    font: 500 14.5px/1 var(--nx-sans);
    letter-spacing: .01em;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: transform .45s var(--nx-ease), background .45s var(--nx-ease), color .45s var(--nx-ease), border-color .45s var(--nx-ease), box-shadow .45s var(--nx-ease);
}
.nx-btn > span { transition: transform .45s var(--nx-ease); }
.nx-btn:hover > span { transform: translateX(4px); }
.nx-btn:focus-visible { outline: 2px solid var(--nx-copper-2); outline-offset: 3px; }

.nx-btn--copper { background: var(--nx-copper-grad); color: #fff; box-shadow: 0 18px 36px -18px rgba(229, 52, 59, .8); }
.nx-btn--copper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .9s var(--nx-ease);
    z-index: -1;
}
.nx-btn--copper:hover { transform: translateY(-2px); box-shadow: 0 24px 44px -18px rgba(229, 52, 59, .9); }
.nx-btn--copper:hover::after { transform: translateX(120%); }

.nx-btn--line { color: var(--nx-bone); border-color: rgba(243, 238, 230, .3); background: rgba(255, 255, 255, .03); }
.nx-btn--line:hover { background: var(--nx-bone); color: var(--nx-ink); border-color: var(--nx-bone); }

.nx-btn--ink { background: var(--nx-ink); color: var(--nx-bone); }
.nx-btn--ink:hover { background: var(--nx-copper); color: #fff; transform: translateY(-2px); }

.nx-btn--lg { min-height: 62px; padding: 0 44px; font-size: 16px; }


.nx-section--paper { background: var(--nx-paper); }
.nx-section--white { background: #fff; }

/* Light dot texture usable on any light section (add <div class="nx-dots" aria-hidden="true"></div>) */
.nx-dots {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(11, 12, 15, .12) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 45% 60% at 100% 0%, #000 0%, transparent 75%);
            mask-image: radial-gradient(ellipse 45% 60% at 100% 0%, #000 0%, transparent 75%);
}

/* Dark textured layer for dark sections (add <div class="nx-tex" aria-hidden="true"></div>) */
.nx-tex { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.nx-tex::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(243, 238, 230, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 238, 230, .045) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 80%);
            mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 80%);
}
.nx-tex::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(620px 380px at 92% 8%, rgba(229, 52, 59, .16), transparent 70%),
        radial-gradient(520px 360px at 4% 96%, rgba(166, 207, 63, .08), transparent 70%);
}
.nx-dark { overflow: hidden; isolation: isolate; background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, .016) 0 1px, transparent 1px 6px); }

/* =====================================================================
   PAGE BANNER (.ph) — dark textured left, photo bleeding off the right
   edge behind a slanted cut, red + lime slashes (logo bolt), slow gear.
===================================================================== */
.ph {
    --ph-top: 52%;      /* where the slanted cut meets the top edge   */
    --ph-bot: 40%;      /* where the slanted cut meets the bottom edge */
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 440px;
    padding: 72px 0;
    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%);
}
.ph .nx-tex { z-index: -2; }

/* Photo layer, revealed through the slanted cut */
.ph-photo {
    position: absolute;
    inset: 0;
    z-index: -1;
    clip-path: polygon(var(--ph-top) 0, 100% 0, 100% 100%, var(--ph-bot) 100%);
}
.ph-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 75% center; animation: ph-photo-in 1.4s var(--nx-ease) .1s both; }
.ph-photo::after { /* blend the cut edge into the dark side */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(11, 12, 15, .75) 38%, rgba(11, 12, 15, .15) 62%, transparent 80%);
}

/* Logo-bolt slashes along the cut */
.ph-slash { position: absolute; inset: 0; z-index: 0; pointer-events: none; animation: ph-slash .9s var(--nx-ease) both; }
.ph-slash--red {
    background: var(--nx-copper-grad);
    clip-path: polygon(calc(var(--ph-top) - 30px) 0, calc(var(--ph-top) - 12px) 0, calc(var(--ph-bot) - 12px) 100%, calc(var(--ph-bot) - 30px) 100%);
    animation-delay: .7s;
}
.ph-slash--green {
    background: var(--nx-copper-2);
    clip-path: polygon(calc(var(--ph-top) - 46px) 0, calc(var(--ph-top) - 40px) 0, calc(var(--ph-bot) - 40px) 100%, calc(var(--ph-bot) - 46px) 100%);
    animation-delay: .85s;
}

/* Slow-turning gear outline (logo motif) behind the title */
.ph-gear {
    position: absolute;
    left: -140px; top: 50%;
    z-index: -1;
    width: 520px; height: 520px;
    margin-top: -260px;
    color: rgba(243, 238, 230, .05);
    animation: ph-spin 80s linear infinite;
}

.ph-inner { width: 100%; }
.ph-copy { position: relative; display: grid; justify-items: start; gap: 22px; max-width: min(520px, 42%); }

.ph-crumbs {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font: 500 12.5px/1 var(--nx-sans);
    color: rgba(243, 238, 230, .7);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(243, 238, 230, .14);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.ph-crumbs { width: max-content; max-width: calc(100vw - 36px); white-space: nowrap; }
.ph-crumbs > * { flex: none; }
@media (max-width: 640px) { .ph-crumbs { white-space: normal; flex-wrap: wrap; row-gap: 6px; width: auto; line-height: 1.3; } .ph-crumbs > * { flex: initial; } }
.ph-crumbs a { color: #f6f2eb; text-decoration: none; transition: color .3s var(--nx-ease); }
.ph-crumbs a:hover { color: var(--nx-copper-2); }
.ph-crumbs [aria-current] { color: var(--nx-copper-2); }
.ph-crumbs-sep { width: 5px; height: 5px; border-radius: 50%; background: var(--nx-copper); }

html body.nx-ui main .ph-title {
    --h-ff: var(--nx-serif);
    --h-fs: clamp(36px, 4vw, 58px);
    --h-lh: 1.04;
    --h-fw: 400;
    --h-ls: -.02em;
    color: #f6f2eb !important;
}
.ph-lead { max-width: 440px; font-size: 15.5px; line-height: 1.7; color: rgba(243, 238, 230, .72); }
.ph-title em { font-style: normal; color: var(--nx-copper-2); }
.ph-crumbs strong { font-weight: 500; color: var(--nx-copper-2); }
.ph-rule { display: flex; gap: 6px; }
.ph-rule i { display: block; height: 3px; border-radius: 3px; }
.ph-rule i:nth-child(1) { width: 56px; background: var(--nx-copper); }
.ph-rule i:nth-child(2) { width: 14px; background: var(--nx-copper-2); }

/* Entrance */
.ph-in { animation: ph-rise .9s var(--nx-ease) var(--d, 0s) both; }
@keyframes ph-rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }
@keyframes ph-photo-in { from { opacity: 0; transform: translateX(8%) scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes ph-slash { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes ph-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .ph-photo, .ph-photo img, .ph-slash, .ph-gear, .ph-in { animation: none !important; }
}

/* ---------- Shared responsive ---------- */
@media (max-width: 1100px) {
    .nx-section { padding: 88px 0; }
}
@media (max-width: 900px) {
    .nx-br { display: none; }
}
@media (max-width: 640px) {
    body.nx-ui { font-size: 15px; }
    .nx-wrap { padding: 0 18px; }
    .nx-section { padding: 72px 0; }
    .nx-head { margin-bottom: 44px; }
}

/* Banner on tablet / phone: photo becomes a dimmed backdrop, slashes move right */
@media (max-width: 900px) {
    .ph { --ph-top: 62%; --ph-bot: 46%; min-height: 360px; padding: 64px 0; }
    .ph-copy { max-width: 70%; }
    .ph-gear { width: 380px; height: 380px; margin-top: -190px; left: -120px; }
}
@media (max-width: 600px) {
    .ph { --ph-top: 74%; --ph-bot: 58%; min-height: 300px; padding: 52px 0; }
    .ph-copy { max-width: 100%; }
    .ph-photo { opacity: .7; }
}
