/* The welcome intro (partials/intro.blade.php, extra/intro.js; Settings › Site status › Welcome intro).
   Hidden unless intro.js put html.snu-intro-on in the <head>. While it is on, the page behind stays hidden
   (visibility, so nothing flashes and nothing can be tabbed to) and only the intro shows; .is-leaving lifts it away.
   If the script stops for any reason, the page shows itself after 7 seconds (snu-intro-failsafe). */

html.snu-intro-on { overflow: hidden; background: #22a6dc; }
html.snu-intro-on body { visibility: hidden; animation: snu-intro-failsafe 0s linear 7s forwards; }
html.snu-intro-on .snu-intro { animation: snu-intro-failsafe-out .4s ease 7s forwards; }
@keyframes snu-intro-failsafe { to { visibility: visible; } }
@keyframes snu-intro-failsafe-out { to { opacity: 0; visibility: hidden; } }

.snu-intro {
  position: fixed; inset: 0; z-index: 2147483000;
  display: none; place-items: center; overflow: hidden;
  visibility: visible;
  color: #fff; font-family: "Poppins", system-ui, sans-serif; text-align: center;
  background:
    radial-gradient(60vmax 60vmax at 50% 42%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 60%),
    linear-gradient(165deg, #64c4ef 0%, #22a6dc 50%, #0b8cc4 100%);
  transition: transform .9s cubic-bezier(.76, 0, .24, 1), border-radius .9s cubic-bezier(.76, 0, .24, 1);
  will-change: transform;
}
html.snu-intro-on .snu-intro,
.snu-intro.is-leaving { display: grid; }

/* soft light and two rings that widen behind the emblem */
.snu-intro__glow { position: absolute; left: 50%; top: 42%; width: 70vmin; height: 70vmin; margin: -35vmin 0 0 -35vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 65%); opacity: 0; animation: snu-intro-fade 1.4s ease .1s forwards; }
.snu-intro__ring { position: absolute; left: 50%; top: 42%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .45); opacity: 0; transform: scale(.6); }
.snu-intro__ring--1 { animation: snu-intro-ring 2.6s cubic-bezier(.2, .7, .2, 1) .5s forwards; }
.snu-intro__ring--2 { animation: snu-intro-ring 2.6s cubic-bezier(.2, .7, .2, 1) .85s forwards; }

.snu-intro__stage { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 16px; transition: opacity .5s ease, transform .9s cubic-bezier(.76, 0, .24, 1); }

/* the emblem: a ring draws itself, the white disc opens inside it and the emblem settles in */
.snu-intro__emblem { position: relative; width: clamp(150px, 34vmin, 210px); aspect-ratio: 1; }
.snu-intro__frame { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.snu-intro__frame circle { fill: none; stroke-width: 3; }
.snu-intro__frame-track { stroke: rgba(255, 255, 255, .25); }
.snu-intro__frame-line { stroke: #fff; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: snu-intro-draw 1.1s cubic-bezier(.65, 0, .35, 1) .2s forwards; }
.snu-intro__disc { position: absolute; inset: 9%; display: grid; place-items: center; border-radius: 50%; background: #fff;
  box-shadow: 0 18px 50px rgba(0, 40, 70, .28), inset 0 0 0 4px rgba(0, 146, 197, .12);
  transform: scale(.2); opacity: 0; animation: snu-intro-pop .9s cubic-bezier(.34, 1.56, .64, 1) .7s forwards; }
.snu-intro__disc img { width: auto; height: 74%; max-width: 70%; object-fit: contain; transform: translateY(8px) scale(.85); opacity: 0;
  animation: snu-intro-settle .8s cubic-bezier(.2, .8, .2, 1) 1s forwards; }

/* the words: "Welcome to" rises, the name is revealed left to right, a gold rule draws beneath */
.snu-intro__text { margin: clamp(22px, 4vh, 34px) 0 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.snu-intro__kicker { font-size: clamp(.85rem, 2.2vw, 1.05rem); font-weight: 500; letter-spacing: .32em; text-transform: uppercase;
  opacity: 0; transform: translateY(14px); animation: snu-intro-rise .7s cubic-bezier(.2, .8, .2, 1) 1.45s forwards; }
.snu-intro__name { font-size: clamp(1.6rem, 5.2vw, 3rem); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; max-width: 18em;
  text-shadow: 0 2px 18px rgba(0, 50, 80, .25); clip-path: inset(0 100% 0 0); animation: snu-intro-reveal 1s cubic-bezier(.65, 0, .35, 1) 1.75s forwards; }
/* the founding year centred on the gold line: the two halves draw outwards from the year, which fades in between them */
.snu-intro__est { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 0; }
.snu-intro__est-line { display: block; flex: none; width: clamp(40px, 9vw, 64px); height: 2px; border-radius: 2px; background: #dbbd81; transform: scaleX(0);
  animation: snu-intro-grow .7s cubic-bezier(.65, 0, .35, 1) 2.45s forwards; }
.snu-intro__est-line:first-child { transform-origin: right center; }
.snu-intro__est-line:last-child { transform-origin: left center; }
.snu-intro__est.is-plain .snu-intro__est-line { width: 72px; height: 3px; border-radius: 3px; transform-origin: center; }   /* Founding line left empty: one plain line */
.snu-intro__est-year { font-size: clamp(.88rem, 2.3vw, 1.02rem); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; max-width: 22em; overflow-wrap: anywhere;
  opacity: 0; transform: translateY(6px); animation: snu-intro-rise .6s cubic-bezier(.2, .8, .2, 1) 2.35s forwards; }

/* leaving: the words drift up and the blue screen lifts away like a curtain, showing the home page */
.snu-intro.is-leaving { pointer-events: none; transform: translateY(-100%); border-radius: 0 0 50% 50% / 0 0 14vh 14vh; animation: none; }
.snu-intro.is-leaving .snu-intro__stage { opacity: 0; transform: translateY(-40px); }

@keyframes snu-intro-fade { to { opacity: 1; } }
@keyframes snu-intro-ring { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(3.2); } }
@keyframes snu-intro-draw { to { stroke-dashoffset: 0; } }
@keyframes snu-intro-pop { to { transform: scale(1); opacity: 1; } }
@keyframes snu-intro-settle { to { transform: none; opacity: 1; } }
@keyframes snu-intro-rise { to { opacity: 1; transform: none; } }
@keyframes snu-intro-reveal { to { clip-path: inset(0 0 0 0); } }
@keyframes snu-intro-grow { to { transform: scaleX(1); } }

/* reduced motion: everything simply fades in together, and the screen fades out instead of lifting */
@media (prefers-reduced-motion: reduce) {
  .snu-intro, .snu-intro__stage { transition: opacity .5s ease; }
  .snu-intro__ring { display: none; }
  .snu-intro__frame-line { stroke-dashoffset: 0; animation: none; }
  .snu-intro__disc, .snu-intro__disc img, .snu-intro__kicker, .snu-intro__name, .snu-intro__est-line, .snu-intro__est-year, .snu-intro__glow {
    transform: none; clip-path: none; opacity: 0; animation: snu-intro-fade .6s ease .1s forwards; }
  .snu-intro.is-leaving { transform: none; border-radius: 0; opacity: 0; }
  .snu-intro.is-leaving .snu-intro__stage { transform: none; }
}
