/* ==========================================================================
   LOVE the Philippines
   The page scrolls through the logo's colours; the 3D blocks live in one fixed
   WebGL canvas behind the text. The chrome (bar, dots, tips, buttons) uses the
   Isda / Tidewater glass palette so the Budots Media pages feel like one family.
   ========================================================================== */

:root {
	/* chrome: the Tidewater palette from Isda */
	--tw-aqua: #5fe3d4;
	--tw-sun: #ffb86b;
	--tw-coral: #ff7a85;
	--tw-ink: #eef6f8;
	--tw-ink-2: rgba(222, 236, 242, 0.76);
	--tw-ink-3: rgba(200, 222, 232, 0.52);
	--tw-ink-4: rgba(190, 215, 228, 0.32);
	--tw-glass: rgba(12, 18, 26, 0.62);
	--tw-line: rgba(170, 215, 235, 0.12);
	--tw-line-2: rgba(170, 215, 235, 0.2);
	--tw-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--tw-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
	--tw-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

	/* page */
	--bg: #12163f;
	--display: 'Fredoka', 'Inter', system-ui, sans-serif;
	--script: 'Caveat Brush', 'Segoe Script', cursive;
	--gutter: clamp(16px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
	background: var(--bg);
	color: #fff;
	font: 400 16px/1.5 var(--tw-font);
	overflow-x: hidden;
	-webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* stacking (one root context): section colour < far layers (0) < 3D canvas (1) < text and stickers (2) */
#gl {
	position: fixed; inset: 0; width: 100%; height: 100%;
	z-index: 1; pointer-events: none; display: block;
}
body.no-webgl #gl { display: none; }

main { position: relative; }

/* ---------- scenes ---------- */
.scene {
	position: relative;
	min-height: 125svh;
	overflow: hidden;
}
.scene[data-ink="dark"] { color: #2a1700; }
.scene[data-ink="light"] { color: #fff; }

.layer { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.layer.far { z-index: 0; }
.layer.near, .copy, .hero-copy, .logo-box, .scroll-cue, .foot { z-index: 2; }

.motif img {
	position: absolute;
	width: min(120vmin, 1100px);
	right: -18vmin; top: 50%;
	transform: translateY(-50%) rotate(-8deg);
	opacity: 0.13;
	filter: grayscale(1) contrast(2.2) brightness(1.15);
}
.scene:nth-of-type(odd) .motif img { right: auto; left: -22vmin; transform: translateY(-50%) rotate(7deg); }

.copy {
	position: absolute;
	left: var(--gutter);
	top: 50%;
	width: min(34rem, calc(100% - 2 * var(--gutter)));
	transform: translateY(-50%);
	will-change: transform;
}
.kicker {
	margin: 0 0 0.6rem;
	font: 500 0.78rem/1 var(--tw-mono);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.8;
}
.copy h2 {
	margin: 0 0 0.3rem;
	font: 700 clamp(4.5rem, 16vw, 13rem)/0.84 var(--display);
	letter-spacing: -0.015em;
	padding-bottom: 0.2em;          /* room for descenders (the g in Dagat) */
}
.en { margin: 0 0 0.4rem; font-weight: 500; font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.35; text-wrap: balance; }
.fil { margin: 0; font-size: clamp(0.98rem, 1.6vw, 1.15rem); opacity: 0.74; text-wrap: balance; }

/* stickers: flat vector tiles in the near layer */
.sticker {
	position: absolute;
	left: var(--x); top: var(--y);
	width: var(--w); aspect-ratio: 1;
	padding: 0; border: 0; background: none; cursor: pointer;
	transform: translate(-50%, -50%) rotate(var(--r));
	pointer-events: auto;
	filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.28));
	transition: transform 240ms var(--tw-ease);
}
.sticker img { width: 100%; height: 100%; }
.sticker:hover { transform: translate(-50%, -50%) rotate(var(--r)) scale(1.08); }
.sticker:focus-visible { outline: 2px solid var(--tw-aqua); outline-offset: 6px; border-radius: 12px; }

/* ---------- hero + finale ---------- */
.hero, .finale {
	min-height: 100svh;
	display: grid;
	align-content: center;
	justify-items: center;
	gap: clamp(12px, 3vh, 32px);
	padding: 96px var(--gutter) 88px;
	text-align: center;
}
.finale { min-height: 115svh; }
.logo-box {
	width: min(88vw, 1180px);
	aspect-ratio: 6697 / 2165;
	position: relative;
}
.logo-2d { width: 100%; height: 100%; transition: opacity 700ms var(--tw-ease); }
body.gl-ready .logo-2d { opacity: 0; }
.hero-copy { position: relative; max-width: 40rem; will-change: transform; }
.script {
	margin: 0 0 0.6rem;
	font: 400 clamp(2.4rem, 6.5vw, 4.8rem)/1 var(--script);
	color: #ffd27a;
	transform: rotate(-3deg);
}
.hero .en, .finale .en { font-size: clamp(1.05rem, 1.8vw, 1.3rem); }

.scroll-cue {
	position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
	transform: translateX(-50%);
	margin: 0; display: grid; justify-items: center; gap: 8px;
	font: 500 0.72rem/1 var(--tw-mono); letter-spacing: 0.12em; text-transform: uppercase;
	color: var(--tw-ink-3);
}
.scroll-cue i {
	width: 12px; height: 12px;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	animation: cue 1.6s var(--tw-ease) infinite;
}
@keyframes cue { 0%, 100% { translate: 0 0; opacity: 0.4; } 50% { translate: 0 6px; opacity: 1; } }

.sparkles i {
	position: absolute; left: var(--x); top: var(--y);
	width: calc(22px * var(--s)); aspect-ratio: 1;
	background: #fff;
	clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
	opacity: 0.8;
	animation: twinkle 3.2s ease-in-out infinite;
	animation-delay: calc(var(--s) * -2.1s);
}
@keyframes twinkle { 0%, 100% { opacity: 0.25; scale: 0.7; } 50% { opacity: 0.95; scale: 1; } }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 1.4rem; }
.foot {
	position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom));
	padding: 0 var(--gutter);
	font-size: 0.82rem; color: var(--tw-ink-2);
}
.foot p { margin: 0.2rem 0; }
.foot .small { font-size: 0.72rem; color: var(--tw-ink-3); }

