/**
 * ══════════════════════════════════════════════════════════
 * HUB GRID SYSTEM — "Huyền Môn" v3.0
 * 1 file duy nhất cho TẤT CẢ hub (11 standalone + 50 inline)
 * Prefix: .smh- (SoiMenh Hub)
 * ══════════════════════════════════════════════════════════
 */

/* ── SECTION WRAPPER ── */
.smh-section {
    background: #0c0c0a;
    border-top: 1px solid rgba(201,169,110,.10);
    padding: 56px 20px 64px;
}
.smh-section--standalone {
    border-top: none;
    padding-top: 0;
}
.smh-inner {
    max-width: 960px;
    margin: 0 auto;
}

/* ── MEANDER DIVIDER ── */
.smh-meander {
    opacity: .5;
    margin: 10px 0;
    line-height: 0;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
}

/* ── HERO HEADER (standalone hub) ── */
.smh-hero {
    text-align: center;
    padding: 52px 0 44px;
}
.smh-hero__title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 14px 0 12px;
}
.smh-hero__name {
    font-family: 'Lexend Deca', sans-serif;
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 700;
    background: linear-gradient(115deg, #b8924a 0%, #c9a96e 25%, #f5d58c 50%, #c9a96e 75%, #b8924a 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoShimmer 8s ease-in-out infinite;
    letter-spacing: .06em;
    line-height: 1.25;
}
.smh-hero__han {
    font-family: 'Playfair Display', serif;
    font-size: clamp(.95rem, 2.5vw, 1.2rem);
    font-style: italic;
    color: rgba(232,224,208,.60);
    letter-spacing: .04em;
}
.smh-hero__sub {
    font-family: 'Playfair Display', serif;
    font-size: clamp(.88rem, 2vw, 1rem);
    font-style: italic;
    color: rgba(232,224,208,.55);
    margin: 0 0 6px;
}
.smh-hero__stats {
    font-size: .82rem;
    color: rgba(232,224,208,.38);
    font-family: 'Be Vietnam Pro', sans-serif;
    letter-spacing: .02em;
}

/* ── INLINE HEADER (inside tool page) ── */
.smh-head {
    text-align: center;
    margin-bottom: 28px;
}
.smh-head__title {
    font-family: 'Lexend Deca', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(201,169,110,.85);
    letter-spacing: .10em;
    margin: 12px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.smh-head__sub {
    font-size: .82rem;
    color: rgba(232,224,208,.55);
    font-family: 'Be Vietnam Pro', sans-serif;
    letter-spacing: .02em;
}

/* ── GRID ── */
.smh-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.smh-grid--2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 640px;
    margin: 0 auto;
}
.smh-grid--1 {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin: 0 auto;
}

/* Inline context: slightly smaller */
.smh-section--inline .smh-grid {
    max-width: 880px;
}

/* ══════════════════════════════════════════════════════════
   CARD — "Huyền Môn" 玄門
   7 tầng chiều sâu: glow · line · frame · brackets · ring · watermark · content
   ══════════════════════════════════════════════════════════ */
.smh-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 18px 18px;
    text-decoration: none;
    background: rgba(14,13,10,.70);
    border: 1px solid rgba(201,169,110,.10);
    overflow: hidden;
    cursor: pointer;
    transition:
        border-color .5s,
        transform .4s cubic-bezier(.23,1,.32,1),
        box-shadow .5s,
        background .5s;
    /* Stagger entrance */
    opacity: 0;
    transform: translateY(16px);
}
.smh-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .5s cubic-bezier(.23,1,.32,1),
        transform .5s cubic-bezier(.23,1,.32,1),
        border-color .5s,
        box-shadow .5s,
        background .5s;
}

