/* ============================================================================
   Players Best Studios — Landing Page (Version Fable)
   Concept: "The Drafting Table" — editorial calm, serif wordmark, blueprint motif.
   Palette from brand logo: ink #05070D · navy #0B2981 · sky #6CB1F2 · gold #F5B942
   ========================================================================== */

:root {
	--ink:        #05070D;
	--ink-2:      #080D18;
	--ink-3:      #0B1322;
	--navy:       #0B2981;
	--blue-mid:   #3C6DB9;
	--sky:        #6CB1F2;
	--gold:       #F5B942;
	--off:        #E8EEF6;
	--muted:      #93A6C4;
	--line:       rgba(108, 177, 242, 0.16);
	--line-soft:  rgba(108, 177, 242, 0.09);

	--font-serif: "Playfair Display", Georgia, serif;
	--font-body:  "Manrope", system-ui, -apple-system, sans-serif;
	--font-mono:  "IBM Plex Mono", ui-monospace, monospace;
	--font-pixel: "Press Start 2P", "IBM Plex Mono", monospace;

	--w-content:  1080px;
	--ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
}

/* self-hosted pixel display font — used on the word "pixel" + the drafting tag */
@font-face {
	font-family: "Press Start 2P";
	src: url("../fonts/FNT_PressStart2P-Regular.ttf") format("truetype");
	font-display: swap;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
	scroll-behavior: smooth;
	/* keep anchor targets clear of the sticky header (smooth scroll + tab focus) */
	scroll-padding-top: 5rem;
}

body {
	background: var(--ink);
	color: var(--off);
	font-family: var(--font-body);
	font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden; /* fallback */
	overflow-x: clip;   /* modern: clips without creating a scroll container (sticky-safe) */
}

/* skip-link target — suppress the ring on the container itself */
main:focus { outline: none; }

/* subtle paper grain over everything (pixel-craft nod, extremely low key) */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	opacity: 0.35;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.04 0 0 0 0 0.06 0 0 0 0 0.10 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }

a { color: var(--sky); text-decoration: none; }
a:hover { color: var(--off); }

strong { color: var(--off); font-weight: 700; }
em { font-style: italic; }
.muted { color: var(--muted); font-weight: 400; }

::selection { background: rgba(245, 185, 66, 0.35); color: var(--off); }

:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
	border-radius: 2px;
}

.visually-hidden {
	position: absolute; width: 1px; height: 1px;
	clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
	position: absolute; top: -48px; left: 16px; z-index: 100;
	background: var(--gold); color: var(--ink);
	padding: 10px 18px; font-weight: 700; border-radius: 0 0 6px 6px;
	transition: top 0.2s;
}
.skip-link:focus { top: 0; color: var(--ink); }

/* ---------- Shared typographic voices ---------- */
.eyebrow {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 1.4rem;
}

.section-title {
	font-family: var(--font-body);
	font-weight: 700;
	font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
	line-height: 1.08;
	letter-spacing: -0.02em;
	margin-bottom: 1.8rem;
}

.section-title-serif {
	font-family: var(--font-serif);
	font-weight: 600;
	letter-spacing: 0;
	font-size: clamp(2.6rem, 1.8rem + 3.4vw, 4.4rem);
	/* darkest rendered stop = blue-mid (3.9:1 on ink) — keeps WCAG large-text 3:1 */
	background: linear-gradient(115deg, #8CC4F8 0%, var(--sky) 45%, var(--blue-mid) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	padding-bottom: 0.08em; /* keep descenders inside the clip */
}

.lede {
	font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
	line-height: 1.65;
	color: var(--off);
}

.mono-label {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.18em;
	color: var(--gold);
	padding-right: 0.3em;
}

/* pixel display font accent on the literal word "pixel" */
.pixel {
	font-family: var(--font-pixel);
	font-size: 0.82em;
	letter-spacing: 0.02em;
	line-height: 1;
}

/* accent colour (brand signal gold) for emphasised words */
.accent { color: var(--gold); }

/* ---------- Header / nav ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--ink); /* solid fallback for browsers without color-mix */
	background: color-mix(in srgb, var(--ink) 82%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line-soft);
}

