html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Anuphan', sans-serif;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Kanit', sans-serif;
}

.hero-gradient {
    background: linear-gradient(-45deg, #00A8B5, #FFC043, #F58220, #00A8B5);
    background-size: 400% 400%;
    animation: aurora-flow 12s ease infinite;
}

@keyframes aurora-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.aurora-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 168, 181, 0.15) 0%, transparent 70%);
    filter: blur(60px);
    z-index: 1;
    pointer-events: none;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.skill-card-logic {
    border-top: 4px solid #00A8B5;
    box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.1);
}

.skill-card-creative {
    border-top: 4px solid #F58220;
    box-shadow: 0 10px 30px -10px rgba(245, 158, 11, 0.1);
}

.skill-card-collab {
    border-top: 4px solid #FFC043;
    box-shadow: 0 10px 30px -10px rgba(14, 165, 233, 0.1);
}

.glow-teal {
    filter: drop-shadow(0 0 15px rgba(0, 168, 181, 0.4));
}

.glow-emerald {
    filter: drop-shadow(0 0 15px rgba(0, 168, 181, 0.4));
}

.glow-amber {
    filter: drop-shadow(0 0 15px rgba(245, 130, 32, 0.4));
}

.glow-sky {
    filter: drop-shadow(0 0 15px rgba(255, 192, 67, 0.4));
}


.nav-shadow {
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.1);
}

.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.animate-spin-slow {
    animation: spin 8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Custom scrollbar for modal */
.modal-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.modal-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.modal-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 60%;
    height: 4px;
    background: #00A8B5;
    transform: translateX(-50%);
    border-radius: 2px;
}

.card-hover {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.1), 0 15px 15px -5px rgba(0, 0, 0, 0.04);
}

.map-container iframe {
    width: 100%;
    height: 400px;
    border-radius: 1.5rem;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounce-subtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.animate-bounce-subtle {
    animation: bounce-subtle 3s infinite ease-in-out;
}

/* Decorative Divider & Marquee */
.decorative-divider {
    position: relative;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
    padding: 3rem 0;
    border-top: 1px solid rgba(0, 168, 181, 0.05);
}

.marquee-container {
    display: flex;
    overflow: hidden;
    user-select: none;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.marquee-content {
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    min-width: 100%;
    gap: 3rem;
    animation: marquee-scroll 40s linear infinite;
    padding: 1rem 0;
}

@keyframes marquee-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border-radius: 99px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.marquee-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 168, 181, 0.3);
}


.animate-fade-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

