/* ===== Pyrdacor.net Blazor Rebuild ===== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Questrial&family=Poppins:wght@300;400;600;700&family=Lato:wght@300;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
/* ---------- Reset & Base ----------
 * Everything below is scoped under .site-wrapper (the root element of the
 * Pyrdacor pages) instead of *, body, a, img, main, :root - this stylesheet
 * is loaded globally in _Host.cshtml alongside the rest of the site's CSS,
 * so unscoped element/root selectors here would leak into every other page.
 *
 * The scoping uses :where(.site-wrapper) rather than plain ".site-wrapper"
 * descendant selectors. :where() always contributes zero specificity, so
 * e.g. ":where(.site-wrapper) a" stays exactly as specific as a bare "a"
 * would have been. Without it, ".site-wrapper a" (a class + an element) is
 * MORE specific than a bare "a", which broke every button/link class here
 * (.donate-btn, .download-btn, .content-cta, ...) that relies on beating a
 * generic link-color rule with a single class selector.
 */
:where(.site-wrapper, .site-wrapper *, .site-wrapper *::before, .site-wrapper *::after) {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.site-wrapper {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-card: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #ccc;
    --text-muted: #999;
    --accent: #ff7a3d;
    --accent-hover: #ffa366;
    --divider: #555;
    --btn-bg: #383838;
    --btn-hover: #4a4a4a;
    --font-heading: 'Montserrat', 'Questrial', sans-serif;
    --font-body: 'Lato', sans-serif;
    --font-ui: 'Poppins', sans-serif;
    --max-width: 1100px;
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
}

/* body (site.css) sets font-size:0.8em and text-shadow:3px 3px 0px #000 for
 * the ambermoon-game look elsewhere on the site; .site-wrapper only resets
 * those on itself, so restate them here to stop every descendant inheriting
 * a tiny font size and a heavy drop-shadow through the normal cascade. */
:where(.site-wrapper *) {
    text-shadow: none;
}

:where(.site-wrapper) a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

:where(.site-wrapper) a:hover {
    color: var(--accent-hover);
}

:where(.site-wrapper) img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* elements.css declares bare h1/h2/code/button rules with real specificity
 * (0,0,1) of their own, so the zero-specificity reset above can't beat them -
 * these need matching (0,0,1) specificity (still losing to any Pyrdacor class
 * like .hero-title or .blog-post h1) to actually cancel the forced
 * text-align/line-height/oversized-code/button-shadow they impose. */
:where(.site-wrapper) h1,
:where(.site-wrapper) h2 {
    text-align: initial;
    line-height: inherit;
    user-select: auto;
}

:where(.site-wrapper) code {
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
    text-shadow: none;
}

:where(.site-wrapper) button {
    text-shadow: none;
}

/* ---------- Layout ----------
 * The site-wide html/body are height:100% + overflow:hidden (see site.css) so
 * that sidenav pages can scroll only their .main-content. Pyrdacor pages have
 * no such inner scroll container of their own, so .site-wrapper has to be the
 * one that scrolls - min-height:100vh alone just gets clipped by body instead.
 */
.site-wrapper {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

:where(.site-wrapper) main {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    flex-shrink: 0;
}

    .logo img {
        height: 200px;
        width: auto;
        margin-bottom: -40px;
    }

.main-nav {
    flex: 1;
    display: flex;
    gap: 24px;
    justify-content: center;
}

.main-nav a,
.main-nav a:visited {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text-primary);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.header-social {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.github-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.github-icon:hover {
    color: var(--text-primary);
}

.social-icon {
    font-size: 18px;
    color: var(--text-secondary);
    transition: color 0.2s;
    cursor: pointer;
}

.social-icon:hover {
    color: var(--text-primary);
}

/* ---------- Intro Section ---------- */
.intro-section {
    padding: 48px 0 24px;
}

.intro-row {
    display: flex;
    align-items: center;
    gap: 32px;
}

.intro-avatar img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #444;
    transition: transform 0.3s, border-color 0.3s;
}

.intro-avatar img:hover {
    transform: scale(1.05);
    border-color: var(--accent);
}

.intro-text {
    flex-grow: 1;
}

.intro-text h1 {
    font-family: var(--font-body);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-primary);
    padding-left: 10%;
    width: 100%;
}

/* ---------- Dividers ---------- */
.section-divider {
    border: none;
    border-top: 2px solid var(--divider);
    margin: 32px 0;
}

/* ---------- Hero Section ---------- */
.hero-section {
    text-align: center;
    padding: 32px 0;
}

.hero-container {
    position: relative;
}

.spider-graphic {
    position: absolute;
    right: 16%;
    top: -30px;
}

.spider-image {
    width: 120px;
    height: auto;
    margin: 0 auto;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.hero-divider {
    border: none;
    border-top: 1px solid var(--divider);
    width: 200px;
    margin: 16px auto;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
}

/* ---------- Project Cards ---------- */
.project-section {
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding: 48px 0;
}

.project-card {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
}

.project-card:nth-child(even) {
    flex-direction: row-reverse;
}

.project-info {
    flex: 0 0 38%;
    text-align: center;
}

.project-title {
    font-family: var(--font-ui);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.project-divider {
    border: none;
    border-top: 2px solid var(--divider);
    margin: 12px 0;
}

.project-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.project-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 20px;
}

.project-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 10px 24px;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.project-btn:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1rem;
}

.project-image {
    flex: 0 0 auto;
}

    .project-image img {
        width: 400px;
        height: auto;
        border-radius: 200px;
        transition: transform 0.3s, box-shadow 0.3s;
    }

.project-image img:hover {
    transform: scale(1.02);
}

/* ---------- Download Section ---------- */
.download-section {
    padding: 48px 0;
    text-align: center;
}

.download-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.download-tabs {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.tab-nav {
    display: flex;
    overflow-x: auto;
    background: var(--bg-secondary);
    border-bottom: 1px solid #444;
}

.tab-label {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-label:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
}

.tab-label.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
    background: rgba(255,255,255,0.05);
}

.tab-content {
    padding: 32px 24px;
}

.tab-title {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tab-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.download-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 12px 32px;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.download-btn:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
}

.additional-downloads {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-secondary);
    padding: 40px 24px;
    margin-top: 48px;
}

