/*
Theme Name: Craig Pennings
Theme URI: https://craigpennings.com
Author: Craig Pennings LLC
Description: Level-up game homepage for Six Figure Freelancing.
Version: 1.0.3
Requires at least: 6.0
Requires PHP: 7.4
License: All rights reserved
Text Domain: craig-pennings
*/

:root {
  --k0: #0B0A08; --k05: #100F0C; --k1: #12110D; --ink: #15140F; --k2: #1E1D17; --k3: #2A2820;
  --ld: #2E2C24; --k4: #3A382F; --md: #5B584F; --mu: #8F8A7C; --so: #B8B3A5; --s2: #D6D2C6;
  --pa: #F3F0E8; --p2: #E8E3D7; --ll: #CFC9BB; --dl: #B0AA9B; --bo: #4A473F; --de: #B23A0A;
  --accent: #FF7A3D; --gold: #FFC83D;
  --pixel: 'Press Start 2P', monospace;
  --display: 'Space Grotesk', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--pa); color: var(--ink); font-family: Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--ink); }
a:hover { color: var(--de); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Animations */
@keyframes cpblink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }
@keyframes cppop { 0% { transform: translate(-50%, 8px) scale(.8); opacity: 0 } 15% { transform: translate(-50%, 0) scale(1.06); opacity: 1 } 25% { transform: translate(-50%, 0) scale(1) } 85% { opacity: 1 } 100% { opacity: 0; transform: translate(-50%, -6px) } }
@keyframes cpbob { 0%, 49% { transform: translateY(0) } 50%, 100% { transform: translateY(-5px) } }
@keyframes cphop { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-14px) } }
@keyframes cpdrift { 0% { transform: translateX(-24px) } 100% { transform: translateX(24px) } }
.cp-blink { animation: cpblink 1s steps(1) infinite; }
.cp-pop { animation: cppop 2.2s ease-out forwards; }
.cp-bob { animation: cpbob 1s steps(1) infinite; }
.cp-hop { animation: cphop .38s ease-in-out infinite; }
.cp-drift { animation: cpdrift 20s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cp-blink, .cp-pop, .cp-bob, .cp-hop, .cp-drift { animation: none; }
}

/* Pixel sprites drawn with box-shadow (sized by game.js) */
.pix-box { position: relative; display: block; flex: 0 0 auto; }
.pix { position: absolute; }

