/*
Theme Name: WIGUEL 2
Theme URI: https://wiguel.com
Author: WIGUEL
Description: Dark, gaming-meets-professional theme for the WIGUEL minigames site. 3D logo homepage, game library and game template.
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: wiguel
*/

:root {
	--bg: #07070f;
	--bg-2: #0b0c18;
	--surface: #0f1120;
	--surface-2: #151833;
	--line: rgba(148, 163, 255, .16);
	--text: #e9ebfa;
	--muted: #a3a9c9;
	--cyan: #22d3ee;
	--violet: #8b5cf6;
	--grad: linear-gradient(135deg, var(--cyan), var(--violet));
	--radius: 16px;
	--wrap: 1160px;
	--header-h: 68px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 1.0625rem/1.65 var(--font);
	-webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #7ee9fa; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--cyan); color: #04121a; padding: .6rem 1rem; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(7, 7, 15, .72);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__mark {
	width: 26px; height: 26px; border-radius: 7px; background: var(--grad);
	box-shadow: 0 0 18px rgba(34, 211, 238, .55);
	clip-path: polygon(0 0, 100% 0, 100% 62%, 62% 100%, 0 100%);
}
.brand__name { font-weight: 900; letter-spacing: .14em; font-size: 1.05rem; }

.primary-nav { display: flex; align-items: center; gap: 1.5rem; }
.primary-nav .menu { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.primary-nav .menu a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; padding: .4rem 0; border-bottom: 2px solid transparent; }
.primary-nav .menu a:hover, .primary-nav .menu .current-menu-item > a { color: var(--text); border-color: var(--cyan); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; padding: 0; cursor: pointer; position: relative; }
.nav-toggle__bar { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle__bar:nth-child(1) { top: 14px; }
.nav-toggle__bar:nth-child(2) { top: 21px; }
.nav-toggle__bar:nth-child(3) { top: 28px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	padding: .95rem 1.7rem; border-radius: 12px; border: 0; cursor: pointer;
	font: 800 .95rem/1 var(--font); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
	color: #04121a; background: var(--grad);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 10px 30px -8px rgba(34, 211, 238, .55);
	transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { color: #04121a; transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset, 0 14px 36px -8px rgba(139, 92, 246, .7); }
.btn--ghost { background: transparent; color: var(--text); box-shadow: 0 0 0 1px var(--line) inset; }
.btn--ghost:hover { color: var(--text); background: rgba(139, 92, 246, .12); box-shadow: 0 0 0 1px var(--violet) inset; }
.btn--small { padding: .65rem 1.1rem; font-size: .8rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero__bg {
	position: absolute; inset: 0; z-index: -1;
	background:
		radial-gradient(60% 50% at 20% 25%, rgba(34, 211, 238, .16), transparent 70%),
		radial-gradient(55% 55% at 82% 30%, rgba(139, 92, 246, .2), transparent 70%),
		linear-gradient(180deg, #07070f 0%, #0a0b1a 70%, var(--bg) 100%);
}
.hero__bg::after {
	content: ""; position: absolute; inset: 0;
	background-image:
		linear-gradient(rgba(148, 163, 255, .06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(148, 163, 255, .06) 1px, transparent 1px);
	background-size: 56px 56px;
	mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
	-webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}
.hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(2rem, 6vh, 4rem) 0 clamp(3.5rem, 8vh, 5.5rem); min-height: calc(100svh - var(--header-h)); justify-content: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .28em; font-size: .78rem; font-weight: 800; color: var(--cyan); margin: 0 0 .5rem; }
.hero__stage { position: relative; width: 100%; height: clamp(240px, 44vh, 460px); margin-bottom: 1rem; }
.hero__canvas { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease;
	-webkit-mask-image: radial-gradient(ellipse 75% 85% at 50% 50%, #000 55%, transparent 100%);
	mask-image: radial-gradient(ellipse 75% 85% at 50% 50%, #000 55%, transparent 100%); }
.hero__canvas.is-ready { opacity: 1; }
.hero__canvas canvas { width: 100% !important; height: 100% !important; }

/* Text fallback shown until the 3D scene is ready (or if WebGL is unavailable) */
.hero__wordmark {
	position: absolute; inset: 0; display: grid; place-items: center;
	font-weight: 900; letter-spacing: .08em; font-size: clamp(3rem, 15vw, 9rem); line-height: 1;
	background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
	filter: drop-shadow(0 0 28px rgba(34, 211, 238, .35));
	transition: opacity .6s ease;
}
.hero-3d-ready .hero__wordmark { opacity: 0; pointer-events: none; }

.hero__lead { max-width: 36rem; font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); margin-bottom: 1.6rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; justify-content: center; }

.scroll-cue { position: absolute; left: 50%; bottom: 1.2rem; width: 26px; height: 42px; margin-left: -13px; border: 2px solid var(--line); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--cyan); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
.section--alt { background: linear-gradient(180deg, var(--bg), var(--bg-2)); border-top: 1px solid var(--line); }
.section__head { margin-bottom: 2.2rem; }
.section__head h2 { font-size: clamp(1.8rem, 4.2vw, 2.8rem); font-weight: 900; margin: 0; }

/* ---------- Game cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.4rem; }
.game-card {
	display: flex; flex-direction: column; text-decoration: none; color: var(--text);
	background: linear-gradient(180deg, var(--surface-2), var(--surface));
	border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
	transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
a.game-card:hover { color: var(--text); transform: translateY(-6px); border-color: rgba(34, 211, 238, .6); box-shadow: 0 18px 50px -18px rgba(34, 211, 238, .45), 0 0 0 1px rgba(139, 92, 246, .35); }
.game-card__media { display: block; aspect-ratio: 16 / 10; background: radial-gradient(80% 90% at 30% 20%, rgba(34, 211, 238, .25), transparent 70%), radial-gradient(80% 90% at 80% 90%, rgba(139, 92, 246, .35), transparent 70%), #0c0e20; position: relative; overflow: hidden; }
.game-card__media img { width: 100%; height: 100%; object-fit: cover; }
.game-card__ph { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 4.5rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .9; }
.game-card__body { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.2rem 1.3rem; flex: 1; }
.game-card__title { font-weight: 800; font-size: 1.2rem; }
.game-card__text { color: var(--muted); font-size: .95rem; flex: 1; }
.game-card__cta { margin-top: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; color: var(--cyan); }
.game-card__cta i { font-style: normal; display: inline-block; transition: transform .2s; }
a.game-card:hover .game-card__cta i { transform: translateX(4px); }
.game-card--soon { opacity: .85; }
.game-card__cta--soon { color: var(--muted); }

/* ---------- Features ---------- */
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.feature h3 { font-size: 1.15rem; font-weight: 800; }
.feature p { color: var(--muted); margin: 0; }
.feature__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; margin-bottom: 1rem; font-weight: 900; font-size: 1.1rem; color: #04121a; background: var(--grad); box-shadow: 0 0 22px rgba(34, 211, 238, .35); }

/* ---------- Inner pages ---------- */
.page { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.page__head h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; }
.page--center { text-align: center; padding-block: 6rem; }
.prose { max-width: 46rem; margin-inline: auto; }
.prose h2, .prose h3 { margin-top: 2em; }
.prose img { border-radius: 12px; }
.meta { color: var(--muted); font-size: .9rem; }
.crumbs { margin-bottom: 1rem; font-weight: 700; }
.game { max-width: 1000px; margin-inline: auto; }
.game__stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-height: 320px; box-shadow: 0 30px 80px -40px rgba(139, 92, 246, .5); }
.game__stage iframe { width: 100%; border: 0; border-radius: 10px; }
.post-list { display: grid; gap: 1.2rem; }
.post-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.post-item h2 { font-size: 1.4rem; }
.post-item h2 a { color: var(--text); text-decoration: none; }
.post-item h2 a:hover { color: var(--cyan); }
.navigation.pagination { margin-top: 2rem; }
.nav-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.page-numbers { padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); }
.page-numbers.current { background: var(--grad); color: #04121a; border-color: transparent; font-weight: 800; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding-top: 2.5rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.site-footer__brand p { color: var(--muted); margin: .8rem 0 0; max-width: 24rem; }
.footer-nav .menu { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin: 0; padding: 0; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--text); }
.site-footer__legal { padding: 1.6rem 0 2rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
	.nav-toggle { display: inline-block; }
	.primary-nav {
		position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 1rem; padding: 1.2rem 1rem 1.5rem;
		background: rgba(7, 7, 15, .97); border-bottom: 1px solid var(--line);
		display: none;
	}
	.primary-nav.is-open { display: flex; }
	.primary-nav .menu { flex-direction: column; gap: .4rem; }
	.primary-nav .menu a { display: block; padding: .7rem 0; font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
