:root { --gold: #f4b400; --gold-dark: #d99f00; --deep: #2e1a47; --violet: #6f42c1; --soft: #f6f3fb; }

body.site { background: #fff; color: #231a33; scroll-behavior: smooth; }
html { scroll-padding-top: 76px; }

.site-nav { background: var(--deep); box-shadow: 0 2px 12px rgba(0, 0, 0, .18); }
.site-nav .navbar-brand, .site-nav .nav-link { color: #fff; }
.site-nav .nav-link { opacity: .9; }
.site-nav .nav-link:hover { opacity: 1; color: var(--gold); }

.btn-gold { background: var(--gold); border-color: var(--gold); color: #2a1f00; font-weight: 600; }
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: #2a1f00; }

/* Hero */
.hero-site {
    background: radial-gradient(1200px 500px at 80% -10%, rgba(244, 180, 0, .22), transparent 60%),
                linear-gradient(135deg, var(--deep) 0%, #4b2a85 55%, var(--violet) 100%);
    color: #fff; padding: 84px 0 96px;
}
.hero-site h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.12; }
.hero-site .lead { color: #e6dcf7; max-width: 46rem; }
.hero-site .motto { color: var(--gold); font-style: italic; letter-spacing: .02em; }
.hero-logo { max-height: 150px; max-width: 100%; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35)); }
.pin-badge { display: inline-flex; align-items: center; gap: .6rem; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .5rem 1.1rem; }
.pin-badge strong { color: var(--gold); font-size: 1.15rem; }

/* Scrolling notices */
.marquee { background: var(--gold); color: #2a1f00; overflow: hidden; white-space: nowrap; border-bottom: 3px solid var(--deep); }
.marquee-inner { display: inline-block; padding: .55rem 0; padding-left: 100%; animation: scroll-left 38s linear infinite; font-weight: 600; }
.marquee:hover .marquee-inner { animation-play-state: paused; }
.marquee-inner span { margin-right: 3.5rem; }
.marquee-inner span::before { content: "\2605"; margin-right: .6rem; color: var(--deep); }
@keyframes scroll-left { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .marquee-inner { animation: none; padding-left: 1rem; white-space: normal; display: block; } }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--soft); }
.section-title { font-weight: 700; color: var(--deep); margin-bottom: .4rem; }
.section-title::after { content: ""; display: block; width: 56px; height: 4px; background: var(--gold); border-radius: 4px; margin-top: .6rem; }
.text-center .section-title::after { margin-left: auto; margin-right: auto; }

.mv-card { border: 0; border-radius: 16px; box-shadow: 0 10px 30px rgba(46, 26, 71, .08); height: 100%; border-top: 5px solid var(--violet); }
.mv-card .icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--soft); color: var(--violet); font-size: 1.6rem; }

