/* Modern CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #111;
    background: #fafafa;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fafafa 0%, #f3f3f3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loader {
    text-align: center;
}

.loader-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.5em;
    margin-bottom: 2rem;
    color: #111;
    transform: translateX(0.25em); /* Compensate for letter-spacing */
}

.loader-progress {
    width: 250px;
    height: 2px;
    background: rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    border-radius: 1px;
}

.loader-bar {
    height: 100%;
    background: #111;
    width: 0%;
    animation: loadProgress 2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes loadProgress {
    to { width: 100%; }
}

/* Particles Background */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.3;
}

/* 3D Canvas */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.7;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav.scrolled {
    background: rgba(250, 250, 250, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 4rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.03);
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.2em;
}

.nav-menu {
    display: flex;
    gap: 3.5rem;
}

.nav-item {
    text-decoration: none;
    color: #111;
    font-weight: 300;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    position: relative;
    transition: all 0.3s ease;
}

.nav-item:hover {
    opacity: 0.7;
}

.nav-item.active {
    font-weight: 400;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1px;
    background: #111;
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 30%;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.nav-toggle span {
    width: 20px;
    height: 1px;
    background: #000;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 3rem 0;
    position: relative;
    margin-top: 0;
}

.hero-content {
    max-width: 1000px;
    width: 100%;
    text-align: left;
}

.dictionary-container {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 4.5rem;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 2px;
    margin-top: 2rem;
    margin-bottom: 4rem;
    position: relative;
    z-index: 10;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.08);
    transform: translateZ(0);
}

.word-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 1.5rem;
}

.main-word {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3.2rem, 8vw, 6rem);
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    opacity: 0; /* Start hidden, will be animated by GSAP */
}

.part-of-speech {
    font-size: 1.1rem;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 300;
    letter-spacing: 0.05em;
    opacity: 0; /* Start hidden, will be animated by GSAP */
}

.definitions {
    margin-bottom: 3rem;
}

.definition {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0; /* Initial state is hidden */
    transform: translateY(20px);
    /* Animation will be applied via JavaScript */
}

/* Animation delays will be applied by JavaScript */
.definition.animate {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.definition.animate:nth-child(1) { animation-delay: 0.2s; }
.definition.animate:nth-child(2) { animation-delay: 0.4s; }
.definition.animate:nth-child(3) { animation-delay: 0.6s; }

.def-number {
    font-weight: 500;
    color: rgba(0, 0, 0, 0.4);
    min-width: 20px;
    font-size: 0.9rem;
}

.definition p {
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 400;
}

.example-quote {
    margin: 2.5rem 0;
    padding: 2rem 2.5rem;
    border-left: 2px solid rgba(0, 0, 0, 0.1);
    opacity: 0; /* Start hidden, will be animated by GSAP */
    background-color: rgba(0, 0, 0, 0.01);
    border-top: none;
    border-bottom: none;
}

.example-quote blockquote {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.75);
    font-weight: 300;
}

.example-quote.animate {
    animation: fadeIn 0.8s ease forwards;
    animation-delay: 0.8s;
}

.etymology {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    opacity: 0; /* Start hidden, will be animated by GSAP */
}

.etymology.animate {
    animation: fadeIn 0.8s ease forwards;
    animation-delay: 1s;
}

.etymology-label {
    font-weight: 500;
    min-width: 60px;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeIn 1s ease 1.5s forwards;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #000, transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-indicator span {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: #666;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Experience Section */
.experience-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: left;
    padding: 0 3rem;
    background: rgba(250, 250, 250, 0.4);
    backdrop-filter: blur(10px);
}

.experience-content {
    text-align: left;
    max-width: 650px;
    margin-left: 3rem;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 4rem;
    font-weight: 300;
}

