/* ============================
   Variables
   ============================ */
:root {
    --primary-color: #FE320E;
    --secondary-color: #ff5c0b;
    --background-color: #efeae3;
    --text-color: #1a1a1a;
    --text-muted: #6b655e;
    --border-color: #00000022;
    --text-color-2: rgb(239, 234, 227);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --glass-bg: rgba(255, 255, 255, 0.35);
    --glass-border: rgba(255, 255, 255, 0.55);
}

/* ============================
   Base
   ============================ */
::-webkit-scrollbar {
    display: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Neue Haas Grotesk Display Pro', 'Poppins', sans-serif;
}

html,
body {
    height: 100%;
    width: 100%;
    background-color: var(--background-color);
    color: var(--text-color);
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

::selection {
    background: var(--primary-color);
    color: #fff;
}

/* .main must stay transparent so the fixed footer shows through .page-8 */
.main {
    position: relative;
    z-index: 10;
    overflow-x: clip;
    pointer-events: none;
}

/* Re-enable interaction for all page sections except the footer spacer */
.main > *:not(.page-8) {
    pointer-events: auto;
}

.accent {
    color: var(--primary-color);
}

section {
    scroll-margin-top: 90px;
}

/* ============================
   Reveal-on-scroll animation
   ============================ */
[data-reveal] {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
    transition-delay: var(--reveal-delay, 0s);
    will-change: opacity, transform;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============================
   Loading Screen
   ============================ */
.loading-screen {
    position: fixed;
    inset: 0;
    background-color: #0c0c0c;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s var(--ease-out);
}

.loading-screen.hide {
    transform: translateY(-100%);
}

.loading-inner {
    text-align: center;
}

.loading-name {
    font-size: clamp(4.5rem, 9vw, 10rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--background-color);
    overflow: hidden;
    display: inline-block;
    white-space: nowrap;
}

/* Letters injected by JS */
.loading-name .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(110%) rotate(8deg);
    animation: letterRise 0.65s var(--ease-spring) forwards;
}

.loading-name .letter.accent-letter {
    color: var(--primary-color);
}

@keyframes letterRise {
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

.loading-tag {
    margin-top: 16px;
    font-size: clamp(0.9rem, 1.5vw, 1.35rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--primary-color);
    opacity: 0;
    animation: loadingFade 0.7s ease 0.75s forwards;
}

@keyframes loadingFade {
    to {
        opacity: 1;
    }
}

/* ============================
   Glass Navbar
   ============================ */
.site-header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(94vw, 1500px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 10px 26px;
    border-radius: 999px;
    background: rgba(239, 234, 227, 0.6);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: box-shadow 0.4s ease;
}

.nav-logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-color);
    text-decoration: none;
    line-height: 1;
}

.nav-logo span {
    color: var(--primary-color);
}

.site-header ul {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn {
    position: relative;
    display: inline-block;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    transition: color 0.35s ease;
    z-index: 0;
    white-space: nowrap;
    background: transparent;
    cursor: pointer;
}

.btn .btn-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    border-radius: 50px;
    transform: translateY(101%);
    transition: transform 0.35s var(--ease-out);
    z-index: -1;
}

.btn:hover .btn-bg {
    transform: translateY(0%);
}

.btn:hover {
    color: white;
}

.btn-solid {
    background: #111;
    color: #fff;
    border-color: #111;
}

.btn-solid .btn-bg {
    background: var(--background-color);
}

.btn-solid:hover {
    color: var(--text-color);
    border-color: var(--background-color);
}

/* ============================
   Section Navigator (arrows)
   ============================ */
.section-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.section-nav.visible {
    opacity: 1;
    pointer-events: auto;
}

.section-nav-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    color: var(--text-color);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.section-nav-btn:hover {
    background: #111;
    color: #fff;
    border-color: #111;
    transform: scale(1.08);
}

.section-nav-btn:active {
    transform: scale(0.94);
}

