/* ==========================
   LP（1ページ版）だけのスタイル
   色・フォント・ヘッダー・各セクション・フォーム・モーダルは style.css（複数ページ版と共通）
   ここでは、メインビジュアルと、イラストの丸い切り抜きだけを指定する
   ========================== */

/* ==========================
   オープニング（「ようこそ まさうちのポートフォリオへ」＋3・2・1のカウントダウン）
   ページを開くたびに表示し、3秒のカウントダウンが終わったら画面ごと消えてサイトが表示される
   ========================== */
.opening {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 var(--gutter);
  background: var(--color-bg);
  text-align: center;
  /* カウントダウンが終わる3秒の時点から消し始める */
  animation: opening-out 0.5s ease 3s forwards;
}

.opening__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.opening__en {
  font-size: 14px;
  color: var(--color-accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0;
  animation: opening-in 0.6s ease forwards;
}

.opening__line {
  color: var(--color-heading);
  font-size: 18px;
  letter-spacing: 0.2em;
  opacity: 0;
  animation: opening-in 0.6s ease 0.2s forwards;
}

.opening__line--main {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: 0.12em;
  animation-delay: 0.4s;
}

/* カウントダウンの数字（3・2・1を同じ場所に重ね、1秒ずつ順に表示する） */
.opening__count {
  position: relative;
  width: 80px;
  height: 80px;
  border: 1px solid var(--color-line);
  border-radius: 50%;
}

.opening__num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0;
  animation: opening-count 1s ease forwards;
}

.opening__num:nth-child(2) {
  animation-delay: 1s;
}

.opening__num:nth-child(3) {
  animation-delay: 2s;
}

/* 3秒かけて左から右へ伸びる線（残り時間の目安） */
.opening__bar {
  width: 120px;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  animation: opening-bar 3s linear forwards;
}

@keyframes opening-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes opening-count {
  0% {
    opacity: 0;
    transform: scale(1.3);
  }
  20%,
  80% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes opening-bar {
  to {
    transform: scaleX(1);
  }
}

@keyframes opening-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* オープニングが消えてから、メインビジュアルの文字とイラストがふわっと出るように少し待つ */
.lp-hero .js-fade {
  transition-delay: 3.2s;
}

/* 動きを減らす設定の方には、オープニングを表示しない */
@media (prefers-reduced-motion: reduce) {
  .opening {
    display: none;
  }

  .lp-hero .js-fade {
    transition-delay: 0s;
  }
}

/* ==========================
   メインビジュアル（文章を左、イラストを右に並べる）
   ========================== */
.lp-hero {
  padding: calc(var(--header-height) + 88px) var(--gutter) 104px;
}

.lp-hero__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: grid;
  /* 文章の列は一番長い行（名前）に合わせた幅にし、文章とイラストのまとまりを中央に寄せる（間が空きすぎないように） */
  grid-template-columns: auto 380px;
  justify-content: center;
  gap: 64px;
  align-items: center;
}

/* 活動名は文字数が多いので、複数ページ版の名前より小さめ・字間せまめにして1行に収める */
.lp-hero__name {
  font-size: clamp(26px, 4vw, 46px);
  letter-spacing: 0.08em;
}

.lp-hero__btn {
  margin-top: 40px;
}

/* イラストを丸く切り抜き、ベージュの輪で囲む */
.lp-hero__image {
  padding: 16px;
  border-radius: 50%;
  background: var(--color-bg-sub);
}

.lp-hero__image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
}

/* ==========================
   こんなお悩みありませんか
   ========================== */
.lp-worry {
  max-width: 880px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.lp-worry__item {
  position: relative;
  padding: 24px 24px 24px 60px;
  background: var(--color-bg);
  border-radius: 4px;
  line-height: 1.8;
}

/* チェックマーク */
.lp-worry__item::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 26px;
  width: 16px;
  height: 9px;
  border-left: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  transform: rotate(-45deg);
}

.lp-worry__lead {
  margin-top: 48px;
  text-align: center;
  font-size: 18px;
  color: var(--color-heading);
}

/* ==========================
   私について（写真の代わりにイラストを丸く表示する）
   ========================== */
.lp-about {
  max-width: 920px;
  margin: 0 auto;
  grid-template-columns: 280px 1fr;
}

.lp-about__photo {
  padding: 12px;
  border-radius: 50%;
  background: var(--color-bg-sub);
}

.about__photo.lp-about__photo img {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
}

/* ==========================
   制作実績の「もっとみる」
   最初は上から2段ぶんだけ表示する（PCは3列なので6件、タブレット・スマホは2列なので4件まで）
   ========================== */
.works__list.is-collapsible:not(.is-open) .works__item:nth-child(n+7) {
  display: none;
}

.lp-works__more .btn {
  min-width: 240px;
  cursor: pointer;
}

/* ==========================
   よくある質問（質問を押すと答えが開くトグル。details / summary で開閉）
   ========================== */
.lp-faq {
  max-width: 800px;
  margin: 0 auto;
}

