/* =========================================================
   SECTIONS — 各セクションのレイアウトとレスポンシブ
   ========================================================= */

/* =====================================================
   1. FIRST VIEW
   ===================================================== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
}

/* -----------------------------------------------------
   Phase 1: タイピング・イントロ
   デフォルトは display:none。animations.js が再生すると
   決めたときだけ .is-visible が付く。
   (JSやGSAPが無い環境ではイントロは一切表示されない)
   ----------------------------------------------------- */
.hero-intro {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  /* 文字ブロックを上下左右中央に置く。
     grid + place-items:center なのでブロック幅は内容ぶんに収まる */
  place-items: center;
  padding: var(--nav-height) var(--space-gutter);
  pointer-events: none;
}

.hero-intro.is-visible {
  display: grid;
}

/* ブロックは中央、行内は左揃え */
.hero-intro-lines {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 13vw, 10rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-align: left;
  max-width: 100%;
}

.intro-line {
  display: block;
}

.intro-line-inner {
  position: relative;
  display: inline-block;
}

/* 全文字が最初からレイアウトを占有する(= ブロック幅が変わらない)。
   入力済みの文字だけ visibility で見えるようにする */
.intro-char {
  visibility: hidden;
}

/* 黄色い入力カーソル。行ごとに1つ持ち、x座標だけ動かす。
   点滅は background-color で行い、GSAPのopacity制御と干渉させない */
.intro-caret {
  position: absolute;
  left: 0;
  bottom: 0.11em;
  width: 0.075em;
  height: 0.72em;
  background-color: var(--color-accent);
  visibility: hidden;
  animation: introCaret 0.85s steps(1, end) infinite;
}

@keyframes introCaret {
  0%, 45% { background-color: var(--color-accent); }
  46%, 100% { background-color: transparent; }
}

/* -----------------------------------------------------
   黄色いブラシストローク(文字 → プロダクトのつなぎ)
   左下から右上へ描かれる。形と動きは render.js / animations.js 側。
   ----------------------------------------------------- */
.intro-paint {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  pointer-events: none;
}

.intro-paint.is-visible {
  display: block;
}

.paint-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 拡大を担当するラッパー。ここにCSSのtransformは書かないこと。
   GSAPのtransformと競合し、切り替えでグラつく原因になる。
   拡大前にGPUレイヤーへ載せておき、再ラスタライズによる一瞬のジャンプを防ぐ。
   ※ will-change はイントロ中だけ(.is-intro)。終わったら手放す。 */
.is-intro .brush-scale {
  will-change: transform;
}

/* 位置と角度は transform 属性で固定。誰も上書きしない */
.brush-anchor {
  will-change: auto;
}

/* ※ ブラシの各要素には CSS の transform を書かないこと。
   GSAPはSVG要素を transform 属性で動かすため、
   CSS側に書くとそちらが優先されて動かなくなる。
   初期状態は animations.js の gsap.set で与えている。 */

/* イントロ中はスクロールを止める(終了時に必ず解除される)。
   スクロールバーが消えるぶんの幅は padding で補い、
   ロック解除の瞬間にレイアウトがずれないようにする。
   --scrollbar-w は animations.js が実測して入れる。 */
html.intro-lock,
html.intro-lock body {
  overflow: hidden;
}

html.intro-lock body {
  padding-right: var(--scrollbar-w, 0px);
}

html.intro-lock {
  touch-action: none;
  overscroll-behavior: none;
}

/* -----------------------------------------------------
   Phase 2: トップ画面のモジュラーグリッド
   画面全体を大小のパネルで埋める。カード一覧にはしない。
   ----------------------------------------------------- */
.hero-grid {
  position: absolute;
  inset: 0;
  padding: calc(var(--nav-height) + 10px) 10px 10px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  /* 2つの帯。上段=アプリ+見出し+アプリ、下段=アプリ+黄色+プロフィール+スクロール */
  grid-template-rows: 1.12fr 1fr;
  gap: 10px;
}

/* --- パネル共通。角丸とドロップシャドウは使わない --- */
.hero-panel {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 2px;
  display: flex;
  min-width: 0;
  min-height: 0;
  text-align: left;
}

/* パネルの登場はイントロの一部。終わったらGPUレイヤーを返す */
.is-intro .hero-panel {
  will-change: transform, clip-path;
}

