/* ==========================================================================
   HOME — HERO CAROUSEL
   Logo palette tokens (--brand-*) are defined in navbar.css.
   ========================================================================== */

.hc {
    --hc-interval: 7000ms;
    --hc-a1: var(--brand-gold-pale);
    --hc-a2: var(--brand-champagne);
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: clamp(640px, 94vh, 900px);
    padding: calc(var(--header-h) + 3.5rem) 0 calc(64px + 2.25rem);
    background: #12110E;
    color: #ffffff;
    overflow: hidden;
}

/* ---------- Background layers ---------- */
.hc-backdrops { position: absolute; inset: 0; z-index: -1; }
.hc-backdrop {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.hc-backdrop.is-active { opacity: 1; }
.hc-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% center;
    transform: scale(1.1);
}
.hc-backdrop.is-active img { animation: hcZoom 9s ease-out forwards; }
@keyframes hcZoom { from { transform: scale(1.1); } to { transform: scale(1); } }

/* Designed background for slides without a photo */
.hc-backdrop-design {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(45% 55% at 78% 30%, rgba(198, 164, 95, 0.55) 0%, transparent 70%),
        radial-gradient(35% 45% at 92% 80%, rgba(223, 200, 142, 0.35) 0%, transparent 70%),
        radial-gradient(30% 40% at 60% 95%, rgba(201, 149, 74, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #1A1814 0%, #1F1C17 50%, #3A332A 100%);
}
.hc-backdrop-design::after {
    content: '';
    position: absolute;
    right: 6%;
    top: 50%;
    width: min(46vw, 620px);
    aspect-ratio: 1;
    transform: translateY(-50%);
    border-radius: 50%;
    border: 1px solid rgba(232, 211, 160, 0.25);
    box-shadow:
        0 0 0 60px rgba(232, 211, 160, 0.04),
        0 0 0 120px rgba(232, 211, 160, 0.03),
        inset 0 0 120px rgba(232, 211, 160, 0.18);
}

/* Legibility shade: strong on the text side, lighter over the image */
.hc-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(18, 17, 14, 0.96) 0%, rgba(22, 20, 17, 0.86) 36%, rgba(26, 24, 20, 0.52) 68%, rgba(26, 24, 20, 0.32) 100%),
        linear-gradient(180deg, rgba(18, 17, 14, 0.55) 0%, transparent 28%, transparent 62%, rgba(18, 17, 14, 0.9) 100%);
}
.hc-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(70% 80% at 20% 40%, #000 0%, transparent 75%);
            mask-image: radial-gradient(70% 80% at 20% 40%, #000 0%, transparent 75%);
}
.hc-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; pointer-events: none; }
.hc-glow-blue   { width: 420px; height: 420px; top: -120px; left: -80px; background: rgba(198, 164, 95, 0.45); animation: hcDrift 14s ease-in-out infinite alternate; }
.hc-glow-green  { width: 320px; height: 320px; bottom: -80px; left: 32%; background: rgba(223, 200, 142, 0.28); animation: hcDrift 17s ease-in-out infinite alternate-reverse; }
.hc-glow-orange { width: 300px; height: 300px; top: 20%; right: -100px; background: rgba(201, 149, 74, 0.25); animation: hcDrift 16s ease-in-out infinite alternate; }
@keyframes hcDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, -30px) scale(1.15); } }

/* ---------- Layout ---------- */
.hc-container { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 3rem; }
.hc-main { display: flex; align-items: center; justify-content: space-between; gap: 3rem; }

/* Slides stack in one grid cell so the hero height never jumps */
.hc-slides { flex: 1; min-width: 0; max-width: 760px; display: grid; }
.hc-slide {
    grid-area: 1 / 1;
    visibility: hidden;
    pointer-events: none;
}
.hc-slide.is-active { visibility: visible; pointer-events: auto; }

/* Per-slide accent (eyebrow dot, highlight gradient, primary button) */
.hc-accent-blue   { --hc-a1: var(--brand-gold-pale);    --hc-a2: var(--brand-champagne);       --hc-btn1: var(--brand-gold);  --hc-btn2: var(--brand-gold-deep); }
.hc-accent-green  { --hc-a1: var(--brand-champagne);  --hc-a2: var(--brand-gold-light);      --hc-btn1: var(--brand-champagne);  --hc-btn2: var(--brand-bronze); }
.hc-accent-orange { --hc-a1: var(--brand-gold-light); --hc-a2: var(--brand-copper); --hc-btn1: var(--brand-copper-light); --hc-btn2: var(--brand-copper); }

