:root {
    --font-readable: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    --void: #0a0d18;
    --night: #101525;
    --panel: #171d31;
    --panel-strong: #20263d;
    --ink: #f7f8ff;
    --muted: #c3c8d8;
    --cyan: #98dde5;
    --blue: #9bc7ec;
    --pink: #ef85bb;
    --gold: #f0d997;
    --green: #9eddbd;
    --danger: #ff7f91;
    --black: #03040c;
    --line: #343d5c;
    --shadow: 5px 5px 0 var(--black);
    --glow: 0 0 18px rgb(152 221 229 / 16%);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background:
        linear-gradient(rgb(10 13 24 / 94%), rgb(10 13 24 / 97%)),
        url("../portfolio-ui/frames/grid.png") repeat,
        var(--void);
    font-family: var(--font-readable);
    font-size: 16px;
    line-height: 1.65;
    cursor: url("../wizard-ui/UI_WizardBook_Cursor01a.png") 2 2, auto;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgb(120 232 242 / 5%), transparent 34%),
        linear-gradient(315deg, rgb(255 211 106 / 4%), transparent 42%),
        repeating-linear-gradient(0deg, transparent 0 4px, rgb(255 255 255 / 0.8%) 4px 5px);
}

a,
button {
    cursor: url("../wizard-ui/UI_WizardBook_Cursor01b.png") 2 2, pointer;
}

a {
    color: var(--cyan);
    text-decoration: none;
}

a:hover {
    color: white;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.6rem;
    color: white;
    font-size: 3.6rem;
    line-height: 1;
    text-shadow: 3px 3px 0 #391853;
}

h2 {
    line-height: 1.18;
}

button,
.primary-action,
.secondary-action {
    font: inherit;
    font-weight: 800;
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: -80px;
    left: 1rem;
    z-index: 100;
    padding: 0.7rem 1rem;
    color: var(--void);
    background: var(--gold);
}

.skip-link:focus {
    top: 1rem;
}

.portfolio-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: 100vh;
}

.portfolio-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 1.15rem;
    border-right: 4px solid var(--black);
    background:
        linear-gradient(180deg, rgb(35 21 62 / 96%), rgb(10 11 30 / 98%)),
        url("../portfolio-ui/frames/grid.png") repeat;
    box-shadow: inset -2px 0 0 #8a68d6, 8px 0 30px rgb(0 0 0 / 30%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    color: white;
}

.brand-logo {
    display: block;
    width: 48px;
    height: 48px;
    border: 3px solid var(--black);
    object-fit: cover;
    background: var(--pink);
    box-shadow: 3px 3px 0 var(--black), inset 0 0 0 2px rgb(255 255 255 / 18%);
    transition: transform 120ms steps(2);
}

.brand:hover .brand-logo {
    transform: translateY(-2px) rotate(-3deg);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.3rem;
}

.brand small {
    margin-top: 0.1rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.user-card,
.sidebar-tip {
    position: relative;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 3px solid var(--black);
    background:
        linear-gradient(rgb(35 43 72 / 92%), rgb(18 24 43 / 96%)),
        url("../wizard-ui/UI_WizardBook_BookCover01a.png") center / 100% 100%;
    box-shadow: var(--shadow), inset 0 0 0 1px rgb(152 221 229 / 22%);
}

.user-card::before,
.project-card::before,
.main-panel::before,
.side-panel::before,
.experience-entry::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 18px;
    width: 54px;
    height: 3px;
    background: var(--pink);
    box-shadow: 60px 0 0 var(--blue);
}

.user-avatar {
    display: grid;
    width: 160px;
    height: 160px;
    margin: 0 auto 0.8rem;
    padding: 4px;
    place-items: center;
    overflow: hidden;
    border: 3px solid var(--black);
    background:
        linear-gradient(135deg, rgb(152 221 229 / 22%), transparent 45%),
        linear-gradient(#ef85bb, #4f6192 58%, #171d31 58%);
    box-shadow: 4px 4px 0 var(--black), inset 0 0 0 3px rgb(255 255 255 / 15%);
}

.avatar-sprite {
    display: block;
    width: 100%;
    height: 100%;
    border: 2px solid rgb(255 255 255 / 18%);
    object-fit: cover;
    object-position: center;
}

.system-label,
.nav-heading,
.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--pink);
    font-size: 0.78rem;
    font-weight: 800;
}

.user-card h2 {
    margin-bottom: 0.25rem;
    font-size: 1.15rem;
}