/* --- 作品パネル:画像が主役。パネルを埋めるまで切り抜く --- */
.hero-panel--work {
  padding: 0;
  cursor: pointer;
  background: var(--color-bg);
  /* 端末は上下を少しはみ出させてパネルで切る */
  overflow: hidden;
}

/* 各アプリのUIに合わせた下地の色 */
.hero-panel--leansave { background: #f7f5f2; }
.hero-panel--bebery { background: #f7f0e2; }
.hero-panel--symbolwalk { background: #101014; }

/* --- iPhoneモックアップ ---------------------------------
   構造(3層・レイヤーを混ぜない):
     .hero-device        = 端末本体(シルバー外周 + 黒フレーム)… 完全固定
     └ .hero-device-screen = スクリーン(本体の内側に完全に収まる / overflow hidden)
       └ .hero-panel-media  = スクロールする画面コンテンツ(これしか動かない)
   Dynamic Island はスクリーンの ::after(コンテンツより上のレイヤー・クリップ内)。
   影・台座・3D装飾・背面パーツはなし。

   ※ 寸法は px 変数と、絶対配置の %(基準は端末自身)だけで組む。
     container-type / cqw / cqh は使わない — ブラウザによって
     高さ% + aspect-ratio との組み合わせで解決に失敗し、
     角丸や画面が崩壊することがあるため(実際に崩れた)。
     padding は px なのでベゼルは上下左右とも厳密に均一。 */
.hero-device {
  --rim: 2px;                                /* ① シルバー外周 */
  --bezel: clamp(5px, 0.55vw, 8px);          /* ② 黒ベゼル(均一) */
  --r-outer: clamp(28px, 2.5vw, 40px);       /* 外周の角丸 */

  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 96%;
  aspect-ratio: 10 / 19;
  background: #0a0a0b;
  border: var(--rim) solid #b7babd;
  border-radius: var(--r-outer);
  padding: var(--bezel);
}

/* ③ スクリーン。本体の内側(ベゼルの内側)に完全に収める。
   角丸は外周からリムとベゼルを引いた同心の内径。
   はみ出しはここで必ず切る */
.hero-device-screen {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--r-outer) - var(--rim) - var(--bezel));
  overflow: hidden;
  background: #000;
  /* Safariで角丸クリップが子のtransformに負けないように */
  isolation: isolate;
}

/* Dynamic Island: スクロールするコンテンツより上・スクリーン内に固定 */
.hero-device-screen::after {
  content: "";
  position: absolute;
  top: 1.7%;
  left: 50%;
  transform: translateX(-50%);
  width: 27%;
  aspect-ratio: 25 / 7.6;
  background: #050506;
  border-radius: 999px;
  z-index: 3;
  background-image: radial-gradient(
    circle at 74% 50%,
    #232a3e 0 14%,
    transparent 16%
  );
}

/* サイドボタン: 左に音量2つ、右に電源。
   %の基準は端末本体(絶対配置の包含ブロック)なのでパネル幅に影響されない */
.hero-device-keys {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-device-keys::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--rim) - 2px);
  top: 24%;
  width: 2px;
  height: 3.6%;
  background: #aeb1b5;
  border-radius: 2px;
}

.hero-device-keys::after {
  content: "";
  position: absolute;
  left: calc(-1 * var(--rim) - 2px);
  top: 28.6%;
  width: 2px;
  height: 3.6%;
  background: #aeb1b5;
  border-radius: 2px;
}

.hero-device-power {
  position: absolute;
  right: calc(-1 * var(--rim) - 2px);
  top: 26%;
  width: 2px;
  height: 5.6%;
  background: #aeb1b5;
  border-radius: 2px;
}

/* パンする窓。スクリーンいっぱいに固定 */
.hero-panel-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: transform;
}

/* ※ 画像レイヤーには CSS の transform / transition を書かないこと。
   パン・ズーム・ホバーはすべて GSAP が担当する(競合するとガタつく)。
   .hero-panel-media = 窓(ホバーズームと視差)
   その中の img      = 中身(ゆっくりしたパン) */
.hero-panel-media img {
  display: block;
  width: 100%;
  height: 100%;
  /* 横パンのときは幅を100%より大きく取る。
     base.css の img { max-width: 100% } に頭を押さえられないようにする */
  max-width: none;
  object-fit: cover;
  will-change: transform;
}

