:root {
    --clr-paper: #e8e4d8;
    --clr-ink: #172b23;
    --clr-ink-light: rgba(23, 43, 35, 0.62);
    --grad-blue: #5c9fbd;
    --grad-sage: #c1d599;
    --grad-peach: #e09374;
    --grad-gold: #eacf7a;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Lora', serif;
    --font-mono: 'Space Mono', monospace;
    --border-width: 1.5px;
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 8px;
    --grid-gap: 1.5rem;
    --max-width: 1400px;
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--clr-paper);
    color: var(--clr-ink);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
}

body::after {
    content: "";
    position: fixed;
    inset: -20% -10%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.55;
    background:
        radial-gradient(circle at 20% 20%, rgba(92, 159, 189, 0.28) 0%, transparent 40%),
        radial-gradient(circle at 80% 25%, rgba(193, 213, 153, 0.24) 0%, transparent 42%),
        radial-gradient(circle at 50% 80%, rgba(224, 147, 116, 0.21) 0%, transparent 45%);
    filter: blur(10px);
    animation: ambientFloat 18s ease-in-out infinite alternate;
}

@keyframes ambientFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0.5%, -1.2%, 0) scale(1.03); }
    100% { transform: translate3d(-0.8%, 1%, 0) scale(1.05); }
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--clr-ink);
}

p {
    font-size: 1.02rem;
    opacity: 0.92;
}

a {
    color: inherit;
}

.meta-text {
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--clr-ink-light);
}

.wrapper {
    width: 100%;
    max-width: var(--max-width);
    min-height: 100vh;
    padding: 3rem;
    display: grid;
    grid-template-columns: 330px 1fr;
    align-items: start;
    gap: 4rem;
    position: relative;
    isolation: isolate;
    --mx: 50%;
    --my: 40%;
}

.wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.4), transparent 70%);
    opacity: 0.55;
    transition: background-position 0.15s ease;
}

header {
    position: sticky;
    top: 3rem;
    height: calc(100vh - 6rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

header::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.sidebar-top {
    flex: 0 0 auto;
    position: relative;
    padding: 1.45rem 1.35rem 1.35rem;
    border: 1px solid rgba(23, 43, 35, 0.14);
    border-radius: 32px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.12) 100%),
        rgba(232, 228, 216, 0.76);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.52),
        0 14px 34px rgba(23, 43, 35, 0.08);
    overflow: hidden;
}

nav {
    margin-top: auto;
    flex: 0 0 auto;
}

.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(23, 43, 35, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.48);
    color: var(--clr-ink);
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 24px rgba(23, 43, 35, 0.08);
}

.mobile-nav-toggle__icon {
    position: relative;
    width: 20px;
    height: 14px;
    flex: 0 0 auto;
}

.mobile-nav-toggle__icon span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--clr-ink);
    transition: transform 0.22s ease, opacity 0.22s ease, top 0.22s ease;
}

.mobile-nav-toggle__icon span:nth-child(1) {
    top: 0;
}

.mobile-nav-toggle__icon span:nth-child(2) {
    top: 6px;
}

.mobile-nav-toggle__icon span:nth-child(3) {
    top: 12px;
}

.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle__icon span:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
}

.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle__icon span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle__icon span:nth-child(3) {
    top: 6px;
    transform: rotate(-45deg);
}

.sidebar-top::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(23, 43, 35, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 43, 35, 0.045) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 82%);
}

.sidebar-top::after {
    content: "";
    position: absolute;
    inset: auto -10% -18% 32%;
    height: 180px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(224, 147, 116, 0.22), transparent 68%);
    filter: blur(12px);
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: var(--border-width) solid var(--clr-ink);
    margin-bottom: 1rem;
    object-fit: cover;
}

.avatar-stage .avatar {
    position: relative;
    z-index: 2;
    margin-bottom: 0;
    box-shadow: 0 14px 24px rgba(23, 43, 35, 0.14);
}

.hero-statement h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-statement p {
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: var(--border-width) solid var(--clr-ink);
    border-radius: 40px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--grad-sage);
    border-radius: 50%;
    border: 1px solid var(--clr-ink);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.contact-pill {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--clr-ink-light);
    border-radius: 999px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.avatar-stage {
    position: relative;
    width: 158px;
    height: 158px;
    display: grid;
    place-items: center;
    margin-bottom: 1.1rem;
}