.user-role {
    margin-bottom: 0.7rem;
    color: #d5dced;
    font-size: 0.82rem;
    line-height: 1.45;
}

.xp-bar {
    height: 12px;
    padding: 2px;
    border: 2px solid var(--black);
    background: #08091a url("../wizard-ui/UI_WizardBook_Bar01a.png") center / 100% 100%;
}

.xp-bar span {
    display: block;
    width: 76%;
    height: 100%;
    background: linear-gradient(90deg, var(--pink), var(--gold));
    animation: xp-glow 2s steps(3) infinite;
}

.side-nav {
    display: grid;
    gap: 0.55rem;
}

.side-nav .nav-heading {
    margin: 0.35rem 0 0;
    color: #aeb5cb;
}

.side-nav > a {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border: 3px solid var(--black);
    color: #e3e7f2;
    background:
        linear-gradient(rgb(18 24 43 / 84%), rgb(18 24 43 / 96%)),
        url("../wizard-ui/UI_WizardBook_Button02a.png") center / 100% 100%;
    box-shadow: 3px 3px 0 #03040b, inset 0 0 0 1px #333b5a;
    transition: transform 100ms steps(2), border-color 100ms linear, background 100ms linear;
}

.side-nav > a:hover,
.side-nav > a.active {
    border-color: var(--pink);
    color: white;
    background: #24233d;
    transform: translateX(3px);
    box-shadow: 3px 3px 0 #03040b, inset 4px 0 0 var(--pink);
}

.nav-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    filter: brightness(0) invert(1) drop-shadow(2px 2px 0 rgb(0 0 0 / 65%));
}

.icon-profile { background-image: url("../wizard-ui/UI_WizardBook_IconDirection01a.png"); }
.icon-skills { background-image: url("../wizard-ui/UI_WizardBook_IconAlert01a.png"); }
.icon-projects { background-image: url("../wizard-ui/UI_WizardBook_IconTreasures01a.png"); }
.icon-experience { background-image: url("../wizard-ui/UI_WizardBook_IconKeys01a.png"); }
.icon-achievements { background-image: url("../wizard-ui/UI_WizardBook_IconHealth01a.png"); }
.icon-contact { background-image: url("../wizard-ui/UI_WizardBook_IconTick01a.png"); }

.sidebar-tip {
    display: flex;
    gap: 0.65rem;
    margin-top: auto;
    margin-bottom: 0;
    padding: 0.8rem;
    color: var(--muted);
    background: #131a2d;
    font-size: 0.78rem;
}

.sidebar-tip p {
    margin: 0;
}

.sidebar-tip strong {
    display: block;
    color: var(--cyan);
}

.blink-dot,
.live-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
    animation: blink 1.4s steps(2) infinite;
}

.portfolio-main {
    min-width: 0;
    padding-bottom: 3rem;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 2rem;
    border-bottom: 3px solid var(--black);
    color: var(--muted);
    background: rgb(9 12 24 / 94%);
    box-shadow: 0 2px 0 #8a68d6;
    backdrop-filter: blur(8px);
    font-size: 0.82rem;
}

.audio-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 38px;
    padding: 0.4rem 0.65rem;
    border: 2px solid var(--pink);
    color: white;
    background: #251335;
    box-shadow: 2px 2px 0 var(--black);
}

.audio-toggle[aria-pressed="true"] {
    color: var(--void);
    background: var(--pink);
}

main {
    min-height: calc(100vh - 110px);
}

.hero {
    position: relative;
    width: min(1180px, calc(100% - 2rem));
    min-height: 520px;
    margin: 3rem auto 2.4rem;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border: 5px solid var(--black);
    background:
        linear-gradient(90deg, rgb(8 12 24 / 70%) 0%, rgb(8 12 24 / 22%) 60%, transparent),
        linear-gradient(0deg, rgb(8 12 24 / 78%) 0%, transparent 55%),
        repeating-linear-gradient(0deg, transparent 0 4px, rgb(255 255 255 / 2%) 4px 5px);
    box-shadow: 8px 8px 0 #2f1750, 0 0 0 2px #8a68d6, var(--glow);
}

.hero-scene {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.region-card {
    position: absolute;
    inset: 0;
    z-index: 0;
    border: 5px solid var(--black);
    background:
        linear-gradient(135deg, rgb(152 221 229 / 18%), rgb(239 133 187 / 18%)),
        repeating-linear-gradient(0deg, transparent 0 8px, rgb(255 255 255 / 4%) 8px 10px),
        #10132f;
    box-shadow: 8px 8px 0 rgb(0 0 0 / 72%), inset 0 0 0 2px rgb(255 255 255 / 8%);
    opacity: 0.78;
    pointer-events: none;
}

.region-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgb(8 12 24 / 78%), rgb(8 12 24 / 24%)),
        url("../portfolio-ui/frames/grid.png") repeat;
}

