/* ==========================================================================
   Barter Express - Home page. Mobile-first; scoped under .hm.
   Uses the --bx-* tokens from app-shell.css.
   ========================================================================== */

.hm {
    background: var(--bx-bg);
    color: var(--bx-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: clip;
}
.hm *, .hm *::before, .hm *::after { box-sizing: border-box; }
:where(.hm) :is(h1, h2, h3, p, ul, ol) { margin: 0; padding: 0; }
.hm ul, .hm ol { list-style: none; }
.hm a { text-decoration: none; }
.hm :focus-visible { outline: 3px solid var(--bx-blue); outline-offset: 2px; border-radius: 8px; }

.hm-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- Hero: fills the whole screen; orange, tagline and bouncing items only ---------- */
.hm-hero {
    position: relative; overflow: hidden; color: #fff; text-align: center;
    display: grid; place-items: center;
    min-height: calc(100vh - var(--bx-nav-h));
    min-height: calc(100svh - var(--bx-nav-h));
    padding: 48px 20px;
    background: linear-gradient(145deg, #ff8f26 0%, #f46d00 55%, #d95a00 100%);
    border-radius: 0 0 36px 36px;
}
/* signed-in users have a fixed tab bar over the bottom of the screen */
body.bx-auth .hm-hero { padding-bottom: calc(var(--bx-tab-h) + 48px); }
.hm-hero::before {
    content: ''; position: absolute; right: -120px; top: -140px; width: 360px; height: 360px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 70%); pointer-events: none;
}
.hm-hero::after {
    content: ''; position: absolute; left: -120px; bottom: -160px; width: 320px; height: 320px; border-radius: 50%;
    background: radial-gradient(circle, rgba(120, 40, 0, .35), rgba(120, 40, 0, 0) 70%); pointer-events: none;
}
.hm-hero__copy { position: relative; z-index: 1; max-width: min(980px, 100%); }
.hm-hero h1 {
    font-size: clamp(2.2rem, 9vw, 5rem); line-height: 1.07; font-weight: 800; letter-spacing: -.03em; color: #fff;
    text-shadow: 0 3px 18px rgba(120, 40, 0, .35);
}
.hm-hero h1 em { font-style: normal; color: #fff3d6; }
.hm-hero__sub {
    margin: 18px auto 0; max-width: 520px; font-size: clamp(1rem, 4vw, 1.25rem); font-weight: 500; color: rgba(255, 255, 255, .96);
    text-shadow: 0 2px 10px rgba(120, 40, 0, .3);
}

/* ---------- Start strip (overlaps the hero) ---------- */
.hm-start {
    position: relative; z-index: 2; margin: 28px auto 0; padding: 20px 16px;
    max-width: 820px; text-align: center;
    background: var(--bx-surface); border: 1px solid var(--bx-border); border-radius: var(--bx-radius); box-shadow: var(--bx-shadow);
}
.hm-actions { display: flex; flex-direction: column; gap: 12px; }
.hm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 54px; padding: 13px 26px; border: 2px solid transparent; border-radius: 16px;
    font-size: 1.02rem; font-weight: 700; text-decoration: none !important;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.hm-btn:active { transform: scale(.98); }
.hm-btn.primary { background: var(--bx-orange); color: #fff !important; box-shadow: 0 10px 22px rgba(255, 122, 0, .4); }
.hm-btn.primary:hover { background: var(--bx-orange-dark); }
.hm-btn.ghost { background: var(--bx-surface); color: var(--bx-blue) !important; border-color: var(--bx-border); }
html.dark-mode .hm-btn.ghost { color: #9cc7f5 !important; }
.hm-btn.ghost:hover { border-color: var(--bx-blue); }
.hm-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.hm-trust li {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
    background: var(--bx-tint); color: var(--bx-text); font-size: .82rem; font-weight: 600;
}
.hm-trust i { color: var(--bx-orange); }

/* ---------- Sections ---------- */
.hm-section { padding: 44px 0 0; }
.hm-head { margin-bottom: 20px; text-align: center; }
.hm-head h2 { font-size: clamp(1.5rem, 5.5vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; }
.hm-head p { margin: 6px auto 0; max-width: 540px; color: var(--bx-muted); }

.hm-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.hm-card {
    background: var(--bx-surface); border: 1px solid var(--bx-border); border-radius: var(--bx-radius);
    box-shadow: var(--bx-shadow); padding: 20px;
    transition: transform .2s ease, border-color .2s ease;
}
.hm-card:hover { transform: translateY(-3px); border-color: rgba(255, 122, 0, .5); }
.hm-ico {
    width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 14px;
    border-radius: 15px; background: var(--bx-accent-soft); color: var(--bx-orange); font-size: 1.2rem;
}
.hm-ico.blue { background: var(--bx-tint); color: var(--bx-blue); }
html.dark-mode .hm-ico.blue { color: #8dbcf2; }
.hm-ico.green { background: var(--bx-success-soft); color: var(--bx-success); }
.hm-card h3 { font-size: 1.08rem; font-weight: 800; margin-bottom: 6px; }
.hm-card p { color: var(--bx-muted); font-size: .95rem; }
.hm-step-no { display: inline-block; margin-bottom: 8px; font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--bx-orange); }

/* Fees */
.hm-fees { display: grid; gap: 12px; grid-template-columns: 1fr; }
.hm-fee { padding: 18px; border-radius: var(--bx-radius-sm); background: var(--bx-surface); border: 1px solid var(--bx-border); box-shadow: var(--bx-shadow); }
.hm-fee strong { display: block; font-size: 1.5rem; font-weight: 800; color: var(--bx-blue); letter-spacing: -.02em; }
html.dark-mode .hm-fee strong { color: #9cc7f5; }
.hm-fee span { color: var(--bx-muted); font-size: .92rem; }
.hm-note { margin-top: 12px; text-align: center; color: var(--bx-muted); font-size: .85rem; }

/* Categories */
.hm-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hm-cat {
    display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 999px;
    background: var(--bx-surface); border: 1px solid var(--bx-border); box-shadow: var(--bx-shadow);
    color: var(--bx-text) !important; font-weight: 700; transition: transform .15s ease, border-color .15s ease;
}
.hm-cat:hover { transform: translateY(-2px); border-color: var(--bx-orange); }
.hm-empty { color: var(--bx-muted); text-align: center; }

/* CTA */
.hm-cta {
    margin-top: 48px; padding: 36px 20px; text-align: center; color: #fff; border-radius: 28px;
    background: linear-gradient(145deg, var(--bx-blue), var(--bx-blue-dark));
    position: relative; overflow: hidden;
}
.hm-cta::before {
    content: ''; position: absolute; right: -80px; top: -90px; width: 240px; height: 240px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 122, 0, .45), rgba(255, 122, 0, 0) 70%); pointer-events: none;
}
.hm-cta > * { position: relative; }
.hm-cta h2 { font-size: clamp(1.5rem, 5.5vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; color: #fff; }
.hm-cta p { margin: 8px auto 22px; max-width: 480px; color: rgba(255, 255, 255, .9); }
.hm-cta .hm-btn { width: 100%; max-width: 360px; }
.hm-bottom { padding-bottom: 28px; }

/* Scroll reveal (only active when JS adds .hm-js) */
.hm.hm-js .hm-reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.hm.hm-js .hm-reveal.is-visible { opacity: 1; transform: none; }

@media (min-width: 640px) {
    .hm-wrap { padding: 0 24px; }
    .hm-hero { padding: 64px 24px; }
    body.bx-auth .hm-hero { padding-bottom: calc(var(--bx-tab-h) + 64px); }
    .hm-start { padding: 24px; margin-top: 36px; }
    .hm-actions { flex-direction: row; justify-content: center; }
    .hm-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
    .hm-fees { grid-template-columns: repeat(3, 1fr); }
    .hm-cta { padding: 52px 32px; }
    .hm-cta .hm-btn { width: auto; }
}
@media (min-width: 960px) {
    .hm-hero { padding: 80px 24px; }
    body.bx-auth .hm-hero { padding-bottom: calc(var(--bx-tab-h) + 80px); }
    .hm-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
    .hm-section { padding-top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
    .hm.hm-js .hm-reveal { opacity: 1; transform: none; transition: none; }
    .hm-card, .hm-cat, .hm-btn { transition: none; }
}
