/* Arrakia — landing page
   A dreamy desert sunset, painted with layered CSS gradients.
   Palette pulled from the logo: #FFF6E0, #F8D079, #E8A23D. */

:root {
	--cream:  #FFF6E0;
	--gold:   #F8D079;
	--amber:  #E8A23D;
	--rust:   #C2673A;
	--dusk:   #7A3F4B;
	--night:  #2C2540;
	--brown:  #3A1F15;

	/* Logo & wordmark — driven from here, not baked into the SVGs */
	--ink:       #331B11;   /* the letters / the "A" mark      */
	--sun-core:  var(--cream);
	--sun-mid:   var(--gold);
	--sun-edge:  var(--amber);
	--sun-shine: #FFFDF6;   /* specular highlight on the sun   */
	--sun-bloom: #F4C95D;   /* soft golden glow behind the A   */
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	overflow: hidden;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	background: var(--night);
	color: var(--night);
}

/* --- Sky: vertical sunset wash --- */
.sky {
	position: fixed;
	inset: 0;
	background: linear-gradient(
		180deg,
		var(--night) 0%,
		var(--dusk)  30%,
		var(--rust)  52%,
		var(--amber) 79%,
		#8A4A28      85%,
		#5A2E1A      89%,
		var(--brown) 93%,
		var(--brown) 100%
	);
	z-index: 0;
}

/* --- Soft sun bloom, aligned behind the logo's own sun --- */
.sun-glow {
	position: fixed;
	left: 50%;
	top: 52%;
	width: 120vmax;
	height: 120vmax;
	transform: translate(-50%, -50%);
	background: radial-gradient(
		circle at center,
		rgba(248, 208, 121, 0.50) 0%,
		rgba(240, 184, 92, 0.40) 16%,
		rgba(232, 162, 61, 0.22) 30%,
		rgba(232, 162, 61, 0) 50%
	);
	z-index: 1;
	animation: breathe 12s ease-in-out infinite;
}

/* --- Dreamy heat haze over everything --- */
.haze {
	position: fixed;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(
		ellipse at 50% 78%,
		rgba(255, 246, 224, 0.18) 0%,
		rgba(255, 246, 224, 0) 45%
	);
	z-index: 3;
}

/* --- Hero content --- */
.hero {
	position: relative;
	z-index: 4;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.6rem;
	text-align: center;
	padding: 2rem 2rem 12vh;
}

