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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Solway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Georgia, serif;
    background: #1a1a1a;
    color: #e8e8e8;
    line-height: 1.6;
    font-size: 1rem;
    overflow-x: hidden;
}

.main {
    min-height: 100vh;
    padding: 2rem 2rem 1rem;
}

.container {
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    width: 100%;
}

.hero h1 {
    font-size: clamp(1.9rem, 5vw + 1.5rem, 3.2rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
    line-height: 1.2;
}

.hero .title {
    font-size: clamp(1.15rem, 2vw + 0.9rem, 1.5rem);
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.hero .summary {
    font-size: clamp(1.15rem, 0.5vw + 1.1rem, 1.4rem);
    margin: 0 auto 2rem;
    line-height: 1.75;
    color: #d0d0d0;
    letter-spacing: 0.01em;
    overflow-wrap: break-word;
}

.skills {
    margin-bottom: 3rem;
    text-align: center;
    width: 100%;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin: 0 auto;
}

.skill-category {
    padding: 1.35rem;
    text-align: center;
}

.skill-icon {
    font-size: 1.9rem;
    margin-bottom: 0.8rem;
    color: #b0b0b0;
}

.skill-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.4rem;
    color: #b0b0b0;
    word-break: keep-all;
}

.skill-list {
    font-size: clamp(0.8rem, 0.4vw + 0.65rem, 0.875rem);
    color: #b0b0b0;
    word-break: keep-all;
    overflow-wrap: normal;
}

.contact {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    width: 100%;
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1rem;
    margin-top: 1.5rem;
}

.contact-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #e8e8e8;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem;
    min-height: 3.5rem;
    min-width: 3.5rem;
}

.contact-item:hover {
    transform: translateY(-2px);
}

.contact-item:active {
    opacity: 0.85;
}

.contact-hint {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.35rem 0.65rem;
    background: #e8e8e8;
    color: #1a1a1a;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.contact-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #e8e8e8;
}

.contact-item:hover .contact-hint {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}

.contact-icon {
    font-size: clamp(1.4rem, 1.5vw + 0.6rem, 1.75rem);
}

.contact-desc {
    font-size: clamp(0.9rem, 0.5vw + 0.7rem, 1rem);
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.skills-mobile {
    display: none;
}

@media (min-width: 769px) {
    .main {
        height: 100vh;
        min-height: 0;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 1rem 0.75rem;
    }

    .container {
        max-width: 1100px;
        max-height: 100%;
        overflow: hidden;
        justify-content: center;
        gap: 0;
        flex-shrink: 1;
        min-height: 0;
    }

    .hero {
        flex-shrink: 0;
    }

    .hero h1 {
        font-size: clamp(1.6rem, 4vw + 1.2rem, 2.75rem);
    }

    .hero .title {
        margin-bottom: 0.5rem;
    }

    .hero .summary {
        margin-bottom: 0.75rem;
        font-size: clamp(1rem, 0.5vw + 1rem, 1.2rem);
        line-height: 1.6;
    }

    .skills {
        margin-bottom: 0.75rem;
        flex-shrink: 1;
        min-height: 0;
    }

    .skill-icon {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
    }

    .skill-title {
        font-size: 1rem;
    }

    .skill-list {
        font-size: 0.8rem;
    }

    .contact {
        margin-bottom: 0;
        padding-top: 0.5rem;
        flex-shrink: 0;
    }

    .contact-grid {
        margin-top: 0.5rem;
    }
}

@media (max-height: 600px) {
    .main {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        align-items: flex-start;
        padding: 1.5rem max(1rem, env(safe-area-inset-right)) 2rem max(1rem, env(safe-area-inset-left));
    }

    .container {
        max-height: none;
        overflow: visible;
    }
}

@media (min-width: 970px) {
    .skills-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .skill-category {
        min-width: 0;
        padding: 0.5rem 0.4rem;
    }

    .skills .skill-list {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .skill-list {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .main {
        padding: 1.5rem max(1rem, env(safe-area-inset-right)) 2rem max(1rem, env(safe-area-inset-left));
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .hero {
        margin-bottom: 1.25rem;
    }

    .hero .summary br {
        display: none;
    }

    .skills {
        display: none;
    }

    .skills-mobile {
        display: block;
        margin: 0 auto 1.25rem;
        padding: 0 0.5rem;
        max-width: 20rem;
        font-size: 0.9rem;
        color: #b0b0b0;
        text-align: center;
        line-height: 1.5;
        overflow-wrap: break-word;
    }

    .hero .summary {
        padding: 0;
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .contact {
        padding-top: 0.75rem;
    }

    .contact-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        max-width: 100%;
        margin: 0.5rem auto 0;
    }

    .contact-item {
        padding: 0.6rem 0.5rem;
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    .contact-icon {
        font-size: 1.75rem;
        margin-bottom: 0;
    }

    .contact-desc {
        display: none;
    }
}

@media (max-width: 380px) {
    .main {
        padding: 1.25rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
    }

    .hero h1 {
        font-size: 1.35rem;
    }

    .hero .title {
        font-size: 0.9rem;
    }

    .hero .summary {
        font-size: 0.9rem;
    }
}
