/* starksi.dev entrance: a comic-panel name prompt, then a portal glitch into the site (intro.js drives it).
   Original art only: halftone, rays, misregistered plates. Uses the comic fonts from /assets/comic.css. */

html.intro-on { overflow: hidden; }
/* Covers the page from the first paint, before intro.js has built the overlay. */
html.intro-on::before { content: ""; position: fixed; inset: 0; z-index: 9998; background: #6fa5b3; }
html.intro-on.intro-mounted::before { display: none; }

.intro { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 20px; overflow: hidden;
  background: #6fa5b3; color: #23282d; font-family: "Oswald", "Arial Narrow", sans-serif; }
.intro--open { background: none; }                    /* the canvas takes over painting once the portal opens */
.intro__bg { position: absolute; inset: -30%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 50%, #6fa5b3 0 9deg, #5f97a6 9deg 18deg);
  animation: intro-spin 14s steps(168) infinite; }
.intro__dots { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(rgba(20, 18, 16, .22) 1.6px, transparent 2.2px) 0 0 / 11px 11px;
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 28%, #000 80%); mask-image: radial-gradient(ellipse at center, transparent 28%, #000 80%); }
.intro__frame { position: absolute; inset: 10px; border: 5px solid #23282d; pointer-events: none; }
.intro--open .intro__bg, .intro--open .intro__dots, .intro--open .intro__frame { display: none; }
.intro__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* The panel */
.intro__box { position: relative; width: min(520px, 100%); padding: 34px 30px 26px; background: #fbfaf6;
  border: 5px solid #23282d; box-shadow: 10px 10px 0 #23282d; transform: rotate(-1.5deg);
  animation: intro-pop .5s steps(6) both; }
.intro__box::after {                                   /* speech-bubble tail */
  content: ""; position: absolute; left: 56px; bottom: -34px; width: 44px; height: 34px; background: #23282d;
  clip-path: polygon(0 0, 100% 0, 18% 100%); }
.intro__burst { position: absolute; top: -46px; right: -30px; width: 124px; height: 124px; display: grid; place-items: center;
  background: #f2bd4f; color: #23282d; font: 30px/1 "Bangers", Impact, sans-serif; letter-spacing: .04em; transform: rotate(12deg);
  clip-path: polygon(50% 0, 61% 17%, 79% 6%, 79% 26%, 98% 26%, 87% 43%, 100% 57%, 82% 64%, 88% 84%, 68% 79%, 60% 100%, 47% 83%, 30% 96%, 28% 76%, 8% 78%, 16% 59%, 0 47%, 17% 37%, 9% 18%, 30% 22%, 36% 3%);
  filter: drop-shadow(4px 4px 0 #23282d); }
.intro__h { margin: 0 0 6px; font: 400 clamp(40px, 9vw, 60px)/.95 "Bangers", Impact, "Arial Black", sans-serif; letter-spacing: .03em;
  text-shadow: -3px -2px 0 #8fc3cf, 3px 2px 0 #f2bd4f; }
.intro__p { margin: 0 0 18px; font: 15px/1.4 "Special Elite", "Courier New", monospace; color: #454b52; }
.intro__row { display: flex; gap: 10px; }
.intro__in { flex: 1; min-width: 0; padding: 12px 14px; background: #fff; color: #23282d; border: 4px solid #23282d; border-radius: 0;
  font: 500 20px/1.2 "Oswald", "Arial Narrow", sans-serif; letter-spacing: .02em; box-shadow: inset 4px 4px 0 rgba(20, 18, 16, .12); }
.intro__in::placeholder { color: #8a8f95; }
.intro__in:focus { outline: 4px solid #8fc3cf; outline-offset: 2px; }
.intro__go { padding: 10px 20px 8px; background: #2b6777; color: #fff; border: 4px solid #23282d; border-radius: 0; cursor: pointer;
  font: 26px/1 "Bangers", Impact, sans-serif; letter-spacing: .06em; box-shadow: 5px 5px 0 #23282d; transition: transform .08s, box-shadow .08s; }
.intro__go:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 #23282d; }
.intro__go:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 #23282d; }
.intro__go:focus-visible, .intro__skip:focus-visible { outline: 4px solid #8fc3cf; outline-offset: 2px; }
.intro__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px;
  font: 13px/1.3 "Special Elite", "Courier New", monospace; color: #6a7077; }
.intro__skip { padding: 2px 0; background: none; border: 0; border-bottom: 2px solid currentColor; color: #454b52; cursor: pointer; font: inherit; }
.intro__box.is-shake { animation: intro-shake .36s steps(6); }

/* Glitch on the panel just before the portal opens: misregistered plates, moving on twos. */
.intro__box.is-glitch { animation: intro-glitch .5s steps(1) both; }
@keyframes intro-glitch {
  0%   { transform: rotate(-1.5deg); filter: none; clip-path: none; }
  12%  { transform: translate(-14px, 4px) skewX(-8deg); filter: drop-shadow(-10px 0 #8fc3cf) drop-shadow(10px 0 #f2bd4f); }
  24%  { transform: translate(18px, -6px) rotate(2deg); clip-path: polygon(0 0, 100% 0, 100% 34%, 0 34%, 0 46%, 100% 46%, 100% 100%, 0 100%); filter: drop-shadow(14px 0 #8fc3cf) drop-shadow(-14px 0 #6fa5b3); }
  36%  { transform: translate(-6px, 10px) scale(1.06, .94); filter: invert(1) drop-shadow(-8px 0 #f2bd4f); clip-path: none; }
  48%  { transform: translate(26px, 0) skewX(14deg); clip-path: polygon(0 12%, 100% 12%, 100% 58%, 0 58%, 0 66%, 100% 66%, 100% 92%, 0 92%); filter: drop-shadow(-18px 0 #8fc3cf) drop-shadow(18px 0 #f2bd4f); }
  60%  { transform: translate(-22px, -8px) scale(.92, 1.1) rotate(-4deg); filter: hue-rotate(160deg) drop-shadow(12px 0 #6fa5b3); clip-path: none; }
  72%  { transform: translate(8px, 6px) scale(1.14); clip-path: polygon(0 0, 100% 0, 100% 22%, 0 22%, 0 40%, 100% 40%, 100% 70%, 0 70%, 0 80%, 100% 80%, 100% 100%, 0 100%); filter: invert(1) drop-shadow(-22px 0 #8fc3cf) drop-shadow(22px 0 #f2bd4f); }
  86%  { transform: translate(-30px, 2px) scale(1.3, .7) skewX(-20deg); filter: drop-shadow(26px 0 #f2bd4f) drop-shadow(-26px 0 #8fc3cf); }
  100% { transform: scale(1.6, .08); opacity: 0; }
}
@keyframes intro-pop { 0% { transform: scale(.3) rotate(-10deg); opacity: 0; } 60% { transform: scale(1.08) rotate(1deg); opacity: 1; } 100% { transform: rotate(-1.5deg); } }
@keyframes intro-shake { 0%, 100% { transform: rotate(-1.5deg); } 20% { transform: translateX(-12px) rotate(-3deg); } 40% { transform: translateX(11px) rotate(0deg); } 60% { transform: translateX(-8px) rotate(-2.5deg); } 80% { transform: translateX(6px) rotate(-1deg); } }
@keyframes intro-spin { to { transform: rotate(360deg); } }

/* The page settling after the portal passes over it. */
html.intro-land body > *:not(.intro):not(.intro-hi) { animation: intro-land .42s steps(1) both; }
@keyframes intro-land {
  0%   { transform: translate(-16px, 5px) skewX(-3deg); }
  20%  { transform: translate(12px, -4px) skewX(2deg); }
  40%  { transform: translate(-7px, 2px); }
  60%  { transform: translate(5px, 0) skewX(-1deg); }
  80%  { transform: translate(-2px, 0); }
  100% { transform: none; }
}

/* Greeting shown once the visitor is in. */
.intro-hi { position: fixed; left: 18px; bottom: 18px; z-index: 9000; max-width: min(360px, calc(100vw - 36px)); padding: 10px 14px 8px;
  background: #6fa5b3; color: #23282d; border: 4px solid #23282d; box-shadow: 6px 6px 0 #23282d; transform: rotate(-1.5deg);
  font: 15px/1.35 "Special Elite", "Courier New", monospace; overflow-wrap: anywhere; animation: intro-pop .4s steps(5) both; }
.intro-hi b { font: 22px/1 "Bangers", Impact, sans-serif; letter-spacing: .04em; }
.intro-hi.is-out { transition: opacity .3s, transform .3s; opacity: 0; transform: translateY(12px) rotate(-1.5deg); }

@media (max-width: 480px) {
  .intro__row { flex-direction: column; }
  .intro__burst { width: 92px; height: 92px; font-size: 22px; top: -40px; right: -12px; }
  .intro__box { padding: 30px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro__bg, .intro__box, .intro-hi { animation: none; }
  .intro { transition: opacity .25s; }
  .intro.is-fade { opacity: 0; }
}
