/* ========================================
Works Page Styles
======================================== */

/* ========================================
CSS Variables
======================================== */
:root {
    --primary-color: #5596B1;
    --secondary-color: #E4ECF0;
    --accent-color: #E68E30;
    --text-color: #333;
    --white: #ffffff;
    --font-serif: 'adobe-garamond-pro', 'EB Garamond', serif;
    --font-sans: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
    --font-serif-jp: 'Ryumin Web', 'EB Garamond', 'Times New Roman', serif;
}

/* ========================================
Base Styles
======================================== */
html {
    font-size: 62.5%;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

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

/* ========================================
Typography
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1rem 0;
}

.section-title {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

/* ========================================
Navigation
======================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow-x: hidden;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    width: 90%;
}

.nav-logo a {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 400;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.nav-logo img{
    width: 100px;
}

.nav-container-menu {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: end;
    align-items: center;
    height: 70px;
    width: 90%;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
    z-index: 101;
    position: fixed;
}

.nav-item {
    margin: 0;
}

.nav-link {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.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(-10px) rotate(-45deg);
}

/* ========================================
Button Arrow Styles
======================================== */
.btn-arrow {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.btn-arrow:hover {
    color: var(--primary-color);
}

.home-btn-container {
    text-align: center;
    margin: 8%;
}

/* ========================================
works Hero Section
======================================== */
.works-hero {
    position: relative;
    height: calc(100vh - 70px);
    min-height: 600px;
    overflow: hidden;
}

.works-hero-image {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 90%;
    z-index: 1;
}

.works-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.works-hero-overlay {
    position: absolute;
    top: -230px;
    left: -1px;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
}

.works-hero-text-box {
    background-color: var(--white);
    padding: 18px 36px;
    max-width: 620px;
    width: 42%;
}

.works-hero-title {
    font-family: var(--font-serif-jp);
    font-size: 3.6rem;
    font-weight: 400;
    color: var(--text-color);
    margin: 0 8px 0 0;
    line-height: 1.3;
    display: inline-block;
}

.works-hero-subtitle {
    font-family: var(--font-sans);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-color);
    margin: 0;
    letter-spacing: 0.1em;
    display: inline-block;
}

.works-hero-side-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: var(--primary-color);
    font-family: var(--font-serif);
    font-size: 8.2rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-shadow: 2px 2px 10px rgba(255, 255, 255, 0.6);
    position: absolute;
    right: 5%;
    top: 40%;
    white-space: nowrap;
}

/* ========================================
Works Sections
======================================== */
.web-site-section {
    padding: 8% 0;
}

.other-designs-section {
    background-color: #ebeff1;
    padding: 8% 0;
}

.javascript-game-section {
    padding-top: 0;
    background-color: #ebeff1;
    padding-bottom: 8%;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 3.6rem;
    font-weight: 400;
    color: var(--text-color);
    text-align: left;
    margin-bottom: 10%;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 340px;
    height: 2px;
    background: var(--accent-color);
}

/* ========================================
Works Grid
======================================== */
.works-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.works-grid-3 {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.work-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.work-image {
    width: 100%;
    height: auto;
    overflow: hidden;
}

.work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    box-shadow: 0 0px 15px rgba(0, 0, 0, 0.2);
}

.work-item:hover .work-image img {
    transform: scale(1.05);
}

.work-content {
    padding: 30px 15px;
}

.work-title {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 15px 0;
    line-height: 1.4;
    display: inline-block;
}

.other-designs-section .work-title{
    display: block;
    font-size: 1.8rem;
}

.javascript-game-section .work-title{
    font-size: 1.8rem;
}

.work-tag {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 16px;
    padding: 3px 24px 5px;
    margin-bottom: 15px;
    margin-left: 20px;
}

.work-description {
    font-family: var(--font-sans);
    font-size: 1.6rem;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0 0 25px 0;
}

.btn-position{
    text-align: center;
}

.work-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    border: 2px solid var(--text-color);
    padding: 10px 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.work-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--text-color);
    z-index: 1;
    transition: left 0.4s cubic-bezier(0.4,0,0.2,1);
}

.work-btn span,
.work-btn .btn-arrow {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.work-btn .btn-arrow {
    color: var(--text-color);
}

.work-btn:hover::before {
    left: 0;
}

.work-btn:hover {
    color: var(--white);
    border-color: var(--text-color);
}

.work-btn:hover .btn-arrow {
    color: var(--white);
    transform: translateX(-4px);
}

/* ========================================
Design Categories
======================================== */
.design-category {
    margin-bottom: 5%;
}

.category-separator {
    background-image: linear-gradient(90deg, rgba(106, 187, 221, 1), rgba(221, 183, 106, 1));
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5%;
}

.separator-text {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 600;
    color: var(--white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========================================
Home Button
======================================== */
.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    color: var(--text-color);
    border: 2px solid var(--text-color);
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.4rem;
    border-radius: 0;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
    position: relative;
    overflow: hidden;
}

.home-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--text-color);
    z-index: 1;
    transition: left 0.4s cubic-bezier(0.4,0,0.2,1);
}

