/* ================= 1. GLOBAL & TYPOGRAPHY ================= */
body {
    font-family: 'Anuphan', sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
    width: 100%;
}

:root {
    --apple-bg: #f5f5f7;
    --apple-card: #ffffff;
    --apple-text: #1d1d1f;
    --apple-subtext: #86868b;
    --orbit-border: rgba(0, 0, 0, 0.12);
    --glow-color: rgba(234, 88, 12, 0.65);
}

.gradient-text {
    line-height: 1.25;
    margin: 0;
    background: linear-gradient(45deg, #0047AB 0%, #2E7DFF 25%, #e75ea4 45%, #ff8c69 65%, #f08e70 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.font-thai-heading {
    font-family: 'Noto Sans Thai', sans-serif;
}

.hero-title-first-line {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.hero-title-second-line {
    display: block;
    margin-top: 0.02em;
}

@media (max-width: 1024px) {
    #hero-section {
        height: auto;
        min-height: 100svh;
    }
}

@media (max-width: 767px) {
    .hero-title-first-line {
        white-space: normal;
    }

    .hero-content-wrapper {
        padding-top: 5.5rem;
    }

    h1.gradient-text {
        font-size: clamp(1.65rem, 8.8vw, 2.35rem);
        line-height: 1.08;
        letter-spacing: -0.03em;
    }

    h2.font-thai-heading {
        font-size: clamp(1rem, 4.8vw, 1.25rem);
        line-height: 1.18;
    }
}

/* ================= 2. HERO SECTION & BACKGROUND ================= */
#hero-section {
    position: relative;
    width: 100%;
    min-height: 100svh;
    height: 100svh;
    overflow: hidden;
    background-color: #000;
}

#hero-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
    filter: grayscale(80%);
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.45);
    z-index: 3;
}

.hero-content-wrapper {
    position: relative;
    z-index: 10;
    pointer-events: none;
}

.hero-content-wrapper button, .hero-content-wrapper a, .hero-content-wrapper .pointer-events-auto {
    pointer-events: auto;
}

