:root {
    --bg: #030303;
    --bg-soft: #0b0b0b;
    --bg-card: #101010;
    --text: #f5f5f5;
    --muted: #a0a0a0;
    --accent: #ff1515;
    --accent-dark: #b80000;
    --border: #242424;
    --steel: #6d7b86;
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        var(--bg);
    background-size: 72px 72px;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(135deg, rgba(255, 21, 21, 0.09), transparent 32%),
        linear-gradient(315deg, rgba(109, 123, 134, 0.08), transparent 36%);
    pointer-events: none;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    margin: 0;
    color: var(--muted);
}

.mobile-topbar {
    display: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar-width);
    padding: 34px 28px;
    background: rgba(3, 3, 3, 0.94);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-avatar {
    width: 48px;
    height: 56px;
    object-fit: cover;
    object-position: top center;
    flex-shrink: 0;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.05;
}

.sidebar-logo-text strong {
    display: block;
    color: var(--text);
    font-size: 1.65rem;
    text-transform: uppercase;
    line-height: 1;
}

.sidebar-nav {
    display: grid;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: color 180ms ease;
}

.nav-prompt {
    color: var(--accent);
    opacity: 0.25;
    font-weight: 800;
    transition: opacity 180ms ease;
    user-select: none;
}

.nav-label {
    letter-spacing: 0.5px;
    transition: padding-left 180ms ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text);
}

.nav-item:hover .nav-prompt,
.nav-item.active .nav-prompt {
    opacity: 1;
}

.nav-item.active .nav-label {
    padding-left: 4px;
}

.nav-item.active .nav-label::after {
    content: "_";
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.sidebar-foot {
    display: grid;
    gap: 10px;
    color: var(--muted);
    font-size: 0.88rem;
}

.sidebar-foot a {
    color: var(--accent);
}

.menu-overlay {
    display: none;
}

.site-main {
    margin-left: var(--sidebar-width);
}

.section {
    position: relative;
    min-height: auto;
    padding: 68px 54px;
    display: flex;
    align-items: center;
}

.section-compact {
    min-height: auto;
    padding-top: 54px;
    padding-bottom: 54px;
}

.section-inner {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.split-layout,
.contact-grid,
.detail-grid,
.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 54px;
    align-items: center;
}

.contact-grid {
    align-items: start;
}

.hero-section {
    min-height: clamp(580px, 72svh, 740px);
    padding-top: clamp(52px, 6svh, 78px);
    padding-bottom: clamp(34px, 4.5svh, 56px);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 21, 21, 0.18), transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.08), transparent 1px);
    background-size: 210px 210px;
    opacity: 0.2;
    transform: rotate(-4deg) scale(1.08);
    pointer-events: none;
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: clamp(32px, 4vw, 48px);
    align-items: center;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--text);
    line-height: 1.05;
    letter-spacing: 0;
}

h1 {
    max-width: 11ch;
    font-size: 5rem;
}

h2 {
    max-width: 14ch;
    font-size: 3.25rem;
}

h3 {
    font-size: 1.25rem;
}

.hero-greeting {
    max-width: 12ch;
    font-size: 5.35rem;
}

.hero-greeting span {
    display: block;
}

.hero-name {
    color: var(--accent);
    white-space: nowrap;
}

.hero-role {
    max-width: 16ch;
    margin-top: 22px;
    color: var(--text);
    font-size: 2.45rem;
    line-height: 1.12;
}

.hero-subtitle {
    max-width: 620px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.18rem;
    font-weight: 500;
    line-height: 1.45;
}

.hero-actions,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-weight: 700;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-ghost:hover {
    border-color: var(--accent);
}

.hero-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: clamp(340px, 38svh, 420px);
}

.profile-frame {
    position: relative;
    width: min(360px, 100%);
    aspect-ratio: 4 / 5;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.profile-frame::before {
    display: none;
}

.profile-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.08) saturate(0.9);
}