.home-btn span,
.home-btn .btn-arrow {
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.home-btn .btn-arrow {
    color: var(--text-color);
}

.home-btn:hover::before {
    left: 0;
}

.home-btn:hover {
    color: var(--white);
    border-color: var(--text-color);
}

.home-btn:hover .btn-arrow {
    color: var(--white);
    transform: translateX(-4px);
}

/* ========================================
Footer
======================================== */
.footer {
    background-color: #E4ECF0;
    color: var(--text-color);
    padding: 40px 0;
    text-align: center;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color);
}

.footer-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.copy-mark {
    font-size: 1.8rem;
    position: relative;
    top: 3px;
}

/* ========================================
Responsive Design
======================================== */
@media (max-width: 1440px) {
    .works-hero-side-text{
        font-size: 7.2rem;
    }
}

@media (max-width: 1024px) {
    .works-hero-title{
        font-size: 2.8rem;
    }
    .works-hero-subtitle{
        font-size: 1.4rem;
    }

    .works-hero-side-text{
        font-size: 6.2rem;
        top: 45%;
    }
    
    .section-title {
        font-size: 3.2rem;
    }
    
    .work-title {
        font-size: 1.8rem;
    }
    .other-designs-section .work-title {
        font-size: 1.6rem;
    }
    
    .work-description {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .works-hero-image{
        top: 60px;
    }

    .nav-menu {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 50%;
        height: calc(100vh - 70px);
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 10% 0;
        gap: 3rem;
        overflow-y: auto;
        z-index: 99;
    }

    .nav-menu.active {
        right: 0;
    }

    .hamburger {
        display: flex;
    }

    .works-hero {
        height: 80vh;
        min-height: 500px;
    }

    .works-hero-overlay {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        top: 0;
    }
    
    .works-hero-text-box {
        padding: 20px 30px;
        max-width: 280px;
    }
    
    .works-hero-title {
        font-size: 2.4rem;
    }
    
    .works-hero-subtitle {
        font-size: 1.4rem;
    }
    
    .works-hero-side-text {
        font-size: 4rem;
        top: 25%;
    }

    .web-site-section,.other-designs-section {
        padding: 12% 0;
    }

    .javascript-game-section {
        padding-bottom: 12%;
    }

    .home-btn-container{
        margin: 12% 0;
    }

    .section-title {
        font-size: 2.8rem;
        margin-bottom: 15%;
    }

    .works-grid-2{
        grid-template-columns: repeat(1,1fr);
    }

    .works-grid-3{
        grid-template-columns: repeat(2,1fr);
    }

    .design-category {
        margin-bottom: 12%;
    }
    
    .work-content {
        padding: 20px 5px;
    }
    
    .work-title {
        font-size: 1.6rem;
    }

    .other-designs-section .work-title,
    .javascript-game-section .work-title {
        font-size: 1.4rem;
        text-align: center;
    }

    .btn-position{
        text-align: center;
    }
    
    .work-description {
        font-size: 1.2rem;
    }
    
    .work-btn {
        font-size: 1.2rem;
        padding: 10px 20px;
    }

    .javascript-game-section .work-tag{
        display: block;
        margin-left: 0;
    }
    
    .category-separator {
        height: 50px;
        margin-bottom: 8%;
    }
    
    .separator-text {
        font-size: 1.6rem;
    }
    
    .home-btn {
        font-size: 1.4rem;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .works-hero-image{
        top: 40px;
    }

    .nav-container{
        width: 100%;
    }
    .nav-logo a{
        font-size: 2.4rem;
    }
    .nav-logo img{
        width: 80px;
    }
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        padding: 5% 0;
        gap: 2rem;
    }
    
    .nav-link {
        font-size: 1.6rem;
    }

    .works-hero-text-box {
        padding: 15px 10px;
        width: 45%;
    }
    
    .works-hero-title {
        font-size: 2.4rem;
    }
    
    .works-hero-side-text {
        font-size: 3.2rem;
    }
    
    .section-title {
        font-size: 2.4rem;
        margin-bottom: 20%;
    }

    .works-section{
        padding: 15% 0;
    }

    .section-title::after{
        width: 250px;
    }
    
    .work-title {
        font-size: 1.4rem;
        display: block;
    }

    .work-tag{
        font-size: 1rem;
        margin-left: 0;
        border-radius: 8px;
    }
    
    .works-grid-3{
        grid-template-columns: repeat(1,1fr);
    }

    .category-separator {
        height: 40px;
    }
    
    .separator-text {
        font-size: 1.4rem;
    }

    .javascript-game-section .work-description{
        text-align: center;
    }

    .javascript-game-section .work-tag{
        width: 60%;
        display: block;
        margin: 0 auto 10px;
        text-align: center;
    }
    
    .home-btn {
        font-size: 1.2rem;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-link {
        font-size: 1.8rem;
    }
}