@font-face {
	font-family: "Riffic";
	src: url("./assets/fonts/RifficFree-Bold.ttf") format("truetype");
	font-display: swap;
}

@font-face {
	font-family: "Aller";
	src: url("./assets/fonts/Aller_Rg.ttf") format("truetype");
	font-display: swap;
}

:root {
	--pink: #ffafbd;
	--peach: #ffc3a0;
	--cream: #fff7fb;
	--ink: #35252d;
	--muted: rgba(84, 55, 66, 0.68);
	--paper: rgba(255, 255, 255, 0.52);
	--paper-strong: rgba(255, 255, 255, 0.7);
	--line: rgba(255, 255, 255, 0.62);
	--terminal: #070a0e;
	--terminal-2: #151a21;
	--cyan: #75e7ff;
	--green: #9dffbd;
	--danger: #ff4f86;
	--collapse-ms: 4100ms;
	--glitch-ms: 2300ms;
	--restore-ms: 4300ms;
	--tile-ms: 1500ms;
}

* {
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	min-height: 100%;
	margin: 0;
}

body {
	min-height: 100vh;
	overflow-x: hidden;
	font-family:
		Aller,
		"Microsoft YaHei",
		"PingFang SC",
		system-ui,
		sans-serif;
	color: var(--ink);
	background: var(--terminal);
	cursor: default;
}

button,
a {
	-webkit-tap-highlight-color: transparent;
}

a {
	color: inherit;
	text-decoration: none;
}

button {
	font: inherit;
}

.reality-shell {
	position: relative;
	min-height: 100vh;
	isolation: isolate;
}

.truth-layer,
.dream-layer {
	position: fixed;
	inset: 0;
	min-height: 100vh;
}

.truth-layer {
	z-index: 1;
	display: grid;
	align-items: center;
	padding: clamp(1rem, 3vw, 3rem);
	color: #c6f7ff;
	background:
		radial-gradient(circle at 78% 16%, rgba(79, 216, 255, 0.12), transparent 24rem),
		radial-gradient(circle at 24% 86%, rgba(157, 255, 189, 0.08), transparent 20rem),
		linear-gradient(135deg, var(--terminal), var(--terminal-2) 54%, #05070a);
	font-family:
		"JetBrains Mono",
		"Cascadia Mono",
		Consolas,
		monospace;
}

.dream-layer {
	z-index: 4;
	overflow: hidden;
	background: linear-gradient(135deg, var(--pink), var(--peach));
	clip-path: inset(0 0 0 0);
	transition: clip-path 120ms steps(5, end), filter 120ms steps(4, end);
}

body.is-reality .dream-layer {
	clip-path: inset(100% 0 0 0);
	pointer-events: none;
}

.dream-bg {
	position: absolute;
	inset: -10%;
	background:
		radial-gradient(circle, rgba(255, 255, 255, 0.5) 0 0.23rem, transparent 0.27rem) 0 0 / 2.05rem 2.05rem,
		radial-gradient(circle, rgba(255, 255, 255, 0.28) 0 0.16rem, transparent 0.2rem) 1.02rem 1.02rem / 2.05rem 2.05rem,
		linear-gradient(120deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.06));
	transform: translate3d(var(--mx, 0), var(--my, 0), 0);
	animation: dreamDrift 16s steps(96, end) infinite;
	will-change: transform;
}

.dream-bg::before,
.dream-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.dream-bg::before {
	background:
		radial-gradient(circle at calc(22% + var(--mx, 0)) calc(32% + var(--my, 0)), rgba(255, 247, 255, 0.72), transparent 18rem),
		radial-gradient(circle at calc(80% - var(--mx, 0)) calc(68% - var(--my, 0)), rgba(255, 111, 129, 0.18), transparent 22rem),
		radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.12), transparent 36rem);
	mix-blend-mode: screen;
	animation: shaderPulse 11s steps(88, end) infinite;
}

.dream-bg::after {
	background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 5px);
	opacity: 0.42;
}

.soft-wash {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.34), transparent 42%),
		linear-gradient(0deg, rgba(255, 255, 255, 0.2), transparent 62%);
	pointer-events: none;
}