.region-card span {
    position: absolute;
    right: 1rem;
    top: 0.9rem;
    z-index: 1;
    padding: 0.3rem 0.55rem;
    border: 2px solid var(--black);
    color: rgb(232 238 252 / 82%);
    background: rgb(10 13 24 / 84%);
    font-size: 0.75rem;
    font-weight: 800;
}

.region-card-1 { transform: translate(-22px, -18px) rotate(-1.4deg); border-color: #6a43b5; }
.region-card-2 { transform: translate(-44px, -34px) rotate(1.8deg); border-color: #4f8ed1; opacity: 0.55; }
.region-card-3 { transform: translate(-66px, -50px) rotate(-3deg); border-color: #d85d9c; opacity: 0.38; }

.hero-copy {
    position: absolute;
    bottom: 2rem;
    left: 2.4rem;
    z-index: 4;
    width: min(540px, calc(100% - 2rem));
    padding: 1.2rem;
    border: 3px solid var(--black);
    border-left: 5px solid var(--pink);
    background: rgb(16 22 37 / 94%);
    box-shadow: var(--shadow), inset 0 0 0 1px rgb(152 221 229 / 34%);
    backdrop-filter: blur(5px);
}

.hero-copy p:not(.eyebrow) {
    max-width: 46ch;
    color: #eef2ff;
    font-size: 1rem;
    line-height: 1.6;
}

.hero-actions,
.card-actions,
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.content-wrap,
.detail-page {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.section-heading,
.detail-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.3rem;
}

.section-heading h2,
.detail-header h1 {
    margin-bottom: 0.25rem;
}

.section-heading h2 {
    color: #f5f7ff;
    font-size: 2rem;
    font-weight: 800;
}

.quest-count {
    padding: 0.45rem 0.7rem;
    border: 2px solid rgb(152 221 229 / 55%);
    color: #e8f8fb;
    background: #172033;
    box-shadow: 3px 3px 0 var(--black);
    font-size: 0.82rem;
    font-weight: 800;
}

.main-panel,
.side-panel,
.experience-entry {
    position: relative;
    padding: 1.25rem;
    border: 3px solid var(--black);
    background:
        linear-gradient(rgb(23 29 49 / 97%), rgb(16 21 36 / 98%)),
        url("../wizard-ui/UI_WizardBook_BookCover01a.png") center / 100% 100%;
    box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}

.main-panel h2,
.side-panel h2 {
    padding-bottom: 0.55rem;
    border-bottom: 2px solid #3d4666;
    color: var(--cyan);
    font-size: 1.35rem;
    font-weight: 800;
}

.main-panel h2::before,
.side-panel h2::before {
    content: "> ";
    color: var(--pink);
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 1.25rem;
    align-items: stretch;
}

.profile-panel p,
.project-story p,
.timeline-item p:last-child,
.contact-panel p {
    color: #e2e7f5;
    line-height: 1.7;
}

.profile-panel p:last-child {
    margin-bottom: 0;
}

.facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 1rem 0;
}

.facts.vertical {
    grid-template-columns: 1fr;
}

.facts div {
    min-width: 0;
    padding: 0.55rem;
    border: 2px solid #080b16;
    background: #10182a;
    box-shadow: inset 0 0 0 1px #323b5b;
}

.facts dt {
    color: var(--pink);
    font-size: 0.78rem;
    font-weight: 800;
}

.facts dd {
    margin: 0.2rem 0 0;
    overflow-wrap: anywhere;
    color: #f3f6ff;
    font-size: 0.95rem;
    line-height: 1.45;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.stats-grid article {
    position: relative;
    padding: 1rem;
    overflow: hidden;
    border: 3px solid var(--black);
    color: white;
    background:
        linear-gradient(rgb(73 75 111 / 78%), rgb(25 31 52 / 90%)),
        url("../wizard-ui/UI_WizardBook_BookCover01a.png") center / 100% 100%;
    box-shadow: 4px 4px 0 var(--black), inset 0 0 0 1px #8a68d6;
}

.stats-grid article::after {
    content: ">";
    position: absolute;
    right: 0.5rem;
    bottom: -0.4rem;
    color: rgb(255 255 255 / 8%);
    font-size: 3.5rem;
    font-weight: 900;
}

.stats-grid strong,
.stats-grid span {
    display: block;
}

.stats-grid strong {
    color: var(--gold);
    font-size: 1.75rem;
    line-height: 1.15;
}

.stats-grid span {
    color: #d8deee;
    font-size: 0.86rem;
    font-weight: 800;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.skill-panel {
    min-height: 100%;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.tag-list span {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0.4rem 0.6rem;
    border: 2px solid var(--black);
    color: #0b1822;
    background: var(--green);
    box-shadow: 2px 2px 0 var(--black);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.25;
}

.tag-list span:nth-child(3n + 2) {
    color: #1b1607;
    background: var(--gold);
}

.tag-list span:nth-child(3n) {
    color: #081827;
    background: var(--blue);
}

.tag-list.compact {
    margin: 1rem 0;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
    align-items: stretch;
}

.project-card {
    position: relative;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 4px solid var(--black);
    background:
        linear-gradient(rgb(15 17 42 / 88%), rgb(11 13 33 / 94%)),
        url("../wizard-ui/UI_WizardBook_BookCover01a.png") center / 100% 100%;
    box-shadow: 6px 6px 0 #03040c, 0 0 0 1px #4c3971;
    transition: transform 130ms steps(3), box-shadow 130ms linear;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 6px 10px 0 #03040c, 0 0 0 2px var(--pink), var(--glow);
}

.project-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 48%;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgb(6 7 20 / 8%) 3px 4px);
}

.card-level {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 3;
    padding: 0.35rem 0.55rem;
    border: 2px solid var(--black);
    color: #111827;
    background: var(--gold);
    box-shadow: 3px 3px 0 var(--black);
    font-size: 0.78rem;
    font-weight: 900;
}

.project-card-media {
    display: grid;
    flex: 0 0 auto;
    background: #080b16;
}

.project-cover {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    image-rendering: auto;
    filter: saturate(0.9) contrast(1.06);
}

.project-card:hover .project-cover {
    filter: saturate(1.04) contrast(1.07);
}

.project-proof-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-top: 4px solid var(--black);
    background: var(--black);
}

.project-proof-strip img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    image-rendering: auto;
    filter: saturate(0.92) contrast(1.04);
}

.project-proof-strip img:only-child {
    grid-column: span 3;
    aspect-ratio: 16 / 5;
}

.card-body {
    position: relative;
    z-index: 2;
    display: grid;
    flex: 1;
    grid-template-rows: auto auto auto minmax(76px, auto) 1fr auto;
    gap: 0.7rem;
    padding: 1.2rem;
    border-top: 4px solid var(--black);
    background:
        linear-gradient(rgb(27 33 54 / 98%), rgb(18 24 40 / 99%)),
        url("../wizard-ui/UI_WizardBook_BookPageR01a.png") center / 100% 100%;
    background-blend-mode: multiply, normal;
}

.card-body h2,
.card-body p {
    margin-bottom: 0;
}

.card-body h2 {
    color: white;
    font-size: 1.35rem;
    font-weight: 900;
}

.card-body > p:not(.eyebrow) {
    color: #dfe4f3;
    line-height: 1.62;
}

.project-card .tag-list.compact {
    align-content: start;
    min-height: 68px;
}

.project-card .card-actions {
    align-self: end;
    margin-top: 0.25rem;
}

.primary-action,
.secondary-action {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 3px solid var(--black);
    padding: 0.65rem 1rem;
    transition: transform 90ms steps(2), filter 90ms linear;
}

.primary-action {
    color: white;
    background:
        linear-gradient(rgb(216 93 156 / 58%), rgb(114 91 166 / 58%)),
        url("../wizard-ui/UI_WizardBook_Button01a.png") center / 100% 100%;
    background-blend-mode: color, normal;
    box-shadow: 4px 4px 0 var(--black), inset 0 0 0 2px rgb(255 255 255 / 15%);
}

.secondary-action {
    color: #eef2ff;
    background:
        linear-gradient(rgb(101 174 232 / 28%), rgb(40 46 78 / 72%)),
        url("../wizard-ui/UI_WizardBook_Button02a.png") center / 100% 100%;
    background-blend-mode: color, normal;
    box-shadow: 4px 4px 0 var(--black), inset 0 0 0 1px #8a68d6;
}

.primary-action:hover,
.secondary-action:hover,
button:hover {
    color: white;
    filter: brightness(1.14);
    transform: translate(-1px, -2px);
}

.primary-action:active,
.secondary-action:active,
button:active {
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 var(--black);
}

.reveal-item {
    opacity: 0;
    transform: translateY(18px);
}

.reveal-item.is-revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 300ms steps(4), transform 300ms steps(4);
}