/* ---------- chrome (Isda glass) ---------- */
.chrome { position: fixed; z-index: 10; }
.pill {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--tw-glass);
	-webkit-backdrop-filter: blur(18px) saturate(1.6);
	backdrop-filter: blur(18px) saturate(1.6);
	border: 1px solid var(--tw-line-2);
	color: var(--tw-ink);
	font: 500 13px/1.2 var(--tw-font);
	text-decoration: none;
}
.bar {
	top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px;
	display: flex; justify-content: space-between; align-items: center;
	pointer-events: none;
}
.bar > * { pointer-events: auto; }
.brand img { width: 20px; height: 20px; border-radius: 5px; }
.taps .lbl { font: 500 11px/1 var(--tw-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tw-ink-3); }
.taps b { font: 500 14px/1 var(--tw-mono); color: var(--tw-aqua); min-width: 2ch; text-align: right; }
.taps.bump b { animation: bump 320ms var(--tw-ease); }
@keyframes bump { 40% { scale: 1.45; color: var(--tw-sun); } }

.dots {
	right: max(10px, env(safe-area-inset-right)); top: 50%;
	transform: translateY(-50%);
	display: flex; flex-direction: column; gap: 2px;
	padding: 8px 6px;
	border-radius: 999px;
	background: var(--tw-glass);
	-webkit-backdrop-filter: blur(18px) saturate(1.6);
	backdrop-filter: blur(18px) saturate(1.6);
	border: 1px solid var(--tw-line-2);
}
.dots button {
	position: relative;
	width: 26px; height: 26px; padding: 0;
	border: 0; background: none; cursor: pointer;
	display: grid; place-items: center;
}
.dots i {
	width: 8px; height: 8px; border-radius: 50%;
	background: var(--tw-ink-4);
	transition: background 240ms var(--tw-ease), scale 240ms var(--tw-ease);
}
.dots button[aria-current="true"] i { background: var(--tw-aqua); scale: 1.35; }
.dots span {
	position: absolute; right: 36px; top: 50%;
	translate: 6px -50%;
	padding: 5px 10px; border-radius: 999px;
	background: var(--tw-glass); border: 1px solid var(--tw-line-2);
	-webkit-backdrop-filter: blur(12px) saturate(1.5);
	backdrop-filter: blur(12px) saturate(1.5);
	color: var(--tw-ink); font: 500 11px/1 var(--tw-mono); letter-spacing: 0.1em; text-transform: uppercase;
	white-space: nowrap;
	opacity: 0; pointer-events: none;
	transition: opacity 140ms var(--tw-ease), translate 140ms var(--tw-ease);
}
.dots button:hover span, .dots button:focus-visible span { opacity: 1; translate: 0 -50%; }
.dots button:focus-visible { outline: 2px solid var(--tw-aqua); border-radius: 50%; }

.action { cursor: pointer; padding: 11px 20px; font-size: 14px; }
.action:not(.ghost) { background: var(--tw-aqua); border-color: transparent; color: #04201c; font-weight: 600; }
.action:hover { filter: brightness(1.08); }
.action:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.tip {
	left: 0; top: 0;
	padding: 7px 12px;
	border-radius: 999px;
	background: var(--tw-glass);
	-webkit-backdrop-filter: blur(18px) saturate(1.6);
	backdrop-filter: blur(18px) saturate(1.6);
	border: 1px solid var(--tw-line-2);
	color: var(--tw-ink);
	font: 500 13px/1.2 var(--tw-font);
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	translate: -50% calc(-100% - 18px);
	transition: opacity 180ms var(--tw-ease);
}
.tip small { color: var(--tw-sun); font: 500 11px/1 var(--tw-mono); margin-left: 6px; }
.tip.show { opacity: 1; }

/* ---------- effects ---------- */
.fx { position: fixed; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
.fx .bit { position: absolute; display: block; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 2px; }
.fx .bit.round { border-radius: 50%; }
.fx .ring {
	position: absolute; display: block; left: 0; top: 0; width: 20px; height: 20px;
	margin: -10px 0 0 -10px; border-radius: 50%;
	border: 2px solid currentColor;
}

/* ---------- small screens ---------- */
@media (max-width: 720px) {
	/* text in the upper part of the section's centred view, the blocks float below it */
	.copy { top: calc(50% - 36svh); transform: none; }
	.dots { display: none; }
	.copy h2 { font-size: clamp(4rem, 23vw, 7rem); }
	.dots { gap: 0; padding: 6px 4px; }
	.dots button { width: 22px; height: 22px; }
	.dots span { display: none; }
	.hero, .finale { padding-top: 84px; }
	.logo-box { width: 92vw; }
	.pill { padding: 7px 12px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.sparkles i, .scroll-cue i { animation: none; }
	.sticker, .logo-2d { transition: none; }
}