.avatar-stage::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0) 72%);
    filter: blur(3px);
}

.avatar-stage::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    border: 1px dashed rgba(23, 43, 35, 0.24);
    animation: orbitSpin 18s linear infinite;
}

.avatar-orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid transparent;
}

.avatar-orbit--one {
    inset: 10px;
    border-top-color: rgba(92, 159, 189, 0.7);
    border-left-color: rgba(92, 159, 189, 0.16);
    animation: orbitSpin 12s linear infinite reverse;
}

.avatar-orbit--two {
    inset: 24px;
    border-right-color: rgba(224, 147, 116, 0.7);
    border-bottom-color: rgba(224, 147, 116, 0.16);
    animation: orbitSpin 9s linear infinite;
}

.avatar-spark {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(92, 159, 189, 0.95), rgba(193, 213, 153, 0.95));
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.4);
}

.avatar-spark--one {
    top: 14px;
    right: 20px;
    animation: sparkFloat 4.8s ease-in-out infinite;
}

.avatar-spark--two {
    bottom: 18px;
    left: 14px;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, rgba(224, 147, 116, 0.95), rgba(234, 207, 122, 0.95));
    animation: sparkFloat 4.8s ease-in-out infinite 1.1s;
}

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

.quick-stat {
    position: relative;
    padding: 0.75rem 0.8rem;
    border: 1px solid rgba(23, 43, 35, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    overflow: hidden;
}

.quick-stat::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--grad-blue), var(--grad-peach), var(--grad-sage));
}

.quick-stat__value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.quick-stat__label {
    display: block;
    margin-top: 0.15rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.35;
    color: var(--clr-ink-light);
    white-space: normal;
    overflow-wrap: anywhere;
}

.lang-switch {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border: 1.5px solid var(--clr-ink);
    border-radius: 999px;
    background: rgba(232, 228, 216, 0.96);
    color: var(--clr-ink);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(23, 43, 35, 0.15);
    backdrop-filter: blur(4px);
    animation: langPulse 3.4s ease-in-out infinite;
}

@keyframes langPulse {
    0%, 100% { box-shadow: 0 8px 20px rgba(23, 43, 35, 0.15); }
    50% { box-shadow: 0 12px 28px rgba(92, 159, 189, 0.25); }
}

.lang-switch::before {
    content: "🌐";
    font-size: 0.9rem;
    line-height: 1;
}

.lang-switch:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

nav a {
    text-decoration: none;
    color: var(--clr-ink);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.02rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: opacity 0.2s ease;
    position: relative;
}

nav a:hover {
    opacity: 0.62;
}

nav a::before {
    content: '';
    display: block;
    width: 18px;
    height: var(--border-width);
    background-color: var(--clr-ink);
    transition: width 0.25s ease, background-color 0.25s ease;
}

nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.15rem;
    width: 0%;
    height: 1px;
    background: var(--clr-ink);
    transition: width 0.25s ease;
}

nav a.is-active {
    opacity: 1;
    color: #0d1f19;
}

nav a.is-active::before {
    width: 30px;
    background: linear-gradient(90deg, var(--grad-blue), var(--grad-sage));
}

nav a.is-active::after {
    width: 100%;
}

main {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    min-width: 0;
    min-height: calc(100vh - 6rem);
}

main > section {
    position: relative;
    --section-progress: 0;
    --section-shift: 0px;
    scroll-margin-top: 5.5rem;
    isolation: isolate;
}

main > section::before {
    content: "";
    position: absolute;
    inset: -0.5rem -0.8rem;
    border-radius: 22px;
    pointer-events: none;
    z-index: -1;
    opacity: calc(var(--section-progress) * 0.22);
    background:
        radial-gradient(circle at 10% 0%, rgba(92, 159, 189, 0.26), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(224, 147, 116, 0.2), transparent 50%);
    filter: blur(16px);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: var(--border-width) solid var(--clr-ink);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    transform: translateY(calc((1 - var(--section-progress)) * 10px));
    opacity: calc(0.7 + var(--section-progress) * 0.3);
    transition: transform 0.25s linear, opacity 0.25s linear;
}

