:root {
	--main-colorRGB: 161, 197, 58; /*#a1c53a;*/
	--main-color: rgba(var(--main-colorRGB), 1);
}

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

html {
	font-family: "Elms Sans";
	/*font-size: 12px;*/ /* base size */
	font-size: clamp(9px, min(2.5vw, 4vh), 13px);
	line-height: 1.3;
	color: #000;
}

/* Headings scale system */
h1 {
	font-size: clamp(2.2rem, 5vh, 5rem);
	margin-bottom: clamp(8px, 2vh, 20px);
}

h2 {
	font-size: clamp(0.2rem, 3vh, 2rem);
}

p {
	font-size: clamp(1.1rem, 3vh, 2rem);
}

.small {
	font-size: clamp(0.85rem, 2.2vh, 1.5rem);
}

.flex {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: clamp(0.5rem, 2vw, 1rem);
	width: 100%;
}

footer ul li {
	display: flex;
	justify-content: center;
	align-items: center;
}

.GreenGalm-text{
	font-size: clamp(6rem, 6vh, 10rem);
}

/*Basic Layout with Header Footer Main:*/
body {
	background-color: #fff;
	margin: 0;
	padding: 0;
	height: 100%;
	min-height: -webkit-fill-available;
}

.overlayFull {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100dvh; 
	min-height: -webkit-fill-available;
	background: transparent;
	user-select: none;      /* prevent text selection */
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	pointer-events: none;
	/* Reserve safe area around notches and system bars */
	padding-top: env(safe-area-inset-top);
	padding-right: env(safe-area-inset-right);
	padding-bottom: env(safe-area-inset-bottom);
	padding-left: env(safe-area-inset-left);
	box-sizing: border-box;
}
#overlayAR {
	z-index: 1;
}
#overlayCSS {
	z-index: 2;
	pointer-events: auto; /*Let events pass through*/
}
#overlayWebGL {
	z-index: 3;
}
#overlayHtml {
	z-index: 4;
	overscroll-behavior: none;
	display: flex;
	flex-direction: column;
	overflow-y: auto;  
}

a, button, input, select {
	pointer-events: auto;  /*Let events work on the important parts*/
}

header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: clamp(0.5rem, 2vh, 1rem) clamp(0.5rem, 3vw, 1.5rem);
	flex-shrink: 0;
}

header nav ul {
	display: flex;
	gap: 1rem;
	list-style: none;
	justify-content: center;
	align-items: center;
	top: 1rem;
}

footer {
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: clamp(0.5rem, 2vh, 1rem);
}

footer section {
	width: 100%;
}

footer ul {
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	list-style: none;
	gap: 1rem;
}

main {
	flex: 1 1 auto;            /* fills remaining space */
	min-height: 0; 
	display: flex;
	align-self: center;
	flex-direction: column;
	justify-content: center;   /* center horizontally */
	align-items: center;       /* center vertically */
	padding: clamp(0.5rem, 2vh, 1rem);
	width: 100%;
}

.center-content {
	display: flex;
	flex-direction: column;    /* stack items top -> bottom */
	align-items: center;       /* center horizontally */
	gap: clamp(0.4rem, 1.5vh, 1rem);  /* compresses on short screens */
	max-width: 520px;          /* constrain width */
	width: 100%;
	text-align: center;
}

.message-window {
	border: 2px solid;
	border-radius: 5px;
}

.right {
	align-self: flex-end;
}

.hidden {
	display: none!important;
}

a {
	color: var(--main-color);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

button {
	color: #000;  
	cursor: pointer;
	background: transparent;
	outline: 2px solid;
	border-radius: 25px;
	border: 0px;
	font-family: "Elms Sans";
	font-size: clamp(1rem, 2.1vw, 1.8rem);
	padding: 0.6em 1.2em;

	transition: 
		background-color 0.25s ease,
		color 0.25s ease,
		transform 0.2s ease,
		border-color 0.25s ease;
}
button:hover {
	background-color: black;
	color: #fff;
	border-color: var(--main-color);
	transform: translateY(-2px);
}
button:active {
	background-color: #000;
	color: var(--main-color);
	transform: translateY(0px) scale(0.98);
}

#ButtonOpenSculpture {
	position: relative;
	left: 5%;
	bottom: 5rem;

    animation: fadeSlideUp 3.9s cubic-bezier(0.22, 1, 0.36, 1) both;
	animation-delay: 0.1s;
}

#logo {
	position: fixed;	 /* stays in place even when scrolling */
	top: 1rem;			 /* distance from top */
	right: 1rem;		 /* distance from right */
	width: clamp(28px, 6vh, 50px); 
}

#logo-ffg {
	position: fixed;	 /* stays in place even when scrolling */
	top: 1.7rem;		 /* distance from top */
	right: 5.5rem;		 /* distance from right */
	width: clamp(60px, 7.5vh, 90px); 
}

.hints {
	margin-top: auto;
	align-self: flex-end;
	
	img {
		height: clamp(80px, 15vh, 200px);
		margin-bottom: 5px
	}
}

#disclaimer {
	align-self: flex-end;
	font-size: clamp(0.55rem, 1.4vh, 0.7rem);
	margin-top: clamp(8px, 1.5vh, 20px);
}