.footer-donate {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--btn-bg);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 20px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
    border: 1px solid #555;
}

.donate-btn:hover {
    background: var(--btn-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.donate-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.footer-divider {
    border: none;
    border-top: 2px solid var(--divider);
    max-width: var(--max-width);
    margin: 24px auto;
}

.footer-contact {
    text-align: center;
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-contact > p:first-child {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.contact-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
    margin-bottom: 16px;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 400;
}

.contact-email:hover {
    color: var(--accent);
}

.envelope-icon {
    width: 20px;
    height: 20px;
    color: currentColor;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
    }

    .logo {
        order: 1;
    }

    .header-social {
        order: 2;
        margin-left: auto;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 16px;
    }

    .intro-row {
        flex-direction: column;
        text-align: center;
    }

    .project-card,
    .project-card:nth-child(even) {
        flex-direction: column-reverse;
    }

    .project-info {
        flex: auto;
    }

    .tab-nav {
        overflow-x: auto;
    }

    .tab-label {
        padding: 12px;
        font-size: 0.75rem;
    }

    .devblog-card,
    .devblog-card:nth-child(even) {
        flex-direction: column;
    }

    .devblog-thumb {
        flex: auto;
        width: 100%;
    }
}

/* ---------- Content pages (About, Donate) ---------- */
.content-section {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 0;
}

.content-section-center {
    text-align: center;
}

.content-section h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.content-section p {
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 16px;
}

.content-section a:not(.content-cta) {
    text-decoration: underline;
}

.content-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 10px 24px;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 8px;
    transition: background 0.2s, transform 0.2s;
}

.content-cta:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
}

.donate-buttons {
    margin-top: 24px;
}

/* ---------- DevBLOG index ---------- */
.devblog-list {
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding: 48px 0;
    max-width: var(--max-width);
    margin: 0 auto;
}

.devblog-card {
    display: flex;
    gap: 32px;
    align-items: center;
}

.devblog-card:nth-child(even) {
    flex-direction: row-reverse;
}

.devblog-thumb {
    flex: 0 0 280px;
}

.devblog-thumb img {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.devblog-info {
    flex: 1;
}

.devblog-info h3 {
    font-family: var(--font-ui);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.devblog-info h3 a {
    color: var(--text-primary);
}

.devblog-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px !important;
}

.devblog-excerpt {
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.6;
}

/* ---------- Downloads grid ---------- */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    max-width: var(--max-width);
    margin: 0 auto 48px;
}

.download-grid .download-btn {
    text-align: center;
}

/* ---------- Blog post article ---------- */
.blog-post {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 0 0;
}

.blog-post h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.post-meta {
    max-width: 760px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.blog-post h2 {
    font-family: var(--font-ui);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 12px;
}

.blog-post h3 {
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 10px;
}

.blog-post p {
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.75;
    margin-bottom: 16px;
}

.blog-post ul,
.blog-post ol {
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
    margin: 0 0 16px 24px;
}

.blog-post li {
    margin-bottom: 6px;
}

.blog-post img {
    border-radius: 8px;
    margin: 16px 0;
}

.blog-post pre {
    background: var(--bg-card);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 1rem;
    line-height: 1.5;
    color: rgb(127, 179, 223);
    background-color: rgba(36, 35, 35, 1);
}

.blog-post code {
    font-weight: 400;
    font-family: 'Roboto Mono', 'Roboto Mono Fallback', monospace;
    opacity: 1;
}

.blog-post table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.blog-post th,
.blog-post td {
    border: 1px solid #444;
    padding: 6px 10px;
    text-align: left;
    color: var(--text-secondary);
}

.blog-post th {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.blog-post-nav {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 0 48px;
    text-align: center;
}