.timeline-list {
    display: grid;
    gap: 1rem;
}

.experience-entry {
    border-left: 5px solid var(--green);
}

.timeline-item h2 {
    margin-bottom: 0.35rem;
}

.project-highlights {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding-left: 1.2rem;
    color: #e2e7f5;
    line-height: 1.68;
}

.project-highlights li::marker {
    color: var(--gold);
}

.badge-list {
    margin-top: 0.8rem;
}

.contact-panel {
    display: grid;
    gap: 0.9rem;
    max-width: 780px;
}

.contact-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.contact-facts a {
    overflow-wrap: anywhere;
}

.site-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.2rem 2rem;
    border-top: 3px solid var(--black);
    color: #929bb4;
    background: #080d1b;
    font-size: 0.78rem;
}

.site-footer p {
    margin: 0;
}

.footer-design {
    justify-self: center;
    color: var(--pink);
}

.footer-tech {
    justify-self: end;
}

.project-detail-page {
    padding-top: 2rem;
}

.project-detail-hero {
    display: block;
    max-width: 860px;
}

.project-detail-hero > p:not(.eyebrow) {
    color: #e2e7f5;
    font-size: 1.06rem;
    line-height: 1.7;
}

.detail-layout,
.project-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
    gap: 1.25rem;
    align-items: start;
}

