/* =====================================================
   GlobalStep.jp - Top Page Brand Experience
   ===================================================== */

/* ----- Page Content Override ----- */
.page-content--top {
    max-width: none;
    padding: 0;
    animation: none;
}

/* ----- CSS Variables (Top Page) ----- */
.page-content--top {
    --gs-section-gap: clamp(80px, 12vw, 160px);
    --gs-content-pad: clamp(1.5rem, 5vw, 4rem);
    --gs-inner-max: 1100px;
    --gs-bg-alt: rgba(255, 255, 255, 0.015);
}

/* ----- scroll-behavior override (conflicts with ScrollTrigger pin) ----- */
html {
    scroll-behavior: auto !important;
}

/* ----- Header Override (Top Page) ----- */
.is-top-page .site-header--nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.is-top-page .site-header--nav.is-scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ----- Opening Overlay ----- */
.opening-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--color-bg, #0a0a0f);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.opening-overlay.is-done {
    display: none;
}

.opening-messages {
    text-align: center;
    padding: 0 var(--gs-content-pad);
}

.opening-line {
    display: block;
    font-size: clamp(1.3rem, 3.5vw, 2.2rem);
    font-weight: 600;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(20px);
    animation: openingTextIn 0.6s ease-out forwards;
}

.opening-line:nth-child(1) {
    animation-delay: 0.3s;
}

.opening-line:nth-child(2) {
    animation-delay: 0.9s;
}

.opening-overlay.is-fading {
    animation: openingFadeOut 0.6s ease-in-out forwards;
}

@keyframes openingTextIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes openingFadeOut {
    to {
        opacity: 0;
    }
}

/* Skip opening for return visitors */
.skip-opening .opening-overlay {
    display: none;
}

.skip-opening .gs-hero-anim {
    animation-delay: 0.1s !important;
}

/* ----- Hero Section ----- */
.gs-hero {
    min-height: 80vh;
    min-height: 80svh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    padding: 0 var(--gs-content-pad);
}

.gs-hero__inner {
    max-width: 960px;
    width: 100%;
}

.gs-hero__label {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--color-text-tertiary);
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeSlideUp 0.7s ease-out forwards;
    animation-delay: 2.1s;
}

.gs-hero__title {
    font-size: clamp(2rem, 5.5vw, 3.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.35;
    margin-bottom: 1.5rem;
}

.gs-hero__title > span {
    display: block;
    opacity: 0;
    transform: translateY(24px);
    animation: fadeSlideUp 0.7s ease-out forwards;
}

.gs-hero__title > span:nth-child(1) {
    animation-delay: 2.25s;
}

.gs-hero__title > span:nth-child(2) {
    animation-delay: 2.45s;
}

.gs-hero__sub {
    font-size: clamp(0.88rem, 1.5vw, 1rem);
    color: var(--color-text-secondary);
    line-height: 2;
    font-weight: 300;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeSlideUp 0.7s ease-out forwards;
    animation-delay: 2.65s;
}

.gs-hero__scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-tertiary);
    opacity: 0;
    animation: fadeSlideUp 0.7s ease-out forwards;
    animation-delay: 3.2s;
}

.gs-hero__scroll span {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.gs-hero__scroll svg {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ----- Section Common ----- */
.gs-section__inner {
    max-width: var(--gs-inner-max);
    margin: 0 auto;
    padding: 0 var(--gs-content-pad);
}

.gs-section__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-family: var(--font-mono);
    text-align: center;
}

.gs-section__heading {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.5;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
    text-align: center;
}

/* ----- Philosophy Section ----- */
.gs-philosophy {
    padding: var(--gs-section-gap) var(--gs-content-pad);
    position: relative;
}

.gs-philosophy__inner {
    max-width: 800px;
    margin: 0 auto;
}

.gs-philosophy__item {
    text-align: center;
    padding: 2rem 0;
}

.gs-philosophy__heading {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.gs-philosophy__text {
    font-size: clamp(0.88rem, 1.3vw, 1rem);
    color: var(--color-text-secondary);
    line-height: 2;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

.gs-philosophy__line {
    display: block;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-gradient-start), var(--color-gradient-end));
    margin: 1.5rem auto;
    border-radius: 1px;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.5), 0 0 40px rgba(99, 102, 241, 0.2);
}

.gs-philosophy__fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.gs-philosophy__item {
    position: relative;
    z-index: 1;
}

.gs-philosophy__glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(6, 182, 212, 0.12) 50%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(50px);
    opacity: 0;
}

.gs-philosophy__ring {
    position: absolute;
    width: 350px;
    height: 350px;
    border: 1.5px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.gs-philosophy__ring--sm {
    width: 200px;
    height: 200px;
    border: 1px solid rgba(6, 182, 212, 0.18);
}

.gs-philosophy__circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
}