.cursor-light {
	position: fixed;
	z-index: 9;
	left: var(--cursor-x, 50vw);
	top: var(--cursor-y, 50vh);
	width: 18rem;
	height: 18rem;
	pointer-events: none;
	border-radius: 999px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.42), transparent 66%);
	mix-blend-mode: screen;
	translate: -50% -50%;
	opacity: 0.58;
	transition: opacity 120ms steps(3, end), background 120ms steps(3, end);
}

body.is-reality .cursor-light {
	opacity: 0.16;
	background: radial-gradient(circle, rgba(117, 231, 255, 0.28), transparent 62%);
}

.dream-topbar,
.truth-topbar {
	position: absolute;
	z-index: 10;
	top: clamp(0.85rem, 2vw, 1.5rem);
	left: clamp(0.9rem, 2vw, 1.6rem);
	right: clamp(0.9rem, 2vw, 1.6rem);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.creator-mark {
	display: grid;
	gap: 0.08rem;
	padding: 0.5rem 0.78rem;
	border: 1px solid rgba(255, 255, 255, 0.7);
	background: rgba(255, 255, 255, 0.23);
	backdrop-filter: blur(14px);
	box-shadow: 0 0.5rem 2rem rgba(192, 71, 100, 0.12);
}

.creator-mark span {
	font-weight: 800;
	letter-spacing: 0;
}

.creator-mark small,
.truth-label {
	font-size: 0.68rem;
	text-transform: uppercase;
	color: rgba(69, 43, 56, 0.62);
}

.icon-button,
.music-button,
.mystery-button,
.restore-line {
	border: 0;
	color: inherit;
	cursor: pointer;
}

.icon-button {
	display: grid;
	place-items: center;
	width: 2.75rem;
	aspect-ratio: 1;
	border: 1px solid rgba(255, 255, 255, 0.76);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.38);
	backdrop-filter: blur(12px);
	box-shadow: 0 0.8rem 2rem rgba(192, 71, 100, 0.16);
	transition: transform 90ms steps(3, end), filter 90ms steps(3, end), background 90ms steps(3, end);
}

.music-button {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-width: 5.1rem;
	height: 2.75rem;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.78);
	background: rgba(255, 255, 255, 0.42);
	backdrop-filter: blur(14px);
	box-shadow:
		0 0.75rem 2rem rgba(192, 71, 100, 0.16),
		inset 0 1px 0 rgba(255, 255, 255, 0.72);
	clip-path: polygon(0 0, calc(100% - 0.6rem) 0, 100% 0.6rem, 100% 100%, 0.6rem 100%, 0 calc(100% - 0.6rem));
	transition: transform 90ms steps(3, end), filter 90ms steps(3, end), background 90ms steps(3, end);
}

.music-button span {
	display: grid;
	place-items: center;
	width: 1.4rem;
	aspect-ratio: 1;
	border-radius: 999px;
	background: rgba(255, 95, 142, 0.16);
	color: #d83e72;
}

.music-button strong {
	font-family:
		"JetBrains Mono",
		"Cascadia Mono",
		Consolas,
		monospace;
	font-size: 0.78rem;
	letter-spacing: 0;
	color: rgba(59, 38, 48, 0.78);
}

.icon-button:hover,
.music-button:hover,
.surface-links a:hover,
.dream-card:hover,
.truth-links a:hover {
	transform: translateY(-2px);
	filter: saturate(1.14);
}

.icon-button.is-playing {
	background: rgba(255, 255, 255, 0.72);
	color: #d83e72;
}

.music-button.is-playing {
	background: rgba(255, 255, 255, 0.78);
}

.music-button.is-playing span {
	background: #ff5f8e;
	color: #fff;
	animation: crtBlink 900ms steps(2, end) infinite;
}

