/*
 * ensave LP
 * スマートフォン向けの寸法は元のデザイン資料（sp_full.png / DESIGN.md v7）に基づく。
 */

/* 共通の色・書体・基準寸法 */
:root {
    --green: #3ac661;
    --bg: #f4f4f4;
    --white: #fff;
    --orange: #f8871d;
    --ink: #154d36;
    --text: #313131;
    --line: #cfdcd2;
    --note: #6b6b6b;
    --black: #000;
    --font:
        "Noto Sans JP",
        "Hiragino Sans",
        "Hiragino Kaku Gothic ProN",
        "Yu Gothic",
        Meiryo,
        sans-serif;

    /* コンテンツは390px幅を基準に拡縮し、520pxを上限とする。 */
    --lp-max-width: 520px;
    --u: calc(min(100vw, var(--lp-max-width)) / 390);
}

/* 全体の初期値とフォーカス表示 */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: auto;
    /* 中央の列の外側に見える背景を画面に固定する。 */
    background: var(--bg) fixed;
}

body {
    position: relative;
    /* セクションごとの背景も中央のコンテンツ幅に収める。 */
    max-width: var(--lp-max-width);
    margin: 0 auto;
    background: var(--bg);
    color: var(--text);
    font: 400 16px / 1.8 var(--font);
    overflow-wrap: anywhere;
    word-break: normal;
    line-break: strict;
}

/* コンテンツ列の外側に、ページを通して薄い影を描く。 */
body::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: var(--lp-max-width);
    margin: 0 auto;
    z-index: 1;
    box-shadow: 0 0 20px rgba(0, 0, 0, .1);
    pointer-events: none;
}

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

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip {
    position: absolute;
    left: 8px;
    top: -60px;
    background: #fff;
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 8px;
    z-index: 50;
    font-weight: 700;
}

.skip:focus {
    top: 8px;
}

h1,
h2,
h3,
p,
ul {
    margin: 0;
}

.note {
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--note);
}

/*
 * ファーストビューと末尾のダウンロード導線
 * 波形と緑の背景は中央の列に収め、見出しや画像は .hero-in を基準に配置する。
 * .hero-in の子要素は絶対配置する。
 * 末尾では同じ部品の位置とサイズを上書きする。
 */
.hero,
.final {
    position: relative;
    background: var(--bg);
}

.final {
    background: var(--green);
}

.wave {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: calc(510 * var(--u));
    fill: var(--green);
}

.hero-in {
    position: relative;
    width: calc(390 * var(--u));
    height: calc(600 * var(--u));
    margin: 0 auto;
    color: #fff;
}

.final-in {
    height: calc(446 * var(--u));
}

.hero-in>* {
    position: absolute;
}

h1,
.final h2 {
    left: calc(20 * var(--u));
    top: calc(34 * var(--u));
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .06);
    letter-spacing: .02em;
}

.h1a,
.h1b {
    display: block;
    text-shadow: 0px 3px 6px rgba(0, 0, 0, 0.25);
}

.h1a {
    font-size: calc(48 * var(--u));
    line-height: calc(60 * var(--u));
}

.h1b {
    font-size: calc(58 * var(--u));
    line-height: calc(70 * var(--u));
}

.brand {
    left: calc(17 * var(--u));
    top: calc(195 * var(--u));
    display: flex;
    align-items: center;
    gap: calc(14 * var(--u));
}

.brand img {
    width: calc(55 * var(--u));
    height: calc(55 * var(--u));
    border-radius: calc(12 * var(--u));
}

.brand span {
    font-size: calc(28 * var(--u));
    font-weight: 500;
    letter-spacing: .02em;
    line-height: 1;
}

.lead {
    left: calc(20 * var(--u));
    top: calc(259 * var(--u));
    width: calc(176 * var(--u));
    font-size: calc(17 * var(--u));
    line-height: 1.2;
    font-weight: 400;
}

.hand {
    left: calc(190 * var(--u));
    top: calc(105 * var(--u));
    width: calc(200 * var(--u));
    height: auto;
}

.ios {
    left: calc(10 * var(--u));
    top: calc(406 * var(--u));
    width: calc(92 * var(--u));
    height: auto;
}

.dl {
    left: 0;
    right: 0;
    top: calc(484 * var(--u));
    text-align: center;
    color: var(--black);
}

.dl-t {
    font-size: calc(16 * var(--u));
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: calc(10 * var(--u));
}

