/* ==========================================================================
 * フォント
 * ========================================================================== */

@font-face {
  font-family: "Local Noto Sans JP";
  src: local("Noto Sans JP");
}

@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/NotoSansJP-VariableFont_wght.ttf") format("truetype");
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/Outfit-VariableFont_wght.ttf") format("truetype");
}

/* ==========================================================================
 * CSS カスタムプロパティ
 * ========================================================================== */

:root {
  /* カラー */
  --color-green: #66c487;
  --color-green-dark: #05a896;
  --color-text: #333;
  --color-text-sub: #4d525f;
  --color-bg: #f6f6f6;
  --color-white: #fff;
  --color-border: #d9d9d9;

  /* カードの背景色 */
  --color-card-blue: #ecf0fb;
  --color-card-warm: #fbf6ef;
  --color-card-purple: #f4edfc;
  --color-card-steel: #f3f7ff;
  --color-card-teal: #d4eef9;

  --noto-sans-jp: "Local Noto Sans JP", "Noto Sans JP";

  /* レイアウト */
  --content-max-width: 1200px;
  --content-max-width--md: clamp(560px, 80vw, 1200px);
  --content-max-width--sm: clamp(320px, 80vw, 1200px);
  --gutter: 24px;
  --section-gap: 120px;
  --header-height: 96px;
  --hero-inset: 16px;

  @media (width < 768px) {
    --gutter: 16px;
    --section-gap: 72px;
    --header-height: 56px;
    --hero-inset: 12px;
  }
}

/* ==========================================================================
* ベーススタイル
* ========================================================================== */

:root {
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--noto-sans-jp), sans-serif;
  background-color: var(--color-white);
  color: var(--color-text);
}

:lang(en) {
  font-family: "Outfit", var(--noto-sans-jp), sans-serif;
}

/* ==========================================================================
 * レイアウト
 * ========================================================================== */

.layout {
  display: grid;
  grid-template-rows: [hd-start main-start] auto [hd-end] auto [main-end ft-start] auto [ft-end];
  grid-template-columns: [fill-start] 1fr [fill-end];
}

.site-header {
  grid-area: hd / fill;
}

.site-main {
  grid-area: main / fill;
}

.site-footer {
  grid-area: ft / fill;
}

.container {
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);

  &.-md {
    max-width: var(--content-max-width--md);
  }

  &.-sm {
    max-width: var(--content-max-width--sm);
  }
}

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

.site-header {
  margin-top: var(--hero-inset);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background-color: var(--color-white);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: var(--header-height);
  padding-block: 24px;

  @media (width < 768px) {
    padding-block: 10px;
  }
}

.site-header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 100%;
  aspect-ratio: 289 / 80;

  img {
    object-fit: contain;
    height: 100%;
    width: auto;
  }
}

@media (width < 1024px) {
  .site-header__pc-nav {
    display: none;
  }
}

/* PCナビゲーションメニュー */
.pc-nav__list {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pc-nav__link {
  display: block;
  padding: 0.25em 0.5em;
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-sub);
  transition-property: color, background-color;
  transition-duration: 0.2s;

  &:focus-visible {
    color: var(--color-green-dark);
    background-color: rgb(0 0 0 / 0.04);
  }

  @media (any-hover: hover) {
    &:hover {
      color: var(--color-green-dark);
      background-color: rgb(0 0 0 / 0.04);
    }
  }
}

/* ボタン */
.site-header__menu-btn {
  display: grid;
  grid-template-areas: "stack";
  place-content: center;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: none;

  &::before,
  &::after {
    content: "";
    grid-area: stack;
    display: block;
    width: 24px;
    height: 24px;
    background-color: var(--color-text-sub);
    mask: var(--_icon) center / contain no-repeat;
    transition-property: opacity;
    transition-duration: 0.3s;
    transition-timing-function: ease;
  }

  &::before {
    --_icon: url("/images/icons/menu.svg");
  }

  &::after {
    --_icon: url("/images/icons/close.svg");
  }

  &:has(+ :not(:popover-open)) {
    &::before { opacity: 1; }
    &::after { opacity: 0; }
  }

  &:has(+ :popover-open) {
    &::before { opacity: 0; }
    &::after { opacity: 1; }
  }

}

@media not (width < 1024px) {
  .site-header__menu-btn {
    display: none;
  }
}

/* SPメニュー */
.sp-nav {
  inset: 0 0 auto;
  margin-top: var(--header-height);
  margin-inline: var(--gutter);
  padding: 20px;
  width: stretch;
  background-color: var(--color-white);
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.12);
}

.sp-nav__list {
  display: grid;
  gap: 16px;
}

.sp-nav__link {
  display: block;
  color: var(--color-text-sub);
  font-size: 1rem;
  font-weight: 600;
}

