/* =========================================================
   xxxxnese — pages/top.css
   トップページ固有のスタイル
   ---------------------------------------------------------
   対象セクション:
     Hero / Intro(Concept) / Products / Secondary Visual /
     Business / News (top teaser) / Company intro
   ========================================================= */

/* Products (Assist 末尾) → Business の遷移は他より詰める
   Assist の 4 カードがコンパクトに完結してるので、
   Business 頭の section-head までの間が広く感じるための調整 */
.section.products + .section.business {
  padding-top: 80px;
}
@media (max-width: 960px) {
  .section.products + .section.business { padding-top: 56px; }
}
@media (max-width: 640px) {
  .section.products + .section.business { padding-top: 40px; }
}

/* ---------- Hero (Overlay) ---------- */
/*
  .hero はフルブリードのレイヤード構造:
    1) .hero__media     ... 背景画像 or プレースホルダー
    2) .hero__scrim     ... 読みやすさ担保のグラデーション
    3) .hero__content   ... 文字レイヤー（絶対位置で左下配置）
*/
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh; /* iOS Safari のアドレスバー考慮 */
  overflow: hidden;
  background-color: #1a1a1a; /* 画像読み込み前のフォールバック */
  color: #ffffff;
}

/* Hero内のフォーカスリングだけ白に反転 */
.hero :focus-visible {
  outline-color: #ffffff;
}

/* Media layer */
.hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto; /* .media の default aspect-ratio を打ち消す */
  background-color: transparent;
}

.hero__media .media__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/*
  3D粒子キャンバス（js/hero-particles.js が埋める）。
  .hero__media の全面を覆う。
  初期状態では空の透明 canvas なので、
  JS 起動前/失敗時は .media__placeholder の暗グラデが見える。
*/
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none; /* Hero CTA などが上にある想定 */
}

/* JS起動成功で付与される。プレースホルダーを隠す（canvas がその役目を担う） */
.hero__media.is-canvas-active .media__placeholder {
  display: none;
}

/*
  Film grain オーバーレイ。
  SVG fractalNoise を inline で持ち、極薄 opacity で重ねる。
  微細な translate animation でフィルムっぽく瞬く。
*/
.hero__grain {
  position: absolute;
  inset: -10%; /* transform ぶれで端が露出しないよう広めに */
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 280px 280px;
  animation: heroGrainShift 0.24s steps(8) infinite;
}

@keyframes heroGrainShift {
  0%   { transform: translate(0, 0); }
  12%  { transform: translate(-2%, 1%); }
  25%  { transform: translate(1%, -2%); }
  37%  { transform: translate(-1%, -1%); }
  50%  { transform: translate(2%, 2%); }
  62%  { transform: translate(-2%, 0); }
  75%  { transform: translate(1%, -1%); }
  87%  { transform: translate(0, 2%); }
  100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__grain {
    animation: none;
  }
}

/*
  Hero専用の placeholder:
  画像が無いときでも成立するよう、
  暗めのグラデーション + かすかなノイズで「面」として成立させる
*/
.hero .media__placeholder {
  background-image:
    linear-gradient(
      135deg,
      transparent 0,
      transparent 49.5%,
      rgba(255, 255, 255, 0.04) 49.5%,
      rgba(255, 255, 255, 0.04) 50.5%,
      transparent 50.5%,
      transparent 100%
    ),
    linear-gradient(180deg, #2a2a2a 0%, #111111 100%);
  background-size: 20px 20px, 100% 100%;
  background-color: #1a1a1a;
  color: rgba(255, 255, 255, 0.35);
}

.hero .media__placeholder::before,
.hero .media__placeholder::after {
  background: rgba(255, 255, 255, 0.1);
}

/*
  Scrim: テキスト視認性用の上下グラデ +
         シネマチックな vignette (radial) を重ねる。
  構図を右寄せにしているので、radial の中心も 65% にオフセット。
*/
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 120% 100% at 65% 50%,
      transparent 0%,
      transparent 40%,
      rgba(0, 0, 0, 0.35) 85%,
      rgba(0, 0, 0, 0.6) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.15) 0%,
      rgba(0, 0, 0, 0) 30%,
      rgba(0, 0, 0, 0) 55%,
      rgba(0, 0, 0, 0.55) 100%
    );
  pointer-events: none;
}