/* ================= 3. ORBIT SCENE & ANIMATIONS ================= */
.orbit-scene {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.orbit-ring {
    position: absolute;
    top: calc(136% + 42px);
    left: 50%;
    border-radius: 50%;
    border: 1.5px solid var(--orbit-border);
    pointer-events: none;
    transform: translate3d(-50%, -50%, 0);
    animation: ringFadeIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: var(--ring-delay, 0s);
}

.orbit-item {
    position: absolute;
    left: 50%;
    top: calc(136% + 42px);
    will-change: transform;
    transform: translate3d(0,0,0);
    animation: orbitMove var(--dur) linear infinite;
    animation-direction: var(--dir);
    animation-delay: var(--delay);
    pointer-events: none;
    width: 0;
    height: 0;
    z-index: 10;
}

.orbit-content {
    position: absolute;
    left: 50%;
    top: 30;
    will-change: transform;
    transform: translate3d(-50%, -50%, 0);
    animation: keepUpright var(--dur) linear infinite;
    animation-direction: var(--dir);
    animation-delay: var(--delay);
}

.orbit-card {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
    transform: translateZ(0);
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border: 1.5px solid #fff;
    cursor: default;
    animation: cardPopIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    animation-delay: var(--pop-delay, 0s);
}

.orbit-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.orbit-card i {
    width: 55%;
    height: 55%;
    stroke-width: 2;
}

@keyframes orbitMove {
    from {
        transform: rotateZ(0deg) translateX(var(--r)) rotateZ(0deg);
    }

    to {
        transform: rotateZ(360deg) translateX(var(--r)) rotateZ(0deg);
    }
}

@keyframes keepUpright {
    from {
        transform: translate3d(-50%, -50%, 0) rotateZ(0deg);
    }

    to {
        transform: translate3d(-50%, -50%, 0) rotateZ(-360deg);
    }
}

@keyframes ringFadeIn {
    0% {
        opacity: 0;
        transform: translate3d(-50%, -50%, 0) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translate3d(-50%, -50%, 0) scale(1);
    }
}

@keyframes cardPopIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ================= 4. WIDGETS & COMPONENTS (Badges, Buttons) ================= */
.badge-blended {
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    color: #475569;
}

@keyframes pulse-wave {
    0% {
        box-shadow: 0 0 0 0 rgba(45, 45, 45, 0.5);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(45, 45, 45, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(45, 45, 45, 0);
    }
}

.animate-pulse-wave {
    animation: pulse-wave 3s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fade-up-1 {
    animation: fadeUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-fade-up-2 {
    animation: fadeUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.animate-fade-up-3 {
    animation: fadeUp 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

@keyframes luxuryRise {
    0% {
        opacity: 0;
        transform: translate3d(0, 42px, 0) scale(0.985);
        filter: blur(16px);
    }

    55% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

.reveal-stage {
    opacity: 0;
    transform: translate3d(0, 42px, 0) scale(0.985);
    filter: blur(16px);
    will-change: transform, opacity, filter;
    transition: opacity 0.95s cubic-bezier(0.16, 1, 0.3, 1), transform 1.05s cubic-bezier(0.16, 1, 0.3, 1), filter 0.95s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0s);
}

.reveal-stage.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
}

.hero-line-reveal {
    display: block;
    opacity: 0;
    transform: translate3d(0, 46px, 0) scale(0.99);
    filter: blur(18px);
    will-change: transform, opacity, filter;
    animation: luxuryRise 1.15s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--line-delay, 0s);
}

.hero-title-first-line.hero-line-reveal,
.hero-title-second-line.hero-line-reveal {
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transform-origin: left center;
}

.hero-title-first-line.hero-line-reveal {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.hero-title-second-line.hero-line-reveal {
    display: block;
}

.hero-thai-line-main.hero-line-reveal,
.hero-thai-line-sub.hero-line-reveal {
    display: inline-block;
}

.hero-thai-line-main,
.hero-thai-line-sub {
    display: inline-block;
}

.hero-thai-line-sub {
    margin-top: 0;
    margin-left: 0.18em;
}

.hero-badge-reveal {
    animation: luxuryRise 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.05s;
    opacity: 0;
}

.hero-social-reveal {
    animation: luxuryRise 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.18s;
    opacity: 0;
}

.section-reveal-grid > * {
    --reveal-delay: 0s;
}

.section-reveal-grid > *:nth-child(1) {
    --reveal-delay: 0.02s;
}

.section-reveal-grid > *:nth-child(2) {
    --reveal-delay: 0.10s;
}

.section-reveal-grid > *:nth-child(3) {
    --reveal-delay: 0.18s;
}

.section-reveal-grid > *:nth-child(4) {
    --reveal-delay: 0.26s;
}

.section-reveal-grid > *:nth-child(5) {
    --reveal-delay: 0.34s;
}

.section-reveal-grid > *:nth-child(6) {
    --reveal-delay: 0.42s;
}

.section-reveal-grid > *:nth-child(7) {
    --reveal-delay: 0.50s;
}

.section-reveal-grid > *:nth-child(8) {
    --reveal-delay: 0.58s;
}

.section-reveal-grid > *:nth-child(9) {
    --reveal-delay: 0.66s;
}

.section-reveal-grid > *:nth-child(10) {
    --reveal-delay: 0.74s;
}

/* ================= 5. NEWS & DONATION SECTION ================= */
.smart-slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.smart-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
}

.smart-slide img {
    display: block;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
}

.flat-card {
    background-color: var(--apple-bg);
}

/* ================= 6. ACTIVITIES SECTION ================= */
.activity-card {
    background: #d8dde3;
    border-radius: 1.25rem;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    border: none;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.activity-card:hover {
    transform: translateY(-5px);
}

.activity-image {
    padding: 12px 12px 0 12px;
    height: 240px;
}

.activity-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.activity-content {
    padding: 16px 16px 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    align-self: flex-start;
}

.date-pink {
    background: #fdf2f8;
    color: #db2777;
}

.date-teal {
    background: #e0f2fe;
    color: #0891b2;
}

.date-green {
    background: #dcfce7;
    color: #16a34a;
}

.activity-card h3 {
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.activity-card p {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 300;
    line-height: 1.6;
    margin: 0 0 16px 0;
    flex: 1;
}

.btn-readmore {
    background: #e2e8f0;
    color: #334155;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-readmore:hover {
    background: #cbd5e1;
    color: #0f172a;
}

/* ================= 6b. ACTIVITY CARDS ================= */
a.activity-card {
    box-shadow: 0 4px 16px rgba(27, 67, 50, 0.06);
    transform: translateY(0) scale(1);
    transition:
        transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, box-shadow;
}

a.activity-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 18px 40px rgba(27, 67, 50, 0.11);
}

/* ================= 7. WHY ECON FLIP CARDS ================= */
.why-econ-section {
    font-family: 'Prompt', 'Anuphan', sans-serif;
}

.why-econ-heading {
    font-family: 'Anuphan', sans-serif;
}

.flip-card {
    background-color: transparent;
    perspective: 1200px;
    aspect-ratio: 3 / 4;
    width: 100%;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1.25rem;
    overflow: hidden;
    border: none;
    box-shadow: none;
}

.flip-card:hover .flip-card-front,
.flip-card:hover .flip-card-back {
    box-shadow: none;
}

.flip-card-front {
    background-size: cover;
    background-position: center;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.25) 45%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
}

.flip-card-back {
    transform: rotateY(180deg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(40px) saturate(1.4);
    -webkit-backdrop-filter: blur(40px) saturate(1.4);
}

@keyframes backlightDrift1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(3vw, -2vh) scale(1.05);
    }

    66% {
        transform: translate(-2vw, 1vh) scale(0.97);
    }
}

@keyframes backlightDrift2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    40% {
        transform: translate(-4vw, -1.5vh) scale(1.06);
    }

    70% {
        transform: translate(2vw, 2vh) scale(0.95);
    }
}

@keyframes backlightDrift3 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }

    50% {
        transform: translate(-3vw, -2vh) scale(1.1);
        opacity: 1;
    }
}