.gs-philosophy__circle[data-circle="1"] {
    width: 100px;
    height: 100px;
    top: 12%;
    right: 8%;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.gs-philosophy__circle[data-circle="2"] {
    width: 160px;
    height: 160px;
    bottom: 15%;
    left: 5%;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.gs-philosophy__circle[data-circle="3"] {
    width: 60px;
    height: 60px;
    top: 55%;
    right: 18%;
    border: 1.5px solid rgba(99, 102, 241, 0.2);
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
}

.gs-philosophy__dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    opacity: 0;
}

.gs-philosophy .gs-section__label {
    margin-bottom: 1.5rem;
}

.gs-philosophy__label {
    position: relative;
    z-index: 2;
}

@media (min-width: 769px) {
    .gs-philosophy {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 var(--gs-content-pad);
    }

    .gs-philosophy__inner {
        position: relative;
        width: 100%;
    }

    .gs-philosophy__stage {
        position: relative;
    }

    .gs-philosophy__item {
        padding: 0;
    }

    .gs-philosophy__item[data-index="1"] {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
    }
}

/* ----- What We Do Section ----- */
.gs-whatwedo {
    padding: var(--gs-section-gap) 0;
    background: var(--gs-bg-alt);
}

.gs-whatwedo__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.gs-whatwedo__card {
    padding: clamp(1.5rem, 3vw, 2rem);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-base);
}

.gs-whatwedo__card:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.gs-whatwedo__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.gs-whatwedo__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.12));
    color: var(--color-accent-3);
    flex-shrink: 0;
}

.gs-whatwedo__title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.gs-whatwedo__desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

/* ----- Strengths Section ----- */
.gs-strengths {
    padding: var(--gs-section-gap) 0;
}

.gs-strengths__layout {
    display: grid;
    gap: 3rem;
}

.gs-strengths__heading .gs-section__label,
.gs-strengths__heading .gs-section__heading {
    text-align: left;
}

.gs-strengths__heading .gs-section__heading {
    margin-bottom: 1rem;
}

.gs-strengths__lead {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.gs-strengths__list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gs-strengths__item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
    align-items: flex-start;
}

.gs-strengths__item:first-child {
    border-top: 1px solid var(--color-border);
}

.gs-strengths__num {
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
    padding-top: 0.15rem;
}

.gs-strengths__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.gs-strengths__desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

@media (min-width: 769px) {
    .gs-strengths__layout {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        align-items: start;
    }

    .gs-strengths__heading {
        position: sticky;
        top: 30vh;
    }
}

/* ----- Products Section ----- */
.gs-products {
    padding: var(--gs-section-gap) 0;
    background: var(--gs-bg-alt);
}

.gs-products__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.gs-products__card {
    display: block;
    text-decoration: none;
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all var(--transition-base);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.gs-products__card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.gs-products__card-inner {
    padding: clamp(1.5rem, 3vw, 2.5rem);
    text-align: center;
}

.gs-products__title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}