.lp-faq__item {
  background: var(--color-bg-sub);
  border-radius: 4px;
}

.lp-faq__item + .lp-faq__item {
  margin-top: 16px;
}

.lp-faq__q {
  position: relative;
  padding: 22px 64px 22px 28px;
  font-weight: 500;
  color: var(--color-heading);
  cursor: pointer;
  list-style: none;   /* ブラウザ標準の三角マークを消す */
  transition: color 0.3s;
}

.lp-faq__q::-webkit-details-marker {
  display: none;
}

.lp-faq__q:hover {
  color: var(--color-accent);
}

/* ＋の印（開いているときは − になる） */
.lp-faq__q::before,
.lp-faq__q::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 28px;
  width: 16px;
  height: 1px;
  background: var(--color-accent);
  transition: transform 0.3s;
}

.lp-faq__q::after {
  transform: rotate(90deg);
}

.lp-faq__item[open] .lp-faq__q::after {
  transform: rotate(0deg);
}

.lp-faq__a {
  padding: 0 28px 24px;
  font-size: 15px;
  color: var(--color-text-sub);
}

/* 開いたとき、答えをふわっと表示する */
.lp-faq__item[open] .lp-faq__a {
  animation: lp-faq-open 0.3s ease;
}

@keyframes lp-faq-open {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-faq__item[open] .lp-faq__a {
    animation: none;
  }
}

/* ==========================
   フォームの注意書き（「こちらは送信できません。」）
   ========================== */
.form__notice {
  margin-bottom: 32px;
  padding: 14px 20px;
  border-left: 3px solid var(--color-accent);
  background: var(--color-white);
  color: var(--color-heading);
  font-size: 15px;
  font-weight: 500;
}

/* ==========================
   フォーム送信後のメッセージ（送信ボタンの下に表示）
   ========================== */
.form__sent {
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-heading);
  font-weight: 500;
  text-align: center;
}

.form__sent:focus {
  outline: none;
}

/* ==========================
   ページトップボタンのhover（色をオリーブベージュに変え、少し浮かせて矢印を上へ動かす）
   ========================== */
.pagetop {
  transition: opacity 0.3s, visibility 0.3s, background-color 0.3s, transform 0.3s;
}

.pagetop::before {
  transition: top 0.3s;
}

.pagetop:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* マウスで操作できる端末だけhoverの動きを付ける（スマホでタップ後に色が残らないように） */
@media (hover: hover) {
  .pagetop:hover {
    background: var(--color-accent);
    transform: translateY(-4px);
  }

  .pagetop:hover::before {
    top: 47%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pagetop,
  .pagetop::before {
    transition: opacity 0.3s, visibility 0.3s;
  }

  .pagetop:hover {
    transform: none;
  }
}

/* ==========================
   タブレット
   ========================== */
@media (max-width: 1024px) {
  .lp-hero__inner {
    grid-template-columns: 1fr 300px;
    gap: 40px;
  }

  /* 私について：1024px以下はスマホと同じ見た目（イラストを上、文章を下の縦並び）にする */
  .about.lp-about {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 640px;
  }

  .lp-about__photo {
    width: 200px;
    margin: 0 auto;
    padding: 10px;
  }

  .lp-about .about__name {
    text-align: center;
  }
}

@media (max-width: 960px) {
  /* 制作実績は2列になるので、2段ぶん＝4件まで表示する */
  .works__list.is-collapsible:not(.is-open) .works__item:nth-child(n+5) {
    display: none;
  }
}

/* ==========================
   スマホ（イラストを上、文章を下に並べる）
   ========================== */
@media (max-width: 767px) {
  .lp-hero {
    padding: calc(var(--header-height) + 40px) 16px 64px;
  }

  .lp-hero__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .lp-hero__image {
    order: -1;
    width: 200px;
    margin: 0 auto;
    padding: 10px;
  }

  .lp-hero__btn {
    margin-top: 32px;
  }

  /* 制作実績はスマホでも2列で折り返す（文字は小さめにして詰める） */
  .works__list,
  .works__list--page {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 12px;
  }

  .works__thumb {
    margin-bottom: 10px;
  }

  .works__name {
    font-size: 14px;
  }

  .works__date,
  .works__role {
    font-size: 12px;
  }

  .works__note {
    font-size: 11px;
  }

  /* 2列×2段＝4件まで表示する（960px以下の指定をそのまま使う） */

  .lp-worry {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lp-worry__item {
    padding: 20px 20px 20px 52px;
    font-size: 15px;
  }

  .lp-worry__item::before {
    top: 27px;
    left: 20px;
  }

  .lp-worry__lead {
    margin-top: 32px;
    font-size: 16px;
  }

  .lp-faq__q {
    padding: 18px 52px 18px 20px;
    font-size: 15px;
  }

  .lp-faq__q::before,
  .lp-faq__q::after {
    right: 20px;
  }

  .lp-faq__a {
    padding: 0 20px 20px;
    font-size: 14px;
  }
}