.experience-controls {
    display: flex;
    gap: 2rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.exp-btn {
    background: transparent;
    border: 1px solid #000;
    padding: 1rem 2rem;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 300;
}

.exp-btn:hover,
.exp-btn.active {
    background: #000;
    color: #fff;
}

/* Services Section */
.services-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 3rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(250, 250, 250, 0.9));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
    z-index: 5;
}

.services-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 5rem;
}

.service-card {
    padding: 3.5rem 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #111;
    transition: width 0.4s ease;
}

.service-card:hover::after {
    width: 100%;
}

.service-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 2.5rem;
    opacity: 0.85;
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.service-card p {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #666;
    font-weight: 300;
}

/* Contact Section */
.contact-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 3rem;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9), rgba(250, 250, 250, 0.7));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    z-index: 5;
}

.contact-content {
    text-align: center;
    max-width: 800px;
}

.contact-subtitle {
    font-size: 1.2rem;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 4rem;
    font-weight: 300;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-grid {
    display: grid;
    gap: 4rem;
    align-items: start;
    width: 100%;
    max-width: 1000px;
    margin-top: 2rem;
}

.contact-info {
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 3rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
}

.contact-label {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    font-weight: 500;
}

.contact-item a {
    color: #111;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
}

.contact-item a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.3);
    transition: width 0.3s ease;
}

.contact-item a:hover {
    opacity: 0.7;
}

.contact-item a:hover::after {
    width: 100%;
}

/* Contact Form Styles */
.contact-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    text-align: left;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transform: translateZ(0);
}

.hidden {
    display: none;
    visibility: hidden;
    position: absolute;
    left: -9999px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

.form-group label {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.95);
    font-family: inherit;
    font-size: 1rem;
    color: #111;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
    font-weight: 400;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px white inset;
    transition: background-color 5000s ease-in-out 0s;
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.form-submit {
    margin-top: 1.5rem;
    align-self: flex-start;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Button Styles */
.cta-button {
    position: relative;
    background: linear-gradient(135deg, #000 0%, #333 100%);
    color: #fff;
    border: none;
    padding: 1.25rem 2.5rem;
    font-size: 1rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 300;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.button-bg {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover .button-bg {
    left: 100%;
}

.cta-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

.cta-button span {
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .nav {
        padding: 1.5rem 2rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-section,
    .experience-section,
    .contact-section {
        padding: 0 2rem;
    }
    
    .dictionary-container {
        padding: 2rem;
        margin-bottom: 2rem;
    }
    
    .services-section {
        padding: 4rem 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .experience-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 2rem;
    }
    
    .definition {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .contact-info {
        gap: 2rem;
        flex-direction: column;
        align-items: center;
    }
    
    .contact-form {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .form-submit {
        align-self: stretch;
        width: 100%;
    }
    
    .project-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .experience-content {
        text-align: left;
        max-width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .nav {
        padding: 1rem;
    }
    
    .main-word {
        font-size: 2.5rem;
    }
    
    .dictionary-container {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.project-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.project-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.75rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.project-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.01), rgba(0,0,0,0.04));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.project-type-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

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

.project-type-card.selected {
    border-color: rgba(0, 0, 0, 0.6);
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.project-type-card svg {
    width: 40px;
    height: 40px;
    margin-bottom: 1.25rem;
    stroke: #333;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.project-type-card:hover svg {
    stroke: #000;
    transform: scale(1.1);
}

.project-type-card.selected svg {
    stroke: #000;
}

.project-type-card span {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.75);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.project-type-card:hover span,
.project-type-card.selected span {
    color: #000;
    font-weight: 500;
}

.project-type-card:hover svg {
    stroke: #000;
    transform: scale(1.05);
}

.project-type-card span {
    font-size: 0.9rem;
    text-align: center;
    color: #333;
    transition: color 0.3s ease;
}

.project-type-card:hover span {
    color: #000;
}

@media (max-width: 768px) {
    .project-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .experience-content {
        text-align: left;
        max-width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .project-type-grid {
        grid-template-columns: 1fr;
    }
}