.section-nav-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.section-nav-progress {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 2px 0;
    user-select: none;
}

/* ============================
   Page 1 — Hero
   ============================ */
.page-1 {
    min-height: 100vh;
    width: 100%;
    background-color: var(--background-color);
    position: relative;
    padding: 110px 4vw 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.7rem, 0.95vw, 1rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 3vh;
}

.pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary-color);
    position: relative;
    flex-shrink: 0;
}

.pulse-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.hero-title {
    display: flex;
    flex-direction: column;
    font-size: clamp(3rem, 8.2vw, 10.5rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.hero-line {
    display: block;
}

.hero-line.accent {
    color: var(--primary-color);
}

.hero-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4vw;
    margin-top: 5vh;
}

.hero-intro {
    max-width: 560px;
    font-size: clamp(0.95rem, 1.1vw, 1.2rem);
    line-height: 1.7;
    color: var(--text-muted);
    font-weight: 500;
}

.hero-cta {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
}

.hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    padding: 26px 0 30px;
    border-top: 1px solid var(--border-color);
    font-size: clamp(0.65rem, 0.85vw, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    position: relative;
    z-index: 5;
}

.meta-divider {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
}

/* Hero gradient shape */
.page-1 .hero-shape {
    position: absolute;
    width: 30vw;
    height: 30vw;
    right: -6vw;
    top: 22vh;
    z-index: 1;
    opacity: 0.55;
    pointer-events: none;
}

.page-1 .hero-shape .hero-1,
.page-1 .hero-shape .hero-2,
.page-1 .hero-shape .hero-3,
.page-1 .hero-shape .hero-4 {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    filter: blur(60px);
}

.page-1 .hero-shape .hero-2,
.page-1 .hero-shape .hero-3,
.page-1 .hero-shape .hero-4 {
    width: 24vw;
    height: 24vw;
}

.page-1 .hero-shape .hero-2 {
    right: 5px;
    animation: hero-drift 6s ease-in-out 0s infinite alternate;
}

.page-1 .hero-shape .hero-3 {
    animation: hero-drift 7s ease-in-out 1s infinite alternate;
}

.page-1 .hero-shape .hero-4 {
    animation: hero-drift 8s ease-in-out 2s infinite alternate;
}

@keyframes hero-drift {
    from {
        transform: translate(0%, -12%);
    }

    to {
        transform: translate(-6%, 12%);
    }
}

/* ============================
   Section label & heading
   ============================ */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.section-label h2 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--text-muted);
}

.circle-small {
    display: inline-block;
    width: 9px;
    height: 9px;
    background-color: var(--primary-color);
    border-radius: 50%;
    flex-shrink: 0;
}

.section-heading {
    font-size: clamp(2.2rem, 4vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 1.5vh 0 6vh;
}

/* ============================
   Page 2 — Services Marquee + About
   ============================ */
.page-2 {
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--background-color);
    padding: 5vw 0 8vw;
    overflow: hidden;
}

.page-2 .moving-text {
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 9vh;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.6vw 0;
}

.page-2 .moving-text .container {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    animation: moving-text 26s linear infinite;
}