.hero .dl-t span {
    position: relative;
    display: inline-block;
    padding: 0 calc(22 * var(--u));
}

/* ダウンロード文言の左右の斜線。太さは固定し、長さと位置は画面幅に合わせる。 */
.hero .dl-t span::before,
.hero .dl-t span::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(26 * var(--u));
    height: 2px;
    background: var(--black);
    transform-origin: center;
}

.hero .dl-t span::before {
    left: calc(-18 * var(--u));
    transform: rotate(50deg);
}

.hero .dl-t span::after {
    right: calc(-18 * var(--u));
    transform: rotate(-50deg);
}

.store {
    display: inline-block;
    width: calc(150 * var(--u));
    min-width: 140px;
    border-radius: 12px;
    line-height: 0;
    transition: transform .15s;
}

.store:active {
    transform: scale(.97);
}

.store img {
    width: 100%;
    height: auto;
}

.final .brand {
    top: calc(201 * var(--u));
}

.final .hand {
    left: calc(235 * var(--u));
    top: calc(128 * var(--u));
    width: calc(155 * var(--u));
}

.final .ios {
    left: calc(298 * var(--u));
    top: calc(60 * var(--u));
}

.final .dl {
    top: calc(296 * var(--u));
    right: auto;
    width: calc(256 * var(--u));
}

.final .dl-t {
    color: var(--white);
}

/* 家計簿の仕組み */
.how {
    background: var(--bg);
    padding: calc(16 * var(--u)) 0 calc(26 * var(--u));
}

.how-in {
    position: relative;
    width: calc(390 * var(--u));
    margin: 0 auto;
    padding: 0 calc(18 * var(--u));
}

.h-how {
    font-size: calc(36 * var(--u));
    font-weight: 600;
    line-height: 1.25;
    color: var(--green);
    padding: calc(8 * var(--u)) 0 0 calc(14 * var(--u));
}

.h-how span {
    display: block;
}

.human {
    position: absolute;
    right: calc(18 * var(--u));
    top: calc(-2 * var(--u));
    width: calc(151 * var(--u));
    height: auto;
}

/* 後続の .app1 が式のカードの下端に重なる。 */
.eq {
    position: relative;
    z-index: 2;
    margin-top: calc(14 * var(--u));
    background: var(--white);
    border: 1.5px solid var(--black);
    border-radius: calc(20 * var(--u));
    padding: calc(14 * var(--u)) 0 calc(14 * var(--u));
    text-align: center;
}

.eq-a {
    font-size: calc(15 * var(--u));
    font-weight: 800;
    color: var(--black);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    gap: .4em;
}

.eq-a b {
    font-weight: 800;
}

.eq-b {
    font-size: calc(25 * var(--u));
    font-weight: 600;
    color: var(--orange);
    line-height: 1.4;
}

.app1 {
    /* フェードインの途中も、画像を式カードより手前に置く。 */
    position: relative;
    z-index: 3;

    /* 14px下からせり上がる演出の開始位置でも、カードの下端に少し重ねる。 */
    margin: -16px calc(-18 * var(--u)) 0;
}

.app1 img {
    width: 95%;
    margin-left: auto;
}

.app1 .note,
.feat-note {
    padding: 0 calc(18 * var(--u));
    margin-top: 8px;
}

/* 便利な4つの機能 */
.feat {
    padding: 0 calc(18 * var(--u)) calc(40 * var(--u));
}

.feat-in {
    width: 100%;
    max-width: calc(354 * var(--u));
    margin: 0 auto;
    background: var(--white);
    border-radius: calc(24 * var(--u));
    padding: calc(36 * var(--u)) calc(24 * var(--u)) calc(30 * var(--u));
}

.h-feat {
    text-align: center;
    font-size: calc(26 * var(--u));
    font-weight: 600;
    line-height: 1.3;
    color: var(--green);
}

.h-feat b {
    font-size: calc(44 * var(--u));
    line-height: 1;
    padding: 0 .08em;
}

.f {
    margin-top: calc(30 * var(--u));
}

.no {
    text-align: center;
    font-size: calc(17 * var(--u));
    font-weight: 600;
    color: var(--green);
    line-height: 1.2;
}

.f h3 {
    text-align: center;
    font-size: calc(25 * var(--u));
    font-weight: 600;
    line-height: 1.3;
    color: var(--green);
    margin: calc(4 * var(--u)) 0 calc(14 * var(--u));
}

.f img {
    margin: 0 auto calc(14 * var(--u));
    width: calc(240 * var(--u));
}