.mystery-button {
	position: fixed;
	z-index: 14;
	left: clamp(0.8rem, 2vw, 1.4rem);
	bottom: clamp(0.8rem, 2vw, 1.4rem);
	display: grid;
	place-items: center;
	width: 3.05rem;
	aspect-ratio: 1;
	border: 1px solid rgba(82, 37, 62, 0.26);
	border-radius: 0;
	background:
		radial-gradient(circle at 50% 50%, rgba(41, 17, 31, 0.9) 0 0.2rem, transparent 0.24rem),
		linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 176, 198, 0.2));
	box-shadow:
		inset 0 0 0 0.38rem rgba(255, 255, 255, 0.2),
		0 0.65rem 2rem rgba(107, 27, 70, 0.16);
	clip-path: polygon(12% 0, 100% 0, 100% 86%, 86% 100%, 0 100%, 0 12%);
	transition: transform 90ms steps(3, end), box-shadow 90ms steps(2, end), filter 90ms steps(2, end);
}

.mystery-button::before {
	content: "??";
	font-family:
		"JetBrains Mono",
		"Cascadia Mono",
		Consolas,
		monospace;
	font-size: 0.72rem;
	font-weight: 800;
	color: rgba(56, 30, 44, 0.48);
	transform: translateY(1.15rem);
}

.mystery-button::after {
	content: "";
	position: absolute;
	inset: -0.5rem;
	border: 1px solid rgba(255, 255, 255, 0.42);
	opacity: 0;
}

.mystery-button:hover {
	transform: translate(2px, -2px);
	filter: contrast(1.3) saturate(0.8);
}

.mystery-button:hover::after {
	opacity: 1;
	animation: crtBlink 420ms steps(2, end) infinite;
}

.dream-composition {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: minmax(32rem, 0.86fr) minmax(18rem, 0.62fr);
	align-items: center;
	gap: clamp(1rem, 3vw, 3.2rem);
	width: min(92rem, calc(100% - 3.2rem));
	min-height: 100vh;
	margin: 0 auto;
	padding: 6.6rem 0 2rem;
}

.dream-board {
	position: relative;
	z-index: 3;
	display: grid;
	gap: 1.1rem;
	max-width: 64rem;
}

.dream-heading {
	display: grid;
	gap: 0.4rem;
	padding-left: 0.25rem;
}

h1 {
	margin: 0;
	font-family:
		Riffic,
		"Courier New",
		monospace;
	font-size: clamp(1.35rem, 3vw, 2.25rem);
	line-height: 1.12;
	letter-spacing: 0;
	color: #3b2630;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.52);
}

.dream-heading p {
	margin: 0;
	font-size: clamp(0.88rem, 1.5vw, 1.08rem);
	color: rgba(130, 78, 91, 0.62);
}

.project-stack {
	display: grid;
	gap: clamp(0.9rem, 2vh, 1.35rem);
}

.dream-card {
	position: relative;
	padding: clamp(1rem, 2.2vw, 1.55rem) clamp(1rem, 2.6vw, 1.9rem);
	border: 1px solid var(--line);
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.24)),
		rgba(255, 255, 255, 0.3);
	backdrop-filter: blur(16px);
	box-shadow:
		0 1.2rem 3rem rgba(189, 67, 103, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.72);
	transition: transform 110ms steps(4, end), filter 110ms steps(3, end), background 110ms steps(3, end);
}

.dream-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 4px),
		linear-gradient(90deg, rgba(255, 105, 140, 0.08), transparent 42%);
	pointer-events: none;
}

.card-index {
	position: relative;
	margin: 0 0 0.65rem;
	font-family:
		"JetBrains Mono",
		"Cascadia Mono",
		Consolas,
		monospace;
	font-size: 0.78rem;
	font-weight: 800;
	color: #ff5f8e;
	text-transform: uppercase;
}

.dream-card h2 {
	position: relative;
	margin: 0 0 0.7rem;
	font-family:
		Riffic,
		"Courier New",
		monospace;
	font-size: clamp(1.25rem, 2vw, 1.8rem);
	line-height: 1.1;
	letter-spacing: 0;
}

.dream-card p:not(.card-index) {
	position: relative;
	max-width: 56rem;
	margin: 0;
	color: var(--muted);
	line-height: 1.8;
}

