/* ==================================================
 * top.css
 * Theme: CHIM WORKS (Green & Yellow Gradient Modern)
 * ================================================== */

/* --- Variables & Utilities --- */
:root {
    --cw-green: #0ba360;
    --cw-green-dark: #077b47;
    --cw-yellow: #f7cd46;
    --cw-yellow-light: #fef5d9;
    --cw-gradient: linear-gradient(135deg, var(--cw-green) 0%, var(--cw-yellow) 100%);
    --cw-gradient-hover: linear-gradient(135deg, var(--cw-green-dark) 0%, #e0b42f 100%);
    --cw-text: #333333;
    --cw-text-light: #555555;
    --cw-bg: #fafafa;
    --cw-radius: 16px;
    --cw-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

body {
    background-color: var(--cw-bg);
    color: var(--cw-text);
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

.cw-section {
    padding: 80px 0;
}

@media (max-width: 750px) {
    .cw-section {
        padding: 60px 0;
    }
}

.cw-title {
    text-align: center;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

@media (max-width: 750px) {
    .cw-title {
        font-size: 28px;
        margin-bottom: 40px;
    }
}

.cw-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--cw-gradient);
    border-radius: 2px;
}

/* --- FV (First View) --- */
.cw-fv {
    position: relative;
    width: 100%;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* プレミアムなメッシュグラデーションに変更 */
    background: linear-gradient(135deg, #0ba360 0%, #3cba92 50%, #f7cd46 100%);
    background-size: 200% 200%;
    animation: mesh-bg-anim 15s ease infinite;
    overflow: hidden;
    color: #fff;
    padding: 100px 20px 60px;
}

@keyframes mesh-bg-anim {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.cw-fv::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: 1;
    animation: fv-blob-anim 10s ease-in-out infinite alternate;
}

@keyframes fv-blob-anim {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(-50px, 30px) scale(1.1);
    }
}

.cw-fv__inner {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
}

.cw-fv__lead {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 30px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 750px) {
    .cw-fv__lead {
        font-size: 32px;
    }
}

.cw-fv__text {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.6;
    opacity: 0.9;
}

@media (max-width: 750px) {
    .cw-fv__text {
        font-size: 16px;
    }
}

/* --- Problems (こんなお悩みありませんか？) --- */
.cw-problems {
    background-color: #fff;
}

.cw-problems__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 900px) {
    .cw-problems__grid {
        grid-template-columns: 1fr;
    }
}

.cw-problems__item {
    background: #fff;
    border-radius: var(--cw-radius);
    padding: 40px 30px;
    box-shadow: var(--cw-shadow);
    text-align: center;
    position: relative;
    border-top: 5px solid var(--cw-yellow);
    transition: transform 0.3s ease;
}

.cw-problems__item:hover {
    transform: translateY(-5px);
}

.cw-problems__icon {
    font-size: 40px;
    color: var(--cw-green);
    margin-bottom: 20px;
    display: block;
}

.cw-problems__text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--cw-text-light);
}

.cw-problems__highlight {
    display: block;
    font-size: 1.15em;
    font-weight: 800;
    color: var(--cw-green);
    margin-bottom: 5px;
}

/* SVG Animations */
.cw-problems__svg {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    display: block;
}

.cw-problems__svg svg {
    width: 100%;
    height: 100%;
}

/* Gear Rotation */
@keyframes gear-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.anim-gear {
    animation: gear-rotate 4s linear infinite;
    transform-origin: center;
}

.anim-gear-rev {
    animation: gear-rotate 4s linear infinite reverse;
    transform-origin: center;
}

/* Clock Rotation (クルクル回る針) */
@keyframes clock-hand-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.anim-rotate {
    animation: clock-hand-rotate 10s linear infinite;
    transform-origin: center;
}

/* Robot/AI Float */
@keyframes robot-float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0);
    }
}

.anim-float {
    animation: robot-float 3s ease-in-out infinite;
}

/* --- Service (ソリューション Intro) --- */
.cw-service {
    background: var(--cw-bg);
}

.cw-service__box {
    background: #fff;
    border-radius: var(--cw-radius);
    padding: 60px;
    box-shadow: var(--cw-shadow);
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
    text-align: center;
}

@media (max-width: 750px) {
    .cw-service__box {
        padding: 40px 20px;
    }
}

.cw-service__lead {
    font-size: 26px;
    font-weight: bold;
    color: var(--cw-green);
    line-height: 1.5;
    margin-bottom: 20px;
}

@media (max-width: 750px) {
    .cw-service__lead {
        font-size: 20px;
    }
}

.cw-service__badge {
    display: inline-block;
    background: var(--cw-gradient);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(11, 163, 96, 0.3);
    white-space: nowrap;
}

.cw-service__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px 20px;
    margin-bottom: 30px;
}

.cw-service__badges--lead {
    margin-top: -10px;
}