@media (max-width: 640px) {
  .hero__scrim {
    /* モバイルでは radial の中心を真ん中に戻す */
    background:
      radial-gradient(
        ellipse 130% 95% at 50% 50%,
        transparent 0%,
        transparent 35%,
        rgba(0, 0, 0, 0.4) 85%,
        rgba(0, 0, 0, 0.65) 100%
      ),
      linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0) 45%,
        rgba(0, 0, 0, 0.65) 100%
      );
  }
}

/* Content layer */
.hero__content {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 160px;
  padding-bottom: 120px;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-style: normal;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 40px;
}

.hero-heading {
  font-size: clamp(40px, 6.8vw, 96px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #ffffff;
  margin-bottom: 48px;
  /* CJK向け: 1ch は Latin "0" 基準で狭いため、文字数ではなくテキスト側の <br> で改行制御 */
  max-width: none;
}

.hero-lead {
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 2;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 56px;
  max-width: 560px;
}

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

/*
  Hero 用のボタンカラーオーバーライド:
  動き(.btn::before のスライド)は共通ルールに任せ、色だけ暗背景向けに差し替える。
*/
/* Hero Primary: 白地 → 黒が流れ込む → 文字は白に反転 */
.hero .btn-primary {
  background: #ffffff;
  color: var(--color-ink);
  border-color: #ffffff;
  cursor: pointer;
}
.hero .btn-primary::before {
  background: var(--color-ink);
  pointer-events: none; /* 塗りレイヤが hover/cursor を奪わないように */
}
.hero .btn-primary:hover { color: #ffffff; }

/* Scroll indicator (右下) */
.hero__indicator {
  position: absolute;
  right: max(var(--container-pad), calc((100vw - var(--container-max)) / 2 + var(--container-pad)));
  bottom: 40px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero__indicator-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  writing-mode: vertical-rl;
}

.hero__indicator-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: indicatorFall 2.4s var(--ease) infinite;
}

@keyframes indicatorFall {
  0%   { transform: scaleY(0); transform-origin: top; }
  40%  { transform: scaleY(1); transform-origin: top; }
  60%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Intro / Concept ---------- */
.intro { padding: 140px 0; }

.intro-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 80px;
  align-items: start;
}

.intro-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
}

.intro-heading {
  font-size: clamp(24px, 2.8vw, 38px);
  font-weight: 500;
  line-height: 1.6;
  color: var(--color-ink);
  letter-spacing: 0.02em;
  margin-bottom: 40px;
}

.intro-text {
  font-size: 15px;
  line-height: 2;
  color: var(--color-text);
  max-width: 640px;
}

/* ---------- Products ---------- */
.product-block {
  padding-top: 0;
  padding-bottom: 120px;
}

.product-block + .product-block {
  padding-top: 120px;
  border-top: 1px solid var(--color-line);
}

/* 末尾の product-block (Assist) は次の section が padding-top を持つので
   block 内の padding-bottom は dead space。0 にして詰める */
.product-block:last-child {
  padding-bottom: 0;
}

.product-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  margin-bottom: 64px;
  align-items: start;
}

/* 左列: ラベル行（catchphrase + 状態 badge）+ ロゴを縦並び。
   catchphrase はロゴの「上に置くラベル」扱い。 */
.product-id {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

/* catchphrase と badge を 1 行で横並びに（badge が無いブロックでは catchphrase 単独） */
.product-id__top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.product-name {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--color-ink);
  margin: 0;
}

.product-logo {
  display: block;
  height: clamp(36px, 4vw, 52px);
  width: auto;
  max-width: 100%;
}

/* ロゴ上に置くラベル。pill 罫線で「ブランドの軸」を明示的に額縁化。
   badge（plain text）と被らないように、こちらは枠ありで差別化。 */