/* ==========================================================================
 * Hero
 * ========================================================================== */

.hero {
  padding: var(--hero-inset);
  position: relative;

  &::before {
    content: "";
    position: absolute;
    inset: var(--hero-inset);
    border-radius: 24px;
    background-image: url("/images/index/hero-bg.png");
    background-size: cover;
    background-position: center;
  }
}

.hero__container {
  margin-top: var(--header-height);
  display: grid;
  grid-template-columns: 5fr 4fr;
  align-items: center;

  @media (width < 1024px) {
    grid-template-columns: 1fr;
    row-gap: 40px;
    justify-items: center;
  }
}

/* 人物画像 */
.hero__image {
  align-self: end;

  @media (width < 768px) {
    max-width: 280px;
  }
}

.hero__content {
  padding-block: 80px 144px;
  display: grid;
  gap: 24px;

  @media (width < 1024px) {
    padding-block: 48px 0px;
    justify-items: center;
    text-align: center;
  }
}

.hero__heading-group {
  color: var(--color-green-dark);
  line-height: 1.2;

  word-break: keep-all;
  overflow-wrap: anywhere;
}

.hero__tagline {
  font-weight: 600;
}

.hero__heading {
  font-size: clamp(1.75rem, 2.5vw, 3rem);
  font-weight: 700;
  font-feature-settings: "halt";
}

.hero__desc {
  line-height: 1.8;
  color: var(--color-text-sub);

  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* ストアバッジ */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.store-badges__link {
  display: block;
  width: fit-content;
  font-size: 0.9rem;

  img {
    width: auto;
    height: 40px;
  }
}

.hero__points {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero__point {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--color-text-sub);
}

/* セクション上部の英字ラベル (FEATURES, HOW IT WORKS 等) */
.section-label {
  color: var(--color-green-dark);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* ==========================================================================
 * Features (カードグリッド)
 * ========================================================================== */

.features {
  padding-block: var(--section-gap);
}

.features__heading-group {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  margin-bottom: 48px;
}

.features__heading {
  font-size: clamp(1.75rem, 2.5vw, 3rem);
  font-weight: 700;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}

.feature-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 32px 20px;
  border-radius: 16px;
  text-align: center;

  &.-steel  { background-color: var(--color-card-steel); }
  &.-warm   { background-color: var(--color-card-warm); }
  &.-blue   { background-color: var(--color-card-blue); }
  &.-purple { background-color: var(--color-card-purple); }
}

.feature-card__icon {
  width: 60px;
  height: 60px;
}

.feature-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text);
}

.feature-card__desc {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--color-text-sub);
}

@media (width <= 767px) {
  .features__grid {
    grid-template-columns: 1fr;
  }
}

/* Feature Blocks (画像+テキスト交互3段) */
.feature-blocks {
  margin-top: var(--section-gap);
  display: grid;
  row-gap: 80px;

  @media (width < 768px) {
    row-gap: 48px;
  }

}

.feature-block__inner {
  --_img-max-width: 360px;
  display: grid;
  grid-template:
    "ctt img"
    / minmax(var(--_img-max-width), 1fr) minmax(auto, var(--_img-max-width));
  align-items: center;
  column-gap: 32px;
  padding-inline: 16px;
}

@media not (width < 768px) {
  /* 偶数ブロック: 画像を右へ移動 */
  .feature-block:nth-child(even) .feature-block__inner {
    grid-template:
      "img ctt"
      / minmax(auto, var(--_img-max-width)) minmax(var(--_img-max-width), 1fr);
  }
}

@media (width < 768px) {
  .feature-block__inner {
    grid-template: "img" "ctt" / 1fr;
    row-gap: 24px;
  }
}

.feature-block__image {
  grid-area: img;

  img {
    width: min(100%, var(--_img-max-width));
    aspect-ratio: 1;

    border-radius: 4px;
    border: 2px solid var(--color-border);
    margin-inline: auto;
  }
}

@media (width < 768px) {
  .feature-block__image img {
    width: min(75%, 240px);
  }
}

.feature-block__content {
  grid-area: ctt;
}

.feature-block__heading {
  font-size: clamp(1.625rem, 2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5em;
}

.feature-block__desc {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--color-text-sub);

  @media (width < 768px) {
    font-size: 1rem;
  }
}

/* ==========================================================================
 * How It Works (3ステップ)
 * ========================================================================== */

.how-it-works {
  padding-block: var(--section-gap);
  background-color: var(--color-bg);
}

.how-it-works__heading-group {
  display: grid;
  gap: 8px;
  margin-bottom: 48px;
}

.how-it-works__heading {
  font-size: clamp(1.75rem, 2.5vw, 3rem);
  font-weight: 700;
}

.how-it-works__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 32px 24px;
  background-color: var(--color-white);
  border-radius: 16px;
}