.tech-orbit {
    position: absolute;
    inset: auto 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.tech-orbit span,
.tag-list span,
.status-pill {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(16, 16, 16, 0.88);
    color: var(--muted);
    font-size: 0.86rem;
}

.tech-orbit span,
.tag-list span {
    padding: 6px 10px;
}

.section-heading {
    margin-bottom: 26px;
}

.section-heading h2 {
    margin-bottom: 18px;
}

.content-stack {
    display: grid;
    gap: 18px;
    font-size: 1.08rem;
}

.about-experience-section {
    padding-top: 68px;
    padding-bottom: 68px;
}

.about-puzzle-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) minmax(260px, 0.8fr);
    grid-template-rows: minmax(250px, auto) minmax(210px, auto);
    grid-template-areas:
        "hero hero visual"
        "experience technical visual";
    gap: 6px;
    align-items: stretch;
}

.about-block {
    position: relative;
    margin: 0;
    min-height: 220px;
    padding: clamp(22px, 3vw, 34px);
    overflow: hidden;
    background: rgba(16, 16, 16, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 190ms ease, filter 190ms ease, background 190ms ease, box-shadow 190ms ease;
}

.about-block:first-child {
    border-radius: 8px 2px 2px 2px;
}

.about-block:nth-child(2) {
    border-radius: 2px 8px 8px 2px;
}

.about-block:nth-child(3) {
    border-radius: 2px 2px 2px 8px;
}

.about-block:nth-child(4) {
    border-radius: 2px 2px 8px 2px;
}

.about-block:hover {
    z-index: 2;
    transform: translateY(-3px);
    filter: brightness(1.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 21, 21, 0.18),
        0 18px 34px rgba(255, 21, 21, 0.08);
}

.about-block--hero {
    grid-area: hero;
    min-height: 360px;
    background:
        linear-gradient(135deg, rgba(255, 21, 21, 0.16), transparent 42%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 1px),
        rgba(15, 15, 15, 0.96);
    background-size: auto, 42px 42px, auto;
    justify-content: center;
    gap: 22px;
}

.about-block--hero::after {
    content: "";
    position: absolute;
    right: 34px;
    top: 34px;
    width: 118px;
    height: 118px;
    background:
        linear-gradient(var(--accent), var(--accent)) 0 0 / 38px 38px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 40px 0 / 38px 38px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 80px 0 / 38px 38px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 40px 40px / 38px 38px no-repeat;
    opacity: 0.09;
    pointer-events: none;
}

.about-block--hero h2 {
    position: relative;
    max-width: 19ch;
    font-size: 3rem;
    z-index: 1;
}

.about-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    max-width: 760px;
}

.about-block--visual {
    grid-area: visual;
    min-height: 100%;
    padding: 0;
    background: var(--bg-soft);
}

.about-block--visual img {
    width: 100%;
    height: 100%;
    min-height: 470px;
    object-fit: cover;
    filter: contrast(1.1) saturate(0.95);
}

.about-block--visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.82)),
        linear-gradient(135deg, rgba(255, 21, 21, 0.12), transparent 46%);
    pointer-events: none;
}

.about-block--visual figcaption {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 1;
    display: grid;
    gap: 4px;
}

.about-block--visual figcaption span,
.about-kicker {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.about-block--visual figcaption strong {
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1.15;
}

.about-block--experience {
    grid-area: experience;
    background:
        linear-gradient(90deg, rgba(255, 21, 21, 0.1), transparent 36%),
        rgba(11, 11, 11, 0.96);
}

.about-block--technical {
    grid-area: technical;
    background:
        linear-gradient(135deg, rgba(109, 123, 134, 0.14), transparent 48%),
        rgba(19, 19, 19, 0.95);
}

.about-block h3 {
    margin-top: 12px;
    font-size: 1.5rem;
    line-height: 1.12;
}

.about-block p {
    margin-top: 14px;
    font-size: 0.98rem;
}

.about-signals {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.about-signals span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
    font-size: 0.82rem;
}

.about-signals strong {
    color: var(--accent);
    font-size: 1.05rem;
    line-height: 1;
}

.skills-section {
    padding-top: 62px;
    padding-bottom: 62px;
}

.skills-section .eyebrow {
    display: block;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 3px;
    margin-bottom: 24px;
}

.skills-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.skills-header h2 {
    max-width: 11ch;
    font-size: 2.8rem;
}

.skills-header p {
    max-width: 340px;
    margin-top: 18px;
    color: #b9b9b9;
}

.skills-tetris {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, 200px) 180px;
    position: relative;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    gap: 6px;
    align-items: stretch;
}

