/* ==============================================
   GREEGION — Clean AI Light Design System
   ============================================== */

/* --- Animated Custom Properties --- */
@property --mesh-1 {
    syntax: '<color>';
    initial-value: rgba(37, 99, 235, 0.08);
    inherits: false;
}

@property --mesh-2 {
    syntax: '<color>';
    initial-value: rgba(124, 58, 237, 0.06);
    inherits: false;
}

@property --mesh-3 {
    syntax: '<color>';
    initial-value: rgba(56, 189, 248, 0.05);
    inherits: false;
}

@property --scroll-progress {
    syntax: '<percentage>';
    initial-value: 0%;
    inherits: false;
}

/* --- Tokens --- */
:root {
    --bg: #FAFBFD;
    --bg-alt: #F0F2F8;
    --card: #FFFFFF;
    --card-hover: #F8F9FC;

    --line: rgba(0, 0, 0, 0.06);
    --line2: rgba(0, 0, 0, 0.10);

    --text: #1A1A2E;
    --text-secondary: #3D3D56;
    --muted: #6B7084;
    --subtle: #9CA3AF;

    --accent: #2563EB;
    --accent2: #7C3AED;
    --accent-light: rgba(37, 99, 235, 0.08);
    --gradient: linear-gradient(135deg, #2563EB, #7C3AED);
    --gradient-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1));

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-accent: 0 4px 24px rgba(37, 99, 235, 0.25);

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;

    --section-pad: 3.5rem 1.5rem;
    --container: 540px;

    --sans: 'Inter', system-ui, sans-serif;
    --jp: 'Noto Sans JP', sans-serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 60px;
}

body {
    font-family: var(--jp);
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==============================================
   SCROLL PROGRESS BAR
   ============================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 200;
    background: transparent;
    pointer-events: none;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient);
    border-radius: 0 2px 2px 0;
    transition: width 0.1s linear;
}

/* ==============================================
   MESH GRADIENT BACKGROUND
   ============================================== */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--bg);
    overflow: hidden;
}

.bg-mesh canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

/* ==============================================
   APP SHELL
   ============================================== */
.app-shell {
    max-width: var(--container);
    margin: 0 auto;
    background: var(--bg);
    min-height: 100dvh;
    position: relative;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
}

/* ==============================================
   NAV
   ============================================== */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 251, 253, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}

.nav.nav-hidden {
    transform: translateY(-100%);
}

.nav.nav-scrolled {
    box-shadow: var(--shadow-sm);
}

.nav-logo {
    font-family: var(--sans);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-cta {
    font-family: var(--sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
    padding: 0.45rem 1.1rem;
    border: 1.5px solid var(--accent);
    border-radius: 100px;
    transition: all .3s var(--ease-out);
}

.nav-cta:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-accent);
}

/* ==============================================
   HERO
   ============================================== */
.hero {
    padding: 4.5rem 1.75rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-bottom: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
    opacity: .3;
}

.hero-eyebrow {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-family: var(--jp);
    font-size: clamp(1.85rem, 6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -0.02em;
    color: var(--text);
}

.hero-title em {
    font-style: normal;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-body {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.9;
    max-width: 380px;
}

/* Typing cursor */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* ==============================================
   BUTTONS
   ============================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.95rem 2rem;
    background: var(--gradient);
    color: #fff;
    font-family: var(--jp);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--r-sm);
    border: none;
    cursor: pointer;
    transition: all .3s var(--ease-out);
    box-shadow: var(--shadow-accent);
    align-self: flex-start;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e54cc, #6429c0);
    opacity: 0;
    transition: opacity .3s;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(37, 99, 235, .35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary span,
.btn-primary svg {
    position: relative;
    z-index: 1;
}

/* ==============================================
   MISSION STRIP
   ============================================== */
.mission-strip {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg-alt);
}

.mission-text {
    font-family: var(--sans);
    font-size: .85rem;
    font-style: italic;
    font-weight: 400;
    color: var(--subtle);
    letter-spacing: 0.03em;
}

/* ==============================================
   SECTIONS
   ============================================== */
.section {
    padding: var(--section-pad);
    border-bottom: 1px solid var(--line);
}

.section--alt {
    background: var(--bg-alt);
}

.section-header {
    margin-bottom: 2.25rem;
}

.label {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.6rem;
}

.section-title {
    font-family: var(--jp);
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.35;
}

/* ==============================================
   STRENGTHS
   ============================================== */
.strengths-list {
    display: flex;
    flex-direction: column;
}

.strength-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 0.75rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--line);
    transition: background .3s var(--ease-out);
    margin: 0 -1.5rem;
    border-radius: 0;
}