@media (max-width: 750px) {
    .cw-service__badge {
        padding: 10px 22px;
        font-size: 16px;
    }

    .cw-service__badges {
        gap: 12px 10px;
        margin-bottom: 20px;
    }

    .cw-service__badges--lead .cw-service__badge {
        white-space: normal;
        max-width: 100%;
        line-height: 1.5;
        border-radius: 12px;
        font-weight: 800;
    }
}

/* --- New Service Section (AI & WEB) --- */
.cw-service-new {
    background: #fff;
    padding-bottom: 100px;
    /* Increased bottom padding */
}

.cw-service-list {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

@media (max-width: 750px) {
    .cw-service-list {
        gap: 60px;
    }
}

/* Service Item Layout */
.cw-service-item {
    display: flex;
    align-items: center;
    gap: 60px;
}

/* 交互に左右反転 */
.cw-service-item:nth-child(even) {
    flex-direction: row-reverse;
}

@media (max-width: 900px) {

    .cw-service-item,
    .cw-service-item:nth-child(even) {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
    }
}

.cw-service-item__content {
    flex: 1;
    /* Match media column width */
}

.cw-service-item__media,
.cw-service-item__slider {
    flex: 1;
    /* Make image/slider column smaller, and consistent widths */
    width: 100%;
    min-width: 0;
    /* Swiper width bug fix */
}

/* Service 2 Specific */
.cw-service-item--web .cw-service-item__content {
    flex: 1;
}

.cw-service-item--web .cw-service-item__slider {
    flex: 1;
    /* Unified with Service 1 */
}

/* Typography elements */
.cw-service-item__meta {
    font-size: 14px;
    font-weight: bold;
    color: var(--cw-yellow);
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.cw-service-item__title {
    font-size: 32px;
    font-weight: 800;
    color: var(--cw-green);
    margin-bottom: 20px;
    line-height: 1.4;
}

@media (max-width: 750px) {
    .cw-service-item__title {
        font-size: 24px;
        margin-bottom: 15px;
    }
}

.cw-service-item__text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--cw-text-light);
}

/* Image */
.cw-service-item__media img {
    width: 100%;
    height: auto;
    border-radius: var(--cw-radius);
    box-shadow: var(--cw-shadow);
    object-fit: cover;
    aspect-ratio: 4/3;
}

/* Style to handle the Web part with the Slider on bottom for mobile */
@media (max-width: 900px) {
    .cw-service-item--web {
        flex-direction: column !important;
    }
}

/* --- Web Slider (Swiper) --- */
.cw-web-slider {
    width: 100%;
    overflow: hidden;
    /* Fix horizontal overflow */
    padding-bottom: 40px !important;
    /* Space for pagination */
}

.cw-web-slide {
    display: block;
    text-decoration: none;
    color: var(--cw-text);
    transition: transform 0.3s ease;
}

.cw-web-slide:hover {
    transform: translateY(-5px);
}

.cw-web-slide__thumb {
    width: 100%;
    aspect-ratio: 16/10;
    background: #eee;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.cw-web-slide__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cw-web-slide:hover .cw-web-slide__thumb img {
    transform: scale(1.05);
}

.cw-web-slide__noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-weight: bold;
}

.cw-web-slide__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Pagination Adjustments */
.cw-web-slider .swiper-pagination-bullet {
    background: #ccc;
    opacity: 1;
}

.cw-web-slider .swiper-pagination-bullet-active {
    background: var(--cw-green);
}

/* --- DX Effects --- */
.cw-effects {
    background: var(--cw-bg);
}

.cw-effects__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

@media (max-width: 750px) {
    .cw-effects__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.cw-effects__card {
    background: #fff;
    border-radius: var(--cw-radius);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--cw-shadow);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.cw-effects__card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    margin: -2px;
    border-radius: inherit;
    background: var(--cw-gradient);
}

.cw-effects__icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.cw-effects__head {
    font-size: 24px;
    font-weight: bold;
    color: var(--cw-green);
    margin-bottom: 15px;
}

.cw-effects__desc {
    font-size: 15px;
    color: var(--cw-text-light);
    line-height: 1.6;
}

/* --- Blog (Column) Section --- */
.cw-blog {
    background: #fff;
}

.cw-blog__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1000px) {
    .cw-blog__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 750px) {
    .cw-blog__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .cw-blog__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cw-blog__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--cw-text);
    text-decoration: none;
    background: var(--cw-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cw-blog__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.cw-blog__thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #eee;
}

.cw-blog__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cw-blog__body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cw-blog__date {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.cw-blog__post-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.cw-btn-wrap {
    text-align: center;
    margin-top: 40px;
}

.cw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    background: var(--cw-gradient);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 5px 15px rgba(11, 163, 96, 0.4);
}

.cw-btn:hover {
    background: var(--cw-gradient-hover);
    transform: translateY(-2px);
    color: #fff;
}