/* Line-by-line reveal of the active slide */
.hc-line { display: block; opacity: 0; transform: translateY(26px); }
.hc-slide.is-active .hc-line { animation: hcLineIn 0.9s var(--ease-premium) forwards; }
.hc-slide.is-active .hc-line:nth-child(1) { animation-delay: 0.1s; }
.hc-slide.is-active .hc-title .hc-line:nth-child(1) { animation-delay: 0.2s; }
.hc-slide.is-active .hc-title .hc-line:nth-child(2) { animation-delay: 0.32s; }
.hc-slide.is-active > .hc-subtitle { animation-delay: 0.44s; }
.hc-slide.is-active > .hc-tags { animation-delay: 0.54s; }
.hc-slide.is-active > .hc-actions { animation-delay: 0.62s; }
.hc-slide.is-leaving .hc-line { animation: hcLineOut 0.45s ease forwards; }
@keyframes hcLineIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes hcLineOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-14px); } }

.hc-eyebrow {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    padding: 0.45rem 1rem 0.45rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.hc-eyebrow-dot {
    position: relative;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--hc-a1);
    box-shadow: 0 0 10px var(--hc-a1);
}
.hc-eyebrow-dot::after {
    content: ''; position: absolute; inset: -5px; border-radius: 50%;
    border: 1px solid var(--hc-a1); opacity: 0;
    animation: mafPulse 2s ease-out infinite;
}

