:root {
    --accent: #d6a86c;
    --accent-soft: #e8c89a;
    --bg: #0a0a0b;
    --surface: #131316;
}

* {
    scroll-behavior: smooth;
}

html {
    scroll-padding-top: 5rem;
}

body {
    background: var(--bg);
    overflow-x: hidden;
}

/* ============ Ambient background ============ */

.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    will-change: transform;
}

.glow-orb-1 {
    top: -10%;
    left: -10%;
    width: 40rem;
    height: 40rem;
    background: radial-gradient(circle, rgba(214, 168, 108, 0.4), transparent 60%);
    animation: orbFloat1 18s ease-in-out infinite;
}

.glow-orb-2 {
    bottom: -20%;
    right: -15%;
    width: 45rem;
    height: 45rem;
    background: radial-gradient(circle, rgba(214, 168, 108, 0.2), transparent 60%);
    animation: orbFloat2 22s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(3rem, 5rem); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-4rem, -3rem); }
}

main, header, footer {
    position: relative;
    z-index: 2;
}

/* ============ Nav ============ */

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #fff;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ============ Reveal on scroll ============ */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============ About ============ */

.grain {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23g)' opacity='0.4'/></svg>");
    mix-blend-mode: overlay;
    opacity: 0.2;
}

.quality {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #d4d4d4;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
    text-align: center;
}

.quality:hover {
    border-color: rgba(214, 168, 108, 0.4);
    color: var(--accent);
    background: rgba(214, 168, 108, 0.05);
    transform: translateY(-2px);
}

.lang-chip {
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 0.8rem;
    color: #d4d4d4;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.25s ease;
}

.lang-chip:hover {
    border-color: rgba(214, 168, 108, 0.3);
    color: #fff;
}

/* ============ Skills ============ */

.skill-card {
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(214, 168, 108, 0.3), transparent 50%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.skill-card:hover {
    transform: translateY(-4px);
    border-color: rgba(214, 168, 108, 0.2);
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(214, 168, 108, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tech {
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 0.8rem;
    color: #e5e5e5;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.25s ease;
    display: inline-block;
}

.tech:hover {
    border-color: rgba(214, 168, 108, 0.4);
    color: var(--accent);
    background: rgba(214, 168, 108, 0.06);
}

/* ============ Marquee ============ */

.marquee {
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.marquee-content {
    display: inline-flex;
    gap: 0.75rem;
    padding-right: 0.75rem;
    animation: marquee 30s linear infinite;
    white-space: nowrap;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.pill {
    padding: 0.6rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #d4d4d4;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============ Timeline ============ */

.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 3rem;
}

@media (min-width: 768px) {
    .timeline-item {
        padding-left: 10.5rem;
        display: grid;
        /* grid-template-columns: 8rem 1fr; */
        gap: 0;
        padding-bottom: 3.5rem;
    }
}

.timeline-date {
    position: relative;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .timeline-date {
        position: absolute;
        left: 0;
        top: 0.5rem;
        margin-bottom: 0;
        width: 8rem;
    }
}

.timeline-dot {
    position: absolute;
    left: -6px;
    top: 0.7rem;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--bg), 0 0 20px rgba(214, 168, 108, 0.5);
    z-index: 2;
}

@media (min-width: 768px) {
    .timeline-dot {
        left: calc(8.5rem - 6px);
    }
}

.timeline-content {
    padding: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content {
    border-color: rgba(214, 168, 108, 0.25);
    transform: translateX(4px);
}

.tag {
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(214, 168, 108, 0.08);
    border: 1px solid rgba(214, 168, 108, 0.2);
    border-radius: 999px;
    white-space: nowrap;
}

/* ============ Projects ============ */

.project-card {
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(214, 168, 108, 0.35), transparent 55%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(214, 168, 108, 0.25);
}

.project-card:hover::before {
    opacity: 1;
}

.project-year {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(214, 168, 108, 0.08);
    border-radius: 999px;
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1207;
    background: linear-gradient(135deg, var(--accent-soft), var(--accent));
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(214, 168, 108, 0.4), 0 4px 16px -4px rgba(214, 168, 108, 0.5);
}

.project-card--featured::before {
    background: linear-gradient(135deg, rgba(214, 168, 108, 0.6), transparent 60%);
    opacity: 0.7;
}

.project-card--featured:hover::before {
    opacity: 1;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 500;
    transition: all 0.25s ease;
}

.project-link:hover {
    background: var(--accent-soft);
    transform: translateX(2px);
}

.project-link-secondary {
    background: transparent;
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.project-link-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(214, 168, 108, 0.3);
    color: var(--accent);
    transform: none;
}

/* ============ Education ============ */

.edu-card {
    padding: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.edu-card:hover {
    transform: translateY(-4px);
    border-color: rgba(214, 168, 108, 0.25);
    background: linear-gradient(180deg, rgba(214, 168, 108, 0.04), transparent);
}

.edu-year {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(214, 168, 108, 0.08);
    border-radius: 999px;
}

/* ============ Contact ============ */

.contact-card {
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    min-width: 0;
}

.contact-card:hover {
    border-color: rgba(214, 168, 108, 0.3);
    background: rgba(214, 168, 108, 0.05);
    transform: translateY(-2px);
}

.contact-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(214, 168, 108, 0.1);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ Scrollbar ============ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(214, 168, 108, 0.3);
}

/* ============ Reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}
