:root {
    --ry-bg: #1d1e24;
    --ry-card: #31313a;
    --ry-card-soft: #2a2b31;
    --ry-accent: #ffb400;
    --ry-accent-soft: rgba(255, 180, 0, 0.15);
    --ry-text: #ffffff;
    --ry-muted: #999999;
    --ry-border: rgba(255, 255, 255, 0.08);
    --ry-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    height: 100%;
}

body {
    font-family: "Poppins", "Segoe UI", sans-serif;
    color: var(--ry-text);
    background: var(--ry-bg);
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #1d1e24 0%, #25262d 35%, #2f3140 70%, #1d1e24 100%);
    background-size: 400% 400%;
    animation: gradientShift 14s ease infinite;
}

.bg-gradient::before,
.bg-gradient::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
    animation: floatOrb 10s ease-in-out infinite alternate;
}

.bg-gradient::before {
    width: 420px;
    height: 420px;
    background: rgba(255, 180, 0, 0.25);
    top: -80px;
    right: 10%;
}

.bg-gradient::after {
    width: 360px;
    height: 360px;
    background: rgba(88, 101, 242, 0.22);
    bottom: -60px;
    left: 8%;
    animation-delay: -4s;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes floatOrb {
    from { transform: translateY(0) translateX(0); }
    to { transform: translateY(30px) translateX(20px); }
}

.preloader {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--ry-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .45s ease, visibility .45s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-ring {
    width: 54px;
    height: 54px;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: var(--ry-accent);
    border-radius: 50%;
    animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.vcard {
    position: sticky;
    top: 0;
    align-self: stretch;
    min-height: 100vh;
    height: 100vh;
    background: var(--ry-card);
    border-radius: 0;
    box-shadow: none;
    border-right: 1px solid var(--ry-border);
    overflow: hidden;
    animation: cardIn .8s ease both;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.vcard-photo {
    position: relative;
    padding: 1.75rem 1.25rem 0;
    text-align: center;
}

.vcard-photo img {
    width: min(100%, 270px);
    height: 270px;
    object-fit: cover;
    object-position: center top;
    margin: 0 auto;
    border-radius: 24px;
    border: 4px solid var(--ry-accent-soft);
    background: #fff;
}

.vcard-body {
    padding: 1.5rem 2rem 2rem;
    text-align: center;
}

.vcard-body h1 {
    margin: 0 0 .35rem;
    font-size: 1.65rem;
    font-weight: 700;
}

.vcard-role {
    color: var(--ry-accent);
    font-size: .95rem;
    font-weight: 500;
    min-height: 1.5rem;
    margin-bottom: 1.25rem;
}

.vcard-social {
    display: flex;
    justify-content: center;
    gap: .65rem;
    margin-bottom: 1.25rem;
}

.vcard-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ry-card-soft);
    border: 1px solid var(--ry-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ry-muted);
    transition: .25s;
}

.vcard-social a:hover {
    color: var(--ry-bg);
    background: var(--ry-accent);
    border-color: var(--ry-accent);
    transform: translateY(-2px);
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    background: var(--ry-accent);
    color: #1d1e24;
    border: none;
    border-radius: 999px;
    padding: .8rem 1.35rem;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: transform .2s, box-shadow .2s;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(255, 180, 0, 0.25);
    color: #1d1e24;
}

.content-wrap {
    animation: contentIn .9s ease .15s both;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem 1.5rem;
    overflow: hidden;
}

@keyframes contentIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
    background: rgba(49, 49, 58, 0.72);
    backdrop-filter: blur(10px);
    border: 1px solid var(--ry-border);
    border-radius: 18px;
    padding: .85rem;
}

.section-nav button {
    flex: 1 1 auto;
    min-width: 110px;
    border: none;
    background: transparent;
    color: var(--ry-muted);
    border-radius: 12px;
    padding: .85rem 1rem;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    transition: .25s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
}

.section-nav button:hover,
.section-nav button.active {
    background: var(--ry-accent);
    color: #1d1e24;
}

.content-card {
    background: rgba(49, 49, 58, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid var(--ry-border);
    border-radius: 20px;
    box-shadow: var(--ry-shadow);
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.page {
    display: none;
    padding: 2rem;
    animation-duration: .55s;
    animation-fill-mode: both;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.page.active {
    display: block;
}

.page.enter-fade {
    animation-name: pageFadeIn;
}

.page.leave-fade {
    animation-name: pageFadeOut;
}

.page.enter-slide {
    animation-name: pageSlideIn;
}

.page.leave-slide {
    animation-name: pageSlideOut;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pageFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-12px); }
}

@keyframes pageSlideIn {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pageSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-24px); }
}

.page-title {
    margin: 0 0 .35rem;
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 700;
}

.page-kicker {
    color: var(--ry-accent);
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: .25rem;
}

.page-head {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ry-border);
}