.hc-title {
    margin: 0 0 1.4rem;
    font-size: clamp(2.4rem, 5.2vw, 4.4rem);
    line-height: 1.06;
    letter-spacing: -0.03em;
    color: #ffffff;
}
.hc-highlight {
    padding-bottom: 0.08em;
    background: linear-gradient(90deg, var(--hc-a1) 0%, var(--hc-a2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hc-subtitle {
    max-width: 580px;
    margin: 0 0 2rem;
    font-size: clamp(1.02rem, 1.4vw, 1.2rem);
    line-height: 1.65;
    color: rgba(243, 234, 214, 0.82);
}

.hc-tags { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 2rem; }
.hc-tag {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.95rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem; font-weight: 600; color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.hc-tag i { color: var(--brand-gold-pale); }
.hc-tag:nth-child(3n+2) i { color: var(--brand-champagne); }
.hc-tag:nth-child(3n) i { color: var(--brand-gold-light); }

.hc-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.hc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 54px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.98rem;
    transition: transform 0.3s var(--ease-premium), box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.hc-btn-primary {
    padding: 0.45rem 0.45rem 0.45rem 1.6rem;
    color: #ffffff;
    background: linear-gradient(135deg, var(--hc-btn1) 0%, var(--hc-btn2) 100%);
    box-shadow: 0 16px 34px -14px rgba(198, 164, 95, 0.6);
}
.hc-btn-arrow {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    font-size: 0.82rem; color: var(--brand-ink); background: #ffffff;
    overflow: hidden;
}
.hc-btn-primary:hover { color: #ffffff; transform: translateY(-2px); box-shadow: 0 22px 40px -16px rgba(198, 164, 95, 0.75); }
.hc-btn-primary:hover .hc-btn-arrow i { animation: mafArrow 0.5s var(--ease-premium); }
.hc-btn-ghost {
    padding: 0 1.6rem;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.hc-btn-ghost:hover { color: #ffffff; background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.5); transform: translateY(-2px); }

/* ---------- Floating stat cards ---------- */
.hc-stats { flex: 0 0 auto; display: flex; flex-direction: column; gap: 0.9rem; }
.hc-stat {
    --stat-c: var(--brand-gold-pale);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 250px;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.6);
    animation: hcFloat 6s ease-in-out infinite;
}
.hc-stat:nth-child(2) { margin-left: 2.25rem; animation-delay: -2s; }
.hc-stat:nth-child(3) { animation-delay: -4s; }
.hc-stat-green  { --stat-c: var(--brand-champagne); }
.hc-stat-orange { --stat-c: var(--brand-copper-light); }
.hc-stat-icon {
    flex-shrink: 0;
    width: 46px; height: 46px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--stat-c);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.hc-stat-text { display: flex; flex-direction: column; }
.hc-stat-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(243, 234, 214, 0.65); }
.hc-stat-value { font-family: var(--font-heading); font-size: 1.3rem; line-height: 1.2; color: #ffffff; }
@keyframes hcFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Controls ---------- */
.hc-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.hc-tabs { display: flex; gap: 0.6rem; flex: 1; min-width: 0; max-width: 820px; }
.hc-tab {
    --hc-a1: var(--brand-gold-pale);
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.8rem 0.9rem 0.75rem;
    border-radius: 14px;
    text-align: left;
    color: rgba(243, 234, 214, 0.6);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.hc-tab:hover { color: #ffffff; background: rgba(255, 255, 255, 0.07); }
.hc-tab.is-active { color: #ffffff; background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.18); }
.hc-tab-top { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; }
.hc-tab-num { font-family: var(--font-heading); font-weight: 700; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.hc-tab-top i { color: var(--hc-a1); opacity: 0.8; }
.hc-tab-label { font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-tab-progress { position: relative; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.hc-tab-progress span {
    position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--hc-a1), var(--brand-champagne), var(--brand-copper-light));
    transform-origin: left center;
    transform: scaleX(0);
}
/* The active tab's bar drives the timer (JS advances on animationend) */
.hc.is-playing .hc-tab.is-active .hc-tab-progress span { animation: hcProgress var(--hc-interval) linear forwards; }
.hc.is-playing.is-paused .hc-tab.is-active .hc-tab-progress span { animation-play-state: paused; }
.hc:not(.is-playing) .hc-tab.is-active .hc-tab-progress span { transform: scaleX(1); }
@keyframes hcProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hc-nav { display: flex; gap: 0.5rem; flex-shrink: 0; }
.hc-nav-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-premium);
}
.hc-nav-btn:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.35); transform: translateY(-2px); }
.hc-nav-btn:active { transform: scale(0.94); }
.hc-pause { width: 40px; height: 40px; align-self: center; font-size: 0.75rem; }

.hc a:focus-visible,
.hc button:focus-visible { outline: 2px solid var(--brand-gold-pale); outline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    .hc-stats { display: none; }
    .hc-slides { max-width: 720px; }
}
@media (max-width: 991px) {
    .hc { min-height: auto; padding: calc(var(--header-h) + 2.75rem) 0 calc(40px + 1.75rem); }
    .hc-shade {
        background:
            linear-gradient(180deg, rgba(18, 17, 14, 0.72) 0%, rgba(22, 20, 17, 0.82) 45%, rgba(18, 17, 14, 0.96) 100%);
    }
    .hc-container { gap: 2.25rem; }
    .hc-tab-label { display: none; }
    .hc-tab { padding: 0.65rem 0.75rem 0.6rem; }
}
@media (max-width: 575px) {
    .hc-eyebrow { font-size: 0.75rem; margin-bottom: 1.1rem; }
    .hc-title { font-size: clamp(2.05rem, 9vw, 2.6rem); margin-bottom: 1rem; }
    .hc-subtitle { margin-bottom: 1.6rem; }
    .hc-tags { display: none; }
    .hc-actions { flex-direction: column; align-items: stretch; }
    .hc-btn { justify-content: space-between; }
    .hc-btn-ghost { justify-content: center; }
    .hc-controls { gap: 0.75rem; }
    .hc-tabs { gap: 0.35rem; }
    .hc-tab { padding: 0.55rem 0.55rem 0.5rem; border-radius: 11px; gap: 0.35rem; }
    .hc-tab-top i { display: none; }
    .hc-nav-btn { width: 42px; height: 42px; }
    .hc-nav .hc-pause { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hc-backdrop, .hc-backdrop.is-active img, .hc-glow, .hc-stat, .hc-eyebrow-dot::after { animation: none !important; transition: none !important; }
    .hc-backdrop img { transform: none; }
    .hc-line, .hc-slide.is-active .hc-line, .hc-slide.is-leaving .hc-line { animation: none !important; opacity: 1; transform: none; }
    .hc-slide:not(.is-active) .hc-line { opacity: 0; }
}