/* Reveal on scroll interaction */
.reveal {
    opacity: 0;
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Core Skills Section */
.core-skills-section {
    padding: 6rem 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 50%, #f3f4f6 100%);
    position: relative;
    overflow: hidden;
}

.core-skills-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(#00A8B5 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.03;
    pointer-events: none;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

.skill-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 1.5rem;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInFromLeft 0.6s ease-out forwards;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.skill-item:hover {
    transform: translateY(-5px) translateX(0) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #00A8B5;
}

.skill-item:nth-child(1) {
    animation-delay: 0.2s;
}

.skill-item:nth-child(2) {
    animation-delay: 0.4s;
}

.skill-item:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes slideInFromLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.skill-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.skill-item:hover .skill-icon {
    transform: scale(1.1) rotate(5deg);
}

.think-icon {
    background: linear-gradient(135deg, #00A8B5, #00c9d9);
}

.create-icon {
    background: linear-gradient(135deg, #F58220, #FFC043);
}

.collab-icon {
    background: linear-gradient(135deg, #00A8B5, #F58220);
}

.founder-card {
    background: linear-gradient(135deg, #00A8B5 0%, #007A85 100%);
    border-radius: 40px;
    padding: 1rem;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 168, 181, 0.3);
    transition: all 0.3s ease;
}

.founder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 30px -5px rgba(0, 168, 181, 0.4);
}

.founder-card::before {
    content: '"';
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 12rem;
    opacity: 0.1;
    font-family: serif;
    line-height: 1;
}

.founder-image-container {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.founder-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.founder-card:hover .founder-image-container img {
    transform: scale(1.05);
}

.founder-quote-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: 1.5rem;
    margin-top: 1.5rem;
    font-style: italic;
    position: relative;
}

/* QR Modal Styles */
.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.qr-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.qr-modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 90%;
    width: 400px;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.qr-modal.active .qr-modal-content {
    transform: scale(1);
    opacity: 1;
}

.close-qr {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: #ef4444;
    transition: all 0.2s;
}

.close-qr:hover {
    transform: scale(1.1);
    background: #fee2e2;
}

/* Lightbox Gallery Styles */
.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 1.5rem;
    height: 12rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 168, 181, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: white;
    font-size: 1.5rem;
    transform: scale(0.5);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    cursor: default;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 2001;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 1rem;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 2002;
    opacity: 0.7;
}

.lightbox-nav:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
    color: #00A8B5;
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

@media (max-width: 768px) {
    .lightbox-nav {
        font-size: 2rem;
        padding: 0.5rem;
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Decorative Background Elements */
.bg-decoration {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    opacity: 0.1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.bg-decoration.animate-float-slow {
    animation: floatSlow 20s ease-in-out infinite;
}

.bg-decoration.animate-float-slower {
    animation: floatSlow 25s ease-in-out infinite;
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.section-with-bg {
    position: relative;
    overflow: hidden;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 3.5rem;
    height: 3.5rem;
    background: white;
    color: #4f46e5;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateY(20px);
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 168, 181, 0.2);
    color: #007A85;
}

/* Team Section Styles */
.team-card {
    background: white;
    border-radius: 2rem;
    padding: 2rem;
    text-align: center;
    border: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.08),
        0 8px 16px -4px rgba(0, 0, 0, 0.15),
        0 16px 32px -8px rgba(0, 168, 181, 0.2);
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.12),
        0 12px 24px -6px rgba(0, 0, 0, 0.2),
        0 30px 60px -15px rgba(0, 168, 181, 0.3);
}

.team-img-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border-radius: 2rem;
    overflow: hidden;
    border: 4px solid #f8fafc;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease;
}

.team-card:hover .team-img-container {
    transform: scale(1.05) rotate(3deg);
}

.team-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Coding Ladder Responsive Positions */
@media (min-width: 768px) {
    .stage-card-container {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 24%;
        /* Adjust width to fit 4 in a row with some spacing */
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }

    /* Remove vertical offsets for a level row */
    .stage-card-1,
    .stage-card-2,
    .stage-card-3,
    .stage-card-4 {
        transform: none !important;
        height: 100%;
    }

    /* Ensure the inner glass-card takes full height */
    .stage-card-container .glass-card {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    #learning-path {
        height: auto !important;
        min-height: unset !important;
    }

    #learning-path .max-w-6xl {
        height: auto !important;
    }

    #stages-container {
        height: auto !important;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .stage-card-container {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin-bottom: 2rem;
    }

    .stage-card-container:last-child {
        margin-bottom: 0;
    }
}

/* Timeline Animations */
@keyframes timeline-draw {
    from {
        stroke-dasharray: 900;
        stroke-dashoffset: 900;
    }
    to {
        stroke-dasharray: 900;
        stroke-dashoffset: 0;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
    }
}

@keyframes float-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SVG Line animations */
svg line {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: timeline-draw 3s ease-out forwards;
}

svg line:nth-child(2) {
    animation-delay: 0.2s;
}

svg line:nth-child(3) {
    animation-delay: 0.4s;
}

svg line:nth-child(4) {
    animation-delay: 0.6s;
}

svg line:nth-child(5) {
    animation-delay: 0.8s;
}

/* Milestone circles glow effect */
svg circle {
    animation: pulse-glow 2.5s ease-in-out infinite;
}

svg circle:nth-child(1) {
    animation-delay: 0s;
}

svg circle:nth-child(2) {
    animation-delay: 0.3s;
}

svg circle:nth-child(3) {
    animation-delay: 0.6s;
}

svg circle:nth-child(4) {
    animation-delay: 0.9s;
}

svg circle:nth-child(5) {
    animation-delay: 1.2s;
}

/* Timeline text fade in */
svg text {
    animation: float-up 0.8s ease-out forwards;
    animation-fill-mode: both;
}

svg text:nth-child(1) { animation-delay: 1s; }
svg text:nth-child(2) { animation-delay: 1.2s; }
svg text:nth-child(3) { animation-delay: 1.4s; }
svg text:nth-child(4) { animation-delay: 1.6s; }
svg text:nth-child(5) { animation-delay: 1.8s; }

/* Stage cards entrance animation */
.stage-card-container {
    animation: float-up 0.6s ease-out forwards;
}

.stage-card-1 { animation-delay: 2s; }
.stage-card-2 { animation-delay: 2.2s; }
.stage-card-3 { animation-delay: 2.4s; }
.stage-card-4 { animation-delay: 2.6s; }

/* Mobile vertical timeline line animation */
.md:hidden .absolute.left-8 {
    animation: timeline-draw-vertical 2s ease-out forwards;
}

@keyframes timeline-draw-vertical {
    from {
        clip-path: inset(100% 0 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}
