/* ===========================
   2021 Batch Class Portal
   — A warm, cute, modern design
   =========================== */

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #0f0e17;
    --bg-secondary: #1a1829;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #fffffe;
    --text-secondary: #a7a9be;
    --text-muted: #72738c;
    --accent: #f9c846;
    --accent-glow: rgba(249, 200, 70, 0.25);
    --accent2: #e16060;
    --accent3: #7f5af0;
    --gradient-hero: linear-gradient(135deg, #0f0e17 0%, #1a1829 40%, #2b1f3a 100%);
    --gradient-warm: linear-gradient(135deg, #f9c846 0%, #e16060 100%);
    --gradient-purple: linear-gradient(135deg, #7f5af0 0%, #d946ef 100%);
    --glass: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --radius: 20px;
    --radius-sm: 12px;
    --shadow-soft: 0 4px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(249, 200, 70, 0.1);
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-handwritten: 'Caveat', cursive;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Particles Background ---------- */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    color: var(--accent);
    animation: float linear infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-30px) rotate(90deg);
    }

    50% {
        transform: translateY(-10px) rotate(180deg);
    }

    75% {
        transform: translateY(-40px) rotate(270deg);
    }
}

/* ---------- Hero Section ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--gradient-hero);
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(127, 90, 240, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(249, 200, 70, 0.06) 0%, transparent 50%);
    animation: heroGlow 12s ease-in-out infinite alternate;
    z-index: -1;
}

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

    100% {
        transform: translate(30px, -20px) scale(1.05);
    }
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease-out;
    text-transform: uppercase;
}

.hero-title {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-title-line {
    display: block;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, #fffffe 0%, #f9c846 60%, #e16060 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    display: block;
    font-size: clamp(1.4rem, 3.5vw, 2.4rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.hero-subtitle em {
    font-family: var(--font-handwritten);
    font-style: normal;
    font-size: 1.3em;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.hero-tagline {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-reps {
    margin-top: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.reps-label {
    font-family: var(--font-handwritten);
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.reps-names {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.rep-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
}

.rep-chip:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.hero-scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 1px;
    animation: fadeInUp 0.8s ease-out 1s both;
}

.scroll-arrow {
    font-size: 1.2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

/* ---------- Main Sections ---------- */
main {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem 2rem;
}

.card-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.card-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 0 12px rgba(249, 200, 70, 0.3));
}

.section-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 500px;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ---------- Section Divider ---------- */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.section-divider.revealed {
    opacity: 1;
}

.section-divider span {
    color: var(--accent);
    font-size: 1.2rem;
    opacity: 0.4;
}

/* ---------- Resource Cards ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.resource-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.8rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    width: 100%;
    overflow: hidden;
}

.resource-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(249, 200, 70, 0.05) 0%, rgba(127, 90, 240, 0.05) 100%);
    opacity: 0;
    transition: var(--transition);
}

.resource-card:hover,
.resource-card:focus-visible {
    background: var(--bg-card-hover);
    border-color: rgba(249, 200, 70, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.resource-card:hover::before {
    opacity: 1;
}

.resource-card--wide {
    max-width: 100%;
}

.resource-card--social {
    border-color: rgba(127, 90, 240, 0.15);
}

.resource-card--social:hover {
    border-color: rgba(127, 90, 240, 0.4);
    box-shadow: 0 0 40px rgba(127, 90, 240, 0.1);
}

.card-emoji {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.resource-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.resource-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    background: rgba(225, 96, 96, 0.1);
    border: 1px solid rgba(225, 96, 96, 0.2);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent2);
    align-self: flex-start;
    transition: var(--transition);
}

.card-badge--open {
    background: rgba(127, 90, 240, 0.1);
    border-color: rgba(127, 90, 240, 0.2);
    color: var(--accent3);
}

.card-badge--unlocked {
    background: rgba(75, 181, 67, 0.1) !important;
    border-color: rgba(75, 181, 67, 0.25) !important;
    color: #4bb543 !important;
}

/* ---------- Footer ---------- */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-sub {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ---------- PIN Modal ---------- */
.pin-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 14, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.pin-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.pin-modal {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: calc(var(--radius) + 4px);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 0 80px rgba(127, 90, 240, 0.08), var(--shadow-soft);
    animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.pin-overlay.active .pin-modal {
    animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

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

.pin-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem;
    line-height: 1;
    transition: var(--transition);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-close:hover {
    color: var(--text-primary);
    background: var(--glass);
}

.pin-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.pin-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.pin-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.pin-input-row {
    display: flex;
    gap: 0.7rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.pin-digit {
    width: 56px;
    height: 64px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--glass);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: var(--transition);
    caret-color: var(--accent);
}

.pin-digit:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(249, 200, 70, 0.05);
}

.pin-error {
    display: none;
    color: var(--accent2);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.pin-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ---------- Shake animation ---------- */
.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-8px);
    }

    30% {
        transform: translateX(8px);
    }

    45% {
        transform: translateX(-6px);
    }

    60% {
        transform: translateX(6px);
    }

    75% {
        transform: translateX(-3px);
    }

    90% {
        transform: translateX(3px);
    }
}

/* ---------- Fade-in Keyframes ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

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

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .hero {
        padding: 2rem 1.2rem;
    }

    main {
        padding: 3rem 1rem 2rem;
    }

    .resource-card {
        padding: 1.4rem;
    }

    .pin-digit {
        width: 48px;
        height: 56px;
        font-size: 1.5rem;
    }

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

    .reps-names {
        gap: 0.4rem;
    }

    .rep-chip {
        font-size: 0.82rem;
        padding: 0.35rem 0.8rem;
    }
}

/* ---------- Selection ---------- */
::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}