.step-card__number {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-border);
}

.step-card__icon {
  display: block;
  width: 48px;
  height: 48px;
}

.step-card__title {
  font-size: 1rem;
  font-weight: 700;
}

.step-card__desc {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--color-text-sub);
}

@media (width < 768px) {
  .how-it-works__steps {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
 * Scenes (役立つシーン)
 * ========================================================================== */

.scenes {
  padding-block: var(--section-gap);
}

.scenes__intro {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 20px 64px;
  margin-bottom: 48px;

  @media (width < 768px) {
    grid-template-columns: 1fr;
  }
}

.scenes__heading-group {
  display: grid;
  align-self: start;
  gap: 8px;
}

.scenes__heading {
  font-size: clamp(1.75rem, 2.5vw, 3rem);
  font-weight: 700;
}

.scenes__lead {
  line-height: 1.8;
  color: var(--color-text-sub);
}

/* 大きな1枚のカード */
.scenes__card {
  background-color: var(--color-bg);
  border-radius: 20px;
  position: relative;
  overflow: clip;

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("/images/index/hero-bg.png") center / cover no-repeat;
    filter: blur(200px);
  }
}

/* カード内グリッド (仕切り線付き) */
.scenes__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 64px 56px;
  padding: 48px;

  @media (width < 768px) {
    padding-inline: 24px;
  }
}

.scene-item {
  display: grid;
  gap: 12px;

  &::before {
    content: "";
    justify-self: center;
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-green);
  }
}

.scene-item__title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
}

.scene-item__desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-sub);
}

/* ==========================================================================
 * ダウンロード
 * ========================================================================== */

.download__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.download__heading {
  font-size: clamp(1.75rem, 2.5vw, 3rem);
  font-weight: 700;
}

/* ==========================================================================
 * よくある質問
 * ========================================================================== */

.faq {
  padding-block: var(--section-gap);
}

.faq__heading {
  font-size: clamp(1.75rem, 2.5vw, 3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.25em;
}

.faq__list {
  max-width: 800px;
  margin-inline: auto;
  background-color: var(--color-bg);
  border-radius: 16px;
}

.faq__item:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.faq__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;

  &::after {
    content: "";
    flex-shrink: 0;
    display: block;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    mask: url("/images/icons/cross.svg") center / contain no-repeat;
    transition: rotate 0.2s ease;
  }
}

.faq__details[open] .faq__question::after {
  rotate: 45deg;
}

.faq__answer {
  padding-inline: 24px;
  padding-bottom: 20px;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--color-text-sub);
}

/* ==========================================================================
 * ページ固有フッター
 * ========================================================================== */

.page-footer {
  background-color: var(--color-bg);
  padding-block: 40px 32px;
  position: relative;
  overflow: clip;

  &::after {
    content: "";
    position: absolute;
    inset: auto 50% 0;
    width: clamp(200px, 30%, 360px);
    aspect-ratio: 1;
    background-color: #cc9bff;
    border-radius: 100%;
    filter: blur(150px);
    translate: -50% 100%;
  }
}

.page-footer__inner {
  display: grid;
  gap: 32px;
}

.page-footer__main {
  display: grid;
  gap: 16px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--color-border);
}

.page-footer__desc {
  line-height: 1.8;
  color: var(--color-text-sub);
  max-width: 720px;
}

.page-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  column-gap: 16px;
  flex-wrap: wrap;
}

@media (width < 768px) {
  .page-footer__bottom {
    flex-direction: column;
  }
}

.page-footer__link {
  &:active,
  &:focus-visible {
    color: var(--color-green-dark);
  }

  @media (any-hover: hover) {
    &:hover {
      color: var(--color-green-dark);
    }
  }
}

.page-footer__copyright {
  font-size: 1rem;
  font-family: "Outfit", var(--noto-sans-jp), sans-serif;
}

/* ==========================================================================
 * 共通フッター
 * ========================================================================== */

.site-footer {
  margin-top: 40px;
  padding: 1.25rem;
  text-align: center;
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;

  :any-link {
    color: #888;
    font-size: 0.875rem;

    &:active,
    &:focus-visible {
      text-decoration: underline;
    }

    @media (any-hover: hover) {
      &:hover {
        text-decoration: underline;
      }
    }
  }
}

/* ==========================================================================
 * appear アニメーション
 * JS 無効 / prefers-reduced-motion: reduce の環境では即表示する
 * ========================================================================== */

@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  [data-mygifts-appear] {
    opacity: 0;
    translate: 0 24px;
    transition-property: opacity, translate;
    transition-duration: 1s;
    transition-timing-function:cubic-bezier(0.215, 0.610, 0.355, 1)
  }

  [data-mygifts-appear][data-is-visible] {
    opacity: 1;
    translate: 0 0;
  }
}
