:root {
    --bg: #070A0F;
    --panel: #0B1120;
    --panel2: #0A0F1A;
    --text: #E6F0FF;
    --muted: #A2B3CC;
    --line: #1B2A44;
    --accent: #7BF0FF;
    --accent2: #B36BFF;
    --shadow: 0 12px 30px rgba(0,0,0,.45);
    --radius: 18px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    background: radial-gradient(1200px 600px at 20% 10%, rgba(123,240,255,.10), transparent 60%), radial-gradient(900px 500px at 90% 20%, rgba(179,107,255,.08), transparent 55%), var(--bg);
    color: var(--text);
    font-family: var(--sans);
    letter-spacing: .2px;
}

a {
    color: inherit
}

.link {
    color: var(--accent);
    text-decoration: none
}

.link:hover {
    filter: brightness(1.1);
    text-decoration: underline
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(to right, rgba(123,240,255,.06) 1px, transparent 1px), linear-gradient(to bottom, rgba(123,240,255,.05) 1px, transparent 1px);
    background-size: 46px 46px;
    opacity: .35;
    pointer-events: none;
    mask-image: radial-gradient(70% 60% at 50% 20%, black 55%, transparent 100%);
}

.bg-scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient( to bottom, rgba(255,255,255,.02) 0px, rgba(255,255,255,.02) 1px, transparent 3px, transparent 6px );
    opacity: .25;
    pointer-events: none;
}

.container {
    width: min(1100px, calc(100% - 40px));
    margin: 26px auto 56px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    background: rgba(7,10,15,.55);
    border-bottom: 1px solid rgba(123,240,255,.12);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-weight: 700;
    background: linear-gradient(135deg, rgba(123,240,255,.18), rgba(179,107,255,.14));
    border: 1px solid rgba(123,240,255,.22);
    box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset;
}

.brand-text {
    font-family: var(--mono);
    font-weight: 700;
    letter-spacing: .6px;
    color: rgba(230,240,255,.92);
}

.nav {
    display: flex;
    gap: 10px;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid rgba(123,240,255,.14);
    background: rgba(11,17,32,.5);
}

.nav-link {
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    color: rgba(230,240,255,.85);
    font-family: var(--mono);
    font-size: 13px;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(123,240,255,.08);
    border-color: rgba(123,240,255,.14);
}

.nav-link.active {
    background: rgba(123,240,255,.12);
    border-color: rgba(123,240,255,.18);
    color: var(--text);
    box-shadow: 0 0 18px rgba(123,240,255,.12);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 10px
}

.select {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    background: rgba(11,17,32,.55);
    border: 1px solid rgba(123,240,255,.16);
    border-radius: 12px;
    padding: 8px 10px;
    outline: none;
}

.card {
    border-radius: var(--radius);
    border: 1px solid rgba(123,240,255,.12);
    background: linear-gradient(180deg, rgba(11,17,32,.72), rgba(10,15,26,.62));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 18px 18px 10px;
    border-bottom: 1px solid rgba(123,240,255,.10);
}

/* Keep header alignment default (left) */
.card-header {
    text-align: left;
}

.card-body {
    padding: 18px
}

.h1 {
    margin: 0 0 6px;
    font-size: clamp(22px, 3.2vw, 30px);
    line-height: 1.12;
    font-family: var(--mono);
    letter-spacing: .3px;
}

.h2 {
    margin: 0 0 10px;
    font-size: 16px;
    font-family: var(--mono);
    color: rgba(230,240,255,.92);
}

.sub {
    margin: 0;
    color: rgba(162,179,204,.92);
    line-height: 1.45;
}

.p {
    margin: 0 0 12px;
    color: rgba(230,240,255,.86);
    line-height: 1.55
}

