/* Home page intro (blue "reboot" screen). Only exists with JavaScript; see partials/intro.php and js/intro.js. */
.intro { display: none }

html.js .intro {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--indigo);
    color: #fff;
    padding: 24px max(5vw, 16px)
}

html.intro-open, html.intro-open body { overflow: hidden }

/* dotted campus grid that drifts slowly */
.intro-grid {
    position: absolute;
    inset: -40px;
    background-image: radial-gradient(rgba(255, 255, 255, .18) 1.4px, transparent 1.6px);
    background-size: 26px 26px;
    animation: introDrift 18s linear infinite
}

@keyframes introDrift { to { transform: translate(26px, 26px) } }

.intro-skip {
    position: absolute;
    top: max(18px, env(safe-area-inset-top, 0px));
    right: max(18px, env(safe-area-inset-right, 0px));
    z-index: 2;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, .25);
    background: transparent;
    color: #d9d5ff;
    font: 500 13px/1 var(--mono);
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer
}

.intro-skip:hover { border-color: #fff; color: #fff }

.intro-body {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    width: min(100%, 560px);
    text-align: center
}

.intro-key { width: 64px; height: 64px; animation: introPop .5s cubic-bezier(.3, 1.6, .5, 1) both }

.intro-title {
    font: 800 clamp(44px, 9vw, 92px)/.95 var(--disp);
    letter-spacing: -.03em;
    text-transform: uppercase
}

.intro-title span { display: block; animation: introUp .6s cubic-bezier(.2, .8, .2, 1) both }
.intro-title span:first-child { animation-delay: .15s }
.intro-title .y { color: var(--yellow); animation-delay: .3s }
.intro-title .cur { display: inline; animation: introBlink 1s steps(1) infinite }

/* kicker, tagline and motto appear one after the other */
.intro-kicker {
    margin-top: 22px;
    font: 500 13px/1.3 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--yellow);
    animation: introFadeIn .5s ease-out .1s both
}

.intro-title { margin-top: 12px }

.intro-tag {
    margin-top: 18px;
    max-width: 30ch;
    text-wrap: balance;
    font: 500 clamp(18px, 2vw, 22px)/1.4 var(--text);
    color: #e4e0ff;
    animation: introFadeIn .6s ease-out .55s both
}

.intro-motto {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    list-style: none;
    margin: 22px 0 0;
    padding: 0
}

.intro-motto li {
    padding: 9px 16px;
    border-radius: 999px;
    font: 700 15px/1 var(--disp);
    letter-spacing: -.01em;
    color: var(--night);
    animation: introPop .5s cubic-bezier(.3, 1.6, .5, 1) both
}

.intro-motto .m1 { background: var(--yellow); animation-delay: .95s }
.intro-motto .m2 { background: var(--orange); animation-delay: 1.25s }
.intro-motto .m3 { background: var(--mint); animation-delay: 1.55s }

.intro-load {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: center;
    margin-top: 26px;
    width: min(100%, 420px);
    font: 700 13px/1 var(--mono);
    color: var(--yellow);
    font-variant-numeric: tabular-nums
}

.intro-bar { flex: 1; height: 10px; border-radius: 5px; background: rgba(21, 17, 46, .35); overflow: hidden }
.intro-bar i {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--yellow), var(--orange), var(--lilac), var(--mint))
}

/* the power button: locked while loading, then pulses */
.intro-power {
    position: relative;
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    margin-top: 34px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .25);
    background: var(--night);
    color: rgba(255, 255, 255, .35);
    cursor: pointer;
    transition: transform .2s, color .3s, border-color .3s, background-color .3s, box-shadow .3s
}

.intro-power:not(.ready):hover { color: rgba(255, 255, 255, .7) }

.intro-power.ready {
    color: var(--yellow);
    border-color: var(--yellow);
    box-shadow: 0 0 0 10px rgba(255, 196, 46, .16), 0 18px 48px rgba(21, 17, 46, .45)
}

.intro-power.ready:hover { transform: scale(1.06) }
.intro-power.ready:active { transform: scale(.92) }
.intro-power:focus-visible { outline: 3px solid #fff; outline-offset: 6px }

.intro-power .ring { position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--yellow); opacity: 0 }
.intro-power.ready .ring { animation: introRing 1.8s ease-out infinite }

.intro-power .sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap
}

.intro-hint {
    margin-top: 18px;
    min-height: 1.5em;
    font: 500 14px/1.5 var(--mono);
    letter-spacing: .04em;
    color: #e4e0ff
}

/* the four line colours, used for the exit sweep */
.intro-lines {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    pointer-events: none
}

.intro-lines i { transform: translateX(-101%) }
.intro-lines i:nth-child(1) { background: var(--yellow) }
.intro-lines i:nth-child(2) { background: var(--orange) }
.intro-lines i:nth-child(3) { background: var(--lilac) }
.intro-lines i:nth-child(4) { background: var(--mint) }

/* exit: the button fires, the lines sweep across, then everything slides away */
.intro.go .intro-power { transform: scale(.85); background: var(--yellow); color: var(--night) }
.intro.go .intro-body { animation: introOut .45s ease-in .1s forwards }
.intro.go .intro-lines i { animation: introSweep .9s cubic-bezier(.7, 0, .2, 1) forwards }
.intro.go .intro-lines i:nth-child(2) { animation-delay: .07s }
.intro.go .intro-lines i:nth-child(3) { animation-delay: .14s }
.intro.go .intro-lines i:nth-child(4) { animation-delay: .21s }
.intro.go { animation: introFade .35s ease-in .55s forwards }

@keyframes introPop { from { transform: scale(.4); opacity: 0 } }
@keyframes introUp { from { transform: translateY(40%); opacity: 0 } }
@keyframes introFadeIn { from { opacity: 0; transform: translateY(8px) } }
@keyframes introBlink { 50% { opacity: 0 } }
@keyframes introRing { from { transform: scale(1); opacity: .7 } to { transform: scale(1.6); opacity: 0 } }
@keyframes introOut { to { transform: scale(.92); opacity: 0 } }
@keyframes introSweep { 0% { transform: translateX(-101%) } 50% { transform: translateX(0) } 100% { transform: translateX(101%) } }
@keyframes introFade { to { opacity: 0; visibility: hidden } }

@media (max-width: 640px) {
    .intro-key { width: 52px; height: 52px }
    .intro-motto li { padding: 8px 13px; font-size: 13px }
    .intro-kicker { font-size: 11px }
    .intro-power { width: 96px; height: 96px; margin-top: 28px }
}

@media (max-height: 620px) {
    .intro-tag, .intro-kicker { display: none }
    .intro-motto { margin-top: 14px }
    .intro-power { margin-top: 20px }
}

@media (prefers-reduced-motion: reduce) {
    .intro-grid, .intro-title span, .intro-key, .intro-kicker, .intro-tag, .intro-motto li, .intro-power.ready .ring, .intro-title .cur { animation: none }
    .intro.go .intro-lines i, .intro.go .intro-body { animation: none }
    .intro.go { animation: introFade .25s ease-in forwards }
}

html.js .intro:focus { outline: none }