.product-catchphrase {
  display: inline-block;
  margin: 0;
  padding: 7px 16px;
  border: 1px solid var(--color-ink);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--color-ink);
}

.product-description {
  font-size: 15px;
  line-height: 2;
  color: var(--color-text);
  max-width: 560px;
}

/* product-head 内の「詳しく見る」リンク（onecart.html / onecart-assist.html へ） */
.product-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-ink);
  text-decoration: none;
  transition: gap 0.3s var(--ease);
}

.product-link:hover {
  gap: 18px;
}

.product-link .arrow {
  font-family: var(--font-display);
  font-size: 14px;
  transition: transform 0.3s var(--ease);
}

.product-link:hover .arrow {
  transform: translateX(4px);
}

/* Business セクション末尾の「詳しく見る」リンクを中央に置くラッパー */
.business-cta {
  margin-top: 56px;
  text-align: center;
}

/* Product ブロック末尾（カラム下）の CTA ボタンを中央に置くラッパー */
.product-block-cta {
  margin-top: 56px;
  text-align: center;
}

/* product-name の隣に置く小さな状態バッジ（"2026.06 公開予定" 等） */
/* ロゴ右に添える状態テキスト（"2026.06 公開予定" 等）。
   catchphrase ラベルとデザインが被らないよう pill は外してテキストのみに。 */
.product-badge {
  display: inline-block;
  margin-left: 14px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--color-muted);
  vertical-align: middle;
  white-space: nowrap;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.product-grid--4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* 4カード構成時は画像を大きめ(正方形)にして存在感を出す */
.product-grid--4 .media--card,
.business-grid .media--card {
  aspect-ratio: 1 / 1;
}

.secondary-visual__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.media--full.is-canvas-active .media__placeholder {
  display: none;
}

/* ---------- Secondary fullbleed visual ---------- */
.secondary-visual {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-line);
}

.secondary-visual .media--full {
  width: 100%;
}

.secondary-visual__caption {
  position: absolute;
  top: 14%;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 2;
  pointer-events: none;
  padding: 0 var(--container-pad);
}

.secondary-visual__heading {
  font-size: clamp(22px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: #ffffff;
  max-width: 900px;
  margin: 0 auto;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}

/* ---------- Business ---------- */
/* 5事業領域カード。desktop は 5列、tablet 2列、mobile 1列で折り返す */
.business-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

/* business-card 内のプロダクト名ピル（ONECART / ONECART Assist 用） */
.business-card__product {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 16px;
  padding: 4px 10px;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* business-card 内のキャッチ（貿易・現地PR 用） */
.business-card__lead {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--color-ink-soft);
}

/* ---------- Why Now（なぜ、今なのか） ---------- */
/* 「02」の横に英字キッカー「Why Now」を並べる（Concept の「01 Concept」に揃える）。
   layout.css の .section-head .section-index { display:block } を上書き */
.whynow .section-head .section-index {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
}
.whynow .section-head .section-index .section-kicker {
  color: var(--color-ink);
}

/* インバウンド × AI × 円安の 3 構造変化を 3 カラムで提示。
   business.html の metric-grid とは別に、トップ専用の大きめ数字ブロックとして組む */
.whynow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: whynow;
}

.whynow-item {
  padding-top: 28px;
  border-top: 2px solid var(--color-ink);
}

.whynow-item__num {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.6vw, 64px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  margin: 0 0 20px;
  /* 「限界費用」など和文を含む数字行が崩れないよう */
  word-break: keep-all;
}

.whynow-item__unit {
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-left: 0.3em;
  color: var(--color-ink-soft);
}

.whynow-item__title {
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--color-ink);
  margin: 0 0 12px;
  word-break: keep-all;
  text-wrap: balance;
}

.whynow-item__text {
  font-size: 14px;
  line-height: 1.95;
  color: var(--color-text);
  margin: 0;
}

@media (max-width: 960px) {
  .whynow-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ---------- News (top-page teaser) ---------- */
.news__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  max-width: none;
}

.news__view-all {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-ink);
  padding: 14px 28px;
  border: 1px solid var(--color-ink);
  border-radius: 999px;
  overflow: hidden;
  transition: color 0.4s var(--ease);
}

