:root {
    --primary-blue: #2b5cff;
    --dark-charcoal: #121214;
    --grid-line-thin: rgba(43, 92, 255, 0.06);
    --grid-line-thick: rgba(43, 92, 255, 0.12);
    --bg-white: #ffffff;
    --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'Bodoni Moda', 'Playfair Display', Georgia, serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-white);
    color: var(--dark-charcoal);
}

.scroll-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
}

.section {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-color: var(--bg-white);
    background-image: 
        linear-gradient(to right, var(--grid-line-thick) 2px, transparent 2px),
        linear-gradient(to bottom, var(--grid-line-thick) 2px, transparent 2px),
        linear-gradient(to right, var(--grid-line-thin) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line-thin) 1px, transparent 1px);
    background-size: 200px 200px, 200px 200px, 40px 40px, 40px 40px;
    background-position: center center;
}

.motion-path-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.desktop-path {
    display: block;
}

.mobile-path {
    display: none;
}

@media (max-width: 768px) {
    .desktop-path {
        display: none;
    }
    .mobile-path {
        display: block;
    }
}

.hero-section {
    padding: 2rem;
}

.title-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.selection-box-container {
    position: relative;
    margin-bottom: 0.5vw;
    transform-origin: left center;
    animation: edit-box 10s infinite cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.bounding-box {
    position: relative;
    padding: 6px 18px;
    border: 2px dashed rgba(18, 18, 20, 0.85);
    display: inline-block;
}

.handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--dark-charcoal);
    border: 1px solid var(--bg-white);
    z-index: 2;
}

.handle-tl {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.handle-tr {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.handle-bl {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.handle-br {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}

.title-grehista {
    font-size: clamp(3.2rem, 8.2vw, 6.8rem);
    font-weight: 900;
    color: var(--primary-blue);
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin: 0;
}

.title-sastra {
    font-size: clamp(4.8rem, 13vw, 11rem);
    font-weight: 900;
    color: var(--primary-blue);
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin: 0;
}

.social-toolbar {
    position: fixed;
    bottom: 40px;
    left: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.social-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    color: var(--dark-charcoal);
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), color 0.25s ease;
}

.social-item:hover {
    transform: translateX(6px);
    color: var(--primary-blue);
}

.social-item svg {
    width: 20px;
    height: 20px;
}

.navbar-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 48px;
    z-index: 50;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: clamp(0.9rem, 1.3vw, 1.15rem);
    color: var(--primary-blue);
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
    opacity: 0.75;
    transform: translateY(-2px);
}

.nav-brand {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: clamp(1.8rem, 2.8vw, 2.5rem);
    color: var(--primary-blue);
    letter-spacing: -0.02em;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-contact-slot {
    width: 120px;
    height: 44px;
}

.portfolio-display {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.portfolio-title-group {
    display: flex;
    align-items: baseline;
    transition: transform 0.5s ease-out;
}

.letter {
    color: var(--primary-blue);
    line-height: 1;
    letter-spacing: -0.02em;
    display: inline-block;
}

.font-serif {
    font-family: var(--font-serif);
    font-size: clamp(4.5rem, 11.5vw, 10.5rem);
    font-weight: 900;
}

.font-sans {
    font-family: var(--font-sans);
    font-size: clamp(4.1rem, 10.5vw, 9.6rem);
    font-weight: 900;
}

.letter.p {
    transform: translateY(20px) rotate(0deg);
}

.letter.o1 {
    transform: translateY(12px) rotate(-4deg);
    margin-left: -2px;
}

.letter.r {
    transform: translateY(0px) rotate(-8deg);
    margin-left: 0px;
}

.letter.t {
    transform: translateY(-12px) rotate(-12deg);
    margin-left: 2px;
}

.letter.f {
    transform: translateY(-24px) rotate(-10deg);
    margin-left: -2px;
}

.letter.o2 {
    transform: translateY(-38px) rotate(-14deg);
    margin-left: -4px;
}

.letter.l {
    transform: translateY(-50px) rotate(-16deg);
    margin-left: 0px;
}

.letter.i {
    transform: translateY(-62px) rotate(-18deg);
    margin-left: 6px;
}

.o-bounding-box-container {
    position: relative;
    margin-left: 0.12em;
    transform: rotate(35deg);
    transform-origin: center center;
    animation: edit-o-box 8s infinite cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.o-bounding-box {
    position: relative;
    padding: 0.05em 0.22em;
    border: 2px dashed rgba(18, 18, 20, 0.85);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.letter-o {
    font-family: var(--font-serif);
    font-size: clamp(4.5rem, 11.5vw, 10.5rem);
    font-weight: 900;
    color: var(--primary-blue);
    line-height: 0.9;
    letter-spacing: -0.02em;
}

.global-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    pointer-events: none;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.5s ease;
    transform-origin: 0 0;
}

.global-cursor.active {
    opacity: 1;
}

.floating-contact {
    position: fixed;
    bottom: 40px;
    right: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
    cursor: pointer;
    will-change: transform;
}

.floating-contact .contact-btn {
    background-color: var(--primary-blue);
    color: var(--bg-white);
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(43, 92, 255, 0.25);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    will-change: padding, font-size, box-shadow;
}

.floating-contact .play-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    opacity: 1;
    will-change: width, opacity;
    overflow: hidden;
}

.floating-contact:hover .contact-btn {
    background-color: #1b45ff;
    box-shadow: 0 6px 20px rgba(43, 92, 255, 0.35);
}

@keyframes edit-box {
    0%, 25% {
        transform: rotate(-8deg);
    }
    45% {
        transform: rotate(-14deg);
    }
    60% {
        transform: rotate(-3deg);
    }
    70% {
        transform: rotate(-8.8deg);
    }
    75% {
        transform: rotate(-7.6deg);
    }
    80%, 100% {
        transform: rotate(-8deg);
    }
}

@keyframes edit-o-box {
    0%, 20% {
        transform: rotate(35deg) scale(1);
    }
    40% {
        transform: rotate(45deg) scale(1.08);
    }
    60% {
        transform: rotate(25deg) scale(0.95);
    }
    72% {
        transform: rotate(37deg) scale(1.02);
    }
    80%, 100% {
        transform: rotate(35deg) scale(1);
    }
}

@media (max-width: 768px) {
    .navbar-header {
        padding: 20px 24px;
    }
    .nav-links {
        gap: 14px;
    }
    .nav-link {
        font-size: 0.8rem;
    }
    .nav-brand {
        font-size: 1.4rem;
        position: static;
        transform: none;
    }
    .social-toolbar {
        bottom: 20px;
        left: 24px;
        flex-direction: row;
        gap: 12px;
    }
    .floating-contact {
        bottom: 20px;
        right: 24px;
    }
}