.surface-links {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.8rem;
}

.surface-links a {
	position: relative;
	display: grid;
	gap: 0.18rem;
	min-height: 4rem;
	padding: 0.82rem 0.95rem;
	border: 1px solid rgba(255, 255, 255, 0.58);
	background: rgba(255, 255, 255, 0.3);
	backdrop-filter: blur(12px);
	box-shadow: 0 0.8rem 2rem rgba(180, 62, 101, 0.1);
	transition: transform 90ms steps(3, end), filter 90ms steps(3, end), background 90ms steps(3, end);
}

.surface-links a::after {
	content: "";
	position: absolute;
	right: 0.7rem;
	top: 0.7rem;
	width: 0.4rem;
	aspect-ratio: 1;
	background: rgba(255, 95, 142, 0.72);
}

.surface-links span {
	font-family:
		Riffic,
		Aller,
		sans-serif;
	font-size: 1rem;
}

.surface-links small {
	color: rgba(69, 43, 56, 0.56);
}

.sayori-stage {
	position: relative;
	z-index: 2;
	align-self: end;
	min-height: min(80vh, 44rem);
	pointer-events: none;
}

.stage-shadow {
	position: absolute;
	right: 5%;
	bottom: 3%;
	width: 76%;
	height: 13%;
	border-radius: 50%;
	background: radial-gradient(ellipse, rgba(134, 41, 70, 0.22), transparent 72%);
	filter: blur(0.28rem);
}

.sayori-art {
	position: absolute;
	right: clamp(1.3rem, 3vw, 3.6rem);
	bottom: -1.5rem;
	width: min(28vw, 27rem);
	max-height: 86vh;
	object-fit: contain;
	object-position: bottom right;
	filter: drop-shadow(0 1rem 2rem rgba(133, 53, 82, 0.2));
	animation: sayoriFloat 6.2s steps(86, end) infinite;
}

.sayori-art.ghost {
	opacity: 0;
	mix-blend-mode: screen;
	filter: hue-rotate(165deg) contrast(1.5);
	transform: translate(0.55rem, -0.3rem);
}

body.is-collapsing .sayori-art.ghost {
	opacity: 0.38;
	animation: ghostTear 130ms steps(2, end) infinite;
}

.fan-notice {
	position: absolute;
	right: 3%;
	bottom: 1rem;
	width: min(19rem, 70%);
	margin: 0;
	padding: 0.48rem 0.65rem;
	border: 1px solid rgba(255, 255, 255, 0.58);
	background: rgba(255, 255, 255, 0.3);
	font-size: 0.72rem;
	text-align: right;
	color: rgba(60, 39, 50, 0.62);
	backdrop-filter: blur(8px);
}

.menu-particles img {
	position: absolute;
	z-index: 1;
	width: clamp(2.8rem, 5vw, 4.2rem);
	opacity: 0.48;
	animation: particleFloat 8s steps(70, end) infinite;
}

.menu-particles img:nth-child(1) {
	left: 9%;
	top: 18%;
}

.menu-particles img:nth-child(2) {
	left: 48%;
	top: 10%;
	animation-delay: -1.8s;
}

.menu-particles img:nth-child(3) {
	right: 21%;
	bottom: 18%;
	animation-delay: -3.2s;
}

.menu-particles img:nth-child(4) {
	left: 35%;
	bottom: 8%;
	animation-delay: -4.6s;
}

