/*
Theme Name: Codypie Portfolio
Theme URI: https://example.com/
Author: Rashid Mumtaz
Description: Game developer portfolio theme. Games are a "Games" post type, all texts/contacts live in Appearance > Customize > Portfolio Settings, contact form messages are saved under "Messages".
Version: 1.0.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: codypie
*/

/* ---------- Design tokens ---------- */
:root {
	--bg: #0b0d1a;
	--bg-2: #11142a;
	--card: #161a36;
	--card-2: #1d2246;
	--line: rgba(255, 255, 255, 0.08);
	--text: #eef0ff;
	--muted: #a3a8cc;
	--brand: #7c5cff;
	--brand-2: #22d3ee;
	--accent: #ffb547;
	--ok: #34d399;
	--radius: 18px;
	--radius-sm: 12px;
	--shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
	--max: 1180px;
	--grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
	--font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Fredoka", var(--font);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 0.5em; font-weight: 600; letter-spacing: 0.2px; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 14px 26px; border-radius: 999px; border: 0;
	font: 700 15px/1 var(--font); cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px rgba(124, 92, 255, 0.45); }
.btn-primary:hover { color: #fff; box-shadow: 0 14px 38px rgba(34, 211, 238, 0.45); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.appstore-badge {
	display: inline-flex; align-items: center; gap: 8px;
	background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 10px; padding: 7px 14px 7px 11px; font-size: 12px; line-height: 1.1;
	transition: border-color .2s ease, transform .2s ease;
}
.appstore-badge svg { width: 22px; height: 22px; fill: #fff; flex: none; }
.appstore-badge small { display: block; font-size: 10px; opacity: .8; }
.appstore-badge strong { font-size: 15px; font-weight: 600; }
.appstore-badge:hover { color: #fff; border-color: var(--brand-2); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
	position: fixed; inset: 0 0 auto 0; z-index: 50;
	background: rgba(11, 13, 26, 0.72);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font: 600 22px/1 var(--font-display); }
.brand-mark {
	width: 38px; height: 38px; border-radius: 11px; background: var(--grad);
	display: grid; place-items: center; font-size: 20px; box-shadow: 0 6px 20px rgba(124, 92, 255, .5);
}
.brand:hover { color: #fff; }
.main-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.main-nav a { color: var(--muted); font-weight: 600; font-size: 15px; padding: 10px 14px; border-radius: 999px; }
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.header-cta { padding: 11px 20px; font-size: 14px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: #fff; border-radius: 10px; width: 44px; height: 44px; cursor: pointer; font-size: 20px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 150px 0 90px; overflow: hidden; }
.hero::before,
.hero::after {
	content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; z-index: -1;
}
.hero::before { width: 520px; height: 520px; background: #5b3dff; top: -160px; left: -140px; }
.hero::after { width: 460px; height: 460px; background: #0ea5c6; bottom: -200px; right: -120px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 50px; align-items: center; }
.eyebrow {
	display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
	background: rgba(124, 92, 255, 0.14); border: 1px solid rgba(124, 92, 255, 0.35);
	color: #cfc4ff; font-weight: 700; font-size: 13px; letter-spacing: .6px; text-transform: uppercase;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); }
.hero h1 { font-size: clamp(40px, 6vw, 68px); margin: 20px 0 18px; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.hero-showcase { position: relative; height: 470px; }
.hero-phone {
	position: absolute; width: 230px; border-radius: 34px; overflow: hidden;
	border: 8px solid #1b1f3e; box-shadow: var(--shadow); background: #1b1f3e;
}
.hero-phone img { width: 100%; aspect-ratio: 9 / 19.5; object-fit: cover; }
.hero-phone.p1 { left: 8%; top: 30px; transform: rotate(-8deg); animation: float 6s ease-in-out infinite; }
.hero-phone.p2 { right: 8%; top: 0; transform: rotate(7deg); animation: float 6s ease-in-out -3s infinite; }
.hero-icon {
	position: absolute; width: 84px; height: 84px; border-radius: 22px; overflow: hidden;
	box-shadow: 0 14px 30px rgba(0, 0, 0, .5); border: 3px solid rgba(255, 255, 255, .12);
	animation: float 5s ease-in-out infinite;
}
.hero-icon.i1 { left: 0; bottom: 30px; animation-delay: -1s; }
.hero-icon.i2 { right: 0; bottom: 70px; animation-delay: -2s; }
.hero-icon.i3 { left: 44%; bottom: -6px; animation-delay: -4s; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }

/* ---------- Stats ---------- */
.stats { padding: 10px 0 40px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 22px; text-align: center;
}
.stat strong { display: block; font: 600 clamp(26px, 3.2vw, 38px)/1.15 var(--font-display); white-space: nowrap; }
.stat span { color: var(--muted); font-size: 14px; }

/* ---------- Sections ---------- */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 50px; }
.section-head .kicker { color: var(--brand-2); font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; font-size: 13px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); margin-top: 10px; }
.section-head p { color: var(--muted); font-size: 17px; }

/* ---------- Games ---------- */
.game-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 34px; }
.game-filters button {
	background: rgba(255, 255, 255, .05); color: var(--muted); border: 1px solid var(--line);
	padding: 9px 18px; border-radius: 999px; cursor: pointer; font: 600 14px var(--font);
}
.game-filters button.active,
.game-filters button:hover { background: var(--grad); color: #fff; border-color: transparent; }
.games-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.game-card {
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
	overflow: hidden; display: flex; flex-direction: column;
	transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.game-card:hover { transform: translateY(-6px); border-color: rgba(124, 92, 255, .55); box-shadow: var(--shadow); }
.game-card.is-hidden { display: none; }
.game-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--card-2); }
.game-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .5s ease; }
.game-card:hover .game-cover img { transform: scale(1.06); }
.game-cover .tag {
	position: absolute; top: 12px; left: 12px; background: rgba(0, 0, 0, .6); color: #fff;
	font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; backdrop-filter: blur(6px);
}
.game-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.game-title { display: flex; gap: 14px; align-items: center; }
.game-title img { width: 58px; height: 58px; border-radius: 15px; flex: none; }
.game-title h3 { font-size: 19px; margin: 0; }
.game-title h3 a { color: #fff; }
.game-title .meta { color: var(--muted); font-size: 13px; }
.game-body p { color: var(--muted); font-size: 14.5px; margin: 0; flex: 1; }
.game-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.game-actions .more { font-weight: 700; font-size: 14px; }
.stars { color: var(--accent); letter-spacing: 1px; font-size: 13px; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service {
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
	transition: border-color .25s ease, transform .25s ease;
}
.service:hover { border-color: rgba(34, 211, 238, .5); transform: translateY(-4px); }
.service .ico {
	width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; font-size: 26px;
	background: rgba(124, 92, 255, .16); margin-bottom: 18px;
}
.service h3 { font-size: 20px; }
.service p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.about-photo { position: relative; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.about-photo img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; }
.about-badge {
	position: absolute; left: 18px; bottom: 18px; right: 18px; background: rgba(11, 13, 26, .82);
	backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px;
	display: flex; align-items: center; gap: 12px; font-weight: 700;
}
.about-text h2 { font-size: clamp(30px, 4vw, 42px); }
.about-text p { color: var(--muted); }
.skills { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 28px; }
.skills span {
	background: rgba(255, 255, 255, .05); border: 1px solid var(--line); padding: 8px 14px;
	border-radius: 999px; font-size: 14px; font-weight: 600;
}

/* ---------- Process ---------- */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; }
.step::before {
	counter-increment: step; content: "0" counter(step);
	font: 600 40px/1 var(--font-display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
	display: block; margin-bottom: 12px;
}
.step h3 { font-size: 18px; }
.step p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 30px; }
.contact-info, .contact-form-wrap {
	background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 34px;
}
.contact-info h3 { font-size: 24px; }
.contact-info > p { color: var(--muted); }
.contact-list { list-style: none; padding: 0; margin: 26px 0; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 14px; align-items: center; }
.contact-list .ci {
	width: 46px; height: 46px; border-radius: 13px; background: rgba(34, 211, 238, .12);
	display: grid; place-items: center; font-size: 20px; flex: none;
}
.contact-list small { display: block; color: var(--muted); font-size: 12.5px; }
.contact-list a, .contact-list span.v { color: #fff; font-weight: 700; word-break: break-word; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.socials a {
	padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
	font-weight: 600; font-size: 14px; background: rgba(255, 255, 255, .04);
}
.socials a:hover { color: #fff; border-color: var(--brand); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; }
.field input, .field select, .field textarea {
	width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
	border-radius: var(--radius-sm); padding: 14px 16px; font: 500 15px var(--font); outline: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124, 92, 255, .2); }
.hp-field { position: absolute; left: -9999px; }
.form-note { color: var(--muted); font-size: 13px; margin-top: 12px; }
.form-alert { border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 18px; font-weight: 600; }
.form-alert.ok { background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .4); color: #a7f3d0; }
.form-alert.err { background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .4); color: #fecaca; }

/* ---------- CTA band + Footer ---------- */
.cta-band {
	margin: 0 auto; border-radius: 28px; padding: 50px; text-align: center;
	background: linear-gradient(135deg, rgba(124, 92, 255, .35), rgba(34, 211, 238, .25)), var(--card);
	border: 1px solid rgba(124, 92, 255, .4);
}
.cta-band h2 { font-size: clamp(28px, 4vw, 40px); }
.cta-band p { color: #d6d9f5; }
.site-footer { padding: 40px 0 34px; border-top: 1px solid var(--line); margin-top: 20px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.site-footer p { color: var(--muted); margin: 0; font-size: 14px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 14px; font-weight: 600; }
.footer-links a:hover { color: #fff; }

/* ---------- Single game ---------- */
.game-hero { padding: 140px 0 50px; }
.game-hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; }
.game-hero-grid > img { width: 150px; height: 150px; border-radius: 34px; box-shadow: var(--shadow); }
.game-hero h1 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 10px; }
.game-hero .meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.shots { display: flex; gap: 18px; overflow-x: auto; padding: 10px 0 24px; scroll-snap-type: x mandatory; }
.shots img { height: 520px; width: auto; border-radius: 22px; border: 1px solid var(--line); scroll-snap-align: start; }
.game-content { max-width: 820px; color: #d6d9f5; font-size: 17px; }
.back-link { display: inline-block; margin-bottom: 20px; font-weight: 700; }

/* ---------- Generic page ---------- */
.page-wrap { padding: 140px 0 40px; }
.page-wrap .entry { max-width: 820px; color: #d6d9f5; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.reveal { opacity: 1; transform: none; }
	* { animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.games-grid, .services-grid { grid-template-columns: repeat(2, 1fr); }
	.process-grid { grid-template-columns: repeat(2, 1fr); }
	.hero-grid { grid-template-columns: 1fr; }
	.hero-showcase { height: 430px; max-width: 520px; margin: 0 auto; width: 100%; }
}
@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.main-nav {
		position: absolute; top: 72px; left: 0; right: 0; background: var(--bg-2);
		border-bottom: 1px solid var(--line); display: none; padding: 12px 20px 20px;
	}
	.main-nav.open { display: block; }
	.main-nav ul { flex-direction: column; }
	.header-cta { display: none; }
	.about-grid, .contact-grid { grid-template-columns: 1fr; }
	.stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.container { padding: 0 16px; }
	.games-grid, .services-grid, .process-grid, .form-row { grid-template-columns: 1fr; }
	.hero { padding: 120px 0 60px; }
	.hero-showcase { height: 360px; }
	.hero-phone { width: 165px; border-width: 6px; border-radius: 26px; }
	.hero-icon { width: 64px; height: 64px; border-radius: 17px; }
	.section { padding: 70px 0; }
	.contact-info, .contact-form-wrap, .cta-band { padding: 24px; }
	.game-hero-grid { grid-template-columns: 1fr; }
	.game-hero-grid > img { width: 110px; height: 110px; border-radius: 26px; }
	.shots img { height: 400px; }
}
