/*
Theme Name: Star Heir
Theme URI: https://starheir.com
Author: Star Heir
Author URI: https://starheir.com
Description: A modern, awesome sci-fi theme for Star Heir: Dark Crusade — advertising books, media, and the videogame.
Version: 2.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: starheir
Tags: sci-fi, space, modern, dark, responsive, gaming, books
*/

/* ============================================================
   Star Heir — Modern Dark Sci-Fi Theme
   ============================================================ */

:root {
    --bg-0: #05060f;
    --bg-1: #0a0e1f;
    --bg-2: #121733;
    --bg-3: #1a2042;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(124, 92, 255, 0.22);
    --border-strong: rgba(124, 92, 255, 0.45);
    --accent: #7c5cff;
    --accent-2: #00d4ff;
    --accent-glow: rgba(124, 92, 255, 0.45);
    --text: #e6e9f2;
    --text-muted: #9aa3bf;
    --text-dim: #6b7394;
    --success: #3ddc97;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 40px rgba(124, 92, 255, 0.25);
    --container: 1200px;
    --header-h: 76px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    color: var(--text);
    line-height: 1.65;
    background: var(--bg-0);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent); }
button { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }

/* Background starfield */
.stars-bg {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.6) 50%, transparent 51%),
        radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.5) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 80% 20%, rgba(255,255,255,0.7) 50%, transparent 51%),
        radial-gradient(1px 1px at 40% 85%, rgba(255,255,255,0.4) 50%, transparent 51%),
        radial-gradient(1px 1px at 15% 60%, rgba(255,255,255,0.5) 50%, transparent 51%),
        radial-gradient(1px 1px at 90% 50%, rgba(255,255,255,0.6) 50%, transparent 51%);
    animation: drift 120s linear infinite;
    opacity: 0.7;
}
@keyframes drift { 0% { transform: translateY(0); } 100% { transform: translateY(-40px); } }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
p { margin: 0 0 16px; }
.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin-bottom: 16px;
    padding: 6px 14px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.06);
}

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(5, 6, 15, 0.7);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; height: var(--header-h);
}
.site-branding { display: flex; align-items: center; }
.site-title {
    font-family: var(--font-display);
    font-size: 1.35rem; font-weight: 800;
    color: #fff; letter-spacing: 0.04em;
    display: inline-flex; align-items: center; gap: 8px;
}
.site-title .title-mark { color: var(--accent); font-size: 1.5rem; }
.site-title a { color: inherit; }
.custom-logo { height: 44px; width: auto; }

.main-nav { display: flex; align-items: center; }
.nav-list {
    list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.nav-list a {
    color: var(--text-muted); font-weight: 500; font-size: 0.92rem;
    padding: 8px 14px; border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.nav-list a:hover { color: #fff; background: var(--surface); }
.nav-toggle { display: none; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 30px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.92rem; letter-spacing: 0.04em;
    text-transform: uppercase; text-decoration: none;
    border: 1px solid transparent; cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
    position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    color: #fff;
    box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 10px 32px var(--accent-glow); }
.btn-ghost {
    background: var(--surface); color: #fff;
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn-amazon {
    background: #ff9900; color: #000; font-weight: 800;
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.3);
}
.btn-amazon:hover { background: #ffb84d; }
.btn-sm { padding: 8px 18px; font-size: 0.82rem; }

/* Hero */
.hero {
    position: relative; min-height: 92vh;
    display: flex; align-items: center; justify-content: center;
    padding: 120px 0 80px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(124, 92, 255, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        var(--bg-0);
}
.nebula {
    position: absolute; inset: -20%; z-index: 0; pointer-events: none;
    background:
        radial-gradient(circle at 30% 40%, rgba(124,92,255,0.18) 0%, transparent 45%),
        radial-gradient(circle at 70% 60%, rgba(0,212,255,0.12) 0%, transparent 40%);
    filter: blur(40px);
    animation: nebula 18s ease-in-out infinite alternate;
}
@keyframes nebula { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(4%, -3%) scale(1.08); } }
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 900px; }
.hero-title {
    background: linear-gradient(135deg, #fff 0%, #c4b5fd 40%, #00d4ff 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 20px;
}
.hero-sub {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    color: var(--text-muted); max-width: 640px; margin: 0 auto 36px;
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats {
    display: flex; gap: 40px; justify-content: center; flex-wrap: wrap;
    padding-top: 32px; border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat strong { font-family: var(--font-display); font-size: 1.1rem; color: #fff; }
.stat span { font-size: 0.78rem; color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; }
.scroll-hint {
    position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
    font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--text-dim);
    animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* Sections */
.section { position: relative; padding: 100px 0; z-index: 1; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-title { margin: 0 0 12px; }
.section-subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto; }
.products-section { background: linear-gradient(180deg, transparent 0%, var(--bg-1) 100%); }
.about-section { background: var(--bg-1); }
.contact-section { background: var(--bg-2); text-align: center; }
.contact-section .btn { margin-top: 8px; }

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
    backdrop-filter: blur(10px);
}
.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-glow);
}
.product-image-wrap { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--bg-2); }
.product-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.product-card:hover .product-image { transform: scale(1.06); }
.product-image.placeholder {
    background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-3) 100%);
}
.product-badge {
    position: absolute; top: 14px; left: 14px;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
    color: #fff; background: rgba(5,6,15,0.7); backdrop-filter: blur(8px);
    padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong);
}
.product-info { padding: 22px; }
.product-title { font-size: 1.2rem; margin: 0 0 8px; }
.product-desc { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 18px; line-height: 1.55; }
.product-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* Game Section */
.game-section { padding: 100px 0; background: var(--bg-1); }
.game-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.feature-list { list-style: none; margin: 0 0 32px; display: flex; flex-direction: column; gap: 12px; }
.feature-list li {
    padding-left: 28px; position: relative; color: var(--text-muted);
}
.feature-list li::before {
    content: '▸'; position: absolute; left: 0; color: var(--accent-2);
}
.game-visual { display: flex; justify-content: center; }
.game-preview {
    position: relative; width: 100%; max-width: 420px; aspect-ratio: 1;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    box-shadow: var(--shadow-glow), var(--shadow);
    overflow: hidden;
}
.preview-glow {
    position: absolute; inset: -30%;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 60%);
    animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }
.preview-card {
    position: absolute; inset: 24px;
    border-radius: var(--radius);
    background: rgba(5,6,15,0.55); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 1.6rem; font-weight: 800;
    color: #fff; letter-spacing: 0.08em;
}

/* Entry content */
.entry-content { max-width: 800px; color: var(--text); }
.entry-content p { margin: 0 0 16px; color: var(--text-muted); }
.entry-content h1, .entry-content h2, .entry-content h3 { margin: 28px 0 12px; }
.entry-content a { color: var(--accent-2); border-bottom: 1px solid rgba(0,212,255,0.3); }
.entry-content a:hover { border-color: var(--accent-2); }
.entry-content img { border-radius: var(--radius-sm); margin: 16px 0; }
.entry-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px; margin: 16px 0;
    background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted); font-style: italic;
}
.entry-content code {
    background: var(--surface-strong); padding: 2px 6px; border-radius: 4px;
    font-size: 0.9em; color: var(--accent-2);
}
.entry-content pre {
    background: rgba(0,0,0,0.4); padding: 16px; border-radius: var(--radius-sm);
    overflow-x: auto; margin: 16px 0; border: 1px solid var(--border);
}

/* Post list / cards */
.post-list { display: grid; gap: 24px; }
.post-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px;
    transition: border-color 0.3s, transform 0.3s;
}
.post-card:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.post-card .entry-title { font-size: 1.5rem; margin: 0 0 6px; }
.post-card .entry-title a { color: #fff; }
.post-card .entry-meta { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 12px; }
.entry-header { margin-bottom: 24px; }
.archive-header { margin-bottom: 40px; }

/* Product single */
.product-single-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start;
}
.product-single-image {
    width: 100%; border-radius: var(--radius); box-shadow: var(--shadow);
}
.product-single-image.placeholder {
    aspect-ratio: 3/4; background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
    border-radius: var(--radius);
}
.product-single-info h1 { margin: 12px 0 16px; }
.product-single-info .entry-content { margin: 20px 0; }

/* Footer */
.site-footer {
    background: var(--bg-1); border-top: 1px solid var(--border);
    padding: 60px 0 32px; position: relative; z-index: 1;
}
.footer-inner {
    display: grid; grid-template-columns: 1.5fr 1fr 1.5fr; gap: 40px; align-items: start;
}
.footer-brand .site-title { margin-bottom: 12px; display: inline-flex; }
.footer-brand p { color: var(--text-muted); font-size: 0.92rem; max-width: 320px; }
.footer-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-list a { color: var(--text-muted); font-size: 0.9rem; }
.footer-list a:hover { color: var(--accent-2); }
.footer-meta p { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 4px; }

/* Empty / error */
.empty-state { text-align: center; color: var(--text-muted); padding: 40px; }
.error-code {
    font-size: clamp(6rem, 20vw, 12rem);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.error-text { font-size: 1.4rem; color: var(--text-muted); margin: 16px 0 32px; }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Pagination */
.pagination { margin-top: 40px; text-align: center; }
.pagination .nav-links a, .pagination a {
    display: inline-block; padding: 10px 18px; margin: 0 4px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-muted);
}
.pagination .nav-links a:hover, .pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* Comments */
.comments-area { margin-top: 48px; }

/* Responsive */
@media (max-width: 900px) {
    .game-grid { grid-template-columns: 1fr; gap: 40px; }
    .product-single-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 768px) {
    .header-inner { height: auto; padding: 16px 0; flex-wrap: wrap; }
    .nav-toggle {
        display: flex; flex-direction: column; gap: 5px;
        background: none; border: 1px solid var(--border); border-radius: 8px;
        padding: 10px; cursor: pointer;
    }
    .nav-toggle span { width: 20px; height: 2px; background: #fff; border-radius: 2px; }
    .main-nav { width: 100%; display: none; }
    .main-nav.is-open { display: block; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 0; }
    .nav-list a { display: block; }
    .hero { min-height: 80vh; padding: 90px 0 60px; }
    .hero-stats { gap: 24px; }
    .section { padding: 70px 0; }
    .product-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .hero-cta { flex-direction: column; }
    .btn { width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Focus */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