.nav {
	max-width: var(--w-content);
	margin: 0 auto;
	padding: 0.9rem 24px;
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.nav-brand { display: flex; align-items: baseline; gap: 0.55rem; color: var(--off); }
.nav-brand-main { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; }
.nav-brand-sub {
	font-family: var(--font-mono); font-size: 0.62rem;
	letter-spacing: 0.42em; text-transform: uppercase; color: var(--muted);
}

.nav-menu { display: flex; align-items: center; gap: 1.9rem; list-style: none; }
.nav-menu a {
	font-size: 0.92rem; font-weight: 600; color: var(--muted);
	transition: color 0.2s;
}
.nav-menu a:hover { color: var(--off); }

.nav-toggle {
	display: none;
	background: none; border: 1px solid var(--line);
	width: 42px; height: 38px; border-radius: 8px; cursor: pointer;
	flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--off); transition: transform 0.25s, opacity 0.25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
	position: relative;
	min-height: 88vh;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	text-align: center;
	padding: 6rem 24px 5rem;
	overflow: hidden;
}

/* the logo-gradient as a quiet light source behind the wordmark */
.hero-glow {
	position: absolute; inset: -20% -30%;
	background:
		radial-gradient(ellipse 60% 45% at 50% 42%, rgba(11, 41, 129, 0.55), transparent 65%),
		radial-gradient(ellipse 42% 30% at 50% 40%, rgba(60, 109, 185, 0.35), transparent 70%),
		radial-gradient(ellipse 26% 18% at 50% 38%, rgba(108, 177, 242, 0.22), transparent 75%);
	filter: saturate(1.05);
	animation: glow-breathe 9s ease-in-out infinite;
}

@keyframes glow-breathe {
	0%, 100% { opacity: 0.9; transform: scale(1); }
	50%      { opacity: 1;   transform: scale(1.03); }
}

.hero-rule {
	position: absolute; left: 50%; transform: translateX(-50%);
	width: min(560px, 70vw); height: 1px;
	background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.hero-rule-top    { top: clamp(84px, 12vh, 130px); }
.hero-rule-bottom { bottom: clamp(48px, 8vh, 90px); }

.hero-eyebrow { position: relative; }

.wordmark { position: relative; line-height: 1; margin: 0.6rem 0 2.2rem; }

.wordmark-main {
	display: block;
	font-family: var(--font-serif);
	font-weight: 600;
	/* lower bound tuned so "Players Best" fits a 320px viewport without clipping */
	font-size: clamp(2.5rem, 1.2rem + 6.5vw, 7.6rem);
	letter-spacing: 0.01em;
	/* darkest rendered stop = blue-mid (3.9:1 on ink) — WCAG large-text safe */
	background: linear-gradient(180deg, #8CC4F8 0%, var(--sky) 42%, var(--blue-mid) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	text-shadow: 0 0 80px rgba(108, 177, 242, 0.18);
	padding-bottom: 0.2em;
}

.wordmark-sub {
	display: block;
	margin-top: 1.6rem;
	font-family: var(--font-serif);
	font-weight: 500;
	font-size: clamp(0.95rem, 0.6rem + 1.8vw, 1.8rem);
	letter-spacing: 0.22em;      /* single tracking method (nbsp gaps carry the rest) */
	padding-left: 0.22em;        /* optically re-centre (compensates trailing tracking) */
	color: var(--off);
	opacity: 0.85;
}

/* graceful fallback where background-clip:text is unsupported — brand must never vanish */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
	.wordmark-main, .section-title-serif {
		background: none;
		color: var(--sky);
	}
}

.hero-tagline {
	font-size: clamp(1.05rem, 0.95rem + 0.7vw, 1.35rem);
	color: var(--muted);
	line-height: 1.75;
	margin-bottom: 2.6rem;
}
.hero-tagline em { color: var(--off); font-family: var(--font-serif); }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-bottom: 3rem; }