.terminal-grid {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(rgba(117, 231, 255, 0.055) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
		linear-gradient(90deg, rgba(117, 231, 255, 0.045) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem;
	mask-image: radial-gradient(circle at 50% 50%, black, transparent 78%);
}

.terminal-noise {
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
	opacity: 0.5;
	pointer-events: none;
}

.truth-topbar {
	color: rgba(198, 247, 255, 0.9);
}

.truth-topbar > div {
	display: grid;
	gap: 0.1rem;
}

.truth-topbar strong {
	font-size: 0.9rem;
	letter-spacing: 0;
	text-transform: uppercase;
}

.truth-topbar .truth-label {
	color: rgba(117, 231, 255, 0.58);
}

.truth-topbar .icon-button {
	border-color: rgba(117, 231, 255, 0.34);
	background: rgba(16, 26, 33, 0.74);
	color: var(--cyan);
	box-shadow: 0 0 1.4rem rgba(117, 231, 255, 0.08);
}

.truth-topbar .icon-button.is-playing {
	background: rgba(117, 231, 255, 0.18);
	color: #dbfbff;
}

.terminal-window {
	position: relative;
	z-index: 2;
	width: min(74rem, 100%);
	margin: 0 auto;
	border: 1px solid rgba(117, 231, 255, 0.24);
	background: rgba(6, 10, 14, 0.86);
	box-shadow:
		0 0 0 1px rgba(157, 255, 189, 0.08) inset,
		0 2rem 5rem rgba(0, 0, 0, 0.38);
	backdrop-filter: blur(12px);
	overflow: hidden;
}

.terminal-title {
	display: flex;
	align-items: center;
	gap: 0.48rem;
	padding: 0.7rem 0.85rem;
	border-bottom: 1px solid rgba(117, 231, 255, 0.18);
	background: rgba(255, 255, 255, 0.03);
}

.terminal-title span {
	width: 0.68rem;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--danger);
}

.terminal-title span:nth-child(2) {
	background: #ffd166;
}

.terminal-title span:nth-child(3) {
	background: var(--green);
}

.terminal-title p {
	margin: 0 0 0 0.7rem;
	color: rgba(198, 247, 255, 0.62);
	font-size: 0.8rem;
}

.terminal-body {
	padding: clamp(1rem, 2.4vw, 1.7rem);
}

.terminal-lines {
	margin-bottom: 1.15rem;
}

.terminal-lines p {
	margin: 0.38rem 0;
	line-height: 1.7;
	color: rgba(210, 248, 255, 0.82);
}

.terminal-lines b {
	color: var(--green);
}

.truth-links {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.7rem;
}

.truth-links a {
	position: relative;
	display: grid;
	grid-template-columns: 2.6rem 1fr;
	gap: 0.3rem 0.8rem;
	align-items: center;
	padding: 0.85rem 0.9rem;
	border: 1px solid rgba(117, 231, 255, 0.2);
	background: rgba(16, 26, 33, 0.72);
	color: rgba(220, 252, 255, 0.92);
	box-shadow: none;
	transition: transform 90ms steps(3, end), background 90ms steps(3, end), filter 90ms steps(3, end);
}

.truth-links a span {
	grid-row: span 2;
	font-family:
		Riffic,
		Aller,
		sans-serif;
	font-size: 1.35rem;
	color: var(--cyan);
}

.truth-links a strong {
	font-size: 1.02rem;
}

.truth-links a small {
	color: rgba(198, 247, 255, 0.54);
}

.truth-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.7rem;
	margin: 0.7rem 0 1rem;
}

.truth-stats p {
	display: grid;
	gap: 0.2rem;
	margin: 0;
	padding: 0.75rem 0.85rem;
	border: 1px solid rgba(157, 255, 189, 0.12);
	background: rgba(157, 255, 189, 0.045);
}

.truth-stats span {
	color: rgba(117, 231, 255, 0.54);
	font-size: 0.72rem;
	text-transform: uppercase;
}

.truth-stats strong {
	color: rgba(220, 252, 255, 0.88);
	font-size: 0.86rem;
}

.truth-stats em {
	color: var(--green);
	font-style: normal;
	font-size: 0.78rem;
}

.sayori-console {
	display: grid;
	gap: 0.6rem;
}

.sayori-dialogue {
	display: grid;
	gap: 0.28rem;
	min-height: 4.1rem;
	padding: 0.75rem 0.85rem;
	border: 1px solid rgba(117, 231, 255, 0.16);
	background: rgba(117, 231, 255, 0.035);
	color: rgba(210, 248, 255, 0.76);
	font-size: 0.86rem;
	line-height: 1.6;
}

.sayori-dialogue p {
	margin: 0;
}

.sayori-dialogue b {
	color: var(--green);
}

