:root {
    --as-sidebar: 240px;
    --as-accent: #f2784b;
    --as-accent-soft: rgba(242, 120, 75, .12);
    --as-text: #2b2b2b;
    --as-muted: #8a8a8a;
    --as-border: #ececec;
    --as-bg: #f7f8fa;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: "Poppins", "Segoe UI", sans-serif;
    color: var(--as-text);
    background: var(--as-bg);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.app {
    display: grid;
    grid-template-columns: var(--as-sidebar) 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--as-border);
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.sidebar-profile {
    padding: 2rem 1.25rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--as-border);
}

.sidebar-profile img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 6px;
    margin: 0 auto 1rem;
}

.sidebar-profile h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--as-accent);
    letter-spacing: .02em;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: .75rem 0;
    flex: 1;
}

.sidebar-nav li { margin: 0; }

.sidebar-nav button {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .95rem 1.35rem;
    font: inherit;
    font-size: .92rem;
    color: var(--as-muted);
    cursor: pointer;
    position: relative;
    text-align: left;
    transition: color .2s, background .2s;
}

.sidebar-nav button i {
    width: 18px;
    font-size: 1rem;
    color: #b0b0b0;
}

.sidebar-nav button:hover,
.sidebar-nav button.active {
    color: var(--as-text);
    background: #fafafa;
}

.sidebar-nav button.active {
    color: var(--as-accent);
}

.sidebar-nav button.active i { color: var(--as-accent); }

.sidebar-nav button.active::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 28px;
    background: var(--as-accent);
    border-radius: 3px 0 0 3px;
}

.content {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.page {
    display: none;
    min-height: 100vh;
    animation-duration: .55s;
    animation-fill-mode: both;
}

.page.active { display: block; }

.page-home {
    display: none;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--as-bg);
}

.page-home.active { display: flex; }

.geom-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.geom-bg span {
    position: absolute;
    background: rgba(0, 0, 0, .035);
}

.geom-bg .s1 {
    width: 42%;
    height: 55%;
    top: -8%;
    right: 8%;
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 70%);
}

.geom-bg .s2 {
    width: 35%;
    height: 48%;
    bottom: -5%;
    left: 18%;
    clip-path: polygon(0 20%, 100% 0, 80% 100%, 0 100%);
}

.geom-bg .s3 {
    width: 28%;
    height: 38%;
    top: 18%;
    left: 42%;
    clip-path: polygon(50% 0, 100% 40%, 70% 100%, 0 80%);
}

.geom-bg .s4 {
    width: 22%;
    height: 30%;
    bottom: 12%;
    right: 28%;
    clip-path: polygon(0 0, 100% 20%, 100% 100%, 20% 100%);
}

.home-center {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.home-center h1 {
    margin: 0 0 .35rem;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--as-accent);
    letter-spacing: -.02em;
}

.home-center p {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 300;
    color: #555;
}

.settings-btn {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 42px;
    height: 42px;
    border: 1px solid var(--as-border);
    border-radius: 8px;
    background: #fff;
    color: #555;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    box-shadow: 0 4px 18px rgba(0,0,0,.04);
    transition: .2s;
}

.settings-btn:hover {
    color: var(--as-accent);
    border-color: var(--as-accent);
}

.page-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 4rem 2.5rem 3rem;
}

.page-title {
    margin: 0 0 .35rem;
    font-size: 2rem;
    font-weight: 700;
}

.page-title span { color: var(--as-accent); }

.page-kicker {
    color: var(--as-muted);
    margin-bottom: 2rem;
    font-size: .95rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

.about-photo {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0,0,0,.08);
}

.about-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
}

.about-list li {
    padding: .45rem 0;
    border-bottom: 1px solid var(--as-border);
    font-size: .92rem;
}

.about-list strong {
    color: var(--as-accent);
    min-width: 100px;
    display: inline-block;
}

.skill-row + .skill-row { margin-top: 1rem; }

.skill-row .label {
    display: flex;
    justify-content: space-between;
    font-size: .88rem;
    margin-bottom: .35rem;
}

.skill-row .bar {
    height: 7px;
    background: #ececec;
    border-radius: 999px;
    overflow: hidden;
}

.skill-row .bar span {
    display: block;
    height: 100%;
    background: var(--as-accent);
    border-radius: 999px;
}

.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.timeline-item {
    padding-left: 1.25rem;
    border-left: 2px solid var(--as-accent-soft);
    margin-bottom: 1.35rem;
    position: relative;
}

.timeline-item::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--as-accent);
    position: absolute;
    left: -6px;
    top: 4px;
}