.hero-status {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	color: var(--muted);
}
.hero-status strong { color: var(--off); font-weight: 500; }

.status-dot {
	display: inline-block; width: 8px; height: 8px; border-radius: 50%;
	background: var(--gold);
	margin-right: 0.55em;
	box-shadow: 0 0 0 0 rgba(245, 185, 66, 0.5);
	animation: dot-pulse 2.4s ease-out infinite;
	vertical-align: 1px;
}
@keyframes dot-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(245, 185, 66, 0.45); }
	70%  { box-shadow: 0 0 0 9px rgba(245, 185, 66, 0); }
	100% { box-shadow: 0 0 0 0 rgba(245, 185, 66, 0); }
}

/* ---------- Buttons ---------- */
.btn {
	display: inline-block;
	font-weight: 700;
	font-size: 0.98rem;
	padding: 0.85rem 1.9rem;
	border-radius: 999px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform 0.18s var(--ease-out), box-shadow 0.25s, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-gold {
	background: linear-gradient(180deg, #FFD27A, var(--gold));
	color: #1A1104;
	box-shadow: 0 6px 26px rgba(245, 185, 66, 0.22);
}
.btn-gold:hover {
	color: #1A1104;
	transform: translateY(-2px);
	box-shadow: 0 10px 34px rgba(245, 185, 66, 0.32);
}

.btn-ghost {
	color: var(--off);
	border-color: var(--line);
	background: rgba(108, 177, 242, 0.05);
}
.btn-ghost:hover { border-color: var(--sky); color: var(--off); background: rgba(108, 177, 242, 0.1); }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(5rem, 10vw, 8.5rem) 24px; }
.section-inner { max-width: var(--w-content); margin: 0 auto; }

.section + .section::before {
	content: "";
	position: absolute; top: 0; left: 50%; transform: translateX(-50%);
	width: min(var(--w-content), calc(100% - 48px)); height: 1px;
	background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* ---------- Studio ---------- */
.studio-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 4.5rem);
	align-items: start;
}

.studio-copy p + p { margin-top: 1.2rem; color: var(--muted); }

.studio-facts { list-style: none; display: grid; gap: 1.4rem; }
.studio-facts li {
	display: flex; gap: 1.2rem; align-items: flex-start;
	padding: 1.2rem 1.4rem;
	background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
	border: 1px solid var(--line-soft);
	border-radius: 14px;
}
.fact-num {
	font-family: var(--font-serif);
	font-size: 2rem; line-height: 1;
	color: var(--sky);
	min-width: 1.6em; text-align: center;
}
.studio-facts h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.studio-facts p { font-size: 0.92rem; color: var(--muted); line-height: 1.55; }

/* Two-column desktop: lift the card stack so its content lines up optically
   with the left copy (the card's inner padding otherwise sits ~1 line lower). */
@media (min-width: 861px) {
	.studio-facts { margin-top: -1.2rem; }
}

/* ---------- Game ---------- */
.section-game {
	background:
		radial-gradient(ellipse 70% 50% at 50% 0%, rgba(11, 41, 129, 0.18), transparent 70%);
}

.game-pitch {
	max-width: 46rem;
	font-size: clamp(1.08rem, 1rem + 0.5vw, 1.28rem);
	color: var(--muted);
	margin-bottom: 3.2rem;
}
.game-pitch strong { color: var(--off); }

/* Blueprint */
.blueprint { margin: 0 0 3.4rem; }

