/* ==================== トークン ==================== */

:root {
    --bg: #08212E;
    --bg-panel: #09202E;
    --ink: #EEE9DD;
    --ink-strong: #F7F6EC;
    --ink-soft: #F0EADB;
    --gold: #B99A5B;
    --gold-light: #C9A863;
    --gold-dark: #80683F;

    --line: rgba(241, 240, 241, 0.1);
    --line-soft: rgba(241, 240, 241, 0.06);
    --line-gold: rgba(185, 154, 91, 0.28);

    --font-jp: 'Noto Sans JP', 'Inter', sans-serif;
    --font-en: 'Inter', sans-serif;
    --font-display: 'Barlow', sans-serif;

    --content: 1120px;
    --gutter: 52px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== ベース ==================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-jp);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ink);
    text-decoration: none;
}

a:hover {
    color: var(--gold);
}

img,
svg {
    display: block;
}

ul {
    list-style: none;
}

::selection {
    background: rgba(185, 154, 91, 0.3);
    color: var(--ink-strong);
}

:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
    border-radius: 3px;
}

.svg-sprite {
    display: none;
}

/* ==================== 共通ユーティリティ ==================== */

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--gold-light);
    color: #09202E;
    font-size: 13px;
    transform: translateY(-160%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
    color: #09202E;
}

/* スクロール連動フェードイン。JS が無い環境では最初から表示する */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ==================== ヘッダー ==================== */

.site-header__inner {
    max-width: 1224px;
    margin: 0 auto;
    padding: 44px var(--gutter) 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header__logo {
    display: flex;
    align-items: center;
}

/* logo_h.png は上下に余白を含むので、字面（316x60）だけを切り出して置く */
.site-header__logo img {
    height: 26px;
    width: 137px;
    object-fit: cover;
}

/* ==================== 言語切り替え ==================== */

.lang {
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 3px;
    border: 1px solid rgba(241, 240, 241, 0.14);
    border-radius: 100px;
}

.lang__item {
    padding: 5px 13px;
    border-radius: 100px;
    font-family: var(--font-en);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
    opacity: 0.55;
    transition: opacity 0.3s ease, background 0.3s ease, color 0.3s ease;
}

a.lang__item:hover {
    color: var(--ink);
    opacity: 1;
    background: rgba(241, 240, 241, 0.06);
}

.lang__item--current {
    color: #09202E;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    opacity: 1;
    cursor: default;
}

/* ==================== ヒーロー ==================== */

.hero {
    position: relative;
    padding: 76px var(--gutter) 150px;
    overflow: hidden;
}

/* 中央のゴールドグロー */
.hero::before {
    content: '';
    position: absolute;
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
    width: 960px;
    height: 960px;
    max-width: 130vw;
    background: radial-gradient(circle, rgba(128, 104, 63, 0.15) 0%, rgba(128, 104, 63, 0.035) 38%, rgba(8, 33, 46, 0) 68%);
    pointer-events: none;
}

/* 背景のグリッド */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(241, 240, 241, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(241, 240, 241, 0.022) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(circle at 50% 26%, #000 0%, transparent 60%);
    mask-image: radial-gradient(circle at 50% 26%, #000 0%, transparent 60%);
    pointer-events: none;
}

.hero__inner {
    position: relative;
    z-index: 1;
    max-width: var(--content);
    margin: 0 auto;
}

.hero__lead {
    max-width: 860px;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(44px, 6.6vw, 86px);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.015em;
    color: var(--ink-strong);
    margin-bottom: 18px;
    text-wrap: balance;
}

.hero__title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero__tagline {
    font-size: clamp(20px, 2.6vw, 30px);
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    margin-bottom: 40px;
    text-wrap: balance;
}

.hero__text {
    font-size: clamp(13px, 1.5vw, 15.5px);
    line-height: 2.1;
    font-weight: 300;
    opacity: 0.78;
    max-width: 640px;
    text-wrap: pretty;
}

/* ==================== バッジ ==================== */

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 100px;
    white-space: nowrap;
}

.badge--outline {
    padding: 3px 9px;
    font-family: var(--font-en);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--gold);
    border: 1px solid rgba(185, 154, 91, 0.45);
}

/* ==================== セクション共通 ==================== */

.section {
    padding: 130px var(--gutter);
    scroll-margin-top: 80px;
}

.section--panel {
    background: var(--bg-panel);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}

.section__inner {
    max-width: var(--content);
    margin: 0 auto;
}

.section__head {
    margin-bottom: 56px;
}

.section__title {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    color: var(--ink-strong);
}

.section__title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==================== プロダクト ==================== */

.product {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    border: 1px solid rgba(185, 154, 91, 0.25);
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(128, 104, 63, 0.07), rgba(8, 33, 46, 0));
}

.product__body {
    padding: 52px 48px;
}

.product__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.product__logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.product__name {
    font-family: var(--font-en);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink-strong);
}

.product__text {
    font-size: 16px;
    line-height: 1.95;
    font-weight: 300;
    opacity: 0.8;
    margin-bottom: 28px;
    text-wrap: pretty;
}

.tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.tags__item {
    font-family: var(--font-en);
    font-size: 12.5px;
    padding: 6px 14px;
    border: 1px solid rgba(241, 240, 241, 0.14);
    border-radius: 100px;
    opacity: 0.85;
}

.arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--gold);
    transition: gap 0.3s ease;
}

.arrow-link:hover {
    gap: 12px;
}

.product__visual {
    position: relative;
    border-left: 1px solid rgba(241, 240, 241, 0.08);
    display: grid;
    place-items: center;
    padding: 32px;
    min-height: 260px;
}

.product__visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(241, 240, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(241, 240, 241, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ---- Melxis のメモリグラフ（LP の hero から移植）----
   スクロール量を --p / --s に入れ、各要素は自分の --appear と比べて出方を決める。
   JS は変数を更新するだけで、見た目の計算は全部ここ。 */

.mel-graph {
    --p: 0;
    --s: 0;
    position: relative;
    width: 100%;
    height: auto;
}

/* 自分の出番（--appear）を過ぎたら 0→1 に立ち上がる量 */
.mel-edge {
    --in-line: clamp(0, calc((var(--p) - var(--appear) + 0.02) / 0.08), 1);
    --in-draw: clamp(0, calc((var(--p) - var(--appear) + 0.02) / 0.12), 1);
    --in-signal: clamp(0, calc((var(--p) - var(--appear) - 0.08) / 0.08), 1);
}

.mel-edge__line {
    opacity: calc(var(--in-line) * var(--w));
    stroke-dashoffset: calc(var(--len) * (1 - var(--in-draw)));
}

.mel-edge__signal {
    opacity: calc(var(--in-signal) * 0.9);
    animation: mel-signal 3.4s linear infinite;
}

.mel-node {
    --in-node: clamp(0, calc((var(--p) - var(--appear) + 0.02) / 0.06), 1);
    --in-scale: clamp(0, calc((var(--p) - var(--appear) + 0.02) / 0.10), 1);
    opacity: var(--in-node);
    transform: scale(calc(0.4 + 0.6 * var(--in-scale)));
    transform-box: fill-box;
    transform-origin: center;
}

.mel-node__drift {
    animation: mel-drift 6.2s ease-in-out infinite;
}

.mel-node__ring {
    opacity: 0.4;
    animation: mel-pulse 4s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

.mel-graph__halo {
    opacity: calc(0.3 + 0.55 * clamp(0, calc(var(--s) / 0.3), 1));
    transform: scale(calc(0.85 + 0.3 * clamp(0, calc(var(--s) / 0.5), 1)));
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes mel-signal {
    from { stroke-dashoffset: 156; }
    to { stroke-dashoffset: 0; }
}

@keyframes mel-drift {
    0%, 100% { transform: translate3d(0, 0, 0); }
    30% { transform: translate3d(4px, -5px, 0); }
    62% { transform: translate3d(-3px, 4px, 0); }
    82% { transform: translate3d(2px, 2.5px, 0); }
}

@keyframes mel-pulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.04); }
}

.product-row {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 30px 34px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(241, 240, 241, 0.012);
}

.product-row__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}

.product-row__icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 9px;
    border: 1px solid rgba(241, 240, 241, 0.16);
    display: grid;
    place-items: center;
    font-size: 20px;
    opacity: 0.85;
}

.product-row__body {
    flex: 1;
    min-width: 240px;
}

.product-row__name {
    font-size: 17px;
    font-weight: 500;
    color: var(--ink-strong);
}

.product-row__text {
    font-size: 14px;
    line-height: 1.75;
    font-weight: 300;
    opacity: 0.7;
}

/* ==================== 会社概要 ==================== */

.info {
    border-top: 1px solid var(--line);
}

.info__row {
    display: grid;
    grid-template-columns: 200px 1fr;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.info__key {
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--gold);
}

.info__value {
    font-size: 15px;
    font-weight: 300;
}

/* ==================== フッター ==================== */

.site-footer {
    padding: 44px var(--gutter);
    border-top: 1px solid rgba(241, 240, 241, 0.08);
}

.site-footer__inner {
    max-width: var(--content);
    margin: 0 auto;
}

.site-footer__copy {
    font-family: var(--font-en);
    font-size: 12.5px;
    letter-spacing: 0.03em;
    opacity: 0.5;
}

/* ==================== レスポンシブ ==================== */

@media (max-width: 900px) {

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

    .product__visual {
        border-left: none;
        border-top: 1px solid rgba(241, 240, 241, 0.08);
    }

    .product__body {
        padding: 40px 30px;
    }
}

@media (max-width: 680px) {
    :root {
        --gutter: 22px;
    }

    .site-header__inner {
        padding: 30px var(--gutter) 16px;
    }

    .site-header__logo img {
        height: 18px;
        width: 95px;
    }

    .hero {
        padding-top: 72px;
        padding-bottom: 88px;
    }

    .section {
        padding-top: 88px;
        padding-bottom: 88px;
    }

    .info__row {
        grid-template-columns: 1fr;
        gap: 4px 0;
        padding: 16px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
    }

    .mel-graph {
        --p: 1;
        --s: 0.5;
    }

    .mel-node__drift,
    .mel-edge__signal,
    .mel-node__ring {
        animation: none;
    }
}