.restore-line {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	width: 100%;
	padding: 0.95rem 1rem;
	text-align: left;
	border: 1px solid rgba(157, 255, 189, 0.22);
	background: rgba(157, 255, 189, 0.05);
	color: var(--green);
	cursor: text;
	transition: filter 90ms steps(3, end), background 90ms steps(3, end);
}

.restore-line:focus-within {
	background: rgba(157, 255, 189, 0.09);
	filter: saturate(1.18);
}

.restore-line span {
	flex: 1;
}

.restore-line input {
	width: 2rem;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--green);
	font:
		inherit;
	text-transform: uppercase;
	caret-color: var(--green);
}

.restore-line input:disabled {
	opacity: 0;
}

.restore-line::after {
	content: "_";
	animation: crtBlink 800ms steps(2, end) infinite;
}

.flash-plane {
	position: fixed;
	z-index: 20;
	inset: 0;
	background: #fff;
	opacity: 0;
	pointer-events: none;
}

body.is-collapsing .flash-plane {
	animation: whiteout var(--collapse-ms) steps(32, end) forwards;
}

.glitch-field {
	position: fixed;
	z-index: 21;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
}

.glitch-bit {
	position: absolute;
	width: var(--s);
	height: var(--s);
	left: var(--x);
	top: var(--y);
	background: var(--c);
	opacity: 0;
	transform: translate(0, 0);
	animation: bitScatter var(--glitch-ms) steps(12, end) forwards;
	animation-delay: var(--d);
}

.pixel-field {
	position: fixed;
	z-index: 22;
	inset: 0;
	display: grid;
	grid-template-columns: repeat(18, 1fr);
	grid-template-rows: repeat(10, 1fr);
	pointer-events: none;
}

.pixel-tile {
	background:
		radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.36), transparent 40%),
		linear-gradient(135deg, var(--pink), var(--peach));
	transform: scale(0);
	animation: tileGrow var(--tile-ms) steps(5, end) forwards;
	animation-delay: var(--d);
}

body.is-shaking .truth-layer,
body.is-shaking .dream-layer {
	animation: screenShake 360ms steps(7, end);
}

body.is-collapsing .dream-layer {
	filter: contrast(1.42) saturate(0.62);
}

body.is-collapsing .dream-layer::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(255, 75, 120, 0.16), transparent 32%, rgba(73, 208, 255, 0.14)),
		repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.09) 0 1px, transparent 1px 5px);
	mix-blend-mode: multiply;
	animation: tearFrames 160ms steps(2, end) infinite;
}

body.is-restoring .truth-layer {
	filter: brightness(1.15);
}

@keyframes dreamDrift {
	0%,
	100% {
		transform: translate3d(var(--mx, 0), var(--my, 0), 0);
	}
	50% {
		transform: translate3d(calc(var(--mx, 0) + 1.15rem), calc(var(--my, 0) - 0.75rem), 0);
	}
}

@keyframes shaderPulse {
	0%,
	100% {
		opacity: 0.74;
		transform: translate3d(0, 0, 0);
	}
	50% {
		opacity: 0.98;
		transform: translate3d(1.35rem, -0.9rem, 0);
	}
}

@keyframes sayoriFloat {
	0%,
	100% {
		transform: translate3d(0, 0, 0);
	}
	50% {
		transform: translate3d(0, -1.05rem, 0);
	}
}

@keyframes ghostTear {
	0% {
		transform: translate(0.55rem, -0.3rem);
	}
	100% {
		transform: translate(-0.35rem, 0.22rem);
	}
}

@keyframes particleFloat {
	0%,
	100% {
		transform: translate3d(0, 0, 0) rotate(0deg);
	}
	50% {
		transform: translate3d(1rem, -1.4rem, 0) rotate(12deg);
	}
}

@keyframes crtBlink {
	0%,
	49% {
		opacity: 1;
	}
	50%,
	100% {
		opacity: 0.22;
	}
}