/* --- Notice (お知らせ) Section --- */
.cw-notice {
    background: var(--cw-bg);
}

.cw-notice__list {
    max-width: 800px;
    margin: 0 auto;
    list-style: none;
    padding: 0;
    border-top: 1px solid #ddd;
}

.cw-notice__item {
    border-bottom: 1px solid #ddd;
}

.cw-notice__link {
    display: flex;
    align-items: center;
    padding: 20px 10px;
    text-decoration: none;
    color: var(--cw-text);
    transition: background-color 0.3s ease;
}

.cw-notice__link:hover {
    background-color: #f0f0f0;
}

.cw-notice__date {
    display: block;
    width: 120px;
    font-size: 14px;
    color: #888;
    flex-shrink: 0;
}

.cw-notice__title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    flex: 1;
}

@media (max-width: 600px) {
    .cw-notice__link {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cw-notice__date {
        width: 100%;
    }
}

/* --- Contact CTA --- */
.cw-contact {
    background: var(--cw-gradient);
    color: #fff;
    text-align: center;
    padding: 80px 20px;
}

.cw-contact__title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
}

@media (max-width: 750px) {
    .cw-contact__title {
        font-size: 24px;
    }
}

.cw-contact__lead {
    font-size: 16px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.cw-contact__btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

@media (max-width: 600px) {
    .cw-contact__btns {
        flex-direction: column;
    }
}

.cw-contact__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 260px;
}

.cw-contact__btn--white {
    background: #fff;
    color: var(--cw-green);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cw-contact__btn--white:hover {
    background: var(--cw-yellow-light);
}

.cw-contact__btn--yellow {
    background: var(--cw-yellow);
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cw-contact__btn--yellow:hover {
    background: #f1bf24;
}

/* --- Profile --- */
.cw-profile {
    background: #fff;
}

.cw-profile__box {
    max-width: 800px;
    margin: 0 auto;
    background: var(--cw-bg);
    border-radius: var(--cw-radius);
    padding: 50px 40px;
    display: flex;
    gap: 40px;
    align-items: center;
    box-shadow: var(--cw-shadow);
}

@media (max-width: 750px) {
    .cw-profile__box {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }
}

.cw-profile__thumb {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--cw-green);
    background: #ddd;
}

.cw-profile__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cw-profile__thumb--top img {
    object-position: top center;
}

.cw-profile__name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--cw-green);
}

.cw-profile__name-en {
    display: block;
    font-size: 14px;
    color: #999;
    font-weight: normal;
    margin-top: 4px;
}

.cw-profile__desc {
    font-size: 15px;
    line-height: 1.8;
    color: var(--cw-text-light);
}

/* --- DX Effects SVG Animations --- */
.cw-effects__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: var(--cw-green);
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-icon {
    width: 60px;
    height: 60px;
}

/* Timer Hand Animation (工期の短縮) */
@keyframes rotate-hand {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.svg-timer .hand {
    transform-origin: 32px 32px;
    animation: rotate-hand 4s linear infinite;
}

/* Power Bar Charging Animation (内製力の強化) */
@keyframes charge-1 {

    0%,
    10% {
        opacity: 0.1;
    }

    20%,
    90% {
        opacity: 1;
    }

    100% {
        opacity: 0.1;
    }
}

@keyframes charge-2 {

    0%,
    30% {
        opacity: 0.1;
    }

    40%,
    90% {
        opacity: 1;
    }

    100% {
        opacity: 0.1;
    }
}

@keyframes charge-3 {

    0%,
    50% {
        opacity: 0.1;
    }

    60%,
    90% {
        opacity: 1;
    }

    100% {
        opacity: 0.1;
    }
}

.svg-power .bar-3 {
    animation: charge-1 3s infinite;
    opacity: 0.1;
}

.svg-power .bar-2 {
    animation: charge-2 3s infinite;
    opacity: 0.1;
}

.svg-power .bar-1 {
    animation: charge-3 3s infinite;
    opacity: 0.1;
}

/* Productivity Line Drawing Animation (生産性の向上) */
@keyframes draw-line {

    0%,
    10% {
        stroke-dashoffset: 100;
    }

    50% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes show-arrow {

    0%,
    45% {
        opacity: 0;
    }

    50%,
    100% {
        opacity: 1;
    }
}

.svg-prod .line-grow {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw-line 3s ease-out infinite;
}

.svg-prod .arrow-head {
    opacity: 0;
    animation: show-arrow 3s ease-out infinite;
}

/* Cost Cut Cross Animation (コストの削減) */
@keyframes draw-cross {

    0%,
    30% {
        stroke-dashoffset: 100;
    }

    60%,
    90% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: 100;
    }

    /* disappear at end for looping */
}

.svg-cost-cut .cross-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    stroke: #ff4d4f;
    /* Red cross */
    animation: draw-cross 3s ease-in-out infinite;
}