/* ── Tầng 1: Radial glow — "Hào Quang" ── */
.smh-card::before {
    content: '';
    position: absolute;
    inset: -15%;
    background: radial-gradient(ellipse at 50% 20%, var(--smh-accent, #c9a96e) 0%, transparent 55%);
    opacity: .04;
    pointer-events: none;
    transition: opacity .6s;
}
.smh-card:hover::before { opacity: .10; }

/* ── Tầng 2: Bottom accent line ── */
.smh-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--smh-accent, #c9a96e), transparent);
    opacity: 0;
    transition: opacity .5s;
}
.smh-card:hover::after { opacity: .25; }

/* ── Tầng 3: Double frame — "Trùng Khung" ── */
.smh-card__frame {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(201,169,110,.04);
    pointer-events: none;
    z-index: 1;
    transition: border-color .5s;
}
.smh-card:hover .smh-card__frame {
    border-color: rgba(201,169,110,.10);
}

/* ── Tầng 4: 4 L-brackets — "Tứ Giác Ấn" ── */
.smh-card__frame::before,
.smh-card__frame::after {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    border-color: rgba(201,169,110,.15);
    border-style: solid;
    transition: border-color .5s;
}
.smh-card__frame::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.smh-card__frame::after  { top: -1px; right: -1px; border-width: 1px 1px 0 0; }

.smh-card__bracket {
    position: absolute;
    width: 14px; height: 14px;
    border-color: rgba(201,169,110,.15);
    border-style: solid;
    transition: border-color .5s;
}
.smh-card__bracket--bl { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.smh-card__bracket--br { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.smh-card:hover .smh-card__frame::before,
.smh-card:hover .smh-card__frame::after,
.smh-card:hover .smh-card__bracket {
    border-color: rgba(201,169,110,.30);
}

/* ── Tầng 5: Icon ring — "Thiên Nhãn" ── */
.smh-card__ring {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    margin-bottom: 14px;
    background: radial-gradient(circle, rgba(201,169,110,.08) 0%, transparent 70%);
}
.smh-card__ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(201,169,110,.20);
    transition: transform 1.2s cubic-bezier(.23,1,.32,1), border-color .5s;
}
.smh-card:hover .smh-card__ring::before {
    transform: rotate(180deg);
    border-color: rgba(201,169,110,.40);
}
.smh-card__icon {
    width: 24px; height: 24px;
    color: var(--smh-accent, #c9a96e);
    position: relative;
    z-index: 1;
    transition: transform .4s;
}
.smh-card__icon svg {
    width: 100%; height: 100%;
    stroke: currentColor;
}
.smh-card:hover .smh-card__icon { transform: scale(1.1); }

/* ── Tầng 6: Watermark — "Thiên Luân" ── */
.smh-card__watermark {
    position: absolute;
    bottom: -10px; right: -10px;
    width: 100px; height: 100px;
    color: var(--smh-accent, #c9a96e);
    opacity: .04;
    pointer-events: none;
    animation: smhWaterSpin 70s linear infinite;
    transition: opacity .6s;
}
.smh-card__watermark svg {
    width: 100%; height: 100%;
    stroke: currentColor;
}
@keyframes smhWaterSpin { to { transform: rotate(360deg); } }
.smh-card:hover .smh-card__watermark { opacity: .08; }

/* Viewport-pause: pause spin off-screen */
.smh-card:not(.is-visible) .smh-card__watermark,
[data-vp]:not(.is-in-view) .smh-card__watermark {
    animation-play-state: paused;
}

/* ── Tầng 7: Content ── */

/* Badge */
.smh-card__badge {
    font-family: 'Lexend Deca', sans-serif;
    font-size: .55rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 2px 10px;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}
.smh-card__badge--live {
    color: var(--smh-accent, #c9a96e);
    background: linear-gradient(135deg, rgba(201,169,110,.10), rgba(201,169,110,.03));
    border: 1px solid rgba(201,169,110,.25);
}
.smh-card__badge--soon {
    color: rgba(232,224,208,.35);
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(232,224,208,.08);
}
.smh-card__badge--current {
    color: #c9a96e;
    background: rgba(201,169,110,.15);
    border: 1px solid rgba(201,169,110,.40);
}

/* Name */
.smh-card__name {
    font-family: 'Lexend Deca', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(232,224,208,.88);
    margin: 0 0 6px;
    line-height: 1.3;
    position: relative;
    z-index: 2;
    transition: text-shadow .5s;
}
.smh-card__name::after {
    content: '';
    display: block;
    width: 28px; height: 1px;
    margin: 8px auto 0;
    background: linear-gradient(90deg, var(--smh-accent, #c9a96e), transparent);
    opacity: .4;
    transition: width .4s, opacity .4s;
}
.smh-card:hover .smh-card__name {
    text-shadow: 0 0 20px var(--smh-accent-glow, rgba(201,169,110,.15));
}
.smh-card:hover .smh-card__name::after {
    width: 44px;
    opacity: .7;
}

/* Description */
.smh-card__desc {
    font-size: .78rem;
    color: rgba(232,224,208,.45);
    font-family: 'Be Vietnam Pro', sans-serif;
    line-height: 1.5;
    margin: 0 0 auto;
    padding-bottom: 12px;
    position: relative;
    z-index: 2;
}

/* CTA */
.smh-card__cta {
    font-family: 'Lexend Deca', sans-serif;
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--smh-accent, #c9a96e);
    opacity: .45;
    margin-top: auto;
    position: relative;
    z-index: 2;
    transition: opacity .3s;
}
.smh-card__arrow {
    display: inline-block;
    transition: transform .3s;
    margin-left: 4px;
}
.smh-card:hover .smh-card__cta { opacity: .9; }
.smh-card:hover .smh-card__arrow { transform: translateX(3px); }

/* ── HOVER STATE ── */
.smh-card:hover {
    border-color: rgba(201,169,110,.20);
    transform: translateY(-4px);
    box-shadow:
        0 12px 40px rgba(0,0,0,.45),
        0 0 1px rgba(201,169,110,.12),
        inset 0 1px 0 rgba(201,169,110,.05);
    background: rgba(14,13,10,.88);
}
.smh-card:active { transform: scale(.98); }
.smh-card:focus-visible { outline: 2px solid #c9a96e; outline-offset: 2px; }

/* ── CARD STATE: SOON ── */
.smh-card--soon {
    opacity: .45;
    cursor: default;
    pointer-events: none;
}
.smh-card--soon .smh-card__ring::before {
    border-style: dashed;
}
.smh-card--soon .smh-card__watermark {
    animation: none;
}

/* ── CARD STATE: CURRENT ── */
.smh-card--current {
    border-color: rgba(201,169,110,.30);
    background: rgba(201,169,110,.05);
}
.smh-card--current .smh-card__frame {
    border-color: rgba(201,169,110,.08);
}

/* ── INLINE CONTEXT — smaller cards ── */
.smh-section--inline .smh-card {
    padding: 20px 14px 14px;
}
.smh-section--inline .smh-card__ring {
    width: 44px; height: 44px;
    margin-bottom: 10px;
}
.smh-section--inline .smh-card__icon {
    width: 22px; height: 22px;
}
.smh-section--inline .smh-card__name {
    font-size: .88rem;
}
.smh-section--inline .smh-card__desc {
    font-size: .72rem;
}
.smh-section--inline .smh-card__watermark {
    width: 80px; height: 80px;
}
.smh-section--inline .smh-card__frame { inset: 4px; }
.smh-section--inline .smh-card__frame::before,
.smh-section--inline .smh-card__frame::after,
.smh-section--inline .smh-card__bracket { width: 10px; height: 10px; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .smh-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .smh-grid--2 { max-width: none; }
    .smh-card { padding: 20px 16px 14px; }
    .smh-card__ring { width: 48px; height: 48px; }
    .smh-card__icon { width: 22px; height: 22px; }
    .smh-card__name { font-size: .88rem; }
    .smh-card__watermark { width: 85px; height: 85px; }
    .smh-card__frame { inset: 4px; }
    .smh-card__frame::before,
    .smh-card__frame::after,
    .smh-card__bracket { width: 12px; height: 12px; }
    .smh-hero__title { gap: 4px; }
}

@media (max-width: 480px) {
    .smh-section { padding: 40px 14px 48px; }
    .smh-grid { grid-template-columns: 1fr; gap: 12px; }
    .smh-grid--2 { grid-template-columns: 1fr; max-width: none; }
    .smh-card { padding: 18px 14px 14px; }
    .smh-card__ring { width: 44px; height: 44px; margin-bottom: 12px; }
    .smh-card__icon { width: 20px; height: 20px; }
    .smh-card__name { font-size: .85rem; }
    .smh-card__desc { font-size: .72rem; }
    .smh-card__badge { font-size: .50rem; }
    .smh-card__watermark { width: 70px; height: 70px; }
    .smh-card__frame { inset: 3px; }
    .smh-card__frame::before,
    .smh-card__frame::after,
    .smh-card__bracket { width: 10px; height: 10px; }
    .smh-card__cta { min-height: 44px; display: flex; align-items: center; }
    .smh-hero { padding: 36px 0 32px; }
    .smh-hub-intro { padding: 0 16px 24px; }
    .smh-hub-intro p { font-size: .9rem; }
}

/* ── HUB INTRO TEXT (SEO) ── */
.smh-hub-intro {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px 32px;
    color: rgba(232,224,208,.6);
    font-size: .95rem;
    line-height: 1.7;
}
.smh-hub-intro h2 {
    color: rgba(232,224,208,.8);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 12px;
}
.smh-hub-intro p {
    margin: 0 0 12px;
}
.smh-hub-intro p:last-child {
    margin-bottom: 0;
}