/* Home layout: description + CV (grid, becomes stacked on mobile) */
.two-col {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

.panel {
    border-radius: calc(var(--radius) - 6px);
    border: 1px solid rgba(123,240,255,.12);
    background: rgba(7,10,15,.35);
    padding: 14px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.pill {
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(230,240,255,.78);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(123,240,255,.14);
    background: rgba(123,240,255,.06);
}

.list {
    margin: 0 0 14px;
    padding-left: 18px;
    color: rgba(230,240,255,.86);
    line-height: 1.55;
}

.list li {
    margin: 6px 0
}

.callout {
    border-radius: 14px;
    border: 1px solid rgba(179,107,255,.18);
    background: linear-gradient(135deg, rgba(179,107,255,.08), rgba(123,240,255,.05));
    padding: 12px;
}

.callout-title {
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(230,240,255,.9);
    margin-bottom: 6px;
}

.callout-text {
    color: rgba(230,240,255,.82);
    line-height: 1.5
}

.pdf-frame {
    height: 520px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(123,240,255,.12);
    background: rgba(0,0,0,.25);
}

.empty-zone {
    height: 140px;
    border-radius: 14px;
    border: 1px dashed rgba(123,240,255,.18);
    background: rgba(7,10,15,.25);
}

.embed-frame {
    height: 560px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(123,240,255,.12);
    background: rgba(0,0,0,.25);
}

.iframe {
    width: 100%;
    height: 100%;
    border: 0
}

.itch-widget {
    width: 100%;
    display: flex;
    justify-content: center;
}

.itch-iframe {
    width: 100%;
    max-width: 552px;
    height: 167px;
    border: 0;
}

.github-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.input {
    flex: 1;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    background: rgba(11,17,32,.55);
    border: 1px solid rgba(123,240,255,.16);
    border-radius: 12px;
    padding: 10px 10px;
    outline: none;
}

.btn {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    background: rgba(123,240,255,.10);
    border: 1px solid rgba(123,240,255,.18);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.08)
}

.repo-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.repo {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(123,240,255,.12);
    background: rgba(11,17,32,.35);
}

.repo-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline
}

.repo-name {
    font-family: var(--mono);
    text-decoration: none;
    color: var(--accent);
}

.repo-meta {
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(162,179,204,.92)
}

.repo-desc {
    margin: 8px 0 0;
    color: rgba(230,240,255,.82);
    line-height: 1.45
}

.fine {
    margin: 10px 0 0;
    font-size: 12.5px;
    line-height: 1.5
}

.muted {
    color: rgba(162,179,204,.92)
}

.site-footer {
    border-top: 1px solid rgba(123,240,255,.10);
    background: rgba(7,10,15,.55);
    padding: 24px 20px;
}

.footer-grid {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr
    }
}

.footer-title {
    font-family: var(--mono);
    margin-bottom: 8px;
    color: rgba(230,240,255,.92);
}

.footer-text {
    margin: 0;
    color: rgba(162,179,204,.92);
    line-height: 1.5
}

.footer-list {
    margin: 0;
    padding: 0;
    list-style: none;
    color: rgba(162,179,204,.92)
}

.footer-list li {
    margin: 6px 0
}

.footer-bottom {
    width: min(1100px, calc(100% - 40px));
    margin: 14px auto 0;
    padding-top: 12px;
    border-top: 1px solid rgba(123,240,255,.08);
}

/* --- itch.io aside blocks --- */
.itch-aside-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.itch-block {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(123,240,255,.12);
    background: rgba(11,17,32,.35);
    text-decoration: none;
    width: 100%;
}

.itch-block:hover {
    background: rgba(123,240,255,.06);
    border-color: rgba(123,240,255,.18);
}

.itch-block-thumb {
    width: 128px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(123,240,255,.12);
    background: rgba(7,10,15,.25);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.itch-block-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.itch-block-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.itch-block-title {
    font-family: var(--mono);
    color: rgba(230,240,255,.92);
    line-height: 1.2;
}

.itch-block-url {
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(162,179,204,.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Center the single-panel layout ONLY on projects page using :has() */
body:has(title[data-i18n="meta.title_projects"]) .card-header {
    text-align: center;
}

body:has(title[data-i18n="meta.title_projects"]) .two-col {
    justify-items: center;
}

body:has(title[data-i18n="meta.title_projects"]) .two-col > .panel {
    width: min(720px, 100%);
    margin-inline: auto;
}

/* Projects-only: center the Games panel inside the card WITHOUT breaking home grid */
body:has(title[data-i18n="meta.title_projects"]) .card-body {
    display: flex;
    justify-content: center;
}

body:has(title[data-i18n="meta.title_projects"]) .card-body > .panel {
    width: min(720px, 100%);
}

body:has(title[data-i18n="meta.title_projects"]) .card-body > .panel .panel-head {
    justify-content: center;
}

body:has(title[data-i18n="meta.title_projects"]) .card-body > .panel .panel-head .pill {
    margin-left: 12px;
}