.tetris-piece {
    position: relative;
    margin: 0;
    display: flex;
    color: var(--text);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-70px);
    background: rgba(16, 16, 16, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
    transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.tetris-piece::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 80% at 16% 10%, rgba(255, 21, 21, 0.16), transparent 52%),
        linear-gradient(125deg, rgba(255, 255, 255, 0.025), transparent 30%);
    pointer-events: none;
}

.tetris-piece::after {
    content: "";
    position: absolute;
    right: 20px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    background:
        linear-gradient(var(--accent), var(--accent)) 0 0 / 16px 16px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 20px 0 / 16px 16px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 20px 20px / 16px 16px no-repeat;
    opacity: 0.07;
    pointer-events: none;
}

.tetris-piece.animate-in {
    opacity: 1;
    transform: translateY(0);
    animation: tetris-drop 560ms cubic-bezier(0.2, 0.92, 0.22, 1) backwards;
    animation-delay: var(--drop-delay, 0ms);
}

.tetris-piece:hover {
    z-index: 10;
    transform: translateY(-4px) scale(1.012);
    filter: brightness(1.09);
    box-shadow:
        inset 0 0 0 1px rgba(255, 21, 21, 0.2),
        0 0 0 1px rgba(255, 21, 21, 0.14),
        0 20px 42px rgba(255, 21, 21, 0.18);
}

.piece-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: clamp(18px, 2.2vw, 28px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.piece-tag {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.piece-name {
    max-width: 18ch;
    color: var(--text);
    font-size: clamp(1.04rem, 1.45vw, 1.4rem);
    line-height: 1.22;
}

.piece-copy {
    margin: 0;
    max-width: 42ch;
    color: #c6c6c6;
    font-size: 0.94rem;
    line-height: 1.45;
}

.piece-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.piece-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(10, 10, 10, 0.6);
    color: #d1d1d1;
    font-size: 0.8rem;
}

.piece-badge-icon {
    font-size: 0.92rem;
    line-height: 1;
}

.piece-app {
    grid-area: 1 / 3 / 3 / 5;
    background:
        linear-gradient(135deg, rgba(109, 123, 134, 0.12), transparent 48%),
        rgba(19, 19, 19, 0.95);
    border-radius: 8px 8px 2px 2px;
}

.piece-app .piece-content {
    height: auto;
    padding-right: clamp(20px, 2.2vw, 28px);
    padding-left: clamp(20px, 2.2vw, 28px);
    padding-bottom: clamp(14px, 1.8vw, 20px);
}

.piece-app .piece-copy {
    max-width: 34ch;
}

.piece-jogos {
    grid-area: 1 / 1 / 3 / 3;
    background:
        linear-gradient(135deg, rgba(255, 21, 21, 0.16), transparent 42%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 1px),
        rgba(15, 15, 15, 0.96);
    background-size: auto, 42px 42px, auto;
    border-radius: 2px 2px 8px 2px;
}

.piece-jogos .piece-content {
    height: auto;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding-top: clamp(18px, 2.1vw, 28px);
    padding-bottom: clamp(12px, 1.6vw, 18px);
    padding-right: clamp(22px, 2.6vw, 34px);
}

.piece-jogos .piece-name {
    max-width: 24ch;
}

.piece-jogos .piece-copy {
    max-width: 46ch;
}

.piece-level {
    grid-area: 3 / 1 / 4 / 3;
    background:
        linear-gradient(90deg, rgba(255, 21, 21, 0.1), transparent 44%),
        rgba(11, 11, 11, 0.96);
    border-radius: 2px 2px 2px 8px;
}

.piece-level .piece-name {
    max-width: 14ch;
    font-size: clamp(0.96rem, 1.15vw, 1.12rem);
}

.piece-level .piece-copy {
    font-size: 0.86rem;
    line-height: 1.38;
}

.piece-sites {
    grid-area: 3 / 3 / 4 / 5;
    background:
        linear-gradient(135deg, rgba(109, 123, 134, 0.14), transparent 48%),
        rgba(19, 19, 19, 0.95);
    border-radius: 2px 2px 8px 8px;
}

.piece-sites .piece-content {
    justify-content: center;
}

.piece-sites .piece-name {
    max-width: 22ch;
}

.piece-sites .piece-copy {
    max-width: 44ch;
}

.stats-grid,
.cards-grid,
.portfolio-grid,
.gallery-grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portfolio-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card,
.info-card,
.portfolio-card,
.details-panel,
.long-text,
.error-box,
.contact-form {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(16, 16, 16, 0.82);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.stat-card:hover,
.info-card:hover,
.portfolio-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 21, 21, 0.72);
    background: rgba(18, 18, 18, 0.96);
}