.blueprint-frame {
	position: relative;
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: clamp(1.8rem, 4vw, 3rem);
	background:
		linear-gradient(rgba(108, 177, 242, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(108, 177, 242, 0.05) 1px, transparent 1px),
		linear-gradient(180deg, rgba(11, 41, 129, 0.16), rgba(5, 7, 13, 0.4)),
		var(--ink-2);
	background-size: 22px 22px, 22px 22px, 100% 100%, 100% 100%;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(108, 177, 242, 0.08);
}
.blueprint-frame::after { /* corner ticks, drafting-table feel */
	content: "";
	position: absolute; inset: 10px;
	pointer-events: none;
	background:
		linear-gradient(var(--sky), var(--sky)) top left    / 14px 1px,
		linear-gradient(var(--sky), var(--sky)) top left    / 1px 14px,
		linear-gradient(var(--sky), var(--sky)) top right   / 14px 1px,
		linear-gradient(var(--sky), var(--sky)) top right   / 1px 14px,
		linear-gradient(var(--sky), var(--sky)) bottom left / 14px 1px,
		linear-gradient(var(--sky), var(--sky)) bottom left / 1px 14px,
		linear-gradient(var(--sky), var(--sky)) bottom right/ 14px 1px,
		linear-gradient(var(--sky), var(--sky)) bottom right/ 1px 14px;
	background-repeat: no-repeat;
	opacity: 0.5;
}

/* isometric pixel-art field — the real 64x64 hand-drawn tile, magnified crisp */
.isofield {
	position: relative;
	width: min(520px, 100%);
	aspect-ratio: 3 / 2;          /* 192 : 128 iso-grid footprint (tile top face 64x32) */
	margin: 0 auto;
	filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.45));
}
.iso-tile {
	position: absolute;
	width: 33.333%;               /* one 64px tile across the 192px-wide grid */
	height: auto;
	image-rendering: crisp-edges;  /* Firefox */
	image-rendering: pixelated;    /* Chromium/Safari — true nearest-neighbour magnify */
	transition: transform 0.25s var(--ease-out);
}
/* only the selected tile lifts; it settles back down when another is chosen */
.iso-tile.is-selected {
	transform: translateY(-16px);
	filter: drop-shadow(0 12px 8px rgba(0, 0, 0, 0.45));
}
/* gold "targeted cell" diamond over the front tile — a quiet tactics nod */
.iso-target {
	position: absolute;
	left: 33.333%; top: 50%;
	width: 33.333%; height: auto;
	pointer-events: none;
	image-rendering: crisp-edges;  /* Firefox */
	image-rendering: pixelated;    /* Chromium/Safari — pixel-perfect frame */
	transform: translateY(-16px);  /* rides with the lifted selected tile */
	animation: iso-pulse 2.6s ease-in-out infinite;
	transition: left 0.18s var(--ease-out), top 0.18s var(--ease-out);
}
@keyframes iso-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* drafting tag in the pixel display font */
.iso-tag {
	position: absolute;
	left: clamp(1.8rem, 4vw, 3rem);
	bottom: clamp(1rem, 2.5vw, 1.6rem);
	font-family: var(--font-pixel);
	font-size: 0.5rem;
	letter-spacing: 0.05em;
	color: var(--muted);
	opacity: 0.8;
}

/* feature line under the iso field */
.iso-spec {
	margin: 1rem auto 0;
	text-align: center;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	letter-spacing: 0.03em;
	color: var(--muted);
}

.blueprint-caption {
	margin-top: 0.9rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	color: var(--muted);
	text-align: right;
}
.blueprint-caption strong { color: var(--gold); font-weight: 500; }

/* Features */
.features {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.4rem;
	margin-bottom: 3rem;
}
.feature {
	padding: 1.7rem 1.6rem;
	border: 1px solid var(--line-soft);
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(11, 19, 34, 0.7), rgba(8, 13, 24, 0.7));
	transition: transform 0.25s var(--ease-out), border-color 0.25s;
}
.feature:hover { transform: translateY(-4px); border-color: var(--line); }
.feature h3 { font-size: 1.05rem; margin-bottom: 0.7rem; line-height: 1.4; }
.feature p { font-size: 0.94rem; color: var(--muted); line-height: 1.6; }

.feature-index {
	font-family: var(--font-serif);
	color: var(--sky);
	padding-right: 0.45em;
}

.game-status {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--muted);
	letter-spacing: 0.04em;
	line-height: 2;
}

