/*
Theme Name: Viktorune
Theme URI: https://viktorunestudios.com
Author: Viktorune Studios
Description: The house theme for Viktorune Studios — an indie studio making casual mobile games and RPGs. Zero ads, zero micro-transactions, zero tracking. Dark, quiet and a little nostalgic. Ships with a Games post type, self-hosted fonts and no third-party requests.
Version: 1.0.2
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: viktorune
*/

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter Display"; font-weight: 800; font-style: normal; font-display: swap; src: url("assets/fonts/inter-display-800.woff") format("woff"); }

/* ---------- Tokens ---------- */
:root {
	--ink: #09090a;
	--panel: #111217;
	--line: #262830;
	--cream: #f5f0e6;
	--muted: #a9a497;
	--blue: #0068d7;
	--blue-bright: #5aa2ff;
	--window-top: #0b2f78;
	--window-bottom: #06183f;

	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Inter Display", "Inter", system-ui, sans-serif;
	--font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

	--wrap: 1120px;
	--prose: 720px;
	--gap: clamp(1.25rem, 3vw, 2rem);
	--section: clamp(4rem, 9vw, 7rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--ink);
	color: var(--cream);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--blue-bright); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--cream); }
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--blue); color: #fff; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.015em;
	margin: 0 0 0.6em;
	text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.005em; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
blockquote { margin: 2rem 0; padding-left: 1.25rem; border-left: 2px solid var(--blue); color: var(--muted); }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.9em; }
pre { background: var(--panel); border: 1px solid var(--line); padding: 1rem; overflow-x: auto; border-radius: 4px; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 0.6rem 0.5rem; text-align: left; }

.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 0.75rem; left: 0.75rem; z-index: 100; width: auto; height: auto;
	clip: auto; clip-path: none; background: var(--cream); color: var(--ink); padding: 0.6rem 1rem;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.prose { width: min(100% - 2.5rem, var(--prose)); margin-inline: auto; }

/* Small tracked label — echoes "STUDIOS" in the logo */
.eyebrow {
	font-size: 0.78rem; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase;
	color: var(--blue-bright); margin: 0 0 1.1rem;
}

/* Rune rule — the logo's blue line with a diamond set in the middle */
.rune-rule { display: flex; align-items: center; gap: 0.9rem; margin: 0 0 2.5rem; }
.rune-rule::before, .rune-rule::after { content: ""; height: 2px; flex: 1; background: var(--blue); }
.rune-rule::before { clip-path: polygon(0 50%, 6px 0, 100% 0, 100% 100%, 6px 100%); }
.rune-rule::after { clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%); }
.rune-rule span { width: 10px; height: 10px; border: 2px solid var(--cream); transform: rotate(45deg); flex: none; }