.f .txt {
    font-size: calc(15 * var(--u));
    line-height: 1.65;
    text-align: left;
}

.feat-note {
    padding: 0;
    margin-top: calc(26 * var(--u));
}

/* よくある質問 */
.faq-sec {
    padding: calc(40 * var(--u)) calc(24 * var(--u)) calc(46 * var(--u));
}

.faq-in {
    max-width: calc(342 * var(--u));
    margin: 0 auto;
}

.h-faq {
    font-size: calc(28 * var(--u));
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    margin-bottom: calc(30 * var(--u));
}

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

.faq details {
    border-bottom: 1px solid var(--line);
}

/* 質問行は Q・質問文・開閉記号の3列。ブラウザー標準のマーカーを隠し、開閉記号は details の open 属性に合わせる。 */
.faq summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: 2.4em 1fr 1.5em;
    align-items: start;
    padding: calc(20 * var(--u)) 0;
    min-height: 48px;
    font-size: calc(15.5 * var(--u));
    font-weight: 700;
    line-height: 1.5;
    color: var(--text);
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::before {
    content: "Q";
    color: var(--ink);
    font-weight: 800;
}

.faq summary::after {
    content: "+";
    color: var(--ink);
    font-weight: 800;
    text-align: right;
}

.faq details[open] summary::after {
    content: "−";
}

.faq .a {
    padding: 0 0 calc(18 * var(--u));
}

.faq .a p {
    font-size: calc(15 * var(--u));
    line-height: 1.9;
}

.faq .a a,
.faq-note a {
    color: var(--ink);
}

.faq-note {
    margin-top: calc(26 * var(--u));
    font-size: calc(13.5 * var(--u));
    color: var(--note);
}

/* フッター */
.site-footer {
    background: var(--white);
    padding: calc(38 * var(--u)) calc(24 * var(--u)) calc(40 * var(--u));
}

.foot-in {
    max-width: calc(342 * var(--u));
    margin: 0 auto;
}

.foot-brand {
    display: flex;
    align-items: center;
    gap: calc(14 * var(--u));
    margin-bottom: calc(26 * var(--u));
}

.foot-brand img {
    width: calc(32 * var(--u));
    height: calc(32 * var(--u));
    border-radius: 7px;
}

.foot-brand span {
    font-size: calc(23 * var(--u));
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer li {
    font-size: calc(14 * var(--u));
    line-height: 1;
    padding: calc(6 * var(--u)) 0;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.site-footer a {
    text-decoration: none;
    color: var(--text);
}

.site-footer a:hover {
    text-decoration: underline;
}

.site-footer .two {
    gap: 1em;
}

.site-footer i {
    font-style: normal;
}

.copy {
    margin-top: calc(22 * var(--u));
    font-size: calc(14 * var(--u));
    color: var(--note);
}

.tm {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.6;
    color: var(--note);
}

/*
 * 画面下部に固定するダウンロードボタン
 * 通常は非表示。.v-sticky が付いた狭い画面では、セーフエリアを含めて下端に固定する。
 * ボタンがフッターに重ならないよう、フッター下部に余白を確保する。
 */
.cta-bar {
    display: none;
}

@media (max-width: 899px) {
    .v-sticky .cta-bar {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        /* 固定バーの背景も中央のコンテンツ幅に揃える。 */
        max-width: var(--lp-max-width);
        margin: 0 auto;
        z-index: 20;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .96);
        border-top: 1px solid var(--line);
    }

    .v-sticky .cta-bar .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        max-width: calc(var(--lp-max-width) - 32px);
        margin: 0 auto;
        min-height: 56px;
        border-radius: 12px;
        background: var(--black);
        color: #fff;
        text-decoration: none;
        font-weight: 800;
        font-size: 16px;
    }

    .v-sticky .site-footer {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }
}

/*
 * PCの左右の余白
 * 左右の高さを揃え、それぞれの余白の中央に固定する。高さが足りないときはパネル内でスクロールする。
 */
.pc-side {
    display: none;
}

