* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0a192f;
    --secondary-color: #64ffda;
    --text-color: #ccd6f6;
    --text-color-light: #8892b0;
    --accent-color: #bd93f9;
    --gradient-1: linear-gradient(45deg, #bd93f9, #64ffda);
    --gradient-2: linear-gradient(135deg, #ff79c6, #bd93f9);
    --transition-speed: 0.3s;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body {
    background-color: var(--primary-color);
    color: var(--text-color);
    font-family: "Kanit", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(100, 255, 218, 0.05) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(189, 147, 249, 0.05) 0%, transparent 25%);
    background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--primary-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Selection styling */
::selection {
    background: var(--secondary-color);
    color: var(--primary-color);
}

/* Header and Navigation */
header {
    width: 100%;
    position: sticky;
    top: 0px;
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-speed) ease;
}

header:hover {
    box-shadow: 0 5px 15px rgba(100, 255, 218, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: 70px;
    max-width: 1400px;
    margin: 0 auto;
}

.left {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    position: relative;
    transition: all var(--transition-speed) ease;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
}

.left::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary-color);
    transition: width var(--transition-speed) ease;
}

.left:hover::after {
    width: 100%;
}

nav ul {
    display: flex;
    align-items: center;
}

nav ul li {
    list-style: none;
    margin: 0px 20px;
    position: relative;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
    position: relative;
    padding: 5px 0;
}

nav ul li a::before {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--secondary-color);
    transition: width var(--transition-speed) ease;
}

nav ul li a:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 8px rgba(100, 255, 218, 0.3);
}

nav ul li a:hover::before {
    width: 100%;
}

nav ul li a.active {
    color: var(--secondary-color);
}

nav ul li a.active::before {
    width: 100%;
}

/* Mobile menu */
.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all var(--transition-speed) ease;
    background-color: var(--text-color);
}

/* Hero Section */
.first {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: calc(100vh - 70px);
    padding: 0 10%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Decorative elements */
.first::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--gradient-1);
    filter: blur(80px);
    opacity: 0.15;
    top: 20%;
    left: 5%;
    z-index: -1;
    animation: float 8s ease-in-out infinite alternate;
}

.first::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--gradient-2);
    filter: blur(80px);
    opacity: 0.1;
    bottom: 10%;
    right: 5%;
    z-index: -1;
    animation: float 10s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }
    100% {
        transform: translateY(-20px) scale(1.1);
    }
}

.firstleft {
    width: 50%;
    font-size: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
    animation-delay: 0.3s;
}

.firstleft div {
    margin-bottom: 10px;
}

.firstleft div:first-child {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.firstleft div:first-child::before {
    content: '<';
    color: var(--secondary-color);
    opacity: 0.7;
    position: absolute;
    left: -20px;
}

.firstleft div:first-child::after {
    content: '/>';
    color: var(--secondary-color);
    opacity: 0.7;
    position: absolute;
    right: -30px;
}

.name {
    color: var(--accent-color);
    font-weight: 700;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 10px rgba(189, 147, 249, 0.3);
}

.name::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--gradient-1);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.5s ease-out;
}

.name:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

#element {
    color: var(--secondary-color);
    font-size: 2.2rem;
    font-weight: 600;
    min-height: 70px;
    display: block;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
}

.firstright {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
    animation-delay: 0.6s;
}

.firstright::before {
    content: '';
    position: absolute;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border-radius: 50%;
    background: var(--gradient-1);
    top: -10px;
    left: -10px;
    z-index: -1;
    animation: pulse 3s infinite alternate;
    opacity: 0.5;
}

.firstright::after {
    content: '';
    position: absolute;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    border-radius: 50%;
    border: 2px dashed var(--secondary-color);
    top: -20px;
    left: -20px;
    z-index: -1;
    animation: rotate 20s linear infinite;
    opacity: 0.3;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.firstright img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--secondary-color);
    transition: all var(--transition-speed) ease;
    filter: grayscale(20%);
    box-shadow: var(--box-shadow);
}

