/* Resets & Variables */
:root {
    --bg-color: #111111;
    --text-color: #f4f4f4;
    --text-sub: #a0a0a0;
    --accent-color: #3caea3;
    /* Teal/Greenish Blue for Trust & Freshness */
    --accent-hover: #2a8a80;
    --font-base: "Noto Sans JP", sans-serif;
    --container-width: 1000px;
    --container-narrow: 700px;
    --spacing-section: 120px;
    --transition-speed: 0.6s;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-base);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.7;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities: Device Visibility */
.u-desktop {
    display: inline;
}

.u-mobile {
    display: none;
}

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

    .u-mobile {
        display: block;
        /* or inline depending on usage, usually block for new lines */
    }
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.container--narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--spacing-section) 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 60px;
    font-weight: 300;
    text-align: center;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Animations */
.fade-in {
    opacity: 0;
    transition: opacity var(--transition-speed) ease-out;
}

.fade-in.active {
    opacity: 1;
}

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-speed) ease-out, transform var(--transition-speed) ease-out;
}

.fade-up.active {
    opacity: 1;
    transform: translateY(0);
}

.slide-up {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
}

.slide-up.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-text {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease, transform 1s ease;
}

.reveal-text.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

.delay-3 {
    transition-delay: 0.6s;
}

.delay-4 {
    transition-delay: 0.8s;
}

.delay-5 {
    transition-delay: 1.0s;
}

.delay-6 {
    transition-delay: 1.2s;
}

.delay-8 {
    transition-delay: 1.6s;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    z-index: 100;
    background: rgba(17, 17, 17, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
}

.header__inner {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.header__nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.header__nav a {
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    position: relative;
}

.header__nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.header__nav a:hover::after {
    width: 100%;
}

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 5%;
}

.hero__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.hero__text-area {
    flex: 1;
    padding-right: 50px;
}

.hero__job-title {
    font-size: 1rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.hero__name {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    line-height: 1.2;
}

.hero__key-copy {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.5;
}

.hero__sub-copy {
    font-size: 1rem;
    color: var(--text-sub);
}

.hero__image-area {
    width: 400px;
    height: 500px;
    overflow: hidden;
    border-radius: 4px;
    flex-shrink: 0;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(30%);
    transform: scale(1.35);
    transform-origin: center 55%;
}

.hero__scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    opacity: 0.5;
}

.hero__scroll .line {
    width: 1px;
    height: 60px;
    background: var(--text-color);
}

/* Intro */
.intro {
    text-align: center;
}

.intro__text {
    font-size: 1.2rem;
    line-height: 2.2;
    margin-bottom: 40px;
}

/* Concept */
.concept__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: left;
}

.concept__item {
    padding: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.concept__head {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.concept__desc {
    color: var(--text-sub);
    font-size: 0.95rem;
}

/* Works */
.works__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 60px 40px;
    /* Vertical gap 60px, Horizontal 40px */
    justify-content: center;
}

@media (max-width: 768px) {
    .works__grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 40px;
    }
}

@media (max-width: 480px) {
    .works__grid {
        grid-template-columns: 1fr;
        /* Force 1 column on small screens */
        gap: 30px;
    }
}

.work-card {
    background: #1a1a1a;
    /* Slight contrast card bg */
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s;
}

.work-card:hover {
    transform: translateY(-5px);
}