/* 作品名は常時表示のチップ。パネル左下に固定し、
   画像のパンには追従しない(.hero-panel-media の外にあるため)。
   ホバー・フォーカス時だけ「詳細を見る →」が下に足される。 */
.hero-panel-tag {
  position: absolute;
  left: clamp(16px, 1.3vw, 20px);
  bottom: clamp(16px, 1.3vw, 20px);
  z-index: 2;
  display: grid;
  gap: 0.12rem;
  padding: 0.5rem 0.7rem 0.55rem;
  max-width: calc(100% - 2 * clamp(16px, 1.3vw, 20px));
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--color-text);
  /* 角丸・影はつけない(モジュラーグリッドの直線に合わせる) */
}

/* Symbol Walk はダークUIなので反転 */
.hero-panel--symbolwalk .hero-panel-tag {
  background: rgba(23, 23, 23, 0.72);
  color: var(--color-bg);
}

.hero-panel-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero-panel-cat {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
  white-space: nowrap;
}

.hero-panel--symbolwalk .hero-panel-cat {
  color: rgba(242, 240, 237, 0.72);
}

/* ホバーで足されるリンク案内 */
.hero-panel-more {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: max-height 0.3s var(--ease-out), opacity 0.3s var(--ease-out),
    margin-top 0.3s var(--ease-out);
}

.hero-panel--work:hover .hero-panel-more,
.hero-panel--work:focus-visible .hero-panel-more {
  max-height: 1.4em;
  opacity: 1;
  margin-top: 0.28rem;
}

/* --- タイポグラフィパネル --- */
.hero-panel--type {
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.2rem, 2.4vw, 2.4rem);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 6.2vw, 6rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
}

/* 1行ずつマスクの中から立ち上げる */
.hero-title-line {
  display: block;
  overflow: hidden;
}

.hero-title-in {
  display: block;
}

.is-intro .hero-title-in {
  will-change: transform;
}

.hero-title-line:nth-child(2) .hero-title-in {
  padding-left: 0.12em;
}

.hero-title-dot {
  color: var(--color-accent);
}

/* --- 黄色の情報パネル --- */
.hero-panel--accent {
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(1.1rem, 1.8vw, 1.9rem);
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-on-yellow);
  overflow: hidden;
}

/* 2行固定の見出し。左上に置く(6カラム幅なので30〜34pxが収まる) */
.hero-accent-copy {
  font-size: clamp(1.55rem, 2.1vw, 2.125rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

/* 左下の名前と肩書き */
.hero-accent-foot {
  display: grid;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

/* 右側の3Dキャラクター。右寄せ・下揃えで、頭と肩は切らない。
   枠・角丸・影・背景装飾はつけない */
.hero-accent-figure {
  position: absolute;
  right: clamp(8px, 1.6vw, 30px);
  bottom: 0;
  height: 92%;
  max-width: 44%;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
  z-index: 0;
}

.hero-meta-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-meta-role {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(23, 23, 23, 0.66);
}

/* --- スクロール案内パネル --- */
.hero-panel--scroll {
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1rem, 2vw, 1.7rem);
  transition: background-color 0.35s ease;
}

.hero-panel--scroll:hover,
.hero-panel--scroll:focus-visible {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.hero-scroll-arrow {
  font-size: clamp(1.6rem, 3.4vw, 2.8rem);
  line-height: 1;
  font-weight: 300;
}

.hero-scroll-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* --- グリッド上の配置(ここだけで構成を変えられる)--- */
.hero-panel--leansave      { grid-area: 1 / 1 / 2 / 4; }
.hero-panel--type          { grid-area: 1 / 4 / 2 / 10; }
.hero-panel--bebery        { grid-area: 1 / 10 / 2 / 13; }
.hero-panel--symbolwalk    { grid-area: 2 / 1 / 3 / 5; }
.hero-panel--accent        { grid-area: 2 / 5 / 3 / 11; }
.hero-panel--scroll        { grid-area: 2 / 11 / 3 / 13; }

/* =====================================================
   2. SKILLS
   ===================================================== */
.skills {
  position: relative;
  background: var(--color-bg);
}

.skills-pin {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-height) + 2rem) var(--space-gutter) 3rem;
  overflow: hidden;
}

.skills-head {
  margin-bottom: clamp(2rem, 5vh, 4rem);
}

.skills-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--color-line);
  border-left: 1px solid var(--color-line);
}