.timeline-item h4 { margin: 0 0 .2rem; font-size: 1rem; }
.timeline-item .meta { color: var(--as-accent); font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.timeline-item p { margin: 0; color: var(--as-muted); font-size: .88rem; }

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.portfolio-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #e9ecef;
}

.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}

.portfolio-card:hover img { transform: scale(1.05); }

.portfolio-card .overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: .85rem;
    background: linear-gradient(transparent, rgba(0,0,0,.78));
    color: #fff;
}

.contact-card {
    background: #fff;
    border: 1px solid var(--as-border);
    border-radius: 10px;
    padding: 2rem;
    max-width: 560px;
}

.contact-row {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    font-size: .92rem;
}

.contact-row i { color: var(--as-accent); font-size: 1.1rem; margin-top: .15rem; }

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--as-accent);
    color: #fff;
    border: none;
    padding: .75rem 1.35rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: .88rem;
    margin-top: .5rem;
}

.btn-accent:hover { color: #fff; opacity: .92; }

.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 40;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--as-border);
    background: #fff;
    color: #555;
}

@media (max-width: 991px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .3s;
        box-shadow: 0 0 40px rgba(0,0,0,.12);
    }
    .app.open-sidebar .sidebar { transform: translateX(0); }
    .mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .about-grid, .resume-grid, .portfolio-grid { grid-template-columns: 1fr; }
    .page-inner { padding: 4.5rem 1.25rem 2rem; }
}

@keyframes asFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes asFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-14px); }
}

@keyframes asSlideIn {
    from { opacity: 0; transform: translateX(36px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes asSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-28px); }
}

@keyframes asScaleIn {
    from { opacity: 0; transform: scale(.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes asFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes asSpin { to { transform: rotate(360deg); } }

.preloader {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--as-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: 50px;
    height: 50px;
    border: 3px solid rgba(0,0,0,.08);
    border-top-color: var(--as-accent);
    border-radius: 50%;
    animation: asSpin .85s linear infinite;
}

.page {
    animation-duration: .55s;
    animation-fill-mode: both;
}

.anim-fade .page.enter { animation-name: asFadeIn; }
.anim-fade .page.leave { animation-name: asFadeOut; }
.anim-slide .page.enter { animation-name: asSlideIn; }
.anim-slide .page.leave { animation-name: asSlideOut; }
.anim-scale .page.enter { animation-name: asScaleIn; }
.anim-scale .page.leave { animation-name: asFadeOut; }

.geom-bg .s1 { animation: asFloat 9s ease-in-out infinite; }
.geom-bg .s2 { animation: asFloat 11s ease-in-out infinite reverse; }
.geom-bg .s3 { animation: asFloat 8s ease-in-out infinite .5s; }
.geom-bg .s4 { animation: asFloat 10s ease-in-out infinite 1s; }

.page-home.active .home-center h1 {
    animation: asScaleIn .85s ease .15s both;
}

.page-home.active .home-center p {
    animation: asFadeIn .85s ease .4s both;
}

.page.active .page-title,
.page.active .page-kicker {
    animation: asFadeIn .65s ease both;
}

.page.active .page-kicker { animation-delay: .12s; }

.page.active .about-photo,
.page.active .contact-card {
    animation: asFadeIn .7s ease .2s both;
}

.page.active .timeline-item,
.page.active .portfolio-card,
.page.active .skill-row {
    opacity: 0;
    animation: asFadeIn .55s ease forwards;
}

.page.active .timeline-item:nth-child(1),
.page.active .portfolio-card:nth-child(1),
.page.active .skill-row:nth-child(1) { animation-delay: .15s; }
.page.active .timeline-item:nth-child(2),
.page.active .portfolio-card:nth-child(2),
.page.active .skill-row:nth-child(2) { animation-delay: .25s; }
.page.active .timeline-item:nth-child(3),
.page.active .portfolio-card:nth-child(3),
.page.active .skill-row:nth-child(3) { animation-delay: .35s; }
.page.active .timeline-item:nth-child(4),
.page.active .portfolio-card:nth-child(4),
.page.active .skill-row:nth-child(4) { animation-delay: .45s; }
.page.active .timeline-item:nth-child(5),
.page.active .portfolio-card:nth-child(5),
.page.active .skill-row:nth-child(5) { animation-delay: .55s; }
.page.active .timeline-item:nth-child(6),
.page.active .portfolio-card:nth-child(6),
.page.active .skill-row:nth-child(6) { animation-delay: .65s; }

.skill-row .bar span {
    width: 0;
    transition: width 1.1s ease;
}

.skill-row.animate .bar span {
    width: var(--percent, 0%);
}

.sidebar-profile {
    animation: asSlideIn .7s ease both;
}