.work-card__thumb {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.work-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

.work-card:hover .work-card__thumb img {
    transform: scale(1.05);
}

.work-card__content {
    padding: 30px;
}

.work-card__meta {
    margin-bottom: 15px;
}

.work-card__tag {
    font-size: 0.8rem;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 50px;
}

.work-card__title {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.work-card__details {
    font-size: 0.9rem;
}

.work-card__details dt {
    color: var(--text-sub);
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.work-card__details dd {
    margin-bottom: 20px;
    line-height: 1.6;
}

.work-card__details dd:last-child {
    margin-bottom: 0;
}

/* About */
.about__content {
    text-align: center;
}

.about__job {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 30px;
    letter-spacing: 0.05em;
}

.about__text {
    font-size: 1rem;
    line-height: 2;
    margin-bottom: 30px;
}

.about__bio {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-sub);
    margin-top: 40px;
}

/* Flow */
.flow__steps {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.flow__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.flow__num {
    font-size: 3rem;
    font-weight: 700;
    color: #222;
    /* faint */
    line-height: 1;
}

.flow__label {
    font-size: 1.1rem;
    font-weight: 500;
}

.flow__arrow {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin: 0 10px;
}

/* Beginner */
.beginner__box {
    background: #1a1a1a;
    padding: 60px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.beginner__title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--accent-color);
}

.beginner__text {
    line-height: 2;
}

/* Contact */
.contact {
    text-align: center;
    padding-bottom: 150px;
}

.contact__message {
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.contact__form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.contact__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-sub);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

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

.form-action {
    text-align: center;
    margin-top: 20px;
}

.contact__success {
    text-align: center;
    padding: 40px;
    background: rgba(60, 174, 163, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    margin-top: 20px;
    line-height: 2;
    color: var(--text-color);
}

.btn {
    display: inline-block;
    padding: 15px 60px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 50px;
    font-weight: 500;
    transition: background 0.3s, transform 0.2s;
}

.btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* Footer */
.footer {
    padding: 40px;
    text-align: center;
    border-top: 1px solid #222;
    font-size: 0.8rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    .header__nav {
        display: none;
    }

    /* Change B: Refine Mobile Hero Layout */
    .hero {
        flex-direction: column-reverse;
        /* Keeps Text bottom, Image top usually... wait. */
        /* 
           Current HTML: text-area (first), image-area (second).
           PC flex-direction: default row. Text Left, Image Right.
           Mobile column-reverse: Image (2nd) becomes Top. Text (1st) becomes Bottom.
           This matches the requirement: Photo -> Text.
        */
        justify-content: center;
        text-align: center;
        padding-top: 60px;
        padding-bottom: 140px;
        /* Increased padding for SCROLL space */
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        position: relative;
    }

    /* Restore SCROLL on mobile with adjustments */
    .hero__scroll {
        display: flex;
        bottom: 30px;
        font-size: 0.7rem;
        /* Smaller font */
        gap: 8px;
    }

    .hero__scroll .line {
        height: 30px;
        /* Shorter line for mobile */
    }

    .hero__content {
        flex-direction: column-reverse;
        padding-bottom: 0;
        gap: 40px;
        /* Increased gap for more whitespace */
    }

    /* Order inside Text Area: Job -> Name -> Key Copy -> Sub Copy */
    /* This matches HTML order, so no flex manipulation needed within text-area */

    .hero__text-area {
        padding-right: 0;
        margin-top: 10px;
    }

    /* Resize image smaller for mobile */
    /* Resize image smaller for mobile - Optimized per request */
    /* Resize image smaller for mobile - 60% width as requested */
    /* Resize image smaller for mobile - 60% -> 15% smaller = 51% */
    .hero__image-area {
        width: 51% !important;
        height: auto !important;
        margin: 0 auto 30px;
        display: block;
        aspect-ratio: 4/5;
        /* Optional: preserves the ratio if image doesn't load immediately, based on 160/200 */
    }

    .hero__name {
        font-size: 2rem;
        margin-bottom: 30px;
        /* Space before Key Copy */
        white-space: nowrap;
    }

    .hero__job-title {
        font-size: 0.9rem;
        margin-bottom: 10px;
        color: var(--accent-color);
    }

    /* Stack Key Copy for Mobile */
    .hero__key-copy {
        font-size: 1.2rem;
        display: flex;
        flex-direction: column;
        /* Stack vertically */
        gap: 10px;
        line-height: 1.4;
        margin-bottom: 30px;
        /* Space before Sub Copy */
        align-items: center;
    }

    .hero__copy-part {
        display: block;
        /* Ensure block behavior */
    }

    /* Hide 'x' separators on mobile since it's stacked */
    .hero__copy-part:nth-child(even) {
        display: none;
    }

    .hero__sub-copy {
        font-size: 0.85rem;
        line-height: 1.8;
        padding: 0 10px;
        color: var(--text-sub);
    }

    /* Fix ABOUT name break */
    .no-break {
        display: inline-block;
    }

    .concept__grid {
        grid-template-columns: 1fr;
    }

    .works__grid {
        grid-template-columns: 1fr;
    }

    /* Change C: Hide Flow Section on Mobile */
    .flow {
        display: none;
    }

    .beginner__box {
        padding: 30px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 40px;
    }

    .hero__name {
        font-size: 2rem;
        /* Smaller font for mobile */
        margin-bottom: 30px;
    }

    .hero__key-copy {
        font-size: 1.1rem;
        line-height: 1.6;
    }

    .hero__image-area {
        width: 100%;
        /* Responsive width */
        max-width: 280px;
        height: 350px;
        /* Slight adjust */
    }

    .intro__text {
        font-size: 1rem;
        line-height: 2;
        text-align: left;
        /* Easier to read on small screens */
    }

    .works__grid {
        gap: 40px;
    }

    .work-card__thumb {
        height: 200px;
    }

    .work-card__content {
        padding: 20px;
    }

    .btn {
        width: 100%;
        /* Full width for easier tapping */
        text-align: center;
        padding: 16px 0;
    }

    .footer {
        padding: 30px 20px;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal__container {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal.active .modal__container {
    transform: translateY(0);
}

.modal__close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.2s;
}

.modal__close:hover {
    color: var(--accent-color);
}

.modal__content {
    display: flex;
    overflow-y: auto;
    /* Scrollable content if tall */
}

.modal__image-area {
    width: 50%;
    background: #000;
    flex-shrink: 0;
}

.modal__image-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal__image-area.is-vertical img {
    object-fit: contain;
}

.modal__text-area {
    width: 50%;
    padding: 40px;
    text-align: left;
}

.modal__title {
    font-size: 1.5rem;
    margin: 15px 0 30px;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.modal__detail-group {
    margin-bottom: 25px;
}

.modal__detail-group h4 {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.modal__detail-group p {
    font-size: 1rem;
    line-height: 1.8;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal__content {
        flex-direction: column;
    }

    .modal__image-area,
    .modal__text-area {
        width: 100%;
    }

    .modal__image-area {
        height: 250px;
    }

    .modal__text-area {
        padding: 25px;
    }

    .modal__title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
}