/* ---------- Buttons ---------- */
.button, .wp-block-button__link, button[type="submit"], input[type="submit"] {
	display: inline-block; font: 600 0.95rem/1 var(--font-body); letter-spacing: 0.02em;
	padding: 0.95rem 1.5rem; border: 2px solid var(--cream); border-radius: 3px;
	background: var(--cream); color: var(--ink); text-decoration: none; cursor: pointer;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.button:hover, .wp-block-button__link:hover, button[type="submit"]:hover, input[type="submit"]:hover {
	background: var(--blue); border-color: var(--blue); color: #fff;
}
.button--ghost, .is-style-outline .wp-block-button__link { background: transparent; color: var(--cream); border-color: var(--line); }
.button--ghost:hover, .is-style-outline .wp-block-button__link:hover { background: transparent; border-color: var(--cream); color: var(--cream); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(9, 9, 10, 0.92); backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; }
.site-brand { display: block; flex: none; }
.site-brand img, .custom-logo { height: 52px; width: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; }
.site-nav a {
	display: block; padding: 0.5rem 0; color: var(--cream); text-decoration: none;
	font-size: 0.82rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
	border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current_page_item > a { border-bottom-color: var(--blue); }
.site-nav .sub-menu { display: none; }

.nav-toggle {
	display: none; background: none; border: 1px solid var(--line); border-radius: 3px; color: var(--cream);
	font: 600 0.78rem/1 var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; padding: 0.7rem 0.9rem; cursor: pointer;
}
@media (max-width: 760px) {
	.nav-toggle { display: block; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-bottom: 1px solid var(--line); }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; gap: 0; width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; padding: 0.5rem 0 1rem; }
	.site-nav a { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
	.site-brand img, .custom-logo { height: 36px; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 var(--section); overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: 1.25fr 0.75fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.hero__text { max-width: 34rem; }
.hero__lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); margin-bottom: 2.2rem; }
.hero__art { position: relative; justify-self: center; }
.hero__art::before {
	content: ""; position: absolute; inset: -22%; z-index: -1;
	background: radial-gradient(closest-side, rgba(0, 104, 215, 0.28), transparent 70%);
}
.hero__art img { width: min(100%, 320px); }
@media (max-width: 760px) {
	.hero__inner { grid-template-columns: 1fr; }
	.hero__art { order: -1; justify-self: start; }
	.hero__art img { width: 132px; }
}

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; border-top: 1px solid var(--line); }
/* Keep anchored sections clear of the sticky header */
.section { scroll-margin-top: 80px; }
.admin-bar .section { scroll-margin-top: 112px; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.section__head h2 { margin: 0; }
.section__more { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; }

/* ---------- The promise: an RPG status window ---------- */
.promise { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.promise__text p:not(.eyebrow) { color: var(--muted); max-width: 30rem; }
.window {
	background: linear-gradient(var(--window-top), var(--window-bottom));
	border: 3px solid var(--cream); border-radius: 8px;
	box-shadow: inset 0 0 0 3px var(--window-bottom), 0 18px 50px rgba(0, 0, 0, 0.6);
	padding: 1.6rem 1.75rem 1.4rem; font-family: var(--font-mono); color: #fff;
}
.window__title { font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase; color: #a9c8ff; margin: 0 0 1rem; }
.window dl { margin: 0; }
.window__row { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.42rem 0; font-size: clamp(0.95rem, 1.6vw, 1.1rem); }
.window__row dt { flex: none; }
.window__row::after { content: ""; order: 1; flex: 1; border-bottom: 2px dotted rgba(255, 255, 255, 0.3); transform: translateY(-0.25em); }
.window__row dd { order: 2; margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: right; }
.window__row--max dd { color: #ffd76a; }
.window__prompt { margin: 1rem 0 0; font-size: 0.85rem; color: #a9c8ff; }
.window__prompt::after { content: "\25BC"; display: inline-block; margin-left: 0.5rem; font-size: 0.7em; animation: vk-blink 1.1s steps(2) infinite; }
@keyframes vk-blink { 50% { opacity: 0; } }
@media (max-width: 760px) { .promise { grid-template-columns: 1fr; } }

/* ---------- Game cards ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); list-style: none; margin: 0; padding: 0; }
.game-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.15s, transform 0.15s; }
.game-card:hover { border-color: var(--blue); transform: translateY(-3px); }
.game-card__art { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--window-top), var(--window-bottom)); display: grid; place-items: center; }
.game-card__art img { width: 100%; height: 100%; object-fit: cover; }
.game-card__art .game-card__placeholder { width: 72px; height: auto; opacity: 0.55; object-fit: contain; }
.game-card__body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.game-card__title { margin: 0; font-size: 1.3rem; }
.game-card__title a { color: var(--cream); text-decoration: none; }
.game-card__title a::after { content: ""; position: absolute; inset: 0; }
.game-card__tagline { color: var(--muted); margin: 0; font-size: 0.98rem; }
.game-card__meta { margin-top: auto; padding-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
	font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
	padding: 0.3rem 0.55rem; border: 1px solid var(--line); border-radius: 2px; color: var(--muted);
}
.tag--status { border-color: var(--blue); color: var(--blue-bright); }

.empty-note { border: 1px dashed var(--line); border-radius: 6px; padding: 2rem; color: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); }
.about__body { font-size: 1.15rem; color: var(--muted); }
.about__body p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

/* ---------- Post lists ---------- */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-list li { display: grid; grid-template-columns: 9rem 1fr; gap: 0.25rem 2rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.post-list time, .entry-meta { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; }
.post-list time { padding-top: 0.3rem; }
.post-list h3 { margin: 0 0 0.3rem; }
.post-list h3 a { color: var(--cream); text-decoration: none; }
.post-list h3 a:hover { color: var(--blue-bright); }
.post-list p { margin: 0; color: var(--muted); font-size: 0.98rem; }
@media (max-width: 600px) { .post-list li { grid-template-columns: 1fr; } }

/* ---------- Single / page ---------- */
.page-head { padding: clamp(3rem, 7vw, 5rem) 0 2.5rem; }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: 0.4em; }
.page-head .entry-meta { margin: 0; }
.archive-description { color: var(--muted); max-width: 40rem; }
.entry-thumb { margin: 0 auto 2.5rem; }
.entry-thumb img { width: 100%; border-radius: 6px; border: 1px solid var(--line); }
.entry-content { padding-bottom: var(--section); }
.entry-content > * { margin-block: 0 1.3em; }
.entry-content > h2, .entry-content > h3 { margin-top: 2em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content .alignwide { width: min(100vw - 2.5rem, var(--wrap)); max-width: none; margin-inline: calc((min(100vw - 2.5rem, var(--wrap)) - 100%) / -2); }
.entry-content .alignfull { width: 100vw; max-width: none; margin-inline: calc(50% - 50vw); }
.entry-content figcaption, .wp-caption-text { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 0.6rem; }
.entry-content img { border-radius: 4px; }
.alignleft { float: left; margin: 0.3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.3rem 0 1rem 1.5rem; }
.aligncenter { margin-inline: auto; }

/* Game detail */
.game-head { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; padding: clamp(3rem, 7vw, 5rem) 0; }
.game-head__art img { width: 100%; border-radius: 6px; border: 1px solid var(--line); }
.game-head__tagline { font-size: 1.2rem; color: var(--muted); }
.game-head .game-card__meta { margin: 0 0 1.75rem; padding: 0; }
.game-head__nope { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); margin: 1.5rem 0 0; }
@media (max-width: 760px) { .game-head { grid-template-columns: 1fr; } }

/* ---------- Pagination, comments, forms ---------- */
.pagination, .post-navigation { padding: 2.5rem 0 var(--section); }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; }
.pagination .nav-links { justify-content: flex-start; }
.page-numbers { padding: 0.5rem 0.9rem; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; color: var(--cream); font-family: var(--font-mono); font-size: 0.9rem; }
.page-numbers.current, .page-numbers:hover { border-color: var(--blue); color: var(--blue-bright); }

input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], textarea, select {
	width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; color: var(--cream);
	font: inherit; padding: 0.8rem 0.9rem;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue-bright); outline: none; }
label { font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 0.35rem; }
.search-form { display: flex; gap: 0.5rem; max-width: 30rem; }
.search-form label { flex: 1; margin: 0; }

.comments-area { border-top: 1px solid var(--line); padding: 3rem 0 var(--section); }
.comment-list { list-style: none; padding: 0; margin: 0 0 2.5rem; }
.comment-list .children { list-style: none; padding-left: 1.5rem; border-left: 1px solid var(--line); }
.comment-body { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.comment-meta a { color: inherit; }
.comment-author .fn { color: var(--cream); font-weight: 600; font-style: normal; }
.comment-form p { margin-bottom: 1rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer__waves { display: block; width: 100%; height: 34px; color: var(--blue); margin-top: -1px; }
.site-footer__inner { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; padding: 2.75rem 0 2.5rem; text-align: center; }
.site-footer__logo { height: 56px; width: auto; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.75rem; }
.site-footer nav a { color: var(--cream); text-decoration: none; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.site-footer nav a:hover { color: var(--blue-bright); }
.site-footer__legal { margin: 0.5rem 0 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

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