.logo {
	width: clamp(210px, 44vmin, 300px);
	height: auto;
	color: var(--ink);
	filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.2));
	animation: rise 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.wordmark {
	width: clamp(220px, 46vmin, 460px);
	height: auto;
	color: var(--ink);
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
	animation: rise 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.taglines {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.7rem;
	animation: rise 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

/* Language switching — same pattern as blaXmacro: show only the active language */
[class*="for-language-"] {
	display: none;
}

.language-en .for-language-en,
.language-de .for-language-de,
.language-fr .for-language-fr,
.language-es .for-language-es,
.language-it .for-language-it,
.language-sv .for-language-sv,
.language-pt .for-language-pt,
.language-ja .for-language-ja {
	display: revert;
}

.subname {
	color: var(--ink);
	font-size: clamp(1rem, 3vmin, 1.45rem);
	letter-spacing: 0.06em;
	text-shadow: 0 2px 12px rgba(60, 30, 15, 0.4);
}

.subname .by {
	opacity: 0.7;
}

.tagline {
	color: #5A3220;
	font-size: clamp(0.9rem, 2.4vmin, 1.15rem);
	letter-spacing: 0.42em;
	text-transform: uppercase;
	text-indent: 0.42em;
	margin-top: 2rem;
	opacity: 0.92;
	text-shadow: 0 2px 12px rgba(60, 30, 15, 0.45);
}

/* --- Motion --- */
@keyframes rise {
	from { opacity: 0; transform: translateY(22px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes breathe {
	0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
	50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
	.logo,
	.wordmark,
	.taglines,
	.sun-glow {
		animation: none;
	}
}

/* --- Language chooser: discreet, pinned to the bottom --- */
.language-chooser {
	position: fixed;
	left: 50%;
	bottom: 1rem;
	transform: translateX(-50%);
	z-index: 5;
	display: flex;
	gap: 1px;
	padding: 4px 6px;
	opacity: 0.3;
	transition: opacity 0.35s ease;
}

.language-chooser:hover {
	opacity: 0.95;
}

.language-chooser a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 3px 5px;
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	opacity: 0.6;
	filter: grayscale(0.7);
	transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.language-chooser a:hover {
	opacity: 1;
	filter: grayscale(0);
	transform: translateY(-1px);
}

body.language-en .highlight-language-en,
body.language-de .highlight-language-de,
body.language-fr .highlight-language-fr,
body.language-es .highlight-language-es,
body.language-it .highlight-language-it,
body.language-sv .highlight-language-sv,
body.language-pt .highlight-language-pt,
body.language-ja .highlight-language-ja {
	opacity: 1;
	filter: grayscale(0);
}

/* --- Legal notes page: scrolls over the fixed sunset, text in a glass card --- */
.legal-scroll {
	position: fixed;
	inset: 0;
	z-index: 4;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: clamp(2.5rem, 8vh, 6rem) 1.25rem clamp(5rem, 12vh, 8rem);
}

.legal {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.6rem;
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
}

.legal-logo {
	display: inline-flex;
	color: var(--ink);
	filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.25));
	transition: transform 0.2s ease;
}

.legal-logo:hover {
	transform: translateY(-2px);
}

.legal-logo img {
	width: 128px;
	height: 128px;
	display: block;
}

.legal-head {
	text-align: center;
}

.legal-wordmark {
	width: clamp(150px, 36vw, 230px);
	height: auto;
	display: block;
	margin: -0.6rem auto 1.8rem;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.legal-head h1 {
	color: var(--ink);
	font-size: clamp(1.5rem, 5vw, 2.2rem);
	font-weight: 700;
	line-height: 1.15;
	text-shadow: 0 2px 14px rgba(60, 30, 15, 0.35);
}

.legal-card {
	width: 100%;
	background: rgba(255, 247, 235, 0.26);
	backdrop-filter: blur(26px) saturate(1.3);
	-webkit-backdrop-filter: blur(26px) saturate(1.3);
	border: 1px solid rgba(255, 246, 224, 0.18);
	border-radius: 20px;
	box-shadow: 0 24px 70px rgba(44, 20, 10, 0.4);
	padding: clamp(1.5rem, 4.5vw, 3rem);
	color: #3A1F15;
}

.legal-card p {
	line-height: 1.65;
	color: #4A2C1C;
	margin: 0.5rem 0 1.1rem;
}

.legal-card h2 {
	color: var(--ink);
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	margin: 1.8rem 0 0.3rem;
}

.legal-card h2:first-of-type {
	margin-top: 1.2rem;
}

.legal-card a {
	color: #B9632F;
	text-decoration: none;
	border-bottom: 1px solid rgba(185, 99, 47, 0.4);
}

.legal-card a:hover {
	border-bottom-color: #B9632F;
}

.legal-card .important {
	font-weight: 600;
	color: var(--ink);
}

.legal-foot {
	text-align: center;
}

.back-link {
	display: inline-block;
	padding: 0.6rem 1.6rem;
	color: var(--cream);
	background: rgba(58, 31, 21, 0.55);
	border: 1px solid rgba(255, 246, 224, 0.35);
	border-radius: 999px;
	font-size: 0.9rem;
	letter-spacing: 0.08em;
	text-decoration: none;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transition: background 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
	background: rgba(58, 31, 21, 0.75);
	transform: translateY(-1px);
}

/* --- Bottom bar: chooser centered, legal link pinned right on the same line --- */
.bottom-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 1rem;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 1.25rem;
}

.bottom-bar .language-chooser {
	position: static;
	left: auto;
	bottom: auto;
	transform: none;
}

/* --- Discreet legal link on the landing page --- */
.legal-link {
	position: absolute;
	right: 1.25rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--cream);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-decoration: none;
	opacity: 0.5;
	transition: opacity 0.3s ease;
}

.legal-link:hover {
	opacity: 0.95;
	text-decoration: underline;
}

/* --- Intro "key signature" reveal (first visit per session) --- */
.play-intro .wordmark {
	animation: none;
	opacity: 1;
}

.play-intro .wordmark > g {
	opacity: 0;
	animation: glyph-ignite 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.play-intro .wordmark > g:nth-child(1) { animation-delay: 0.05s; }
.play-intro .wordmark > g:nth-child(2) { animation-delay: 0.14s; }
.play-intro .wordmark > g:nth-child(3) { animation-delay: 0.23s; }
.play-intro .wordmark > g:nth-child(4) { animation-delay: 0.32s; }
.play-intro .wordmark > g:nth-child(5) { animation-delay: 0.41s; }
.play-intro .wordmark > g:nth-child(6) { animation-delay: 0.50s; }
.play-intro .wordmark > g:nth-child(7) { animation-delay: 0.59s; }

.play-intro .logo {
	animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}

.play-intro .taglines {
	animation: none;
	opacity: 1;
}

.play-intro .subname {
	opacity: 0;
	animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}

.play-intro .tagline {
	opacity: 0;
	animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) 2.6s both;
}

@keyframes glyph-ignite {
	0%   { opacity: 0; filter: drop-shadow(0 0 22px #F4C95D) drop-shadow(0 0 8px #FFF6E0); }
	55%  { opacity: 1; }
	100% { opacity: 1; filter: drop-shadow(0 0 0 rgba(244, 201, 93, 0)); }
}

/* Click / scroll / keypress skips straight to the final state */
.intro-skip .wordmark > g {
	animation: none !important;
	opacity: 1 !important;
}

.intro-skip .logo,
.intro-skip .taglines,
.intro-skip .subname,
.intro-skip .tagline {
	animation: none !important;
	opacity: 1 !important;
	transform: none !important;
}