@keyframes whiteout {
	0% {
		opacity: 0;
	}
	18% {
		opacity: 0.25;
	}
	48% {
		opacity: 0.97;
		background: #fff;
	}
	72% {
		opacity: 1;
		background: #fff;
	}
	74% {
		background: #05070a;
	}
	100% {
		opacity: 0;
		background: #05070a;
	}
}

@keyframes bitScatter {
	0% {
		opacity: 0;
		transform: translate(0, 0) scale(0.6);
	}
	18% {
		opacity: 0.9;
	}
	100% {
		opacity: 0;
		transform: translate(var(--dx), var(--dy)) scale(0.1);
	}
}

@keyframes tileGrow {
	0% {
		transform: scale(0);
	}
	100% {
		transform: scale(1.02);
	}
}

@keyframes screenShake {
	0%,
	100% {
		transform: translate(0, 0);
	}
	20% {
		transform: translate(-0.55rem, 0.22rem);
	}
	40% {
		transform: translate(0.45rem, -0.34rem);
	}
	60% {
		transform: translate(-0.25rem, -0.2rem);
	}
	80% {
		transform: translate(0.28rem, 0.3rem);
	}
}

@keyframes tearFrames {
	0% {
		clip-path: inset(0 0 0 0);
		transform: translateX(-0.3rem);
	}
	100% {
		clip-path: inset(4% 0 6% 0);
		transform: translateX(0.3rem);
	}
}

@media (max-width: 1080px) {
	.dream-composition {
		grid-template-columns: minmax(0, 1fr);
		align-items: center;
		width: min(58rem, calc(100% - 2rem));
	}

	.sayori-stage {
		position: absolute;
		inset: auto -2rem -2.8rem auto;
		width: 24rem;
		min-height: 28rem;
		opacity: 0.3;
		z-index: 1;
	}

	.sayori-art {
		width: 23rem;
		max-height: 50vh;
	}

	.dream-board {
		position: relative;
		z-index: 4;
	}

	.dream-card {
		background:
			linear-gradient(90deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.38)),
			rgba(255, 255, 255, 0.38);
	}
}

@media (max-width: 780px) {
	.dream-composition {
		padding-top: 5.4rem;
		padding-bottom: 5.2rem;
	}

	.project-stack {
		gap: 0.8rem;
	}

	.surface-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.truth-links,
	.truth-stats {
		grid-template-columns: 1fr;
	}

	.terminal-window {
		margin-top: 4rem;
	}

	.fan-notice {
		display: none;
	}
}

@media (max-width: 520px) {
	.creator-mark small {
		display: none;
	}

	.dream-topbar,
	.truth-topbar {
		top: 0.75rem;
		left: 0.75rem;
		right: 0.75rem;
	}

	.icon-button {
		width: 2.45rem;
	}

	.mystery-button {
		width: 2.65rem;
	}

	.dream-composition {
		width: min(100% - 1.25rem, 32rem);
		padding-top: 5rem;
	}

	h1 {
		font-size: clamp(1.08rem, 6vw, 1.5rem);
	}

	.dream-heading p,
	.dream-card p:not(.card-index) {
		font-size: 0.94rem;
	}

	.dream-card {
		padding: 0.95rem;
		background:
			linear-gradient(90deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.28)),
			rgba(255, 255, 255, 0.26);
	}

	.dream-card h2 {
		font-size: 1.22rem;
	}

	.surface-links a,
	.truth-links a {
		padding: 0.72rem;
	}

	.surface-links {
		padding-left: 3.6rem;
		padding-bottom: 3.8rem;
	}

	.sayori-stage {
		position: fixed;
		inset: 5.2rem -1.2rem auto auto;
		width: 15rem;
		min-height: 76vh;
		opacity: 0.56;
		z-index: 3;
	}

	.sayori-art {
		right: 0;
		bottom: auto;
		top: 0;
		width: 15rem;
		max-height: 70vh;
		filter:
			drop-shadow(0 1rem 1.6rem rgba(133, 53, 82, 0.18))
			saturate(1.05);
	}

	.terminal-lines,
	.terminal-title,
	.truth-stats,
	.restore-line {
		font-size: 0.78rem;
	}
}