/* 左から右へ滑り込む塗り */
.news__view-all::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-ink);
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease);
}

.news__view-all > * {
  position: relative;
  z-index: 1;
}

.news__view-all:hover {
  color: #ffffff;
}

.news__view-all:hover::before {
  transform: translateX(0);
}

/* 下線＋矢印スタイルをpillに置換したため、矢印は非表示 */
.news__view-all .arrow {
  display: none;
}

/* ---------- Company intro ---------- */
.company-intro {
  max-width: 840px;
}

.company-intro__lead {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: var(--color-ink);
  margin-bottom: 40px;
}

/* Noto Sans JP の em dash は重いので、ダッシュだけ Latin フォントの
   細いグリフに差し替える */
.thin-dash {
  font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  font-weight: 300;
  letter-spacing: 0;
  margin: 0 0.05em;
}

.company-intro__body {
  font-size: 15px;
  line-height: 2;
  color: var(--color-text);
  margin-bottom: 48px;
  max-width: 720px;
}

.company-intro__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-ink);
  padding: 16px 32px;
  border: 1px solid var(--color-ink);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  transition: color 0.4s var(--ease);
}

.company-intro__link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-ink);
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease);
  pointer-events: none; /* 塗りレイヤが hover/cursor を奪わないように */
}

.company-intro__link > * {
  position: relative;
  z-index: 1;
}

.company-intro__link:hover {
  color: #ffffff;
}

.company-intro__link:hover::before {
  transform: translateX(0);
}

.company-intro__link .arrow {
  display: none;
}

.br-desktop {
  display: inline;
}

/* =========================================================
   Responsive — top page
   ========================================================= */

/* Tablet */
@media (max-width: 960px) {
  .hero__content {
    padding-top: 140px;
    padding-bottom: 96px;
  }

  .hero__indicator {
    bottom: 28px;
  }

  .intro {
    padding: 96px 0;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .intro-label {
    flex-direction: row;
    gap: 24px;
    padding-top: 0;
  }

  /* intro-heading は他セクションの section-heading と同程度の存在感に揃える */
  .intro-heading {
    font-size: clamp(28px, 7.5vw, 32px);
    line-height: 1.5;
  }

  .product-head {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 48px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .product-grid--4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .product-block {
    padding-bottom: 88px;
  }

  .product-block + .product-block {
    padding-top: 88px;
  }

  .secondary-visual__caption {
    top: 12%;
  }

  .business-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  /* Hero on mobile: 画面に収まる高さで縦長構成 */
  .hero {
    min-height: 86vh;
    min-height: 86svh;
  }

  .hero__content {
    min-height: 86vh;
    min-height: 86svh;
    padding-top: 112px;
    padding-bottom: 88px;
  }

  .hero__scrim {
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.2) 0%,
      rgba(0, 0, 0, 0) 30%,
      rgba(0, 0, 0, 0) 45%,
      rgba(0, 0, 0, 0.65) 100%
    );
  }

  .hero-eyebrow {
    margin-bottom: 24px;
    font-size: 11px;
  }

  .hero-heading {
    margin-bottom: 28px;
    line-height: 1.3;
  }

  .hero-lead {
    font-size: 14px;
    margin-bottom: 36px;
    line-height: 1.95;
  }

  .hero-cta {
    flex-direction: column;
    gap: 12px;
  }

  .hero__indicator {
    display: none; /* モバイルではスペース優先で非表示 */
  }

  /* Intro */
  .intro { padding: 72px 0; }

  /* Products */
  .product-block {
    padding-bottom: 64px;
  }

  .product-block + .product-block {
    padding-top: 64px;
  }

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

  .product-grid--4 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Secondary visual */
  .secondary-visual__caption {
    top: 10%;
    padding: 0 var(--container-pad);
  }

  /* Business */
  .business-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* News */
  .news__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  /* Company */
  .br-desktop {
    display: none;
  }

  .company-intro__lead {
    margin-bottom: 28px;
  }

  .company-intro__body {
    margin-bottom: 36px;
  }
}