.stat-card {
    min-height: 154px;
    padding: 24px;
    display: grid;
    align-content: space-between;
}

.stat-card strong {
    color: var(--accent);
    font-size: 2.4rem;
    line-height: 1;
}

.stat-card span {
    color: var(--muted);
}

.info-card {
    position: relative;
    margin: 0;
    min-height: 220px;
    padding: clamp(22px, 3vw, 34px);
    overflow: hidden;
    background: rgba(16, 16, 16, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 190ms ease, filter 190ms ease, background 190ms ease, box-shadow 190ms ease;
    border-radius: 8px;
}

.info-card:hover {
    z-index: 2;
    transform: translateY(-3px);
    filter: brightness(1.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 21, 21, 0.18),
        0 18px 34px rgba(255, 21, 21, 0.08);
}

.card-mark {
    width: 42px;
    height: 3px;
    background: var(--accent);
}

.tech-carousel {
    position: relative;
    overflow: hidden;
}

.tech-viewport {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.tech-track {
    display: flex;
    gap: 34px;
    align-items: center;
    width: max-content;
    padding: 18px 8px 22px;
    animation: tech-marquee 34s linear infinite;
    will-change: transform;
}

.tech-carousel:hover .tech-track,
.tech-carousel:focus-within .tech-track {
    animation-play-state: paused;
}

.tech-item {
    flex: 0 0 112px;
    min-height: 118px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    opacity: 0.82;
    transition: transform 220ms ease, opacity 220ms ease, filter 220ms ease;
}

.tech-item:hover {
    transform: translateY(-5px) scale(1.03);
    opacity: 1;
    filter: drop-shadow(0 14px 18px rgba(255, 21, 21, 0.16));
}

.tech-icon {
    position: relative;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
}

.tech-icon picture,
.tech-icon img {
    display: block;
}

.tech-icon img {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.tech-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 800;
    opacity: 0;
}

.tech-icon.icon-failed .tech-fallback {
    opacity: 1;
}

.tech-name {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

@keyframes tech-marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(-50% - 17px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .tech-track {
        animation: none;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .tech-item[aria-hidden="true"] {
        display: none;
    }
}

.portfolio-card {
    overflow: hidden;
}

.portfolio-section {
    padding-top: 64px;
}

.portfolio-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.portfolio-header h2 {
    max-width: none;
    font-size: 3rem;
}

.portfolio-header p {
    margin-top: 10px;
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.filter-btn {
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(16, 16, 16, 0.62);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 21, 21, 0.5);
    color: var(--text);
}

.filter-btn.active {
    border-color: var(--accent);
    background: rgba(255, 21, 21, 0.14);
    color: var(--text);
}

.portfolio-media {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--bg-soft);
    overflow: hidden;
}

.portfolio-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 240ms ease;
}

.portfolio-card:hover .portfolio-media img {
    transform: scale(1.04);
}

.portfolio-card.is-filtered-out {
    display: none;
}

.portfolio-card.is-filtered-in {
    animation: portfolio-card-in 240ms ease both;
}

@keyframes portfolio-card-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-body {
    padding: 22px;
    display: grid;
    gap: 14px;
}

.portfolio-body h3 {
    min-height: 2.6em;
}

.portfolio-page-section {
    min-height: 100vh;
    padding-top: 92px;
}

.portfolio-page-heading {
    max-width: 650px;
}

.portfolio-page-heading .back-link {
    display: inline-block;
    margin-bottom: 18px;
}

.portfolio-page-heading h1 {
    max-width: 12ch;
    font-size: 3.2rem;
}

.portfolio-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-pill {
    width: fit-content;
    padding: 5px 9px;
    color: var(--accent);
    border-color: rgba(255, 21, 21, 0.4);
}

.status-pill--muted {
    color: var(--muted);
    border-color: var(--border);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.text-link {
    color: var(--accent);
    font-weight: 700;
}

.text-link:hover {
    color: var(--text);
}

.empty-state {
    grid-column: 1 / -1;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.portfolio-filter-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(16, 16, 16, 0.76);
}

.contact-details {
    display: grid;
    gap: 8px;
    margin-top: 26px;
}

.contact-details strong {
    color: var(--text);
}

.contact-form {
    padding: 28px;
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    gap: 8px;
}

label {
    color: var(--text);
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #070707;
    color: var(--text);
    font: inherit;
    padding: 13px 14px;
    outline: none;
    transition: border-color 180ms ease, background 180ms ease;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    background: #0d0d0d;
}

.hp-field {
    position: absolute;
    left: -9999px;
}

.detail-hero {
    min-height: 68vh;
}

.game-detail-page .game-detail-hero {
    min-height: auto;
    padding-top: clamp(56px, 7svh, 88px);
    padding-bottom: clamp(24px, 4svh, 44px);
}

.game-detail-page .game-detail-hero .detail-grid {
    gap: clamp(30px, 4.2vw, 48px);
}

.game-detail-page .game-details-section {
    padding-top: clamp(24px, 3.4vw, 42px);
    padding-bottom: clamp(48px, 5vw, 68px);
}

.game-detail-page .game-details-section .detail-content {
    align-items: flex-start;
    gap: clamp(28px, 4vw, 48px);
}

.detail-copy h1 {
    max-width: 12ch;
}

.detail-copy p {
    margin-top: 24px;
    font-size: 1.15rem;
}

.detail-cover {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
}

.detail-cover img {
    width: 100%;
    aspect-ratio: 16 / 11;
    object-fit: cover;
}

.details-panel,
.long-text,
.error-box {
    padding: 30px;
}

.details-panel h2,
.long-text h2 {
    margin-bottom: 20px;
    font-size: 1.65rem;
}

dl {
    display: grid;
    gap: 14px;
    margin: 0 0 24px;
}

dl div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
    color: var(--text);
}

.long-text {
    color: var(--muted);
}

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.gallery-item {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
}

.gallery-link,
.phone-frame__link {
    display: block;
    width: 100%;
    color: inherit;
    cursor: zoom-in;
}

.gallery-link:focus-visible,
.phone-frame__link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 5px;
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.mobile-gallery {
    display: grid;
    gap: clamp(22px, 3vw, 34px);
    align-items: start;
    justify-items: center;
}

.mobile-gallery--portrait {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.mobile-gallery--landscape {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.phone-frame {
    display: grid;
    justify-items: center;
    width: 100%;
    margin: 0;
}

.phone-frame--portrait {
    max-width: 280px;
}

.phone-frame--landscape {
    max-width: 560px;
}

.phone-frame__device {
    position: relative;
    width: 100%;
    background: linear-gradient(145deg, #101010, #000 56%, #070707);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 26px 70px rgba(0, 0, 0, 0.42),
        inset 0 0 0 2px rgba(255, 255, 255, 0.045),
        inset 0 0 0 7px rgba(0, 0, 0, 0.82);
}

.phone-frame__device::before,
.phone-frame__device::after {
    content: "";
    position: absolute;
    z-index: 3;
    background: #020202;
}

.phone-frame__device::before {
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.phone-frame__device::after {
    opacity: 0.92;
}

.phone-frame--portrait .phone-frame__device {
    aspect-ratio: 9 / 19.5;
    padding: 13px;
    border-radius: 42px;
}

.phone-frame--portrait .phone-frame__device::before {
    top: 18px;
    left: 50%;
    width: 38%;
    height: 18px;
    border-radius: 999px;
    transform: translateX(-50%);
}

.phone-frame--portrait .phone-frame__device::after {
    top: 26%;
    right: -4px;
    width: 4px;
    height: 58px;
    border-radius: 0 5px 5px 0;
}

.phone-frame--landscape .phone-frame__device {
    aspect-ratio: 19.5 / 9;
    padding: 13px 18px;
    border-radius: 34px;
}

.phone-frame--landscape .phone-frame__device::before {
    top: 50%;
    left: 18px;
    width: 18px;
    height: 38%;
    border-radius: 999px;
    transform: translateY(-50%);
}

.phone-frame--landscape .phone-frame__device::after {
    top: -4px;
    right: 25%;
    width: 58px;
    height: 4px;
    border-radius: 5px 5px 0 0;
}

.phone-frame__screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #101010;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-frame--portrait .phone-frame__screen {
    border-radius: 31px;
}

.phone-frame--landscape .phone-frame__screen {
    border-radius: 24px;
}

.phone-frame__screen::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 34%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

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

body.lightbox-open {
    overflow: hidden;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 44px);
    background: rgba(0, 0, 0, 0.9);
}

.image-lightbox[hidden] {
    display: none;
}

.image-lightbox__image {
    max-width: min(100%, 1180px);
    max-height: calc(100svh - 88px);
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: #050505;
    box-shadow: 0 28px 86px rgba(0, 0, 0, 0.58);
}

.image-lightbox__close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(10, 10, 10, 0.88);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.image-lightbox__close:hover,
.image-lightbox__close:focus-visible {
    border-color: var(--accent);
    background: rgba(20, 20, 20, 0.96);
    color: var(--accent);
    outline: none;
}

.image-lightbox__nav {
    position: fixed;
    top: 50%;
    z-index: 2;
    width: 50px;
    height: 58px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(10, 10, 10, 0.78);
    color: var(--text);
    font: inherit;
    font-size: 1.55rem;
    font-weight: 800;
    cursor: pointer;
    transform: translateY(-50%);
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.image-lightbox__nav--previous {
    left: 18px;
}

.image-lightbox__nav--next {
    right: 18px;
}

.image-lightbox__nav:hover,
.image-lightbox__nav:focus-visible {
    border-color: var(--accent);
    background: rgba(20, 20, 20, 0.96);
    color: var(--accent);
    outline: none;
}

.image-lightbox__counter {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 2;
    min-width: 78px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(10, 10, 10, 0.82);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    padding: 10px 12px;
    transform: translateX(-50%);
}

.error-box {
    max-width: 720px;
}

.error-box h1 {
    max-width: 12ch;
    margin-bottom: 18px;
}

.error-box .btn {
    margin-top: 28px;
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 35;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--accent);
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent-dark);
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.about-piece {
    opacity: 0;
    transform: translateY(-82px) scale(0.985);
}

.about-piece.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: piece-drop 620ms cubic-bezier(0.2, 0.92, 0.22, 1) backwards;
    animation-delay: var(--drop-delay, 0ms);
}

@keyframes piece-drop {
    0% {
        opacity: 0;
        transform: translateY(-92px) scale(0.98);
    }

    62% {
        opacity: 1;
        transform: translateY(8px) scale(1.012);
    }

    78% {
        transform: translateY(-3px) scale(0.997);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tetris-drop {
    0% {
        opacity: 0;
        transform: translateY(-86px) scale(0.98);
    }

    60% {
        opacity: 1;
        transform: translateY(7px) scale(1.018);
    }

    78% {
        transform: translateY(-4px) scale(0.998);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .about-piece,
    .about-piece.is-visible,
    .tetris-piece,
    .tetris-piece.animate-in {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

@media (max-width: 1180px) {
    h1 {
        font-size: 4.1rem;
    }

    h2 {
        font-size: 2.7rem;
    }

    .hero-greeting {
        font-size: 4.45rem;
    }

    .hero-role {
        font-size: 2.1rem;
    }

    .stats-grid,
    .cards-grid,
    .portfolio-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-puzzle-grid {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr);
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "hero visual"
            "experience visual"
            "technical technical";
    }

    .about-block--hero h2 {
        max-width: 18ch;
        font-size: 2.35rem;
    }

    .skills-layout {
        grid-template-columns: minmax(190px, 0.58fr) minmax(0, 1.42fr);
        gap: 28px;
    }

    .skills-header h2 {
        font-size: 2.45rem;
    }

    .skills-tetris {
        grid-template-rows: repeat(3, 172px);
    }
}

@media (max-width: 900px) {
    .mobile-topbar {
        position: fixed;
        inset: 0 0 auto 0;
        z-index: 60;
        height: 66px;
        padding: 0 18px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: rgba(3, 3, 3, 0.95);
        border-bottom: 1px solid var(--border);
    }

    .mobile-brand {
        font-weight: 800;
        text-transform: uppercase;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
        border: 1px solid var(--border);
        border-radius: 6px;
        background: var(--bg-card);
        display: grid;
        place-items: center;
        gap: 4px;
        padding: 10px;
    }

    .menu-toggle span {
        width: 20px;
        height: 2px;
        background: var(--text);
    }

    .sidebar {
        width: min(82vw, 310px);
        transform: translateX(-100%);
        transition: transform 220ms ease;
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(0, 0, 0, 0.58);
    }

    body.menu-open .menu-overlay {
        display: block;
    }

    .site-main {
        margin-left: 0;
    }

    .section {
        min-height: auto;
        padding: 84px 22px 54px;
    }

    .game-detail-page .game-detail-hero {
        padding-top: 92px;
        padding-bottom: 24px;
    }

    .game-detail-page .game-details-section {
        padding-top: 24px;
        padding-bottom: 50px;
    }

    .hero-section {
        min-height: auto;
        padding-top: 88px;
        padding-bottom: 44px;
    }

    .hero-grid,
    .split-layout,
    .contact-grid,
    .detail-grid,
    .detail-content {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .game-detail-page .game-detail-hero .detail-grid,
    .game-detail-page .game-details-section .detail-content {
        gap: 28px;
    }

    .about-puzzle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "hero hero"
            "visual experience"
            "visual technical";
    }

    .about-block--hero {
        min-height: 300px;
    }

    .about-block--visual img {
        min-height: 420px;
    }

    .portfolio-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .portfolio-page-section {
        padding-top: 94px;
    }

    .portfolio-filters {
        justify-content: flex-start;
    }

    .skills-layout {
        grid-template-columns: 1fr;
    }

    .skills-header {
        max-width: 620px;
    }

    .skills-header h2 {
        max-width: none;
    }

    .skills-tetris {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: repeat(3, 158px);
    }

    .hero-visual {
        min-height: 300px;
    }
}

@media (max-width: 640px) {
    h1 {
        max-width: 100%;
        font-size: 2.7rem;
    }

    h2 {
        max-width: 100%;
        font-size: 2.05rem;
    }

    .hero-greeting {
        max-width: 100%;
        font-size: 2.8rem;
    }

    .hero-role {
        max-width: 100%;
        margin-top: 16px;
        font-size: 1.55rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .detail-copy p {
        font-size: 1rem;
    }

    .stats-grid,
    .cards-grid,
    .portfolio-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .about-experience-section {
        padding-top: 58px;
        padding-bottom: 58px;
    }

    .about-puzzle-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "hero"
            "visual"
            "experience"
            "technical";
        gap: 5px;
    }

    .about-block {
        min-height: auto;
        padding: 20px;
        border-radius: 4px;
    }

    .about-block--hero {
        gap: 18px;
    }

    .about-block--hero h2 {
        max-width: 100%;
        font-size: 2rem;
    }

    .about-block--visual {
        min-height: 280px;
        padding: 0;
    }

    .about-block--visual img {
        min-height: 280px;
    }

    .about-signals {
        flex-direction: column;
    }

    .portfolio-section {
        padding-top: 54px;
    }

    .skills-section {
        padding-top: 54px;
        padding-bottom: 54px;
    }

    .skills-layout {
        gap: 22px;
    }

    .skills-header h2 {
        font-size: 2.05rem;
    }

    .skills-header p {
        max-width: none;
        margin-top: 12px;
    }

    .skills-tetris {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 10px;
    }

    .tetris-piece,
    .piece-app,
    .piece-jogos,
    .piece-level,
    .piece-sites {
        grid-area: auto;
        min-height: 112px;
        clip-path: none;
        border-radius: 8px;
    }

    .piece-content,
    .piece-app .piece-content,
    .piece-jogos .piece-content,
    .piece-sites .piece-content {
        height: auto;
        align-items: flex-start;
        justify-content: center;
        text-align: left;
        padding: 22px;
    }

    .piece-name {
        font-size: 1.16rem;
    }

    .portfolio-header {
        gap: 18px;
        margin-bottom: 22px;
    }

    .portfolio-header h2 {
        font-size: 2.1rem;
    }

    .portfolio-page-heading h1 {
        max-width: 100%;
        font-size: 2.25rem;
    }

    .portfolio-filters {
        gap: 8px;
    }

    .filter-btn {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.88rem;
    }

    .tech-track {
        gap: 18px;
        padding: 14px 6px 18px;
        animation-duration: 28s;
    }

    .tech-item {
        flex-basis: 86px;
        min-height: 104px;
        padding: 8px 4px;
    }

    .tech-icon {
        width: 44px;
        height: 44px;
    }

    .tech-icon img {
        width: 38px;
        height: 38px;
    }

    .tech-name {
        font-size: 0.82rem;
    }

    @keyframes tech-marquee {
        from {
            transform: translateX(0);
        }

        to {
            transform: translateX(calc(-50% - 9px));
        }
    }

    .hero-actions,
    .detail-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .profile-frame {
        width: min(270px, 100%);
    }

    .tech-orbit {
        position: static;
        margin-top: 16px;
    }

    .stat-card,
    .info-card {
        min-height: 136px;
    }

    .portfolio-body h3 {
        min-height: auto;
    }

    dl div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

@media (max-width: 900px) {
    .mobile-gallery--landscape {
        grid-template-columns: 1fr;
    }

    .phone-frame--portrait {
        max-width: 260px;
    }

    .phone-frame--landscape {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .mobile-gallery--portrait,
    .mobile-gallery--landscape {
        grid-template-columns: 1fr;
    }

    .phone-frame--portrait {
        max-width: min(76vw, 250px);
    }

    .phone-frame--portrait .phone-frame__device {
        border-radius: 38px;
        padding: 11px;
    }

    .phone-frame--portrait .phone-frame__screen {
        border-radius: 28px;
    }

    .phone-frame--landscape .phone-frame__device {
        border-radius: 28px;
        padding: 10px 14px;
    }

    .phone-frame--landscape .phone-frame__screen {
        border-radius: 20px;
    }

    .image-lightbox {
        padding: 64px 14px 62px;
    }

    .image-lightbox__image {
        max-height: calc(100svh - 138px);
    }

    .image-lightbox__nav {
        top: auto;
        bottom: 14px;
        width: 48px;
        height: 42px;
        font-size: 1.25rem;
        transform: none;
    }

    .image-lightbox__nav--previous {
        left: 14px;
    }

    .image-lightbox__nav--next {
        right: 14px;
    }

    .image-lightbox__counter {
        bottom: 14px;
    }
}

.sidebar-social {
    display: flex;
    gap: 16px;
    align-items: center;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.sidebar-social a {
    color: var(--muted);
    transition: color 180ms ease, transform 180ms ease;
    display: flex;
    align-items: center;
}

.sidebar-social a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}