.skill-cell {
  border-right: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  padding: clamp(1.6rem, 4vw, 3.5rem);
  min-height: clamp(180px, 28vh, 300px);
  display: flex;
  flex-direction: column;
  /* 番号を外したので、見出しと説明をセル下端にまとめる */
  justify-content: flex-end;
  gap: 0.7rem;
}

.skill-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.25rem, 2.6vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.skill-desc {
  font-size: 0.88rem;
  color: var(--color-muted);
  line-height: 1.9;
}

/* 中央の黄色い円(拡大してWorksへトランジション)
   Desktop/Tabletでは clip-path の円として描画し、
   拡大時も輪郭が劣化しないようにする。
   円の中心座標(グリッド交点)は animations.js が上書きする。 */
.skills-circle {
  position: absolute;
  inset: 0;
  background: var(--color-accent);
  clip-path: circle(clamp(65px, 7.5vw, 105px) at 50% 58%);
  z-index: 5;
  pointer-events: none;
}

/* グリッド交点付近のテキストが円と重ならないよう、
   右列セルは左パディングを広めに取る */
@media (min-width: 768px) {
  .skill-cell:nth-child(even) {
    padding-left: clamp(4rem, 8vw, 7rem);
  }
}

/* =====================================================
   3. WORKS TRANSITION
   ===================================================== */
/* --- SELECTED WORKS の見出し ---------------------------------
   独立したセクションではなく、WHAT I DO のピンの中に重ねてある。
   黄色い円がまだ広がっている途中から出はじめるので、
   「黄色一色だけのコマ」ができない。 */
.works-reveal {
  position: absolute;
  inset: 0;
  /* 円(z-index:5)の上 */
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 上下は対称にする。ナビの下ではなく画面そのものの中央に見出しを置くため
     (黄色はナビの裏まで回り込んでいて、画面全体がひとつの面に見える) */
  padding: clamp(1.5rem, 6vh, 4rem) var(--space-gutter);
  text-align: center;
  color: var(--color-text-on-yellow);
  pointer-events: none;
}

.works-transition-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 11vw, 11rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

/* 1語ずつの「窓」。中身をこの外へ追い出しておき、下から立ち上げる */
.works-line {
  display: block;
  overflow: hidden;
  /* 立ち上がり切る前に下端が切れないよう少しだけ持たせる */
  padding-bottom: 0.04em;
}

.works-line-in {
  display: block;
  will-change: transform;
}

/* 動きを減らす設定では、円も演出もなしで
   「黄色い帯の上に見出しが出ている」完成形をそのまま置く */
@media (prefers-reduced-motion: reduce) {
  .skills-pin {
    min-height: auto;
  }

  .skills-circle {
    display: none;
  }

  .works-reveal {
    position: static;
    background: var(--color-accent);
    margin: clamp(2.6rem, 6vh, 4.5rem) calc(var(--space-gutter) * -1) -3rem;
    padding: clamp(3rem, 9vh, 6rem) var(--space-gutter);
  }
}

/* =====================================================
   4. SELECTED WORKS
   ===================================================== */
.works {
  background: var(--color-bg);
  padding: var(--space-section) var(--space-gutter);
}

.works-list {
  display: flex;
  flex-direction: column;
  gap: clamp(5rem, 14vh, 10rem);
  max-width: 1200px;
  margin: 0 auto;
}

.work-item {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  cursor: pointer;
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out),
    filter 0.55s var(--ease-out);
}

/* 偶数番目は画像と説明を反転(非対称リズム) */
.work-item:nth-child(even) {
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
}

.work-item:nth-child(even) .work-figure-wrap {
  order: 2;
}

/* --- スクロールフォーカス --- */
.work-item.is-dimmed {
  opacity: 0.28;
  transform: scale(0.94);
  filter: blur(3px);
}

