/* ==========================================================================
   endflock.org — intro animation (home page only)
   Styles for the overlay that intro.js builds. Nothing here touches the site
   itself; the overlay sits on top and fades away. No inline styles in markup.
   ========================================================================== */

html.intro-lock {
	overflow: hidden;
}

#intro {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	overflow: hidden;
	background: radial-gradient(ellipse at 50% 38%, var(--bg-glow, #1a0407) 0%, var(--bg, #08080a) 62%);
	color: var(--text-hi, #f2f2f4);
	opacity: 1;
	transition: opacity 1.4s ease;
}

#intro.out {
	opacity: 0;
	pointer-events: none;
}

#intro.out.fast {
	transition-duration: 0.4s;
}

/* ── map ── */

#intro .i-map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 3vh 3vw;
	opacity: 0;
	animation: i-fade-in 1.2s ease-out 0.1s forwards;
}

#intro .i-land {
	transition: opacity 0.18s linear;
}

#intro .i-fill     { fill: #0c0c10; stroke: none; }
#intro .i-borders  { fill: none; stroke: #2a2a31; stroke-width: 0.6; stroke-linejoin: round; }
#intro .i-outline  { fill: none; stroke: #4c4c57; stroke-width: 1;   stroke-linejoin: round; }

@keyframes i-fade-in {
	to { opacity: 1; }
}

/* ── dots ── */

#intro .i-dot,
#intro .i-ring {
	transform-box: fill-box;
	transform-origin: center;
	opacity: 0;
}

#intro .i-dot  { fill: var(--red-hot, #ff3b3b); }
#intro .i-ring { fill: none; stroke: var(--red-hot, #ff3b3b); stroke-width: 1.2; vector-effect: non-scaling-stroke; }

#intro .i-dot.on  { animation: i-pop  0.9s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards; }
#intro .i-ring.on { animation: i-ring 1.4s ease-out forwards; }

@keyframes i-pop {
	0%   { opacity: 0;    transform: scale(0);   fill: #fff; }
	30%  { opacity: 1;    transform: scale(2.4); fill: #fff; }
	100% { opacity: 0.95; transform: scale(1);   fill: var(--red-hot, #ff3b3b); }
}

@keyframes i-ring {
	0%   { opacity: 0.85; transform: scale(0.4); }
	100% { opacity: 0;    transform: scale(5.5); }
}

/* ── half-clear black layer + text ── */

#intro .i-dim {
	position: absolute;
	inset: 0;
	background: #000;
	opacity: 0;
	pointer-events: none;
}

#intro.hit .i-dim {
	opacity: 0.55;
	transition: opacity 0.12s linear;
}

#intro .i-text {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	margin: 0;
	padding: 0 5vw;
	text-align: center;
	font-family: var(--display, 'Archivo', 'Inter', system-ui, sans-serif);
	font-weight: 800;
	font-size: clamp(2.4rem, 9.5vw, 8rem);
	line-height: 1;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	color: var(--text-hi, #f2f2f4);
	text-shadow: 0 0 48px rgba(210, 31, 44, 0.6);
	opacity: 0;
	pointer-events: none;
}

#intro.hit .i-text {
	animation:
		i-flicker 0.55s steps(1, end) forwards,
		i-glitch  0.55s steps(1, end) forwards;
}

/* hard on/off flashes, then steady */
@keyframes i-flicker {
	0%   { opacity: 0; }
	6%   { opacity: 1; }
	14%  { opacity: 0.08; }
	24%  { opacity: 1; }
	33%  { opacity: 0.3; }
	42%  { opacity: 1; }
	100% { opacity: 1; }
}

/* brief RGB split while it flickers, then it settles */
@keyframes i-glitch {
	0%   { transform: translateX(0);    text-shadow: 3px 0 #ff3b3b, -3px 0 #3bd0ff; }
	14%  { transform: translateX(-6px); text-shadow: 6px 0 #ff3b3b, -6px 0 #3bd0ff; }
	33%  { transform: translateX(5px);  text-shadow: -4px 0 #ff3b3b, 4px 0 #3bd0ff; }
	50%  { transform: translateX(0);    text-shadow: 0 0 48px rgba(210, 31, 44, 0.6); }
	100% { transform: translateX(0);    text-shadow: 0 0 48px rgba(210, 31, 44, 0.6); }
}

/* ── controls ── */

#intro .i-skip,
#intro .i-gate {
	font-family: var(--mono, ui-monospace, 'SF Mono', Menlo, monospace);
	text-transform: uppercase;
	letter-spacing: 0.14em;
	cursor: pointer;
}

#intro .i-skip {
	position: absolute;
	right: max(16px, 2.5vw);
	bottom: max(16px, 2.5vh);
	padding: 8px 12px;
	font-size: 0.75rem;
	color: var(--muted, #8a8a94);
	background: transparent;
	border: 1px solid var(--border, #26262b);
	z-index: 2;
}

#intro .i-skip:hover,
#intro .i-skip:focus-visible {
	color: var(--text-hi, #f2f2f4);
	border-color: var(--border-hot, #46181e);
}

#intro .i-gate {
	position: absolute;
	left: 50%;
	top: 50%;
	translate: -50% -50%;
	padding: 16px 28px;
	font-size: 0.95rem;
	color: var(--text-hi, #f2f2f4);
	background: rgba(8, 8, 10, 0.75);
	border: 1px solid var(--red, #d21f2c);
	z-index: 2;
	animation: i-pulse 1.8s ease-in-out infinite;
}

#intro .i-gate[hidden] {
	display: none;
}

#intro .i-gate:hover,
#intro .i-gate:focus-visible {
	background: var(--red, #d21f2c);
}

@keyframes i-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(210, 31, 44, 0.5); }
	50%      { box-shadow: 0 0 0 10px rgba(210, 31, 44, 0); }
}

@media print {
	#intro { display: none !important; }
}
