:root {
    color-scheme: light;
    --ba-sky: #65c7f7;
    --ba-turquoise: #20c9b5;
    --ba-blue: #4f7cff;
    --ba-pink: #ff78a8;
    --ba-lavender: #a98bff;
    --ba-yellow: #ffd166;
    --ba-mint: #9be7c4;
    --ba-ink: #17345c;
    --ba-muted: #59718e;
    --ba-surface: rgba(255, 255, 255, .78);
    --ba-surface-strong: #ffffff;
    --ba-border: rgba(79, 124, 255, .18);
    --ba-shadow: 0 20px 55px rgba(44, 88, 145, .16);
    --ba-page:
        radial-gradient(circle at 8% 10%, rgba(255, 209, 102, .34), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(255, 120, 168, .24), transparent 30%),
        radial-gradient(circle at 78% 86%, rgba(32, 201, 181, .24), transparent 32%),
        linear-gradient(145deg, #f7fcff 0%, #edf8ff 42%, #fff4fa 100%);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --ba-ink: #f5f8ff;
    --ba-muted: #bfd0e6;
    --ba-surface: rgba(20, 33, 65, .82);
    --ba-surface-strong: #17284d;
    --ba-border: rgba(155, 231, 196, .2);
    --ba-shadow: 0 22px 65px rgba(1, 8, 28, .42);
    --ba-page:
        radial-gradient(circle at 10% 10%, rgba(79, 124, 255, .24), transparent 30%),
        radial-gradient(circle at 90% 16%, rgba(255, 120, 168, .14), transparent 28%),
        radial-gradient(circle at 72% 88%, rgba(32, 201, 181, .16), transparent 34%),
        linear-gradient(145deg, #08142d 0%, #10254a 50%, #251b45 100%);
}

html, body { min-height: 100%; }

body.bg-theme {
    background: var(--ba-page) !important;
    background-attachment: fixed !important;
    color: var(--ba-ink) !important;
    transition: background .3s ease, color .3s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: .45;
    background-image: radial-gradient(rgba(255,255,255,.8) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

.navbar {
    background: linear-gradient(105deg, rgba(79,124,255,.92), rgba(32,201,181,.88), rgba(169,139,255,.9)) !important;
    border-bottom: 1px solid rgba(255,255,255,.38);
    box-shadow: 0 12px 35px rgba(53, 91, 157, .2);
    backdrop-filter: blur(18px) saturate(150%);
}

html[data-theme="dark"] .navbar {
    background: linear-gradient(105deg, rgba(15,39,80,.93), rgba(18,91,100,.9), rgba(55,39,97,.92)) !important;
}

.cover-wrapper { color: var(--ba-ink); }
.cover-title { color: var(--ba-ink) !important; text-shadow: 0 3px 18px rgba(79,124,255,.14); }
.cover-intro, .cover-desc { color: var(--ba-muted) !important; }

.topic-circle {
    border: 2px solid rgba(255,255,255,.72);
    box-shadow: var(--ba-shadow) !important;
}
.topic-item:nth-child(5n+1) .topic-circle { background: linear-gradient(145deg, #4f7cff, #65c7f7) !important; }
.topic-item:nth-child(5n+2) .topic-circle { background: linear-gradient(145deg, #20c9b5, #63dfb7) !important; }
.topic-item:nth-child(5n+3) .topic-circle { background: linear-gradient(145deg, #ff78a8, #ff9a7b) !important; }
.topic-item:nth-child(5n+4) .topic-circle { background: linear-gradient(145deg, #a98bff, #6f8cff) !important; }
.topic-item:nth-child(5n+5) .topic-circle { background: linear-gradient(145deg, #f0aa3c, #ffd166) !important; color: #3e2e11 !important; }

.stat-card, .feed-card, .post-card, .modal-card, .auth-card {
    background: var(--ba-surface) !important;
    border: 1px solid var(--ba-border) !important;
    color: var(--ba-ink) !important;
    box-shadow: var(--ba-shadow) !important;
    backdrop-filter: blur(18px) saturate(130%);
}
.stat-number { color: var(--ba-blue) !important; }
html[data-theme="dark"] .stat-number { color: var(--ba-mint) !important; }
.post-content { color: var(--ba-ink) !important; }

.ba-experience-controls {
    position: fixed;
    top: 82px;
    right: 18px;
    z-index: 1045;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--ba-border);
    border-radius: 16px;
    background: var(--ba-surface);
    box-shadow: var(--ba-shadow);
    backdrop-filter: blur(18px) saturate(140%);
}

.ba-control {
    min-height: 38px;
    border: 0;
    border-radius: 11px;
    padding: 7px 11px;
    color: var(--ba-ink);
    background: rgba(255,255,255,.54);
    font: inherit;
    cursor: pointer;
}
html[data-theme="dark"] .ba-control { background: rgba(255,255,255,.09); }
.ba-control:focus-visible { outline: 3px solid rgba(79,124,255,.35); outline-offset: 2px; }
.ba-theme-toggle { width: 42px; font-size: 18px; }

#bottomNav {
    background: linear-gradient(105deg, #375da8, #267f8d, #5e4a9c) !important;
}
#moreSheet { background: var(--ba-surface-strong) !important; color: var(--ba-ink); }
.more-item { color: var(--ba-ink) !important; }

html[lang="ja"] body { font-family: "Noto Sans JP", "Sarabun", sans-serif !important; }
html[lang="my"] body { font-family: "Noto Sans Myanmar", "Sarabun", sans-serif !important; }
html[lang="lo"] body { font-family: "Noto Sans Lao", "Sarabun", sans-serif !important; }

/* Illustrated landing experience */
.navbar {
    background: rgba(255, 255, 255, .9) !important;
    border-bottom-color: rgba(72, 125, 169, .14);
}
.navbar .nav-link.text-white,
.navbar .navbar-brand { color: #17345c !important; }
.navbar .nav-link.active-link { border-bottom-color: var(--ba-turquoise) !important; }
.navbar .btn-outline-light {
    color: #fff !important;
    border: 0 !important;
    background: linear-gradient(135deg, #25b7d3, #25c7b6) !important;
    box-shadow: 0 8px 22px rgba(27, 167, 182, .25);
}
html[data-theme="dark"] .navbar {
    background: rgba(7, 27, 61, .94) !important;
    border-bottom-color: rgba(132, 218, 255, .14);
}
html[data-theme="dark"] .navbar .nav-link.text-white,
html[data-theme="dark"] .navbar .navbar-brand { color: #f7fbff !important; }

body .cover-wrapper.cover-scene {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    justify-content: flex-start;
    min-height: calc(100vh - 68px);
    padding: clamp(118px, 14vh, 170px) 24px 90px;
    background-image:
        linear-gradient(180deg, rgba(246,252,255,.2) 0%, rgba(246,252,255,.08) 38%, rgba(244,252,252,.28) 100%),
        url('/images/experience/begin-again-light.webp');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}
html[data-theme="dark"] body .cover-wrapper.cover-scene {
    background-image:
        linear-gradient(180deg, rgba(1,14,42,.18) 0%, rgba(1,14,42,.08) 42%, rgba(1,14,42,.38) 100%),
        url('/images/experience/begin-again-dark.webp');
}
.cover-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 22%, rgba(255,255,255,.78), rgba(255,255,255,.2) 35%, transparent 62%);
}
html[data-theme="dark"] .cover-scene::before {
    background: radial-gradient(ellipse at 50% 22%, rgba(4,25,69,.54), rgba(4,25,69,.16) 38%, transparent 65%);
}
.cover-scene > * { position: relative; z-index: 1; }

.cover-scene .cover-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 7px 15px;
    color: #466580;
    font-size: 14px;
    border: 1px solid rgba(79,124,255,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.7);
    box-shadow: 0 8px 24px rgba(57,103,150,.12);
    backdrop-filter: blur(14px);
}
.cover-scene .cover-kicker::before { content: "✨"; }
html[data-theme="dark"] .cover-scene .cover-kicker {
    color: #e8f5ff;
    background: rgba(7,31,69,.7);
    border-color: rgba(126,215,255,.2);
}
.cover-scene .cover-title {
    max-width: 980px;
    margin: 0 auto 16px;
    color: #123765 !important;
    font-size: clamp(42px, 6vw, 72px);
    line-height: 1.15;
    letter-spacing: -.035em;
    text-shadow: 0 3px 0 rgba(255,255,255,.75), 0 12px 35px rgba(23,52,92,.18);
}
html[data-theme="dark"] .cover-scene .cover-title {
    color: #f7fbff !important;
    text-shadow: 0 4px 24px rgba(0,9,35,.75);
}
.cover-scene .cover-intro {
    max-width: 780px;
    margin: 0 auto 13px;
    color: #234e73 !important;
    font-size: clamp(17px, 2.2vw, 23px);
    line-height: 1.7;
    text-shadow: 0 2px 10px rgba(255,255,255,.9);
}
.cover-scene .cover-desc {
    max-width: 760px;
    color: #345d7d !important;
    font-size: clamp(15px, 1.6vw, 19px);
    text-shadow: 0 2px 10px rgba(255,255,255,.85);
}
html[data-theme="dark"] .cover-scene .cover-intro,
html[data-theme="dark"] .cover-scene .cover-desc {
    color: #e1efff !important;
    text-shadow: 0 3px 16px rgba(0,8,31,.92);
}

.cover-scene .topic-grid {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
    margin: 34px auto 0;
}
.cover-scene .topic-item,
.cover-scene .topic-item:nth-child(n) { top: 0; }
.cover-scene .topic-circle {
    width: 100%;
    height: 188px;
    min-width: 0;
    padding: 22px 14px;
    flex-direction: column;
    gap: 12px;
    border-radius: 25px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    box-shadow: 0 20px 50px rgba(20,65,110,.2) !important;
    backdrop-filter: blur(16px) saturate(135%);
}
.cover-scene .topic-circle::before {
    display: block;
    font-size: 39px;
    line-height: 1;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,.12));
}
.cover-scene .topic-item:nth-child(5n+1) .topic-circle::before { content: "💗"; }
.cover-scene .topic-item:nth-child(5n+2) .topic-circle::before { content: "🫂"; }
.cover-scene .topic-item:nth-child(5n+3) .topic-circle::before { content: "🌱"; }
.cover-scene .topic-item:nth-child(5n+4) .topic-circle::before { content: "☀️"; }
.cover-scene .topic-item:nth-child(5n+5) .topic-circle::before { content: "🪧"; }
.cover-scene .topic-item:nth-child(5n+1) .topic-circle { background: linear-gradient(145deg, rgba(255,121,159,.94), rgba(255,151,135,.9)) !important; }
.cover-scene .topic-item:nth-child(5n+2) .topic-circle { background: linear-gradient(145deg, rgba(76,147,255,.94), rgba(87,197,239,.9)) !important; }
.cover-scene .topic-item:nth-child(5n+3) .topic-circle { background: linear-gradient(145deg, rgba(163,124,255,.94), rgba(113,141,255,.9)) !important; }
.cover-scene .topic-item:nth-child(5n+4) .topic-circle { background: linear-gradient(145deg, rgba(255,211,89,.96), rgba(255,179,87,.92)) !important; color: #493516 !important; }
.cover-scene .topic-item:nth-child(5n+5) .topic-circle { background: linear-gradient(145deg, rgba(50,204,173,.96), rgba(71,221,190,.9)) !important; }

.cover-scene .stats {
    width: min(850px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 34px auto 0;
}
.cover-scene .stat-card {
    position: relative;
    width: auto;
    min-height: 154px;
    padding: 24px 28px 24px 92px;
    text-align: left;
    border-radius: 24px;
    background: rgba(255,255,255,.76) !important;
}
.cover-scene .stat-card::before {
    position: absolute;
    left: 27px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 42px;
}
.cover-scene .stat-card:nth-child(1)::before { content: "🫂"; }
.cover-scene .stat-card:nth-child(2)::before { content: "💙"; }
.cover-scene .stat-number { margin: 4px 0; font-size: 38px; line-height: 1.05; }
html[data-theme="dark"] .cover-scene .stat-card { background: rgba(7,31,69,.75) !important; }

.cover-scene > .cover-desc:last-of-type {
    margin: 46px auto 0;
    padding: 25px 30px;
    border: 1px solid var(--ba-border);
    border-radius: 22px;
    background: var(--ba-surface);
    box-shadow: var(--ba-shadow);
    backdrop-filter: blur(18px);
}

@media (max-width: 991px) {
    .ba-experience-controls { top: 72px; right: 10px; padding: 6px; }
    .ba-control { min-height: 34px; padding: 5px 8px; font-size: 13px; }
    body .cover-wrapper.cover-scene { padding: 128px 16px 86px; background-position: 58% top; }
    .cover-scene .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .cover-scene .topic-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .cover-scene .topic-circle { height: 145px; font-size: 14px; padding: 16px 10px; }
    .cover-scene .topic-circle::before { font-size: 31px; }
    .cover-scene .stats { grid-template-columns: 1fr; }
    .cover-scene .stat-card { min-height: 134px; padding: 21px 20px 21px 80px; }
    .cover-scene .stat-card::before { left: 22px; font-size: 36px; }
}