.work-item.is-active {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.work-figure-wrap {
  display: flex;
  justify-content: center;
}

.work-figure {
  margin: 0;
  width: 100%;
}

/* Selected Works の phone 作品は FV と同じ iPhone コンポーネントを共通利用。
   ここでは「位置決めの箱」だけ用意し、フレーム自体の見た目は
   .hero-device 一式(シルバーリム/ベゼル/Island/ボタン)を共有する。
   スクロールはさせない(静止表示)。 */
.work-figure--device {
  position: relative;
  /* 3作品で端末サイズを揃えるため固定幅(親が狭い場合のみ縮む) */
  width: 280px;
  max-width: 100%;
  aspect-ratio: 10 / 19;
  margin: 0;
}

.work-figure--device .hero-device {
  height: 100%;
}

.work-figure--device .hero-device-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
  display: block;
}

.work-figure.frame--phone {
  width: min(300px, 68%);
}

.work-caption {
  position: relative;
}

.work-category {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--color-muted);
  margin-bottom: 0.9rem;
}

.work-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 4.2vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
  word-break: auto-phrase; /* 日本語タイトルの改行位置を自然にする(対応ブラウザのみ) */
}

.work-title .accent-line {
  background-image: linear-gradient(transparent 62%, var(--color-accent) 62%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.work-summary {
  font-size: 0.95rem;
  line-height: 2;
  color: var(--color-text);
  max-width: 34em;
  margin-bottom: 1.8rem;
}

/* キャプションはフォーカス時にふわっと表示 */
.work-caption > * {
  transition: opacity 0.5s var(--ease-out) 0.08s, translate 0.5s var(--ease-out) 0.08s;
}

.work-item.is-dimmed .work-caption > * {
  opacity: 0;
  translate: 0 18px;
}

.work-item.is-active .work-caption > * {
  opacity: 1;
  translate: 0 0;
}

/* =====================================================
   5. APPROACH
   ===================================================== */
.approach {
  background: var(--color-bg);
  border-top: 1px solid var(--color-line);
  padding: var(--space-section) var(--space-gutter);
}

.approach-inner {
  max-width: 1300px;
  margin: 0 auto;
}

.approach-steps {
  margin-top: clamp(3rem, 7vh, 5rem);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-left: 1px solid var(--color-line);
}

.approach-step {
  position: relative;
  border-right: 1px solid var(--color-line);
  padding: 2rem 1.4rem 2.6rem;
  min-height: 240px;
  display: flex;
  flex-direction: column;
}

.approach-step-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  letter-spacing: 0.01em;
  /* 番号が持っていた下寄せをここで引き継ぐ */
  margin-top: auto;
  margin-bottom: 0.6rem;
}

.approach-step-desc {
  font-size: 0.85rem;
  line-height: 1.9;
  color: var(--color-muted);
}

/* =====================================================
   6. PERSONAL PR
   ===================================================== */
.pr {
  background: var(--color-dark);
  color: var(--color-text-on-dark);
  padding: var(--space-section) var(--space-gutter);
}

.pr-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.pr-copy {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 6.2vw, 5.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 14em;
  margin-bottom: clamp(2.5rem, 7vh, 5rem);
}

.pr-copy .accent {
  color: var(--color-accent);
}

.pr-columns {
  border-top: 1px solid rgba(242, 240, 237, 0.22);
  padding-top: clamp(2rem, 5vh, 3.5rem);
}

.pr-body {
  font-size: 1.02rem;
  line-height: 2.2;
  color: rgba(242, 240, 237, 0.88);
  /* 1カラム。読みやすい行長に抑える */
  max-width: 42em;
}

/* =====================================================
   7. CONTACT
   ===================================================== */
.contact {
  background: var(--color-bg);
  padding: var(--space-section) var(--space-gutter) clamp(5rem, 10vw, 9rem);
}

.contact-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.contact-copy {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 7vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 12em;
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}

.contact-copy .accent-line {
  background-image: linear-gradient(transparent 60%, var(--color-accent) 60%);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* ---------- Tablet (〜1023px) ---------- */
@media (max-width: 1023px) {
  /* Tablet: 8カラムに再構成。パネルの主従は変えない */
  .hero-grid {
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: 1fr 0.7fr 1fr;
  }

  .hero-panel--leansave      { grid-area: 1 / 1 / 2 / 4; }
  .hero-panel--type          { grid-area: 1 / 4 / 2 / 9; }
  .hero-panel--accent        { grid-area: 2 / 1 / 3 / 9; }
  .hero-panel--bebery        { grid-area: 3 / 1 / 4 / 4; }
  .hero-panel--symbolwalk    { grid-area: 3 / 4 / 4 / 7; }
  .hero-panel--scroll        { grid-area: 3 / 7 / 4 / 9; }


  .hero-title { font-size: clamp(2.8rem, 9.5vw, 5.4rem); }
  .hero-accent-copy { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }

  .approach-steps {
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--color-line);
  }

  .approach-step {
    border-bottom: 1px solid var(--color-line);
    min-height: 200px;
  }
}

/* ---------- Mobile (〜767px) ---------- */
@media (max-width: 767px) {
  /* Mobile: トップ画面は2カラムに再構成し、縦スクロールで作品を見せる */
  .hero {
    height: auto;
    min-height: 100svh;
  }

  /* イントロ文字が画面外へはみ出さないように抑える(中央配置は維持) */
  .hero-intro-lines {
    font-size: clamp(2.2rem, 15vw, 4rem);
    letter-spacing: -0.03em;
  }

  .hero-grid {
    position: relative;
    inset: auto;
    min-height: 100svh;
    padding: calc(var(--nav-height) + 8px) 8px 8px;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    grid-auto-rows: minmax(0, auto);
    gap: 8px;
  }

  /* Desktopで指定した grid-area を解除してから積み直す */
  .hero-panel {
    grid-area: auto;
  }

  /* 全パネル全幅。アプリUIは縦に十分な高さで見せる */
  .hero-panel {
    grid-column: 1 / 3;
  }

  .hero-panel--work { aspect-ratio: 4 / 5; }
  .hero-panel--type { min-height: 32svh; }
  .hero-panel--accent { min-height: 26svh; }
  .hero-panel--scroll { min-height: 12svh; }

  /* 並び順:見出し → アプリ3枚を軸に、黄色とプロフィールを挟む */
  .hero-panel--type { order: 1; }
  .hero-panel--leansave { order: 2; }
  .hero-panel--bebery { order: 3; }
  .hero-panel--accent { order: 4; }
  .hero-panel--symbolwalk { order: 5; }
  .hero-panel--scroll { order: 6; }

  .hero-title { font-size: clamp(2.4rem, 12vw, 3.6rem); }
  .hero-accent-copy { font-size: 1.4rem; }


  /* Skills: 縦1列 */
  .skills-pin {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 4rem;
  }

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

  .skill-cell {
    min-height: 0;
    gap: 0.6rem;
  }

  /* Mobile: 円はグリッド下の静的な装飾に切り替える */
  .skills-circle {
    position: static;
    inset: auto;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    clip-path: none;
    margin: 2.6rem auto 0;
  }

  /* Mobileはピン留めしないので、見出しは重ねずに
     黄色い帯としてそのまま流れに置く。文字の登場だけJSが行う */
  .works-reveal {
    position: static;
    background: var(--color-accent);
    margin: clamp(2.2rem, 5vh, 3.4rem) calc(var(--space-gutter) * -1) -4rem;
    padding: clamp(3.2rem, 11vh, 5.5rem) var(--space-gutter);
  }

  /* Works: 縦1列・フォーカス演出は軽く(blurなし) */
  .work-item,
  .work-item:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .work-item:nth-child(even) .work-figure-wrap {
    order: 0;
  }

  .work-item.is-dimmed {
    opacity: 0.45;
    transform: none;
    filter: none;
  }

  .work-figure.frame--phone {
    width: min(240px, 62%);
  }

  .work-figure--device {
    width: 230px;
  }

  .work-summary {
    margin-bottom: 1.4rem;
  }

  .approach-steps {
    grid-template-columns: 1fr;
  }

  .approach-step {
    gap: 0.4rem;
    min-height: 0;
    padding: 1.6rem 1.2rem;
  }

  .approach-step-title {
    margin-top: 0;
  }

  .contact-links {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-links .btn {
    justify-content: center;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.6rem;
    text-align: center;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  /* タイピング演出とペイントは行わず、プロダクト表示状態から始める */
  .hero-intro,
  .intro-paint {
    display: none !important;
  }

  .intro-caret {
    animation: none;
  }

  .work-item,
  .work-caption > *,
  .hero-item-label,
  .nav-cta,
  .btn {
    transition: none;
  }

  .work-item.is-dimmed {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .work-item.is-dimmed .work-caption > * {
    opacity: 1;
    translate: 0 0;
  }
}