.strength-item:last-child {
    border-bottom: none;
}

.strength-item:hover {
    background: var(--accent-light);
}

.strength-num {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-top: 0.2rem;
}

.strength-title {
    font-family: var(--jp);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.55;
    margin-bottom: 0.4rem;
}

.strength-desc {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.85;
}

/* ==============================================
   SERVICES
   ============================================== */
.services-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: all .3s var(--ease-out);
}

.service-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--line2);
    transform: translateY(-2px);
}

.service-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.service-icon-wrap {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-soft);
    border-radius: var(--r-sm);
    color: var(--accent);
    flex-shrink: 0;
}

.service-title {
    font-family: var(--jp);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.service-desc {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.85;
    padding-left: calc(42px + 0.75rem);
}

/* ==============================================
   CASE STUDY — Gallery
   ============================================== */
.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.gallery-photo {
    overflow: hidden;
    height: 160px;
}

.gallery-wide {
    grid-column: 1 / -1;
    height: 200px;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--ease-out);
}

.gallery-img:hover {
    transform: scale(1.05);
}

.case-name-block {
    margin-bottom: 1rem;
}

.case-name {
    font-family: var(--sans);
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--text);
    margin: 0.3rem 0 0.2rem;
}

.case-type {
    font-size: 0.9rem;
    color: var(--subtle);
}

.case-desc {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.9;
    margin-bottom: 1.75rem;
}

/* Metrics */
.metrics {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.metric {
    flex: 1;
    padding: 1.25rem 0.75rem;
    text-align: center;
}

.metric-divider {
    width: 1px;
    height: 48px;
    background: var(--line);
    flex-shrink: 0;
}

.metric-value {
    display: block;
    font-family: var(--sans);
    font-size: 1.875rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.metric-value small {
    font-size: .65em;
    font-weight: 700;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.45;
}

.case-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    padding-bottom: 2px;
    border-bottom: 1.5px solid rgba(37, 99, 235, .3);
    transition: all .3s var(--ease-out);
}

.case-link:hover {
    color: var(--accent2);
    border-color: var(--accent2);
}

/* ==============================================
   COMPANY
   ============================================== */
.company-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.company-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    transition: background .3s var(--ease-out);
}

.company-row:last-child {
    border-bottom: none;
}

.company-row:hover {
    background: var(--card-hover);
}

.company-row dt {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--subtle);
    letter-spacing: 0.04em;
    padding: 1rem;
    border-right: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    background: var(--bg-alt);
}

.company-row dd {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 1rem 1.25rem;
    line-height: 1.85;
}

.en-small {
    display: block;
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--subtle);
    margin-top: 0.15rem;
}

/* ==============================================
   CONTACT
   ============================================== */
.contact-lead {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.85;
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

.req {
    color: var(--accent);
}

.field input,
.field textarea {
    background: var(--card);
    border: 1.5px solid var(--line2);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--jp);
    font-size: 1rem;
    padding: 0.85rem 1rem;
    transition: all .3s var(--ease-out);
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--subtle);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

.field textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    align-self: flex-start;
    margin-top: 0.5rem;
}

/* ==============================================
   FOOTER
   ============================================== */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid var(--line);
    background: var(--bg-alt);
}

.footer-logo {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-copy {
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--subtle);
}

/* ==============================================
   REVEAL ANIMATIONS
   ============================================== */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 420px) {
    :root {
        --section-pad: 2.75rem 1.25rem;
    }

    .hero {
        padding: 3.5rem 1.25rem 3rem;
    }

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

    .strength-item {
        grid-template-columns: 44px 1fr;
        margin: 0 -1.25rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .company-row {
        grid-template-columns: 80px 1fr;
    }

    .gallery-photo {
        height: 130px;
    }

    .gallery-wide {
        height: 160px;
    }
}