/* ---------- Promise ---------- */
.promise-panel {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: clamp(1.6rem, 4vw, 3.5rem);
	align-items: center;
	padding: clamp(1.8rem, 4vw, 3.2rem);
	border-radius: 20px;
	border: 1px solid rgba(245, 185, 66, 0.22);
	background:
		radial-gradient(ellipse 60% 80% at 12% 50%, rgba(245, 185, 66, 0.07), transparent 60%),
		linear-gradient(180deg, var(--ink-3), var(--ink-2));
}

.promise-seal { width: clamp(110px, 16vw, 150px); }
.seal-svg { width: 100%; height: auto; animation: seal-turn 40s linear infinite; transform-origin: 50% 50%; }
@keyframes seal-turn { to { transform: rotate(360deg); } }
/* only the dashed ring should feel like it turns — text stays upright */
.seal-svg text { animation: seal-counter 40s linear infinite; transform-origin: 50% 50%; }
@keyframes seal-counter { to { transform: rotate(-360deg); } }

.promise-copy .lede { margin-bottom: 1.1rem; }
.promise-copy p:last-child { color: var(--muted); }

.promise-zero {
	display: inline-block;
	font-family: var(--font-serif);
	font-size: 1.9em;
	line-height: 0;
	color: var(--gold);
	padding-left: 0.15em;
	vertical-align: -0.12em;
}

/* prominent PayPal support button in the Promise block */
.promise-donate { margin-top: 1.7rem; }

/* ---------- Footer ---------- */
.site-footer {
	border-top: 1px solid var(--line-soft);
	padding: 3rem 24px 3.4rem;
	text-align: center;
	background: linear-gradient(180deg, transparent, rgba(11, 41, 129, 0.08));
}
.footer-brand { font-family: var(--font-serif); font-size: 1.3rem; margin-bottom: 0.5rem; }
.footer-brand span {
	font-family: var(--font-mono); font-size: 0.6rem;
	letter-spacing: 0.42em; text-transform: uppercase; color: var(--muted);
	padding-left: 0.5rem;
}
.footer-line { color: var(--muted); font-size: 0.92rem; }
.footer-small { margin-top: 0.6rem; font-size: 0.78rem; color: var(--muted); }

/* PayPal support button in the footer */
.footer-support { margin-top: 1.4rem; }

/* ---------- Reveal-on-scroll ----------
   Gated on html.js: content is fully visible without JavaScript (progressive enhancement). */
.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.is-visible {
	opacity: 1; transform: none;
	transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
	.studio-grid { grid-template-columns: 1fr; }
	.features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.promise-panel { grid-template-columns: 1fr; text-align: center; }
	.promise-seal { margin: 0 auto; }
}

@media (max-width: 600px) {
	.features { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
	.nav-toggle { display: flex; }
	.nav-menu {
		position: absolute; top: 100%; left: 0; right: 0;
		flex-direction: column; align-items: flex-start; gap: 0;
		background: var(--ink-2);
		border-bottom: 1px solid var(--line-soft);
		max-height: 0; overflow: hidden;
		visibility: hidden; /* closed menu: links leave tab order / AT tree */
		transition: max-height 0.3s var(--ease-out), visibility 0s linear 0.3s;
	}
	.nav-menu.is-open {
		max-height: 320px;
		visibility: visible;
		transition: max-height 0.3s var(--ease-out), visibility 0s;
	}
	.nav-menu li { width: 100%; }
	.nav-menu a { display: block; padding: 1rem 24px; width: 100%; }

	.hero { min-height: 76vh; }
	.blueprint-caption { text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.hero-glow, .status-dot, .seal-svg, .seal-svg text, .iso-target { animation: none; }
	.js .reveal { opacity: 1; transform: none; transition: none; }
	.iso-tile, .iso-target { transition: none; }
	.iso-tile.is-selected, .iso-target { transform: none; }
	.btn, .feature { transition: none; }
	.nav-menu, .nav-menu.is-open { transition: none; }
}