.page-2 .moving-text span {
    font-size: clamp(1rem, 2.2vw, 2.4rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: inline-block;
    color: var(--text-muted);
}

.page-2 .moving-text .container .circle {
    display: inline-block;
    width: clamp(8px, 0.8vw, 14px);
    height: clamp(8px, 0.8vw, 14px);
    background-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 2.5vw;
    flex-shrink: 0;
}

@keyframes moving-text {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

.page-2 .section-label {
    margin-left: 4vw;
}

.page-2 .about {
    width: 100%;
    padding: 4vh 4vw 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6vw;
}

.about-text {
    width: 58%;
}

.about-text h1 {
    font-size: clamp(1.6rem, 3vw, 3.4rem);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.about-text h1 em {
    font-style: italic;
    color: var(--primary-color);
}

.about-text > p {
    margin-top: 3vh;
    font-size: clamp(0.95rem, 1.05vw, 1.15rem);
    line-height: 1.8;
    color: var(--text-muted);
    max-width: 620px;
    font-weight: 500;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2vw;
    margin-top: 5vh;
    padding-top: 4vh;
    border-top: 1px solid var(--border-color);
}

.about-stats .stat h3 {
    font-size: clamp(1.4rem, 2.2vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

.about-stats .stat p {
    margin-top: 6px;
    font-size: clamp(0.6rem, 0.8vw, 0.85rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.about-portrait {
    width: 26%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.portrait-frame {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

.portrait-frame img {
    width: 100%;
    display: block;
    transition: transform 0.7s var(--ease-out);
}

.portrait-frame:hover img {
    transform: scale(1.04);
}

.portrait-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.portrait-caption span:first-child {
    font-weight: 700;
    font-size: 1rem;
}

.portrait-caption span:last-child {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ============================
   Experience Timeline
   ============================ */
.page-experience {
    width: 100%;
    background-color: var(--background-color);
    padding: 10vh 4vw 12vh;
}

.timeline {
    display: flex;
    flex-direction: column;
    max-width: 980px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 28px 220px 1fr;
    gap: 2.5vw;
    padding-bottom: 7vh;
    position: relative;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--background-color);
    border: 2px solid var(--text-color);
    flex-shrink: 0;
    margin-top: 5px;
    z-index: 2;
}

.timeline-dot.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 5px rgba(254, 50, 14, 0.15);
}

.timeline-dot.edu {
    border-style: dashed;
    border-color: var(--text-muted);
}

.timeline-rule {
    flex: 1;
    width: 1px;
    background: var(--border-color);
    margin-top: 8px;
}

.timeline-date {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-top: 5px;
    white-space: nowrap;
}

.timeline-body h3 {
    font-size: clamp(1.15rem, 1.4vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.timeline-body h4 {
    margin-top: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
}

.timeline-body p {
    margin-top: 12px;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 560px;
    font-weight: 500;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.timeline-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.timeline-tags span:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================
   Page 3 — Projects
   ============================ */
.page-3 {
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--background-color);
    padding: 8vh 4vw 12vh;
}

.element-container {
    border-top: 1px solid var(--border-color);
}

.page-3 .element {
    min-height: 130px;
    width: 100%;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2vw;
    padding: 22px 2vw;
    overflow: hidden;
    cursor: pointer;
}

.element-index {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    z-index: 1;
    flex-shrink: 0;
    width: 3vw;
    min-width: 34px;
    transition: color 0.4s ease;
}

.page-3 .element .left {
    flex: 1;
}

.page-3 .element h2 {
    font-size: clamp(1.6rem, 3.2vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    transition: transform 0.5s var(--ease-out), color 0.4s ease;
}

.page-3 .element:hover h2 {
    transform: translateX(1.2vw);
}

.page-3 .element .overlay {
    height: 100%;
    width: 100%;
    background-color: #111;
    position: absolute;
    left: 0;
    top: -100%;
    transition: top 0.5s var(--ease-out);
    z-index: 0;
}

.page-3 .element:hover .overlay {
    top: 0;
}

.page-3 .element:hover h2,
.page-3 .element:hover .element-index,
.page-3 .element:hover .right h3,
.page-3 .element:hover .right h4 {
    color: var(--background-color);
}

.page-3 .element:hover .element-index {
    color: var(--primary-color);
}

.page-3 .element .right {
    text-align: right;
    position: relative;
    z-index: 1;
}

.page-3 .element .right h3 {
    font-size: clamp(0.85rem, 1vw, 1.1rem);
    font-weight: 600;
    transition: color 0.4s ease;
}

.page-3 .element .right h4 {
    font-size: clamp(0.7rem, 0.85vw, 0.9rem);
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 4px;
    transition: color 0.4s ease;
}

/* Project hover card */
.fixed-container {
    position: fixed;
    height: auto;
    width: min(30vw, 420px);
    border-radius: 20px;
    left: 60%;
    top: 40%;
    opacity: 0;
    z-index: 800;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.94) translateY(8px);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.32),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: opacity 0.32s ease, transform 0.32s var(--ease-out);
    overflow: hidden;
}

.fixed-container.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
}

.fixed-container .hover-card {
    position: relative;
    width: 100%;
    background:
        linear-gradient(165deg, rgba(32, 30, 28, 0.96) 0%, rgba(17, 17, 17, 0.97) 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--background-color);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 22px 24px 20px;
    overflow: hidden;
}

.fixed-container .hover-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), rgba(232, 119, 63, 0.25));
}

.fixed-container .hover-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.fixed-container .hover-heading {
    min-width: 0;
}

.fixed-container .hover-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--background-color);
    line-height: 1.25;
}

.fixed-container .hover-tagline {
    margin: 4px 0 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(239, 234, 227, 0.55);
    letter-spacing: 0.01em;
}

.fixed-container .hover-status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.fixed-container .hover-status--production {
    background: rgba(232, 119, 63, 0.18);
    border-color: rgba(232, 119, 63, 0.35);
    color: var(--primary-color);
}

.fixed-container .hover-status--private,
.fixed-container .hover-status--client-work {
    background: rgba(239, 234, 227, 0.08);
    border-color: rgba(239, 234, 227, 0.16);
    color: rgba(239, 234, 227, 0.75);
}

.fixed-container .hover-status--open-source,
.fixed-container .hover-status--extension,
.fixed-container .hover-status--automation,
.fixed-container .hover-status--full-stack,
.fixed-container .hover-status--research {
    background: rgba(239, 234, 227, 0.06);
    border-color: rgba(239, 234, 227, 0.14);
    color: var(--secondary-color);
}

.fixed-container .hover-description {
    margin: 0;
    color: rgba(239, 234, 227, 0.8);
    line-height: 1.65;
    font-size: 0.84rem;
    font-weight: 400;
}

.fixed-container .hover-divider {
    height: 1px;
    margin: 16px 0 12px;
    background: linear-gradient(
        90deg,
        rgba(239, 234, 227, 0.18),
        rgba(239, 234, 227, 0.04)
    );
}

.fixed-container .hover-sub {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin: 0 0 8px;
}

.fixed-container .hover-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fixed-container .tech-pill {
    background: rgba(239, 234, 227, 0.07);
    border: 1px solid rgba(239, 234, 227, 0.14);
    color: rgba(239, 234, 227, 0.92);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.fixed-container .hover-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(239, 234, 227, 0.1);
}

.fixed-container .hover-cta,
.fixed-container .hover-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.fixed-container .hover-cta {
    color: var(--primary-color);
}

.fixed-container .hover-cta i {
    font-size: 0.7em;
    transition: transform 0.25s ease;
}

.fixed-container.visible .hover-cta i {
    transform: translate(1px, -1px);
}

.fixed-container .hover-badge {
    color: rgba(239, 234, 227, 0.55);
}

.fixed-container .hover-badge i {
    font-size: 0.75em;
}

/* Clickable project rows */
.page-3 .element.element-clickable {
    cursor: pointer;
}

.page-3 .element .element-link-icon {
    font-size: 0.72em;
    margin-left: 6px;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.page-3 .element:hover .element-link-icon {
    opacity: 0.85;
    transform: translateY(0);
}

/* "20+ more projects" glass bar */
.more-projects {
    margin-top: 7vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3vw;
    padding: clamp(24px, 2.6vw, 44px);
    border-radius: 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.more-left h3 {
    font-size: clamp(1.4rem, 2.2vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.more-left h3::after {
    content: "";
    display: block;
    width: 52px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary-color);
    margin-top: 10px;
}

.more-left p {
    margin-top: 14px;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    line-height: 1.7;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 560px;
}

.more-cta {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ============================
   Research & Recognition — Carousel
   ============================ */
.page-highlights {
    width: 100%;
    background-color: var(--background-color);
    padding: 4vh 4vw 12vh;
}

.highlights-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4vh;
}

.carousel-controls {
    display: flex;
    gap: 10px;
}

.carousel-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.carousel-btn:hover {
    background: #111;
    color: #fff;
    border-color: #111;
    transform: scale(1.08);
}

.carousel-btn:active {
    transform: scale(0.94);
}

.carousel {
    overflow: hidden;
    border-radius: 24px;
}

.carousel-track {
    display: flex;
    transition: transform 0.55s var(--ease-out);
}

.carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
    padding: 2px;
}

.highlight-card {
    max-width: 880px;
    margin: 0 auto;
    border-radius: 24px;
    padding: clamp(28px, 3vw, 52px);
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.highlight-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #111;
    color: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 22px;
}

.highlight-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-color);
    border: 1px solid rgba(254, 50, 14, 0.35);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.highlight-card h3 {
    font-size: clamp(1.25rem, 1.8vw, 1.8rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.highlight-card p {
    font-size: clamp(0.92rem, 1vw, 1.05rem);
    line-height: 1.75;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 640px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 3vh;
}

.carousel-dots button {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: var(--border-color);
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dots button.active {
    background: var(--primary-color);
    transform: scale(1.35);
}

/* ============================
   Page 5 — Skills
   ============================ */
.page-5 {
    width: 100%;
    background-color: var(--background-color);
    padding: 10vh 4vw 10vh;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid var(--border-color);
}

.skill-group {
    padding: 3.5vh 2vw 3.5vh 0;
    border-bottom: 1px solid var(--border-color);
}

.skill-group:nth-child(odd) {
    border-right: 1px solid var(--border-color);
}

.skill-group:nth-child(even) {
    padding-left: 2.5vw;
}

.skill-group h3 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 18px;
}

.skill-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-pills span {
    font-size: 0.88rem;
    font-weight: 600;
    padding: 7px 16px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-color);
    background: transparent;
    transition: all 0.3s ease;
    cursor: default;
}

.skill-pills span:hover {
    background: #111;
    color: var(--background-color);
    border-color: #111;
    transform: translateY(-3px);
}

/* Social Icons */
.page-5 .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8vh;
}

.page-5 .social-icons {
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: 14px 28px;
    border-radius: 50px;
    display: flex;
    gap: 2rem;
}

.page-5 .social-icons a {
    font-size: 1.3rem;
    color: var(--text-color);
    transition: transform 0.3s ease, color 0.3s ease;
}

.page-5 .social-icons a[href*="linkedin"]:hover {
    color: #0A66C2;
}

.page-5 .social-icons a[href*="github"]:hover {
    color: black;
}

.page-5 .social-icons a[href*="Resume.pdf"]:hover {
    color: var(--primary-color);
}

.page-5 .social-icons a:hover {
    transform: translateY(-4px) scale(1.15);
}

/* ============================
   Page 7 — Contact
   ============================ */
.page-7 {
    width: 100%;
    background-color: var(--background-color);
    padding: 12vh 4vw 14vh;
}

.contact-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 6vw;
    align-items: flex-start;
}

.contact-left {
    width: 42%;
}

.contact-left h1 {
    font-size: clamp(2.4rem, 4.5vw, 5.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 2.5vh 0;
}

.contact-left > p {
    font-size: clamp(0.95rem, 1.05vw, 1.15rem);
    line-height: 1.75;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 440px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 5vh;
}

.contact-details a,
.contact-details span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-details i {
    color: var(--primary-color);
    width: 18px;
    text-align: center;
}

.contact-details a:hover {
    color: var(--primary-color);
}

.contact-form {
    width: 52%;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.input-group {
    display: flex;
    gap: 1.2rem;
}

.input-group input {
    flex: 1;
    min-width: 0;
}

.contact-form input,
.contact-form textarea {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 1rem 1.2rem;
    font-size: 1rem;
    color: var(--text-color);
    border-radius: 14px;
    transition: all 0.3s ease;
    resize: none;
    width: 100%;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-muted);
}

.contact-form input:hover,
.contact-form textarea:hover {
    border-color: #00000055;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--text-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* Submit Button — same style as header buttons */
.custom-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 44px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    transition: color 0.35s ease;
    z-index: 0;
    cursor: pointer;
    align-self: flex-start;
}

.custom-btn .btn-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    border-radius: 50px;
    transform: translateY(101%);
    transition: transform 0.35s var(--ease-out);
    z-index: -1;
}

.custom-btn:hover .btn-bg {
    transform: translateY(0%);
}

.custom-btn:hover {
    color: white;
}

.custom-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner */
.custom-btn .spinner {
    width: 15px;
    height: 15px;
    border: 3px solid currentColor;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
    display: inline-block;
}

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

/* ============================
   Toasts
   ============================ */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #111;
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s ease-in-out;
    z-index: 9999;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.toast.info {
    background-color: #111;
}

.toast.success {
    background-color: #1d7f3f;
}

.toast.error {
    background-color: #c22a2a;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

input.invalid,
textarea.invalid {
    border-color: #c22a2a !important;
}

input.invalid-shake,
textarea.invalid-shake {
    animation: shake 0.3s ease-in-out;
}

input.valid,
textarea.valid {
    border-color: #1d7f3f !important;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* ============================
   Footer
   ============================ */
.page-8 {
    height: 100vh;
    width: 100%;
    pointer-events: none; /* let clicks reach the fixed footer beneath */
}

footer {
    position: fixed;
    z-index: 9;
    height: 100vh;
    width: 100%;
    background-color: #0c0c0c;
    color: var(--background-color);
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 18vh 4vw 4vh;
    pointer-events: auto;
}

.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.footer-top h2 {
    font-size: clamp(1.8rem, 3.2vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--background-color);
}

.footer-top > p {
    font-size: clamp(0.9rem, 1vw, 1.1rem);
    color: rgba(239, 234, 227, 0.65);
    font-weight: 500;
}

.footer-links {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-top: 2.5vh;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(239, 234, 227, 0.22);
    background: rgba(239, 234, 227, 0.08);
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.footer-links:hover {
    border-color: rgba(239, 234, 227, 0.35);
    background: rgba(239, 234, 227, 0.12);
}

.footer-links a {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(239, 234, 227, 0.88);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    pointer-events: auto;
    transition:
        background 0.35s var(--ease-out),
        color 0.35s ease,
        transform 0.35s var(--ease-spring),
        box-shadow 0.35s ease;
}

/* Vertical dividers between connected icons */
.footer-links a + a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 22px;
    background: rgba(239, 234, 227, 0.18);
    pointer-events: none;
}

.footer-links a:hover {
    background: var(--background-color);
    transform: translateY(-5px) scale(1.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    z-index: 1;
}

.footer-links a:active {
    transform: translateY(-2px) scale(1.05);
}

.footer-links a.footer-icon--email:hover {
    color: var(--primary-color);
}

.footer-links a.footer-icon--linkedin:hover {
    color: #0A66C2;
    background: #fff;
}

.footer-links a.footer-icon--github:hover {
    color: #111;
    background: #fff;
}

.footer-links a.footer-icon--resume:hover {
    color: var(--primary-color);
}

.footer-name {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 0;
}

.footer-name h1 {
    font-size: clamp(4rem, 17vw, 21rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--background-color);
    white-space: nowrap;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 3vh;
    border-top: 1px solid rgba(239, 234, 227, 0.15);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(239, 234, 227, 0.5);
}

/* ============================
   Responsive — Tablet (≤1024px)
   ============================ */
@media (max-width: 1024px) {
    section {
        scroll-margin-top: 80px;
    }

    /* Header */
    .site-header {
        top: 12px;
        padding: 8px 10px 8px 20px;
    }

    .nav-logo {
        font-size: 1.7rem;
    }

    .site-header .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Hero */
    .page-1 {
        padding-top: 96px;
    }

    .hero-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 3.5vh;
    }

    .page-1 .hero-shape {
        width: 44vw;
        height: 44vw;
        top: 30vh;
    }

    .page-1 .hero-shape .hero-2,
    .page-1 .hero-shape .hero-3,
    .page-1 .hero-shape .hero-4 {
        width: 36vw;
        height: 36vw;
    }

    /* About */
    .page-2 .about {
        flex-direction: column-reverse;
        align-items: center;
        gap: 6vh;
    }

    .about-text {
        width: 100%;
    }

    .about-portrait {
        width: min(70vw, 380px);
    }

    /* Timeline */
    .timeline-item {
        grid-template-columns: 28px 1fr;
        grid-template-areas:
            "marker date"
            "marker body";
        gap: 0 5vw;
    }

    .timeline-marker {
        grid-area: marker;
    }

    .timeline-date {
        grid-area: date;
        margin-bottom: 10px;
    }

    .timeline-body {
        grid-area: body;
    }

    /* Projects */
    .fixed-container {
        display: none;
    }

    .more-projects {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .skill-group:nth-child(odd) {
        border-right: none;
    }

    .skill-group:nth-child(even) {
        padding-left: 0;
    }

    /* Contact */
    .contact-wrapper {
        flex-direction: column;
        gap: 7vh;
    }

    .contact-left,
    .contact-form {
        width: 100%;
    }

    /* Footer: static (no reveal) on smaller screens */
    .page-8 {
        display: none;
    }

    footer {
        position: static;
        height: auto;
        padding: 9vh 5vw 4vh;
        gap: 5vh;
    }

    .footer-name h1 {
        font-size: 18vw;
    }
}

/* ============================
   Responsive — Mobile (≤640px)
   ============================ */
@media (max-width: 640px) {

    /* Header: logo + resume only */
    .site-header {
        width: calc(100vw - 24px);
        padding: 8px 8px 8px 18px;
    }

    .site-header ul li:not(:last-child) {
        display: none;
    }

    .nav-logo {
        font-size: 1.5rem;
    }

    /* Section navigator: bottom-right corner on phones */
    .section-nav {
        right: 14px;
        top: auto;
        bottom: 18px;
        transform: none;
        gap: 6px;
    }

    .section-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 13px;
    }

    /* Hero */
    .page-1 {
        padding-top: 88px;
    }

    .hero-title {
        font-size: 15vw;
    }

    .hero-cta {
        width: 100%;
    }

    .hero-cta .btn {
        flex: 1;
        text-align: center;
    }

    .hero-meta {
        gap: 10px;
        font-size: 0.62rem;
    }

    /* About stats: 2x2 */
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }

    /* Timeline */
    .timeline-item {
        gap: 0 6vw;
        padding-bottom: 6vh;
    }

    .timeline-date {
        font-size: 0.75rem;
    }

    /* Projects rows stack */
    .page-3 .element {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 20px 3vw;
    }

    .element-index {
        width: auto;
    }

    .page-3 .element h2 {
        font-size: 8vw;
    }

    .page-3 .element .right {
        text-align: left;
    }

    .more-cta {
        width: 100%;
    }

    .more-cta .btn {
        flex: 1;
        text-align: center;
    }

    /* Carousel header stacks */
    .highlights-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    /* Contact inputs stack */
    .input-group {
        flex-direction: column;
    }

    .custom-btn {
        width: 100%;
    }

    /* Footer */
    footer {
        padding: 8vh 5vw 3vh;
    }

    .footer-name h1 {
        font-size: 22vw;
    }

    .footer-bottom {
        justify-content: center;
        text-align: center;
        font-size: 0.68rem;
    }
}