.dept-card { border: 1px solid #e6def4; border-radius: 14px; padding: 1.2rem; height: 100%; background: #fff; transition: transform .15s, box-shadow .15s; }
.dept-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(46, 26, 71, .12); }
.dept-card .icon { color: var(--violet); font-size: 1.8rem; }
.dept-card .code { font-size: .78rem; letter-spacing: .08em; color: #7a6a95; }

/* Leaders */
.leader-card { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(46, 26, 71, .1); height: 100%; text-align: center; }
.leader-photo { width: 100%; aspect-ratio: 5 / 6; object-fit: cover; background: #e9e1f7; display: block; }
.leader-initials { width: 100%; aspect-ratio: 5 / 6; display: grid; place-items: center; background: linear-gradient(135deg, #e9e1f7, #cdbdea); color: var(--deep); font-size: 3.2rem; font-weight: 700; }
.leader-body { padding: 1.1rem 1.2rem 1.4rem; }
.leader-position { display: inline-block; background: var(--deep); color: #fff; border-radius: 999px; padding: .15rem .8rem; font-size: .8rem; margin-bottom: .5rem; }
.leader-card.featured .leader-position { background: var(--gold); color: #2a1f00; font-weight: 600; }
.leader-msg { font-size: .92rem; color: #5b4d73; font-style: italic; }

/* Steps */
.step { text-align: center; padding: 1.2rem; }
.step .num { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .8rem; background: var(--violet); color: #fff; font-weight: 700; font-size: 1.3rem; box-shadow: 0 0 0 6px rgba(111, 66, 193, .15); }

.contact-box { background: var(--deep); color: #fff; border-radius: 18px; padding: 2rem; }
.contact-box i { color: var(--gold); }

.site-footer { background: #1e1030; color: #cbbfe0; padding: 1.4rem 0; font-size: .9rem; }
.site-footer a { color: var(--gold); text-decoration: none; }

/* Apply pages */
.apply-wrap { background: var(--soft); min-height: 70vh; padding: 48px 0; }
.apply-card { border: 0; border-radius: 18px; box-shadow: 0 12px 34px rgba(46, 26, 71, .12); }
.pin-input { letter-spacing: .18em; font-weight: 600; text-transform: uppercase; font-size: 1.2rem; text-align: center; }
.passport-preview { width: 120px; height: 160px; object-fit: cover; border-radius: 8px; border: 2px solid #e6def4; background: #fff; }
@media print {
    .site-nav, .site-footer, .no-print, .alert { display: none !important; }
    .apply-wrap { background: #fff; padding: 0; }
    .apply-card { box-shadow: none; border: 1px solid #999; }
}

/* ===== Welcome page: pictures, entrance animation, campus life ===== */
.hero-site { position: relative; overflow: hidden; }
.hero-site .photo-fade { opacity: .3; }
.hero-site > .container { position: relative; z-index: 2; }
.hero-site h1 { animation: fadeUp .9s ease-out both; }
.hero-site .motto { animation: fadeUp .8s ease-out both; }
.hero-site .lead { animation: fadeUp .9s ease-out .2s both; }
.hero-site .btn-lg { animation: fadeUp .9s ease-out .4s both; }
.hero-site .pin-badge { animation: fadeUp .9s ease-out .6s both, glowPulse 2.8s ease-in-out 1.6s infinite; }
.hero-site .hero-logo { animation: popIn .9s cubic-bezier(.2,.8,.2,1) .2s both, floaty 6s ease-in-out 1.2s infinite; }
.apply-wrap { position: relative; overflow: hidden; }
.apply-wrap > .container { position: relative; z-index: 2; }
.apply-wrap .photo-fade { opacity: .3; }
.campus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.campus-item { position: relative; overflow: hidden; border-radius: 14px; aspect-ratio: 4 / 3; box-shadow: 0 8px 22px rgba(46, 26, 71, .16); opacity: 0; animation: fadeUp .8s ease-out forwards; }
.campus-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.campus-item:hover img { transform: scale(1.08); }
.campus-item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; color: #fff; font-weight: 600; background: linear-gradient(transparent, rgba(30, 14, 52, .85)); }
@media (prefers-reduced-motion: reduce) {
    .hero-site h1, .hero-site .motto, .hero-site .lead, .hero-site .btn-lg, .hero-site .pin-badge, .hero-site .hero-logo, .campus-item { animation: none; opacity: 1; }
}

/* ===== 3D application pages ===== */
.apply-wrap { background: radial-gradient(1100px 560px at 8% -10%, #efe7ff 0%, transparent 60%), radial-gradient(900px 480px at 100% 8%, #fff1cf 0%, transparent 55%), var(--soft); }
.apply-wrap::before, .apply-wrap::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; z-index: 1; opacity: .55; animation: float3d 9s ease-in-out infinite; }
.apply-wrap::before { width: 220px; height: 220px; left: -70px; top: 90px; background: radial-gradient(circle at 30% 28%, #c3a9f5, #6f42c1 70%); box-shadow: inset -22px -22px 44px rgba(0, 0, 0, .28); }
.apply-wrap::after { width: 150px; height: 150px; right: -34px; bottom: 70px; animation-delay: -4s; background: radial-gradient(circle at 30% 28%, #ffe58f, #f4b400 70%); box-shadow: inset -16px -16px 32px rgba(0, 0, 0, .22); }
@keyframes float3d { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(12px, -26px, 0); } }

.apply-card { border: 0; border-radius: 22px; background: linear-gradient(160deg, #fff 0%, #f7f2ff 100%);
    box-shadow: 0 1px 0 #fff inset, 0 2px 2px rgba(46, 26, 71, .06), 0 10px 18px rgba(46, 26, 71, .10), 0 28px 60px rgba(46, 26, 71, .18);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; }
.apply-card:hover { transform: translateY(-4px); box-shadow: 0 1px 0 #fff inset, 0 4px 4px rgba(46, 26, 71, .07), 0 16px 26px rgba(46, 26, 71, .14), 0 38px 74px rgba(46, 26, 71, .22); }
.apply-card > .card-body { position: relative; }
.apply-card > .card-body::before { content: ""; pointer-events: none; position: absolute; left: 0; top: 18px; bottom: 18px; width: 6px; border-radius: 0 6px 6px 0; background: linear-gradient(180deg, #8f6be0, #4c2d85); box-shadow: 2px 0 6px rgba(76, 45, 133, .4); }
.apply-card h1, .apply-card h2 { text-shadow: 0 1px 0 #fff, 0 2px 0 #e4daf7, 0 4px 8px rgba(46, 26, 71, .16); }

.type-card { position: relative; z-index: 2; border-radius: 16px; background: #fff; border: 1px solid #e0d6f3; box-shadow: 0 4px 0 #d9ccf0, 0 10px 18px rgba(46, 26, 71, .12); transition: transform .2s, box-shadow .2s, border-color .2s; }
.type-card:hover { transform: perspective(800px) translateY(-6px) rotateX(5deg); box-shadow: 0 8px 0 #cdbdee, 0 22px 32px rgba(46, 26, 71, .2); }
.type-card:has(input:checked) { border-color: #6f42c1; background: linear-gradient(160deg, #fff, #efe6ff); transform: translateY(-3px); box-shadow: 0 4px 0 #6f42c1, 0 16px 28px rgba(111, 66, 193, .35); }

.apply-wrap .btn-primary { background: linear-gradient(180deg, #8559dc, #5b34ab); border: 0; box-shadow: 0 5px 0 #3d2275, 0 12px 20px rgba(46, 26, 71, .3); transition: transform .08s, box-shadow .08s, filter .15s; }
.apply-wrap .btn-primary:hover { filter: brightness(1.08); }
.apply-wrap .btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #3d2275, 0 3px 6px rgba(46, 26, 71, .3); }
.apply-wrap .btn-gold { background: linear-gradient(180deg, #ffd761, #f4b400); border: 0; box-shadow: 0 5px 0 #a87b00, 0 12px 20px rgba(120, 80, 0, .3); transition: transform .08s, box-shadow .08s; }
.apply-wrap .btn-gold:active { transform: translateY(4px); box-shadow: 0 1px 0 #a87b00, 0 3px 6px rgba(120, 80, 0, .3); }
.apply-wrap .btn-outline-primary, .apply-wrap .btn-outline-secondary { box-shadow: 0 3px 0 rgba(46, 26, 71, .12); transition: transform .08s, box-shadow .08s; }
.apply-wrap .btn-outline-primary:active, .apply-wrap .btn-outline-secondary:active { transform: translateY(3px); box-shadow: none; }
.apply-wrap .form-control, .apply-wrap .form-select { border-radius: 12px; box-shadow: inset 0 2px 5px rgba(46, 26, 71, .08); transition: box-shadow .15s, transform .15s; }
.apply-wrap .form-control:focus, .apply-wrap .form-select:focus { transform: translateY(-1px); box-shadow: inset 0 2px 5px rgba(46, 26, 71, .08), 0 0 0 4px rgba(111, 66, 193, .2), 0 8px 16px rgba(111, 66, 193, .2); }

.hero3d { display: flex; align-items: center; gap: 1.3rem; padding: 1.1rem 1.5rem; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #2e1a47, #6f42c1); box-shadow: 0 22px 44px rgba(46, 26, 71, .38), inset 0 1px 0 rgba(255, 255, 255, .25); }
.hero3d .stack-wrap { perspective: 520px; width: 92px; height: 92px; flex: 0 0 92px; }
.hero3d .stack { position: relative; width: 78px; height: 78px; margin: 8px; transform-style: preserve-3d; transform: rotateX(58deg) rotateZ(-35deg); }
.hero3d .sheet { position: absolute; inset: 0; border-radius: 12px; background: #fff; box-shadow: 4px 6px 12px rgba(0, 0, 0, .3); }
.hero3d .s1 { opacity: .45; }
.hero3d .s2 { transform: translateZ(14px); opacity: .75; }
.hero3d .s3 { transform: translateZ(28px); display: grid; place-items: center; font-size: 2.2rem; color: #6f42c1; animation: bob3d 3.6s ease-in-out infinite; }
@keyframes bob3d { 0%, 100% { transform: translateZ(28px); } 50% { transform: translateZ(44px); } }

.key3d { display: inline-grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; font-size: 2.1rem; color: #fff; background: radial-gradient(circle at 30% 28%, #a98af0, #5b34ab 70%); box-shadow: inset -8px -10px 18px rgba(0, 0, 0, .3), 0 14px 24px rgba(46, 26, 71, .35); animation: bobKey 4s ease-in-out infinite; }
@keyframes bobKey { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
    .apply-wrap::before, .apply-wrap::after, .hero3d .s3, .key3d { animation: none; }
    .apply-card, .apply-card:hover, .type-card, .type-card:hover { transition: none; transform: none; }
}
@media print {
    .apply-wrap::before, .apply-wrap::after, .hero3d { display: none !important; }
    .apply-card, .apply-card:hover { transform: none; background: #fff; }
    .apply-card > .card-body::before { display: none; }
}

.type-card input { pointer-events: none; }