.section-header h2 {
    font-size: 1.4rem;
}

.card-bordered {
    position: relative;
    background-color: var(--clr-paper);
    border: var(--border-width) solid var(--clr-ink);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 8px 18px rgba(23, 43, 35, 0.07);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.08) 100%),
        var(--clr-paper);
}

.card-bordered:hover {
    transform: translateY(-2px);
}

.card-bordered::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 35%),
        radial-gradient(circle at 100% 0%, rgba(92, 159, 189, 0.1), transparent 32%);
}

.motion-card {
    transform-style: preserve-3d;
    --rx: 0deg;
    --ry: 0deg;
    --hover-lift: 0px;
    --hover-scale: 0;
    --card-glow: 0 8px 18px rgba(23, 43, 35, 0.07);
    box-shadow: var(--card-glow);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.28s ease;
}

.motion-card > * {
    transform: translateZ(0);
    position: relative;
    z-index: 1;
}

.motion-card::after {
    content: "";
    position: absolute;
    inset: -120% auto auto -40%;
    width: 55%;
    height: 300%;
    pointer-events: none;
    transform: rotate(18deg) translateX(-120%);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 45%,
        rgba(255, 255, 255, 0) 100%
    );
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.motion-card:hover::after {
    transform: rotate(18deg) translateX(270%);
}

.mobile-motion .motion-card.mobile-live {
    animation: mobileCardBreath 3.4s ease-in-out infinite;
    animation-delay: var(--mobile-delay, 0ms);
}

.mobile-motion .motion-card.mobile-live::after {
    animation: mobileShimmer 5.5s ease-in-out infinite;
    animation-delay: var(--mobile-delay, 0ms);
    opacity: 0.42;
}

.mobile-motion .motion-card.tap-pop {
    --hover-lift: -2px;
    --hover-scale: 0.012;
    --card-glow: 0 16px 28px rgba(92, 159, 189, 0.22);
}

.mobile-motion .project-link-button:active,
.mobile-motion .contact-pill:active,
.mobile-motion .lang-switch:active {
    transform: scale(0.96);
}

@keyframes mobileCardBreath {
    0%, 100% { box-shadow: 0 10px 20px rgba(23, 43, 35, 0.1); }
    50% { box-shadow: 0 18px 30px rgba(92, 159, 189, 0.18); }
}

@keyframes mobileShimmer {
    0%, 70%, 100% { transform: rotate(18deg) translateX(-125%); }
    85% { transform: rotate(18deg) translateX(240%); }
}

.reveal {
    opacity: 0;
    --reveal-y: 22px;
    transform:
        translate3d(0, calc(var(--reveal-y) + var(--hover-lift)), 0)
        rotateX(var(--rx))
        rotateY(var(--ry))
        scale(calc(0.985 + var(--hover-scale)));
    filter: blur(3px);
    transition:
        opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.65s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.25s ease;
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    --reveal-y: 0px;
    transform:
        translate3d(0, calc(var(--reveal-y) + var(--hover-lift)), 0)
        rotateX(var(--rx))
        rotateY(var(--ry))
        scale(calc(1 + var(--hover-scale)));
    filter: blur(0);
}

.card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.index-circle {
    width: 30px;
    height: 30px;
    border: var(--border-width) solid var(--clr-ink);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(193, 213, 153, 0.28));
    box-shadow: 0 8px 16px rgba(23, 43, 35, 0.08);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--grid-gap);
}

.project-meta {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.7rem;
    margin-bottom: 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.project-links {
    margin: 0.75rem 0 0.95rem;
    padding: 0.65rem 0.75rem;
    border: 1px dashed rgba(23, 43, 35, 0.32);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.35);
}

.project-links-label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--clr-ink-light);
}

.project-links-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.project-link-button {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--clr-ink);
    border-radius: 999px;
    background: var(--clr-paper);
    color: var(--clr-ink);
    padding: 0.32rem 0.72rem;
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 600;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.project-link-button:hover {
    transform: translateY(-1px);
    opacity: 0.88;
}

.project-link-button {
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.project-link-button:hover {
    box-shadow: 0 6px 14px rgba(23, 43, 35, 0.18);
}

.list {
    padding-left: 1.2rem;
}

.list li {
    margin-bottom: 0.4rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(23, 43, 35, 0.18);
    padding-top: 0.8rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--clr-ink-light);
    border-radius: 4px;
}