.firstright:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Sections */
.second {
    padding: 50px 10%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.second::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--gradient-2);
    filter: blur(80px);
    opacity: 0.1;
    top: 30%;
    right: 0;
    z-index: -1;
}

.second h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
    color: var(--text-color);
}

.second h1::before {
    content: '{';
    color: var(--secondary-color);
    opacity: 0.7;
    position: absolute;
    left: -25px;
    top: 0;
}

.second h1::after {
    content: '}';
    color: var(--secondary-color);
    opacity: 0.7;
    position: absolute;
    right: -25px;
    top: 0;
}

.second h1 span {
    position: relative;
}

.second h1 span::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    bottom: -10px;
    left: 0;
    background: var(--gradient-1);
}

details {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 3px solid var(--secondary-color);
    transition: all var(--transition-speed) ease;
    box-shadow: var(--box-shadow);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

details:nth-child(2) {
    animation-delay: 0.2s;
}

details:nth-child(3) {
    animation-delay: 0.4s;
}

details:nth-child(4) {
    animation-delay: 0.6s;
}

details:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    border-left-width: 5px;
}

summary {
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
}

summary::before {
    content: '→';
    margin-right: 10px;
    transition: transform var(--transition-speed) ease;
}

details[open] summary::before {
    transform: rotate(90deg);
}

details p {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 1px dashed rgba(100, 255, 218, 0.3);
}

main hr {
    margin: 30px auto;
    height: 1px;
    border: 0;
    background: linear-gradient(to right, transparent, var(--accent-color), transparent);
    width: 80%;
}

/* Footer */
footer {
    background-color: rgba(10, 25, 47, 0.9);
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gradient-1);
    opacity: 0.5;
}

.copyright {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
    color: var(--text-color-light);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.social {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.social a {
    margin: 0 15px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all var(--transition-speed) ease;
}

.social img {
    height: 20px;
    width: 20px;
    transition: all var(--transition-speed) ease;
    filter: grayscale(100%);
}

.social a:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.social a:hover img {
    filter: grayscale(0%);
}

.social a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    z-index: -1;
}

.social a:hover::before {
    opacity: 0.3;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.1);
        opacity: 0.2;
    }
}

/* Page Transitions */
.page-transition {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Title styling for inner pages */
.title {
    padding: 50px 10% 20px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.title::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--gradient-1);
    filter: blur(70px);
    opacity: 0.1;
    top: 30%;
    right: 10%;
    z-index: -1;
}

.title h1 {
    font-size: 3rem;
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeInUp 1s forwards;
    color: var(--text-color);
    text-shadow: 0 0 10px rgba(204, 214, 246, 0.1);
}

.title h1::before {
    content: '<';
    color: var(--secondary-color);
    opacity: 0.7;
    position: absolute;
    left: -30px;
    font-size: 0.8em;
}

.title h1::after {
    content: '/>';
    color: var(--secondary-color);
    opacity: 0.7;
    position: absolute;
    right: -45px;
    font-size: 0.8em;
}

/* About page */
main p {
    margin: 0 10%;
    padding: 20px 0;
    font-family: "Kanit", sans-serif;
    text-align: justify;
    color: var(--text-color-light);
    line-height: 1.8;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10%;
    opacity: 0;
    animation: fadeInUp 1s forwards;
    animation-delay: 0.3s;
    position: relative;
    z-index: 1;
}

main p::first-letter {
    font-size: 1.5em;
    color: var(--secondary-color);
    font-weight: 600;
}

/* Projects page */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 10%;
    max-width: 1400px;
    margin: 0 auto;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
    box-shadow: var(--box-shadow);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(100, 255, 218, 0.03), transparent);
    transform: translateY(100%);
    transition: transform 0.6s ease;
}

.project-card:hover::before {
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all var(--transition-speed) ease;
}