/* Layout helpers */
.wrap { max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.eyebrow-pixel { font-family: var(--pixel); }
.h-section { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.02; letter-spacing: -0.025em; }
.btn { display: inline-block; text-decoration: none; font-weight: 600; padding: 16px 24px; border-radius: 999px; }
.btn-accent { background: var(--accent); color: var(--k0); }
.btn-accent:hover { color: var(--k0); filter: brightness(1.06); }
.btn-ghost { border: 1px solid var(--md); background: rgba(11, 10, 8, 0.6); color: var(--pa); font-weight: 500; padding: 15px 24px; }
.btn-ghost:hover { color: #fff; }
.btn-dark { background: var(--k1); color: var(--pa); padding: 16px 28px; font-size: 16px; }
.btn-dark:hover { color: #fff; }

/* Nav */
.nav { padding: 24px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.nav-brand { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--pa); text-decoration: none; }
.nav-brand:hover { color: #fff; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; font-size: 15px; }
.nav-links a.nav-link { color: var(--s2); text-decoration: none; padding: 12px 0; }
.nav-links a.nav-link:hover { color: #fff; }
.nav-links .btn { padding: 12px 18px; }

/* Hero */
.hero { position: relative; min-height: 820px; background: var(--k0); color: var(--pa); overflow: hidden; }
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-inner { position: relative; z-index: 1; padding-bottom: 56px; pointer-events: none; }
.hero-inner a, .hero-inner button, .hero-panel { pointer-events: auto; }
.hero-grid { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-top: 24px; }
.hero-copy { flex: 1 1 400px; min-width: 0; }
.hero-eyebrow { margin: 0 0 24px; display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 12px; line-height: 1; color: var(--accent); }
.hero-caret { display: block; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid var(--accent); }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(44px, 5.4vw, 76px); line-height: 1.02; letter-spacing: -0.03em; }
.hero-sub { margin: 24px 0 0; font-size: 19px; line-height: 1.55; color: var(--s2); max-width: 500px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-panel { flex: 1 1 460px; min-width: 0; max-width: 560px; position: relative; }

/* Game panels */
.panel { background: #15140F; border: 3px solid var(--k4); box-shadow: 6px 6px 0 #000; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.panel[hidden] { display: none; }
.px-label { font-family: var(--pixel); }
.char-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; }
.char-btn { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 4px 8px; min-height: 150px; cursor: pointer; background: var(--k05); border: 3px solid var(--ld); color: var(--pa); }
.char-btn:hover, .char-btn.is-hover { border-color: var(--mu); }
.char-btn.is-on { background: var(--k2); border-color: var(--accent); box-shadow: 3px 3px 0 #000; }
.char-arrow { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 10px; line-height: 1; color: var(--accent); visibility: hidden; }
.char-btn.is-hover .char-arrow, .char-btn.is-on .char-arrow, .char-btn:hover .char-arrow { visibility: visible; }
.char-sprite { position: relative; display: block; width: 60px; height: 90px; }
.char-plat { display: block; width: 52px; height: 6px; margin-top: 2px; background: var(--ld); }
.char-btn.is-on .char-plat { background: var(--accent); opacity: .6; }
.char-tag { margin-top: 8px; font-family: var(--pixel); font-size: 8px; color: transparent; }
.char-btn.is-on .char-tag { color: var(--accent); }
.btn-start { height: 52px; padding: 0 22px; border: 3px solid var(--k0); background: var(--accent); color: var(--k0); font-family: var(--pixel); font-size: 12px; cursor: pointer; box-shadow: 4px 4px 0 #000; }
.panel-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border-top: 2px dashed var(--ld); padding-top: 16px; }
.avatar-box { flex: 0 0 auto; background: var(--k2); border: 3px solid var(--ld); padding: 8px 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.avatar-box canvas { width: 108px; height: 162px; display: block; image-rendering: pixelated; }
.btn-change { min-height: 28px; padding: 4px 8px; border: none; background: transparent; color: var(--mu); font-family: var(--pixel); font-size: 7px; cursor: pointer; text-decoration: underline; }
.xpbar { height: 14px; background: var(--k0); border: 2px solid var(--k4); padding: 2px; }
.xpbar > div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 8px, var(--k0) 8px 10px); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.stat-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.stat-bar { height: 8px; background: var(--k0); border: 2px solid var(--ld); }
.stat-bar > div { height: 100%; width: 2%; }
.loot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.loot a { display: flex; flex-direction: column; gap: 8px; min-height: 92px; padding: 10px; text-decoration: none; color: var(--mu); background: var(--k05); border: 2px dashed var(--k4); }
.loot a.is-open { color: var(--pa); background: var(--k2); border: 2px solid var(--accent); }
.btn-action { height: 44px; padding: 0 16px; border: 2px solid var(--accent); background: transparent; color: var(--accent); font-family: var(--pixel); font-size: 10px; cursor: pointer; box-shadow: 3px 3px 0 #000; }
.banner-wrap { position: absolute; left: 50%; top: -22px; z-index: 2; pointer-events: none; }
.banner { transform: translate(-50%, 0); white-space: nowrap; background: var(--accent); color: var(--k0); border: 3px solid var(--k0); box-shadow: 4px 4px 0 #000; padding: 12px 16px; font-family: var(--pixel); font-size: 11px; }
.banner[hidden] { display: none; }

/* Stage map */
.stage-wrap { position: relative; overflow: hidden; }
.stage-wrap > .cp-drift { position: absolute; }
.cp-map { display: grid; grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr) 72px minmax(170px, 210px); align-items: stretch; }
.cp-link { align-self: center; height: 0; border-top: 6px dotted var(--de); margin: 0 14px; }
@media (max-width: 960px) {
  .cp-map { grid-template-columns: minmax(0, 1fr); }
  .cp-link { justify-self: center; width: 0; height: 44px; border-top: none; border-left: 6px dotted var(--de); margin: 10px 0; }
}

/* Inner pages (privacy policy etc.) */
.page-top { background: var(--k0); }
.page-body { max-width: 760px; margin: 0 auto; padding: 64px 24px 96px; font-size: 17px; line-height: 1.7; color: var(--bo); }
.page-body h1 { font-family: var(--display); font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.025em; color: var(--ink); margin: 0 0 32px; }
.page-body h2 { font-family: var(--display); font-size: 26px; line-height: 1.2; color: var(--ink); margin: 48px 0 12px; }
.page-body h3 { font-family: var(--display); font-size: 20px; color: var(--ink); margin: 32px 0 8px; }
.page-body table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.page-body th, .page-body td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ll); vertical-align: top; }
.page-body th { color: var(--ink); }
.page-body a { color: var(--de); }

/* Footer */
.site-footer { border-top: 1px solid var(--ll); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--bo); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }

/* Arcade "insert coin" prompt */
@keyframes cppulse { 0%, 55% { opacity: 1 } 75% { opacity: .2 } 100% { opacity: 1 } }
.cp-blink-slow { animation: cppulse 2.4s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .cp-blink-slow { animation: none; } }

/* Blog */
.post-body { max-width: 720px; margin: 0 auto; padding: 64px 24px 96px; }
.post-head h1 { margin: 12px 0 0; font-family: var(--display); font-weight: 700; font-size: clamp(40px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.03em; color: var(--ink); }
.post-dek { margin: 18px 0 0; font-size: 21px; line-height: 1.5; color: var(--bo); }
.post-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; color: var(--mu); }
.post-cat { font-size: 9px; color: var(--de); }
.post-hero { margin: 40px 0 0; }
.post-hero img { display: block; width: 100%; height: auto; border-radius: 20px; }
.post-content { margin-top: 40px; font-size: 19px; line-height: 1.75; color: #2A2820; }
.post-content > * { margin: 0 0 1.2em; }
.post-content h2 { margin: 2em 0 .6em; font-family: var(--display); font-size: 30px; line-height: 1.15; letter-spacing: -0.015em; color: var(--ink); }
.post-content h3 { margin: 1.6em 0 .5em; font-family: var(--display); font-size: 23px; line-height: 1.25; color: var(--ink); }
.post-content ul, .post-content ol { padding-left: 1.3em; }
.post-content li { margin: 0 0 .5em; }
.post-content a { color: var(--de); }
.post-content blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--accent); font-family: var(--display); font-size: 23px; line-height: 1.45; color: var(--ink); }
.post-content img { border-radius: 14px; }
.post-content hr { border: 0; border-top: 2px dashed var(--ll); margin: 2.4em 0; }
.post-cta { margin: 56px 0 0; padding: 32px; background: var(--k2); color: var(--pa); border: 3px solid var(--accent); box-shadow: 6px 6px 0 #000; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.post-cta p { margin: 0; color: var(--s2); line-height: 1.6; }
.post-cta .post-cta-title { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; color: var(--pa); }
.post-back { margin: 40px 0 0; font-weight: 600; }
.post-back a { color: var(--ink); text-decoration: none; }
.post-list { display: flex; flex-direction: column; gap: 20px; margin-top: 40px; }
.post-card { padding: 28px; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.post-card h2 { margin: 12px 0 10px; font-size: 28px; line-height: 1.15; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--de); }
.post-card p { margin: 0 0 14px; }
.post-card .post-meta { margin: 0; }
.post-card-more { font-weight: 600; color: var(--ink); text-decoration: none; }

/* Designed long-form posts */
.xp-progress { position: fixed; left: 0; right: 0; top: 0; height: 8px; background: var(--k0); z-index: 50; }
.admin-bar .xp-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .xp-progress { top: 46px; } }
.xp-progress > div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 10px, var(--gold) 10px 12px); }
.post-content .post-lede { font-size: 22px; line-height: 1.6; color: var(--ink); }
.post-lede::first-letter { font-family: var(--pixel); font-size: 40px; float: left; line-height: 1; margin: 8px 12px 0 0; color: var(--de); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 1.6em 0 2em !important; }
.stat-card { background: var(--k1); color: var(--pa); padding: 18px 18px 20px; border: 3px solid var(--k0); box-shadow: 4px 4px 0 var(--accent); display: flex; flex-direction: column; gap: 10px; }
.stat-num { font-family: var(--pixel); font-size: 20px; line-height: 1.2; color: var(--gold); }
.stat-txt { font-size: 15px; line-height: 1.45; color: var(--s2); }
.level-select { margin: 2.4em 0 !important; padding: 24px; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.level-select > p { margin: 0 0 12px; font-family: var(--pixel); font-size: 11px; color: var(--de); }
.level-select ol { list-style: none; margin: 0; padding: 0; }
.level-select li { margin: 0; }
.level-select a { display: flex; gap: 14px; align-items: baseline; padding: 10px 0; text-decoration: none; color: var(--ink) !important; font-weight: 600; font-size: 17px; border-bottom: 1px dashed var(--ll); }
.level-select li:last-child a { border-bottom: 0; }
.level-select a span { flex: 0 0 104px; font-family: var(--pixel); font-size: 9px; color: var(--mu); }
.level-select a:hover { color: var(--de) !important; }
.lvl-section { scroll-margin-top: 90px; }
.post-content .lvl-head { margin: 3.2em 0 1.2em; padding-top: 28px; border-top: 3px solid var(--ink); display: flex; align-items: center; gap: 18px; }
.lvl-head h2 { margin: 0 !important; }
.lvl-tag { display: block; font-family: var(--pixel); font-size: 10px; color: var(--de); margin-bottom: 10px; }
.post-content .pullquote { margin: 2em 0; padding: 28px 28px 28px 32px; background: var(--k2); color: var(--pa); font-family: var(--display); font-size: clamp(24px, 3vw, 32px); line-height: 1.25; letter-spacing: -0.01em; border-left: 8px solid var(--accent); }
.card-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 1.6em 0 !important; }
.post-content .list-card, .post-content .tip-card { background: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 20px 22px; margin: 1.6em 0; }
.card-pair .list-card { margin: 0 !important; }
.list-card ul, .tip-card ul { margin: 10px 0 0 !important; padding-left: 1.2em; }
.list-card li, .tip-card li { font-size: 17px; margin: 0 0 .35em; }
.post-content .card-label { margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.25; color: var(--ink); }
.tip-card p { margin: 0 0 .6em; }
.tip-card p:last-child { margin: 0; }
.tip-kind { display: inline-block; font-family: var(--pixel); font-size: 8px; line-height: 1; padding: 6px 7px; margin-bottom: 12px; background: var(--gold); color: var(--k0); }
.tip-card.info .tip-kind { background: #5EE0C8; }
.tip-card.replay .tip-kind { background: var(--accent); }
.post-content .calc-card { margin: 2em 0; padding: 24px; background: #161A3A; color: var(--pa); border: 3px solid var(--k0); box-shadow: 6px 6px 0 var(--accent); }
.post-content .calc-title { margin: 0 0 18px; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.25; color: #fff; }
.calc-row { display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; gap: 12px; margin: 0 0 10px; }
.calc-age { font-family: var(--pixel); font-size: 9px; color: var(--s2); }
.calc-bar { height: 22px; background: rgba(255, 255, 255, .08); }
.calc-bar > span { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--gold) 0 12px, #D9951A 12px 14px); }
.calc-val { font-family: var(--pixel); font-size: 10px; color: var(--gold); text-align: right; }
.post-content .calc-note { margin: 16px 0 0; font-size: 14px; color: var(--so); }
.prong-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 1.2em 0 2em !important; }
.prong { background: var(--k1); color: var(--s2); padding: 20px; border-top: 6px solid var(--accent); font-size: 16px; line-height: 1.55; }
.prong .tip-kind { display: block; width: max-content; }
.prong p { margin: 0; }
.post-content .loot-box { margin: 3em 0 1em; padding: 28px; background: var(--k1); color: var(--pa); border: 3px solid var(--k0); box-shadow: 6px 6px 0 var(--gold); }
.loot-box > p { margin: 0; font-family: var(--pixel); font-size: 10px; color: var(--gold); }
.post-content .loot-box h4 { margin: 10px 0 18px; font-family: var(--display); font-size: 24px; color: #fff; line-height: 1.2; }
.loot-list { list-style: none; margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.loot-list li { margin: 0 !important; }
.loot-list a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--k2); border: 2px solid var(--k4); color: var(--pa) !important; text-decoration: none; font-size: 15px; line-height: 1.35; }
.loot-list a:hover { border-color: var(--gold); }
.post-content .fine-print { margin-top: 2.4em; padding-top: 16px; border-top: 1px dashed var(--ll); font-size: 14px; line-height: 1.6; color: var(--mu); }