.gs-products__desc {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.gs-products__link {
    font-size: 0.82rem;
    color: var(--color-accent-3);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.gs-products__card:hover .gs-products__link {
    color: var(--color-accent-1);
}

/* ----- About Section ----- */
.gs-about {
    padding: var(--gs-section-gap) 0;
}

.gs-about__table {
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.gs-about__row {
    display: flex;
    gap: 2rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.gs-about__row:last-child {
    border-bottom: none;
}

.gs-about__label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-tertiary);
    min-width: 100px;
    flex-shrink: 0;
    margin: 0;
}

.gs-about__value {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ----- News Section ----- */
.gs-news {
    padding: var(--gs-section-gap) 0;
    background: var(--gs-bg-alt);
}

.gs-news__empty {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.gs-news__list {
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.gs-news__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition-fast);
}

.gs-news__item:last-child {
    border-bottom: none;
}

.gs-news__item:hover {
    background: var(--color-surface-hover);
}

.gs-news__date {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.gs-news__category {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-accent-1);
    text-transform: uppercase;
    flex-shrink: 0;
}

.gs-news__title {
    font-size: 0.88rem;
    color: var(--color-text-primary);
}

.gs-news__more {
    text-align: center;
    margin-top: 1.5rem;
}

/* ----- CTA Section ----- */
.gs-cta {
    padding: var(--gs-section-gap) var(--gs-content-pad);
    text-align: center;
}

.gs-cta__inner {
    max-width: 600px;
    margin: 0 auto;
}

.gs-cta__heading {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.gs-cta__text {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.gs-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-accent-2));
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.gs-cta__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

/* ----- Section Divider ----- */
.gs-divider {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-gradient-start), var(--color-gradient-end));
    margin: 0 auto;
    border-radius: 1px;
}

/* ----- Reveal Animation System ----- */
.gs-reveal {
    opacity: 1;
    transform: none;
}

.js-ready .gs-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-ready .gs-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.js-ready .gs-reveal-stagger {
    transition-delay: var(--stagger-delay, 0s);
}

/* Scale reveal variant */
.js-ready .gs-reveal--scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s ease, transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js-ready .gs-reveal--scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* ----- Responsive (Mobile) ----- */
@media (max-width: 768px) {
    .gs-hero {
        padding: 0 1.25rem;
    }

    .gs-hero__scroll {
        bottom: 1.5rem;
    }

    .gs-whatwedo__grid {
        grid-template-columns: 1fr;
    }

    .gs-products__grid {
        grid-template-columns: 1fr;
    }

    .gs-strengths__heading .gs-section__label,
    .gs-strengths__heading .gs-section__heading {
        text-align: center;
    }

    .gs-about__row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .gs-about__label {
        min-width: unset;
    }

    .gs-news__item {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem 1.25rem;
    }

    .gs-news__title {
        width: 100%;
    }

    .gs-philosophy__item + .gs-philosophy__item {
        border-top: 1px solid var(--color-border);
        margin-top: 2rem;
        padding-top: 3rem;
    }

    /* Mobile FX sizing */
    .gs-philosophy__glow {
        width: 280px;
        height: 280px;
    }

    .gs-philosophy__ring {
        width: 200px;
        height: 200px;
    }

    .gs-philosophy__ring--sm {
        width: 130px;
        height: 130px;
    }

    .gs-philosophy__circle[data-circle="1"] {
        width: 70px;
        height: 70px;
    }

    .gs-philosophy__circle[data-circle="2"] {
        width: 100px;
        height: 100px;
    }

    .gs-philosophy__circle[data-circle="3"] {
        width: 45px;
        height: 45px;
    }

    /* Mobile FX animations (triggered by .is-active on section) */
    .gs-philosophy.is-active .gs-philosophy__glow {
        animation: mGlow 2.5s ease-out forwards;
    }

    .gs-philosophy.is-active .gs-philosophy__ring {
        animation: mRing 2s ease-out 0.3s forwards;
    }

    .gs-philosophy.is-active .gs-philosophy__ring--sm {
        animation: mRingSm 2.2s ease-out 0.5s forwards;
    }

    .gs-philosophy.is-active .gs-philosophy__circle[data-circle="1"] {
        animation: mCircle1 2.5s ease-out 0.2s forwards;
    }

    .gs-philosophy.is-active .gs-philosophy__circle[data-circle="2"] {
        animation: mCircle2 2.8s ease-out 0.4s forwards;
    }

    .gs-philosophy.is-active .gs-philosophy__circle[data-circle="3"] {
        animation: mCircle3 2s ease-out 0.6s forwards;
    }

    /* Mobile item reveal */
    .gs-philosophy__item {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .gs-philosophy__item.is-active {
        opacity: 1;
        transform: translateY(0);
    }

    .gs-philosophy__item.is-active .gs-philosophy__line {
        width: 40px;
        transition: width 0.6s ease-out 0.5s;
    }
}

/* ----- Mobile Philosophy Keyframes ----- */
@keyframes mGlow {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    50% { opacity: 0.7; }
    100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes mRing {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-30deg); }
    60% { opacity: 0.5; }
    100% { opacity: 0.3; transform: translate(-50%, -55%) scale(1) rotate(0deg); }
}

@keyframes mRingSm {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(20deg); }
    60% { opacity: 0.4; }
    100% { opacity: 0.2; transform: translate(-50%, -60%) scale(1) rotate(-10deg); }
}

@keyframes mCircle1 {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; transform: scale(1) translateY(-10px); }
}

@keyframes mCircle2 {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.5; }
    100% { opacity: 0.25; transform: scale(1) translateY(-15px); }
}

@keyframes mCircle3 {
    0% { opacity: 0; transform: scale(0.3); }
    60% { opacity: 0.4; }
    100% { opacity: 0.2; transform: scale(1); }
}

/* ----- Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
    .opening-overlay {
        display: none;
    }

    .gs-hero__label,
    .gs-hero__title > span,
    .gs-hero__sub,
    .gs-hero__scroll {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .gs-hero__scroll svg {
        animation: none;
    }

    .js-ready .gs-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .opening-line {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .gs-philosophy.is-active .gs-philosophy__glow,
    .gs-philosophy.is-active .gs-philosophy__ring,
    .gs-philosophy.is-active .gs-philosophy__ring--sm,
    .gs-philosophy.is-active .gs-philosophy__circle {
        animation: none;
        opacity: 0;
    }

    .gs-philosophy__item {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