.project-card:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.project-content {
    padding: 20px;
}

.project-content h3 {
    color: var(--text-color);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.project-content h3::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--secondary-color);
    transition: width var(--transition-speed) ease;
}

.project-card:hover .project-content h3::after {
    width: 100%;
}

.project-content p {
    color: var(--text-color-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-links a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-links a i {
    transition: transform var(--transition-speed) ease;
}

.project-links a:hover {
    color: var(--accent-color);
}

.project-links a:hover i {
    transform: translateX(3px);
}

/* Contact form styling */
.contact-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px);
    padding: 0 10%;
    position: relative;
}

.contact-container::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--gradient-1);
    filter: blur(80px);
    opacity: 0.1;
    top: 20%;
    left: 10%;
    z-index: -1;
}

.contact-container::after {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: var(--gradient-2);
    filter: blur(80px);
    opacity: 0.1;
    bottom: 10%;
    right: 10%;
    z-index: -1;
}

.form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 450px;
    padding: 40px;
    transition: all var(--transition-speed) ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
    position: relative;
    overflow: hidden;
}

.form::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(100, 255, 218, 0.03), transparent);
    transform: rotate(45deg);
    animation: formShine 6s linear infinite;
    z-index: -1;
}

@keyframes formShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.form:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

form input, form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: var(--text-color);
    font-family: "Kanit", sans-serif;
    transition: all var(--transition-speed) ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

form input:focus, form textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--secondary-color), inset 0 2px 5px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.15);
}

form textarea {
    min-height: 150px;
    resize: vertical;
}

form button {
    width: 100%;
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-family: "Kanit", sans-serif;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
    z-index: -1;
}

form button:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

form button:hover::before {
    left: 100%;
}

#thanks {
    text-align: center;
    margin-top: 15px;
    color: var(--secondary-color);
    font-weight: 600;
    height: 20px;
    transition: all var(--transition-speed) ease;
}

/* Responsive Design */
@media only screen and (max-width: 1024px) {
    .first {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 50px;
    }
    
    .firstleft {
        width: 100%;
        margin-top: 50px;
    }
    
    .firstleft div:first-child::before,
    .firstleft div:first-child::after,
    .title h1::before,
    .title h1::after,
    .second h1::before,
    .second h1::after {
        display: none;
    }
    
    .name::after, .title h1::after, .second h1 span::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .second h1, .title h1 {
        text-align: center;
        display: block;
    }
    
    .social a {
        margin: 0 10px;
    }
}

@media only screen and (max-width: 768px) {
    .hamburger {
        display: block;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .right ul {
        position: fixed;
        left: -100%;
        top: 70px;
        gap: 0;
        flex-direction: column;
        background-color: rgba(10, 25, 47, 0.95);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
        padding: 20px 0;
        z-index: 100;
    }
    
    .right ul.active {
        left: 0;
    }
    
    nav ul li {
        margin: 16px 0;
    }
    
    .firstleft {
        font-size: 1.5rem;
    }
    
    #element {
        font-size: 1.7rem;
    }
    
    .firstright {
        width: 250px;
        height: 250px;
    }
    
    .form {
        width: 100%;
        padding: 30px 20px;
    }
    
    footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .social {
        margin-top: 10px;
    }
    
    .social a {
        width: 35px;
        height: 35px;
        margin: 0 8px;
    }
    
    .social img {
        height: 18px;
        width: 18px;
    }
}

@media only screen and (max-width: 480px) {
    .firstleft {
        font-size: 1.2rem;
    }
    
    #element {
        font-size: 1.4rem;
    }
    
    .firstright {
        width: 200px;
        height: 200px;
    }
    
    .title h1 {
        font-size: 2rem;
    }
    
    .second h1 {
        font-size: 1.8rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .social a {
        width: 30px;
        height: 30px;
        margin: 0 5px;
    }
    
    .social img {
        height: 15px;
        width: 15px;
    }
}