@media (min-width: 1120px) {
    .pc-side {
        /* 中央の本文を除いた片側の余白と、その中央位置。 */
        --pc-side-gutter: calc((100% - var(--lp-max-width)) / 2);
        --pc-side-center: calc(var(--pc-side-gutter) / 2);

        display: flex;
        flex-direction: column;
        justify-content: safe center;
        position: fixed;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        height: min(780px, calc(100vh - 48px));
        padding: clamp(20px, 2vw, 28px);
        overflow: auto;
        color: var(--ink);
    }

    .pc-side > * {
        flex-shrink: 0;
    }

    .pc-intro {
        left: var(--pc-side-center);
        width: min(416px, calc(var(--pc-side-gutter) - 24px));
        container-type: inline-size;
        padding: 18px 12px;
        background: var(--green);
        color: var(--white);
        border: 1px solid var(--line);
        border-radius: 24px;
        box-shadow: 0 6px 24px rgba(0, 0, 0, .07);
    }

    /* 中央と書体・サイズを共用し、幅が足りないときだけ比率を保って縮める。 */
    .pc-intro-title,
    .pc-intro-brand {
        --u: min(calc(var(--lp-max-width) / 390), calc(100cqw / 244));
        width: min(100%, 326px);
        margin-inline: auto;
    }

    .pc-intro-title {
        font-weight: 800;
        letter-spacing: .02em;
    }

    .pc-intro-brand {
        margin-top: 12px;
    }

    .pc-intro-image {
        width: min(100%, 230px);
        min-height: 152px;
        flex-shrink: 1;
        object-fit: contain;
        margin: 16px auto 0;
        /* 手首が画像の右下で切れるため、この角だけ丸める。 */
        border-bottom-right-radius: 28% 14%;
    }

    .pc-nav {
        left: calc(100% - var(--pc-side-center));
        width: min(416px, calc(var(--pc-side-gutter) - 24px));
        gap: 28px;
        padding: 12px;
    }

    .pc-nav-title {
        display: grid;
        place-items: center;
        min-height: 50px;
        padding: 8px 16px;
        background: var(--ink);
        color: var(--white);
        border-radius: 999px;
        font-size: 16px;
        font-weight: 800;
        text-align: center;
    }

    .pc-nav-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 0;
        list-style: none;
    }

    .pc-nav a {
        position: relative;
        display: grid;
        place-items: center;
        padding: 10px 22px;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.4;
        text-align: center;
        text-decoration: none;
    }

    .pc-nav a::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
        border-block: 5px solid transparent;
        border-left: 7px solid currentColor;
    }

    .pc-nav-list a {
        min-height: 80px;
        height: 100%;
        background: var(--white);
        border-radius: 12px;
        transition: background-color .15s ease;
    }

    .pc-nav-list a:hover,
    .pc-nav-list a:focus-visible {
        background-color: var(--orange);
    }

    .pc-download {
        display: grid;
        gap: 10px;
    }

    .pc-download-link {
        min-height: 50px;
        background: var(--green);
        color: var(--white);
        border-radius: 999px;
        transition: transform .15s ease;
    }

    .pc-download-link:hover {
        transform: scale(1.03);
    }

    .pc-download-preview {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 12px;
        background: var(--white);
        border: 1px solid var(--line);
        border-radius: 14px;
    }

    /* QRコード。白い余白（クワイエットゾーン）は画像に含まれる。 */
    /* .pc-nav a の余白・矢印を、QRコードのリンクには適用しない。 */
    .pc-nav .pc-download-qr {
        display: block;
        flex: none;
        width: 116px;
        height: 116px;
        padding: 0;
        background: var(--white);
    }

    .pc-nav .pc-download-qr::after {
        content: none;
    }

    .pc-download-qr img {
        display: block;
        width: 100%;
        height: 100%;
    }

    .pc-download-store {
        font-weight: 800;
    }

    .pc-download-caption {
        color: var(--note);
        font-size: 12px;
    }
}

/* PCのページ内リンクを押したときは、移動先まで滑らかにスクロールする。 */
@media (min-width: 1120px) and (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/*
 * モーション
 * 端末画像は読み込み時に動かす。
 * .rv は html に .js が付いていると初期状態で隠れ、lp.js が .in を付けると表示する。
 */
@media (prefers-reduced-motion: no-preference) {
    .pc-side {
        animation: pc-side-in .45s ease both;
    }

    .hand {
        animation: rise .6s ease-out both;
    }

    .js .rv {
        opacity: 0;
        transform: translateY(14px);
        transition: opacity .45s ease, transform .45s ease;
    }

    .js .rv.in {
        opacity: 1;
        transform: none;
    }

    .store,
    .cta-bar .btn {
        transition: transform .15s, box-shadow .15s;
    }
}

/* 固定位置の中央揃えを保ったまま、14px下から表示する。 */
@keyframes pc-side-in {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 14px));
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
