/* Home page 3D view (three.js). Loaded on index.html only.
   The 3D world itself is drawn by js/home3d.js. While it is on (html.t3d) the ordinary HTML page is hidden;
   it is all still in the document, and "Classic view" brings it back untouched. Everything here is scoped
   to html.t3d or to .t3d-* classes, so the classic page is unaffected. */

/* ---- toggle button (always visible on the home page) ------------------------------------- */
.t3d-toggle {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 1001;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 12px 20px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #19B5C8 0%, #2F80ED 100%);
	color: #fff;
	font: 700 14px/1 "DM Sans", sans-serif;
	letter-spacing: .01em;
	cursor: pointer;
	box-shadow: 0 10px 30px rgba(25, 181, 200, .38);
	transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.t3d-toggle:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(25, 181, 200, .5); }
.t3d-toggle:focus-visible { outline: 3px solid #FF6A2B; outline-offset: 3px; }
.t3d-toggle i { font-size: 15px; }
.t3d-toggle[aria-pressed="true"] {
	background: #0F1B2D;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .28), 0 12px 32px rgba(0, 0, 0, .45);
}
.t3d-toggle[disabled] { opacity: .6; cursor: not-allowed; }
@media (max-width: 991px) {
	.t3d-toggle { right: 12px; bottom: 84px; padding: 11px 16px; } /* clear of the mobile quick-actions bar */
	html.t3d .t3d-toggle { bottom: 14px; }                        /* that bar is hidden in 3D */
}

/* ---- 3D world ---------------------------------------------------------------------------- */
.t3d-canvas {
	display: none;
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 1000;
	touch-action: none;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}
html.t3d,
html.t3d body { height: 100%; overflow: hidden; background: #050a18; padding-bottom: 0; }
html.t3d body > *:not(.t3d-keep) { display: none !important; }
html.t3d .t3d-canvas { display: block; }

/* section dots on the right, a hint at the bottom, and a live region for screen readers */
.t3d-hud {
	position: fixed;
	right: 16px;
	top: 50%;
	z-index: 1002;
	display: flex;
	flex-direction: column;
	gap: 11px;
	transform: translateY(-50%);
}
.t3d-dot {
	width: 11px;
	height: 11px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .55);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.t3d-dot:hover { border-color: #fff; transform: scale(1.25); }
.t3d-dot:focus-visible { outline: 2px solid #FF6A2B; outline-offset: 3px; }
.t3d-dot[aria-current="true"] { background: #19B5C8; border-color: #19B5C8; transform: scale(1.35); }
.t3d-hint {
	position: fixed;
	left: 50%;
	bottom: 22px;
	z-index: 1002;
	padding: 9px 18px;
	border-radius: 999px;
	background: rgba(8, 14, 32, .78);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: rgba(255, 255, 255, .86);
	font: 500 13px/1 "DM Sans", sans-serif;
	letter-spacing: .02em;
	white-space: nowrap;
	pointer-events: none;
	transform: translateX(-50%);
	transition: opacity .6s ease;
}
.t3d-hint.is-gone { opacity: 0; }
.t3d-live {
	position: fixed;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
@media (max-width: 991px) {
	.t3d-hud { right: 8px; gap: 9px; }
	.t3d-hint { bottom: 70px; }
}


/* loading screen, shown while three.js and the fonts load */
.t3d-loader {
	position: fixed;
	inset: 0;
	z-index: 1003;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	background: radial-gradient(ellipse at center, #0b1838 0%, #050a18 70%);
	color: #fff;
	transition: opacity .8s ease, visibility .8s;
}
.t3d-loader.is-done { opacity: 0; visibility: hidden; }
.t3d-loader-logo { font: 800 34px/1 "DM Sans", sans-serif; letter-spacing: -.01em; }
.t3d-loader-logo span { color: #19B5C8; }
.t3d-loader-bar { position: relative; width: 160px; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .12); }
.t3d-loader-bar i { position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, #19B5C8, transparent); animation: t3d-load 1.1s ease-in-out infinite; }
.t3d-loader-text { font: 500 12px/1 "DM Sans", sans-serif; letter-spacing: .28em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
@keyframes t3d-load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }


/* custom cursor in 3D (mouse only): a ring that eases after the pointer and a dot on it */
.t3d-cursor, .t3d-cursor-dot {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 1004;
	border-radius: 50%;
	pointer-events: none;
	opacity: 0;
	transition: opacity .3s ease;
	will-change: transform;
}
.t3d-cursor.is-on, .t3d-cursor-dot.is-on { opacity: 1; }
.t3d-cursor::before {
	content: "";
	position: absolute;
	left: -17px;
	top: -17px;
	width: 34px;
	height: 34px;
	border: 1.5px solid rgba(159, 216, 255, .75);
	border-radius: 50%;
	box-shadow: 0 0 14px rgba(25, 181, 200, .35);
	transition: transform .35s cubic-bezier(.2, .8, .2, 1), background .3s ease, border-color .3s ease;
}
.t3d-cursor.is-hover::before { transform: scale(1.65); border-color: #19B5C8; background: rgba(25, 181, 200, .08); }
.t3d-cursor.is-button::before { transform: scale(2.1); background: rgba(25, 181, 200, .14); border-color: rgba(255, 255, 255, .9); }
.t3d-cursor.is-down::before { transform: scale(.8); }
.t3d-cursor-dot::before {
	content: "";
	position: absolute;
	left: -3px;
	top: -3px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 8px #19B5C8;
}


.t3d-cursor.is-grab::before { transform: scale(1.4); border-style: dashed; border-color: rgba(255, 255, 255, .85); animation: t3d-spin 6s linear infinite; }
@keyframes t3d-spin { to { transform: scale(1.4) rotate(360deg); } }

/* fade to black when a card is clicked (after the camera dives in) */
.t3d-fade { position: fixed; inset: 0; z-index: 1005; background: #050a18; opacity: 0; pointer-events: none; transition: opacity .6s ease .25s; }
.t3d-fade.is-on { opacity: 1; }

/* sound on/off, bottom left */
.t3d-sound {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 1002;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 50%;
	background: rgba(8, 14, 32, .7);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: rgba(255, 255, 255, .8);
	font-size: 15px;
	cursor: pointer;
	transition: border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.t3d-sound:hover { border-color: #19B5C8; color: #fff; }
.t3d-sound[aria-pressed="true"] { border-color: #19B5C8; color: #19B5C8; box-shadow: 0 0 16px rgba(25, 181, 200, .35); }
.t3d-sound:focus-visible { outline: 3px solid #FF6A2B; outline-offset: 3px; }
@media (max-width: 991px) { .t3d-sound { left: 12px; bottom: 14px; } }


/* ---- narrow screens (phones, portrait tablets): a hamburger replaces the 3D menu bar, the dots and the floating buttons */
.t3d-burger { display: none; }
html.t3d.t3d-narrow .t3d-hud,
html.t3d.t3d-narrow .t3d-sound,
html.t3d.t3d-narrow .t3d-toggle { display: none !important; }
html.t3d.t3d-narrow .t3d-burger {
	position: fixed;
	top: calc(var(--t3d-bar, 60px) - 22px);
	right: 14px;
	z-index: 1007;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 50%;
	background: rgba(8, 14, 32, .55);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	cursor: pointer;
}
.t3d-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #fff; transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
.t3d-burger[aria-expanded="true"] { border-color: #19B5C8; }
.t3d-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.t3d-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.t3d-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.t3d-burger:focus-visible { outline: 3px solid #FF6A2B; outline-offset: 3px; }

.t3d-menu {
	position: fixed;
	inset: 0;
	z-index: 1006;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: calc(var(--t3d-bar, 60px) + 44px) 28px calc(28px + env(safe-area-inset-bottom, 0px));
	background: radial-gradient(120% 80% at 100% 0%, rgba(25, 181, 200, .16), transparent 60%), rgba(5, 10, 24, .78);
	-webkit-backdrop-filter: blur(18px) saturate(1.3);
	backdrop-filter: blur(18px) saturate(1.3);
	opacity: 0;
	transition: opacity .35s ease;
	overflow-y: auto;
}
.t3d-menu[hidden] { display: none; }
.t3d-menu.is-open { opacity: 1; }
.t3d-menu-list { margin: 0; padding: 0; list-style: none; }
.t3d-menu-list li { opacity: 0; transform: translateY(18px); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1); }
.t3d-menu.is-open .t3d-menu-list li { opacity: 1; transform: none; }
.t3d-menu.is-open .t3d-menu-list li:nth-child(2) { transition-delay: .04s; }
.t3d-menu.is-open .t3d-menu-list li:nth-child(3) { transition-delay: .08s; }
.t3d-menu.is-open .t3d-menu-list li:nth-child(4) { transition-delay: .12s; }
.t3d-menu.is-open .t3d-menu-list li:nth-child(5) { transition-delay: .16s; }
.t3d-menu.is-open .t3d-menu-list li:nth-child(6) { transition-delay: .2s; }
.t3d-menu.is-open .t3d-menu-list li:nth-child(7) { transition-delay: .24s; }
.t3d-menu-link {
	display: flex;
	align-items: baseline;
	gap: 16px;
	width: 100%;
	padding: 11px 0;
	border: 0;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
	background: none;
	color: #fff;
	font: 700 clamp(24px, 7.5vw, 34px)/1.15 "DM Sans", sans-serif;
	letter-spacing: -.01em;
	text-align: left;
	cursor: pointer;
}
.t3d-menu-link em { min-width: 26px; color: #19B5C8; font: 600 12px/1 "DM Sans", sans-serif; font-style: normal; letter-spacing: .12em; }
.t3d-menu-link[aria-current="true"] span { color: #19B5C8; }
.t3d-menu-link:focus-visible, .t3d-menu-pill:focus-visible { outline: 3px solid #FF6A2B; outline-offset: 3px; }
.t3d-menu-foot { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 24px; }
.t3d-menu-pill {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 12px 18px;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 999px;
	background: rgba(255, 255, 255, .05);
	color: #fff;
	font: 600 14px/1 "DM Sans", sans-serif;
	cursor: pointer;
}
.t3d-menu-pill[aria-pressed="true"] { border-color: #19B5C8; color: #19B5C8; }

@media (prefers-reduced-motion: reduce) {
	.t3d-toggle, .t3d-dot, .t3d-hint, .t3d-loader, .t3d-cursor::before { transition: none; }
	.t3d-loader-bar i, .t3d-cursor.is-grab::before { animation: none; }
	.t3d-fade, .t3d-menu, .t3d-menu-list li, .t3d-burger span { transition: none; }
}