.avatar {
    animation: avatarFloat 6.5s ease-in-out infinite;
    transform-origin: center;
}

.status-badge {
    animation: badgeSway 4.8s ease-in-out infinite;
}

.section-header h2 {
    position: relative;
}

.section-header h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.55rem;
    width: 3.4rem;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--grad-blue), var(--grad-peach), var(--grad-sage));
    transform-origin: left center;
    animation: accentSweep 3.6s ease-in-out infinite;
}

.reveal.is-visible .tech-tag,
.reveal.is-visible .project-link-button,
.reveal.is-visible .contact-pill,
.reveal.is-visible .link-list a {
    animation: chipLift 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--reveal-delay, 0ms) + 120ms);
}

.reveal.is-visible .project-link-button:nth-child(2),
.reveal.is-visible .tech-tag:nth-child(2),
.reveal.is-visible .contact-pill:nth-child(2),
.reveal.is-visible .link-list a:nth-child(2) {
    animation-delay: calc(var(--reveal-delay, 0ms) + 180ms);
}

.reveal.is-visible .project-link-button:nth-child(3),
.reveal.is-visible .tech-tag:nth-child(3),
.reveal.is-visible .contact-pill:nth-child(3),
.reveal.is-visible .link-list a:nth-child(3) {
    animation-delay: calc(var(--reveal-delay, 0ms) + 240ms);
}

.reveal.is-visible .project-link-button:nth-child(4),
.reveal.is-visible .tech-tag:nth-child(4),
.reveal.is-visible .link-list a:nth-child(4) {
    animation-delay: calc(var(--reveal-delay, 0ms) + 300ms);
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(-1.2deg); }
}

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sparkFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(3px, -6px, 0) scale(1.12); }
}

@keyframes badgeSway {
    0%, 100% { transform: translateX(0px); }
    50% { transform: translateX(4px); }
}

@keyframes accentSweep {
    0%, 100% { transform: scaleX(0.75); opacity: 0.8; }
    50% { transform: scaleX(1.15); opacity: 1; }
}

@keyframes chipLift {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-scalloped {
    border: var(--border-width) solid var(--clr-ink);
    border-radius: var(--radius-lg);
    overflow: hidden;
    grid-column: 1 / -1;
    background-color: var(--clr-paper);
}

.scalloped-top {
    position: relative;
    padding: 2.2rem 2rem 4.6rem;
    background: linear-gradient(160deg, var(--grad-blue) 0%, var(--grad-sage) 30%, var(--grad-gold) 60%, var(--grad-peach) 100%);
}

.scalloped-top h3 {
    font-size: 2rem;
    max-width: 100%;
    margin-top: 0.8rem;
}

.scallop-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 40px;
}

.scallop-divider path {
    fill: var(--clr-paper);
}

