* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(to bottom, #FFF0F5, #F0F4FF);
    color: #6B607A;
    line-height: 1.65;
    overflow-x: hidden;
}

/* ===== BACKGROUND GRADIENT ===== */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #FFF0F5, #F0F4FF);
    z-index: -2;
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
    z-index: 1;
    overflow: hidden;
}

/* ===== SPELL CIRCLE ===== */
.spell-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    z-index: 0;
    animation: rotateLayers 0.3s ease-out forwards;
}

.spell-circle svg {
    width: 100%;
    height: 100%;
}

.outer-ring {
    animation: rotateOuter 60s linear infinite;
}

.inner-ring {
    animation: rotateInner 45s linear reverse infinite;
}

@keyframes rotateLayers {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.15;
    }
}

@keyframes rotateOuter {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateInner {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

/* ===== SPARKLES ===== */
#sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: twinkleFloat linear infinite;
}

@keyframes twinkleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) translateX(var(--float-x, 0));
    }
}

/* ===== HERO CONTENT ===== */
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.title-wrapper {
    margin-bottom: 24px;
}

.title {
    font-size: 80px;
    font-weight: 700;
    color: #5B4A8A;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    line-height: 1;
}

.title-letter {
    display: inline-block;
    animation: bounce 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.title-letter:nth-child(1) {
    animation-delay: 0ms;
}

.title-letter:nth-child(2) {
    animation-delay: 100ms;
}

.title-letter:nth-child(3) {
    animation-delay: 200ms;
}

@keyframes bounce {
    0% {
        transform: translateY(-30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.subtitle {
    font-size: 32px;
    font-weight: 600;
    color: #5B4A8A;
    animation: fadeInScale 400ms ease-out 600ms both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tagline {
    font-size: 18px;
    font-weight: 600;
    color: #A89EC8;
    margin-top: 16px;
    animation: fadeIn 500ms ease-out 1000ms both;
}

.description {
    font-size: 15px;
    color: #8A7A9A;
    margin-top: 8px;
    animation: fadeIn 500ms ease-out 1200ms both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== NAVIGATION PILLS ===== */
.nav-pills {
    display: flex;
    gap: 16px;
    margin-top: 48px;
    justify-content: center;
    flex-wrap: wrap;
    animation: slideInPills 300ms ease-out 1400ms both;
}

@keyframes slideInPills {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-pill {
    padding: 12px 24px;
    border-radius: 20px;
    background-color: #FFFFFF;
    color: #5B4A8A;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(150, 130, 180, 0.15);
    cursor: pointer;
    transition: all 200ms;
    position: relative;
    z-index: 10;
}

.nav-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(150, 130, 180, 0.25);
}

.nav-pill[data-school="charm"] {
    background-color: #FFB6C1;
    color: #FFFFFF;
}

.nav-pill[data-school="divination"] {
    background-color: #A8D8EA;
    color: #FFFFFF;
}

.nav-pill[data-school="nature"] {
    background-color: #B8E6C8;
    color: #FFFFFF;
}

/* ===== MAIN CONTAINER ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 40px;
    position: relative;
    z-index: 1;
}

/* ===== SCHOOL SECTIONS ===== */
.school-section {
    margin-bottom: 120px;
    scroll-margin-top: 100px;
}

.school-section h2 {
    font-size: 36px;
    font-weight: 700;
    color: #5B4A8A;
    margin-bottom: 48px;
    text-align: center;
}

/* ===== CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ===== THEORY CARDS ===== */
.theory-card {
    position: relative;
    height: 340px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(150, 130, 180, 0.15);
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55), box-shadow 200ms;
}

.theory-card:hover {
    box-shadow: 0 8px 24px rgba(150, 130, 180, 0.25);
    transform: translateY(-6px);
}

.theory-card.flipped {
    transform: rotateY(180deg);
}

.card-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 8px;
    animation: expandBar 300ms ease-out 0.3s forwards;
}

@keyframes expandBar {
    to {
        width: 100%;
    }
}

.charm-bar {
    background-color: #FFB6C1;
}

.divination-bar {
    background-color: #A8D8EA;
}

.nature-bar {
    background-color: #B8E6C8;
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 28px;
    display: flex;
    flex-direction: column;
    backface-visibility: hidden;
}

.card-back {
    transform: rotateY(180deg);
    justify-content: flex-start;
}

.school-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.card-front h3 {
    font-size: 20px;
    font-weight: 600;
    color: #5B4A8A;
    margin-bottom: 8px;
}

.card-front p {
    font-size: 14px;
    color: #8A7A9A;
    margin-bottom: auto;
}

.difficulty {
    display: flex;
    gap: 4px;
    margin-top: 16px;
}

.star {
    font-size: 14px;
    color: #FFB6C1;
    opacity: 0;
    animation: popStar 100ms ease-out 0.6s forwards;
}

.star:nth-child(1) {
    animation-delay: 0.6s;
}

.star:nth-child(2) {
    animation-delay: 0.7s;
}

.star:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes popStar {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.star.empty {
    opacity: 0.3;
}

.card-back h3 {
    font-size: 18px;
    font-weight: 600;
    color: #5B4A8A;
    margin-bottom: 12px;
}

.card-back p {
    font-size: 14px;
    color: #6B607A;
    line-height: 1.6;
}

/* ===== GLOSSY HIGHLIGHT ===== */
.theory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
    border-radius: 12px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-section {
        height: 80vh;
        padding: 40px 20px;
    }

    .spell-circle {
        width: 200px;
        height: 200px;
    }

    .title {
        font-size: 48px;
    }

    .subtitle {
        font-size: 24px;
    }

    .container {
        padding: 60px 20px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }

    .theory-card {
        height: 300px;
    }

    .school-section h2 {
        font-size: 28px;
        margin-bottom: 32px;
    }

    .nav-pills {
        margin-top: 32px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 70vh;
        padding: 30px 16px;
    }

    .spell-circle {
        width: 150px;
        height: 150px;
    }

    .title {
        font-size: 36px;
    }

    .subtitle {
        font-size: 20px;
    }

    .tagline {
        font-size: 14px;
    }

    .description {
        font-size: 13px;
    }

    .container {
        padding: 40px 16px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .theory-card {
        height: 280px;
    }

    .school-section h2 {
        font-size: 24px;
    }

    .nav-pill {
        padding: 10px 20px;
        font-size: 12px;
    }

    .school-icon {
        font-size: 24px;
    }

    .card-front h3 {
        font-size: 16px;
    }

    .card-back h3 {
        font-size: 16px;
    }
}