#debug {
	bottom: 0;
	left: 0;
	width: 100%;
	height: 10vh;
	font-family: "Elms Sans";
	overflow-y: auto;
	padding: 5px;
	box-sizing: border-box;
	border-top: 2px solid #333;
	pointer-events: auto;
}

#exportButtons {
	position: fixed;
	top: 1rem;
	right: 13rem;
	z-index: 10;
	display: flex;
	gap: 0.5rem;
}
.export-btn {
	pointer-events: auto;	
	cursor: pointer;
	padding: 5px 10px;
	font-size: 1rem;		
}



@font-face {
	font-family: "Elms Sans";
	src: url("../resources/fonts/Elms_Sans/static/ElmsSans-Light.ttf") format("truetype");
	font-weight: 200;
	font-style: normal;
}
@font-face {
	font-family: "Elms Sans";
	src: url("../resources/fonts/Elms_Sans/static/ElmsSans-Medium.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
}


.lil-gui {
	z-index: 2 !important;
	/* TODO Solve this in HTML */
}

@media (max-width: 820px) {
	#exportButtons {
		display: none !important;
	}
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* --- 1. Splash screen --- */
/*--#splash {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: splashExit 0.8s ease forwards 2.8s;
    pointer-events: none;
}

#splashText {
    font-size: clamp(3rem, 10vw, 7rem);
    color: #000;
    letter-spacing: -0.02em;
    animation: fontCycle 2s steps(1) forwards;
}

@keyframes fontCycle {
    0%   { font-family: "Times New Roman", serif;         opacity: 0.4; }
    16%  { font-family: "Courier New", monospace;         opacity: 1;   }
    32%  { font-family: Impact, "Arial Narrow", sans-serif; opacity: 0.7; }
    48%  { font-family: Georgia, serif;                   opacity: 1;   }
    64%  { font-family: "Palatino Linotype", serif;       opacity: 0.6; }
    80%  { font-family: "Arial Black", sans-serif;        opacity: 1;   }
    100% { font-family: "Elms Sans", sans-serif;          opacity: 1;   }
}

@keyframes splashExit {
    0%   { opacity: 1; }
    100% { opacity: 0; pointer-events: none; }
}
--*/

/* --- Section entrance: fade + slide up --- */
.center-content {
    animation: fadeSlideUp 3.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Delay slightly so it doesn't compete with the splash fade */
#intro.center-content {
    animation-delay: 0.1s;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Loading dots pulse --- */
#loader h2:last-child {
    display: inline-flex;
    gap: 0.2em;
    overflow: hidden;
}

#loader h2:last-child {
    animation: loadingPulse 1.2s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.2; }
    50%       { opacity: 1;   }
}

/* ============================================================
   Flow buttons
   ============================================================ */
 
/* Tour offer: two buttons side by side */
.tour-choice {
	display: flex;
	gap: clamp(0.8rem, 3vw, 1.5rem);
	justify-content: center;
	flex-wrap: wrap;
	margin-top: clamp(0.5rem, 2vh, 1rem);
}

#ButtonNextToInfo, #ButtonNextToTour{
	position: relative;
	top: 1vw;
}

/* ============================================================
   TOUR SHELL
   ============================================================ */

#tourShell {
    position: fixed;
    bottom: 2rem;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;       /* let taps pass through to the scene */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(1rem, 3vh, 2rem) clamp(1rem, 3vw, 2rem);
    gap: 0.75rem;
    z-index: 10;
}

.tour-card {
    pointer-events: auto;
    width: clamp(260px, 38%, 420px);  /* smth 35% from left */
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(161, 197, 58, 0.4);
    border-radius: 14px;
    padding: clamp(0.8rem, 2.5vh, 1.4rem) clamp(1rem, 2.5vw, 1.6rem);
    color: #fff;
    font-size: clamp(0.85rem, 2vh, 1.1rem);
    line-height: 1.5;

    /* Entrance animation */
    animation: tourCardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tourCardIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.tour-nav {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: clamp(260px, 38%, 420px);  /* matches card width */
}

.tour-nav-btn {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 2.4em;
    height: 2.4em;
    padding: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tour-nav-btn:hover {
    background: rgba(161, 197, 58, 0.3);
    border-color: var(--main-color);
    color: var(--main-color);
}

.tour-step-indicator {
    display: flex;
    gap: 6px;
    flex: 1;
}

.tour-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.25s ease, transform 0.25s ease;
}

.tour-dot.active {
    background: var(--main-color);
    transform: scale(1.3);
}

.tour-skip {
    font-size: clamp(0.7rem, 1.6vh, 0.9rem);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tour-skip:hover {
	background: rgba(161, 197, 58, 0.3);
    border-color: var(--main-color);
    color: var(--main-color);
}

.tour-try-it {
    margin-top: 0.6em;
    font-size: clamp(0.75rem, 1.7vh, 0.95rem);
    color: var(--main-color);
    border-top: 1px solid rgba(161, 197, 58, 0.25);
    padding-top: 0.55em;
    line-height: 1.45;
}

/*
	background: var(--main-color);
	border-color: var(--main-color);
	color: #fff;
*/