.page-head p {
    margin: .5rem 0 0;
    color: var(--ry-muted);
    max-width: 680px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.about-grid.two-col {
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .85rem;
}

.info-item {
    background: var(--ry-card-soft);
    border: 1px solid var(--ry-border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.info-item span {
    display: block;
    color: var(--ry-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .25rem;
}

.info-item strong {
    font-size: .92rem;
    font-weight: 600;
    word-break: break-word;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .85rem;
    width: 100%;
}

.stat-card {
    background: var(--ry-card-soft);
    border: 1px solid var(--ry-border);
    border-radius: 14px;
    padding: 1.15rem 1rem;
    text-align: center;
    height: auto;
    min-height: 0;
    align-self: start;
}

.stat-card i {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--ry-accent-soft);
    color: var(--ry-accent);
    font-size: 1.1rem;
    margin-bottom: .65rem;
}

.stat-card strong {
    display: block;
    font-size: 1.55rem;
    line-height: 1.1;
    color: var(--ry-accent);
    margin-bottom: .2rem;
}

.stat-card span {
    display: block;
    color: var(--ry-muted);
    font-size: .8rem;
    line-height: 1.3;
}

.skills-wrap {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.skill-row .label {
    display: flex;
    justify-content: space-between;
    margin-bottom: .45rem;
    font-size: .88rem;
    font-weight: 600;
}

.skill-row .bar {
    height: 8px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
}

.skill-row .bar span {
    display: block;
    height: 100%;
    width: var(--percent, 0%);
    background: linear-gradient(90deg, var(--ry-accent), #ffd86b);
    border-radius: 999px;
    transition: width 1.2s ease;
}

.skill-row:not(.animate) .bar span {
    width: 0;
}

.skill-row.animate .bar span {
    width: var(--percent);
}

.skill-circles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.skill-circle {
    text-align: center;
}

.skill-circle svg {
    width: 92px;
    height: 92px;
    transform: rotate(-90deg);
}

.skill-circle circle.bg {
    fill: none;
    stroke: rgba(255,255,255,.08);
    stroke-width: 8;
}

.skill-circle circle.progress {
    fill: none;
    stroke: var(--ry-accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 251;
    stroke-dashoffset: 251;
    transition: stroke-dashoffset 1.2s ease;
}

.skill-circle.animate circle.progress {
    stroke-dashoffset: var(--offset);
}

.skill-circle label {
    display: block;
    margin-top: .55rem;
    font-size: .82rem;
    color: var(--ry-muted);
}

.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: .4rem;
    bottom: .4rem;
    width: 2px;
    background: linear-gradient(var(--ry-accent), rgba(255,180,0,.15));
}

.timeline-item {
    position: relative;
    padding: 0 0 1.5rem 1.25rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.62rem;
    top: .35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ry-accent);
    box-shadow: 0 0 0 6px var(--ry-accent-soft);
}

.timeline-item h4 {
    margin: 0 0 .2rem;
    font-size: 1.05rem;
}

.timeline-item .meta {
    color: var(--ry-accent);
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: .45rem;
}

.timeline-item p {
    margin: 0;
    color: var(--ry-muted);
    font-size: .9rem;
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-bottom: 1.25rem;
}

.filter-btn {
    border: 1px solid var(--ry-border);
    background: var(--ry-card-soft);
    color: var(--ry-muted);
    border-radius: 999px;
    padding: .5rem 1rem;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    cursor: pointer;
    transition: .25s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--ry-accent);
    border-color: var(--ry-accent);
    color: #1d1e24;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.portfolio-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--ry-card-soft);
    transition: transform .3s, opacity .3s;
}

.portfolio-item.hidden { display: none; }

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}

.portfolio-item:hover img { transform: scale(1.08); }

.portfolio-item .overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: .85rem;
    background: linear-gradient(transparent, rgba(0,0,0,.85));
}

.portfolio-item h4 {
    margin: 0 0 .1rem;
    font-size: .88rem;
}

.portfolio-item span {
    color: var(--ry-muted);
    font-size: .75rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.contact-card {
    background: var(--ry-card-soft);
    border: 1px solid var(--ry-border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    gap: .85rem;
    align-items: flex-start;
}

.contact-card i {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--ry-accent-soft);
    color: var(--ry-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.contact-card strong {
    display: block;
    margin-bottom: .2rem;
}

.contact-card span,
.contact-card a {
    color: var(--ry-muted);
    font-size: .9rem;
    word-break: break-word;
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 120;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid var(--ry-border);
    background: rgba(49,49,58,.95);
    color: var(--ry-text);
}

@media (max-width: 991px) {
    .app-shell {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
        padding-top: 4.5rem;
    }

    .vcard {
        position: relative;
        top: 0;
        min-height: auto;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--ry-border);
    }

    .content-wrap {
        height: auto;
        min-height: auto;
        overflow: visible;
        padding: 1rem;
    }

    .content-card {
        min-height: 520px;
    }

    .mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .app-shell.collapsed .vcard { display: none; }

    .about-grid,
    .about-grid.two-col,
    .skills-wrap,
    .portfolio-grid,
    .contact-grid,
    .info-grid,
    .stats-grid,
    .skill-circles {
        grid-template-columns: 1fr;
    }

    .section-nav button {
        min-width: calc(50% - .5rem);
    }
}