.project-story {
    display: grid;
    gap: 1.3rem;
}

.project-article-block {
    display: grid;
    gap: 0.85rem;
}

.project-article-image {
    margin: 0.35rem 0 0.6rem;
    overflow: hidden;
    border: 3px solid #080b16;
    background: #0d1324;
    box-shadow: 4px 4px 0 #03040c, inset 0 0 0 1px rgb(152 221 229 / 16%);
}

.project-article-image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: center;
    image-rendering: auto;
    background: #0c1222;
}

.project-article-image figcaption {
    padding: 0.65rem 0.8rem;
    color: #dce6f7;
    background: #11182a;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.4;
}

@keyframes blink {
    50% { opacity: 0.25; }
}

@keyframes xp-glow {
    50% { filter: brightness(1.3); }
}

@media (max-width: 1040px) {
    .portfolio-shell {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .portfolio-sidebar {
        padding: 0.85rem;
    }

    .user-avatar {
        width: 72px;
        height: 72px;
    }

    .project-grid,
    .skill-grid,
    .profile-grid,
    .detail-layout,
    .project-detail-layout {
        grid-template-columns: 1fr;
    }

    .facts,
    .stats-grid,
    .contact-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .portfolio-shell {
        display: block;
    }

    .portfolio-sidebar {
        position: relative;
        height: auto;
        overflow: visible;
        border-right: 0;
        border-bottom: 4px solid var(--black);
        box-shadow: inset 0 -2px 0 #8a68d6;
    }

    .user-card,
    .sidebar-tip {
        display: none;
    }

    .side-nav {
        display: flex;
        gap: 0.45rem;
        overflow-x: auto;
        padding-bottom: 0.35rem;
    }

    .side-nav .nav-heading {
        display: none;
    }

    .side-nav > a {
        width: max-content;
        min-width: max-content;
    }

    .topbar {
        position: relative;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .hero {
        min-height: 430px;
        margin-top: 1rem;
    }

    .region-card {
        transform: translate(-10px, -10px);
    }

    .region-card-2,
    .region-card-3 {
        display: none;
    }

    .hero-copy {
        bottom: 0.85rem;
        left: 0.65rem;
        width: calc(100% - 1.3rem);
    }

    .section-heading,
    .detail-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    h1,
    .hero h1 {
        font-size: 2.2rem;
    }

    .topbar > div:first-child {
        display: none;
    }

    .topbar {
        justify-content: flex-end;
    }

    .hero,
    .content-wrap,
    .detail-page {
        width: calc(100% - 1rem);
    }

    .facts,
    .stats-grid,
    .contact-facts {
        grid-template-columns: 1fr;
    }

    .project-proof-strip {
        grid-template-columns: 1fr;
    }

    .project-proof-strip img,
    .project-proof-strip img:only-child {
        grid-column: auto;
        aspect-ratio: 16 / 9;
    }

    .site-footer {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-design,
    .footer-tech {
        justify-self: center;
    }
}

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