.scalloped-bottom {
    padding: 1.4rem 2rem 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.scalloped-bottom h4 {
    font-size: 1.1rem;
    flex: 1;
}

.scalloped-bottom p {
    flex: 2;
    font-size: 0.95rem;
}

.icon-circle {
    width: 24px;
    height: 24px;
    border: 1px solid var(--clr-ink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.7rem;
}

.role-list {
    list-style: none;
    border-top: var(--border-width) solid var(--clr-ink);
}

.role-item {
    display: flex;
    padding: 1.2rem 0;
    border-bottom: var(--border-width) solid var(--clr-ink);
    gap: 1.4rem;
}

.role-year {
    font-family: var(--font-display);
    font-weight: 500;
    width: 150px;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.role-details {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.role-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
}

.role-company {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--clr-ink-light);
}

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

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

.link-list {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.link-list a {
    text-decoration: none;
    border: 1px solid var(--clr-ink-light);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.74rem;
    font-family: var(--font-mono);
}

footer {
    border-top: var(--border-width) solid var(--clr-ink);
    padding-top: 1rem;
    margin-top: auto;
    color: var(--clr-ink-light);
    font-size: 0.9rem;
}

strong {
    color: var(--clr-ink);
}

@media (max-width: 1120px) {
    .wrapper {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 2rem;
        min-height: auto;
    }

    header {
        position: static;
        height: auto;
    }

    main {
        min-height: auto;
    }

    .quick-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-statement h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 860px) {
    .wrapper {
        padding: 5rem 1.2rem 2rem;
    }

    header {
        flex-direction: column;
        gap: 0.9rem;
        overflow: visible;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        order: -2;
        position: fixed;
        top: 0.75rem;
        left: 1.2rem;
        width: calc(100% - 2.4rem - 5.8rem);
        max-width: 320px;
        z-index: 1100;
        backdrop-filter: blur(10px);
    }

    nav {
        order: -1;
        position: fixed;
        top: calc(0.75rem + 3.6rem);
        left: 1.2rem;
        right: 1.2rem;
        z-index: 1099;
        margin-top: 0;
        width: auto;
        max-width: 420px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
        padding: 0;
        border: 1px solid rgba(23, 43, 35, 0.12);
        border-radius: 20px;
        background: rgba(232, 228, 216, 0.96);
        box-shadow: 0 18px 38px rgba(23, 43, 35, 0.16);
        backdrop-filter: blur(12px);
        transition: max-height 0.28s ease, opacity 0.22s ease, transform 0.22s ease;
    }

    header.is-nav-open nav {
        max-height: 320px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        padding: 0.55rem;
    }

    nav ul {
        gap: 0.55rem;
        padding: 0;
    }

    nav a {
        padding: 0.75rem 0.95rem;
        border: 1px solid rgba(23, 43, 35, 0.16);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.72);
        box-shadow: 0 8px 18px rgba(23, 43, 35, 0.08);
    }

    nav a::after {
        display: none;
    }

    main {
        gap: 3rem;
    }

    main > section {
        --section-shift: 0px !important;
        transform: none !important;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        transform: none !important;
        opacity: 1 !important;
    }

    .projects-grid {
        display: flex;
        flex-direction: column;
        gap: var(--grid-gap);
    }

    .skills-grid,
    .honors-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid > .card-bordered {
        width: 100%;
        min-width: 0;
    }

    .card-bordered {
        padding: 1.25rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }

    .project-meta {
        margin-top: 0.55rem;
        margin-bottom: 0.9rem;
    }

    .project-links {
        padding: 0.55rem 0.6rem;
    }

    .project-links-items {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .sidebar-top {
        order: 0;
        padding: 1.15rem;
    }

    .avatar-stage {
        width: 138px;
        height: 138px;
    }

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .project-link-button {
        width: 100%;
        justify-content: center;
        font-size: 0.72rem;
        padding: 0.28rem 0.6rem;
    }

    .motion-card,
    .reveal,
    .reveal.is-visible {
        transform: none !important;
        filter: none !important;
    }

    .motion-card::after {
        display: none;
    }

    #projects h3,
    .project-meta span,
    .meta-text,
    .project-link-button {
        overflow-wrap: anywhere;
    }

    .role-item,
    .scalloped-bottom {
        flex-direction: column;
    }

    .role-year {
        width: auto;
    }

    .lang-switch {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.4rem 0.75rem;
        font-size: 0.78rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }

    body::after {
        animation: none;
    }

    .lang-switch {
        animation: none;
    }

    .avatar-stage::after,
    .avatar-orbit,
    .avatar-spark {
        animation: none;
    }

    main > section {
        transform: none;
        transition: none;
    }

    .section-header {
        transform: none;
        opacity: 1;
        transition: none;
    }

}

@media (hover: none), (pointer: coarse) {
    .lang-switch {
        animation-duration: 2.8s;
    }

    .mobile-nav-toggle {
        display: inline-flex;
    }

    main > section {
        --section-shift: 0px !important;
        transform: none !important;
    }

    .section-header {
        transform: none !important;
        opacity: 1 !important;
    }

    .motion-card::after {
        display: none;
    }

    .reveal {
        transform: none !important;
        filter: none;
        will-change: auto;
    }

    .reveal.is-visible {
        transform: none !important;
    }

    .motion-card {
        transform-style: flat;
        --rx: 0deg !important;
        --ry: 0deg !important;
        --hover-lift: 0px !important;
        --hover-scale: 0 !important;
    }
}