/* ================= 8. ECON PORTAL SECTION ================= */
#ep-stitch-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

#econ-portal-section {
    --ep-primary-font: 'Anuphan', sans-serif;
    --ep-backlight-color: rgba(186, 230, 253, 0.5);
    --ep-card-bg-normal: rgba(226, 232, 240, 0.85);
    --ep-card-bg-hover: rgba(255, 255, 255, 0.98);
    --ep-outer-glass: rgba(255, 255, 255, 0.4);
    font-family: var(--ep-primary-font);
    padding: 4rem 1.5rem;
    position: relative;
    display: flex;
    justify-content: center;
}

#econ-portal-section .ep-outer-card {
    background: var(--ep-outer-glass);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 3rem;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 1100px;
    padding: 3rem;
    position: relative;
    z-index: 10;
}

#econ-portal-section .ep-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    #econ-portal-section .ep-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    #econ-portal-section .ep-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

#econ-portal-section .ep-service-card {
    background: var(--ep-card-bg-normal);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.6rem;
    padding: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    text-decoration: none;
}

#econ-portal-section .ep-service-card:hover {
    background: var(--ep-card-bg-hover);
    transform: translateY(-3px) scale(1.01);
    border-color: #FFFFFF;
    box-shadow: 0 12px 25px -8px rgba(0, 0, 0, 0.07);
}

#econ-portal-section .ep-mouse-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(150px circle at var(--ep-m-x, 50%) var(--ep-m-y, 50%), var(--ep-backlight-color), transparent 80%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

#econ-portal-section .ep-service-card:hover .ep-mouse-glow {
    opacity: 1;
}

#econ-portal-section .ep-icon-box {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    transition: transform 0.5s ease;
}

#econ-portal-section .ep-service-card:hover .ep-icon-box {
    transform: scale(1.06);
}

#econ-portal-section .ep-content {
    flex-grow: 1;
    min-width: 0;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#econ-portal-section .ep-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.2;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#econ-portal-section .ep-desc {
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748B;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

#econ-portal-section .ep-action-btn {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: #CBD5E1;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

#econ-portal-section .ep-service-card:hover .ep-action-btn {
    background: #0EA5E9;
    color: #FFFFFF;
    transform: scale(1.1);
}

#econ-portal-section .ep-bg-blue {
    background-color: #E0F2FE;
    color: #0284C7;
}

#econ-portal-section .ep-bg-green {
    background-color: #DCFCE7;
    color: #16A34A;
}

#econ-portal-section .ep-bg-purple {
    background-color: #F3E8FF;
    color: #9333EA;
}

#econ-portal-section .ep-bg-pink {
    background-color: #FCE7F3;
    color: #DB2777;
}

#econ-portal-section .ep-bg-yellow {
    background-color: #FEF9C3;
    color: #CA8A04;
}

#econ-portal-section .ep-bg-teal {
    background-color: #F0FDFA;
    color: #0D9488;
}

/* ================= 9. CSP-SAFE UTILITY CLASSES ================= */
.section-transparent {
    background: transparent;
}

.section-anuphan {
    font-family: 'Anuphan', sans-serif;
}

.z-1 {
    z-index: 1;
}

.glass-card-bg {
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.btn-readmore-lg {
    font-size: 0.95rem;
    padding: 13px 24px;
}

.hero-line-delay-1 { --line-delay: 0.14s; }
.hero-line-delay-2 { --line-delay: 0.40s; }
.hero-line-delay-3 { --line-delay: 0.70s; }
.hero-line-delay-4 { --line-delay: 0.96s; }

.reveal-delay-1 { --reveal-delay: 0.22s; }
