/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 英字は Sora、日本語は Zen Kaku Gothic New、数字やラベルは JetBrains Mono。
     フォールバックは全部ゴシックで揃える（Webフォントが落ちても明朝に化けない） */
  --font-en: 'Sora', 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  --font-jp: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --accent: #6c63ff;
  --accent-light: #a89cff;
  --accent-dark: #4e46d6;
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --bg-3: #1a1a26;
  --surface: #1e1e2e;
  --border: rgba(255,255,255,0.08);
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --text-dim: #5a5a7a;
  --green: #0cce6b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-en);
  /* 日本語の約物（、。・）を詰める */
  font-feature-settings: 'palt' 1;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.accent { color: var(--accent); }

/* ===== Reveal Animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Loader ===== */
/* <head> のスクリプトが html に loader-on / is-loading を付けた時だけ出る（JSが動かない時は出ない） */
.loader { display: none; }
html.loader-on .loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: radial-gradient(70% 60% at 50% 45%, #06173a 0%, #020a18 55%, #01050d 100%);
  color: #cfe6ff;
}
html.is-loading,
html.is-loading body { overflow: hidden; }
/* 読み込み中はヒーローの文字を待たせ、円が開いた時に下からふわっと出す */
html.is-loading .hero .reveal { opacity: 0; transform: translateY(40px); }

.loader__streams {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.loader__core {
  position: relative;
  width: 176px;
  height: 176px;
  will-change: transform, opacity;
}
.loader__ring {
  position: absolute;
  inset: 18px;
  width: calc(100% - 36px);
  height: calc(100% - 36px);
}
.loader__progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
}
.loader__track,
.loader__bar {
  fill: none;
  stroke-width: 0.6;
}
.loader__track { stroke: rgba(150, 200, 255, 0.14); }
/* 読み込んだ割合ぶん線が伸びる（pathLength=100 なので --p がそのまま%になる） */
.loader__bar {
  stroke: #bfe8ff;
  stroke-dasharray: var(--p, 0) 100;
  filter: drop-shadow(0 0 2px rgba(98, 198, 255, 0.9));
}
.loader__head {
  transform-origin: 60px 60px;
  transform: rotate(calc(var(--p, 0) * 3.6deg));
}
.loader__head circle {
  fill: #eaf6ff;
  filter: drop-shadow(0 0 3px #62c6ff);
}
/* 照準の枠（四隅のかぎ）と、ゆっくり逆回りする目盛り */
.loader__frame {
  --c: rgba(170, 215, 255, 0.55);
  position: absolute;
  inset: -18px;
  background:
    linear-gradient(var(--c), var(--c)) top left / 16px 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px 16px,
    linear-gradient(var(--c), var(--c)) top right / 16px 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px 16px,
    linear-gradient(var(--c), var(--c)) bottom left / 16px 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px 16px,
    linear-gradient(var(--c), var(--c)) bottom right / 16px 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px 16px;
  background-repeat: no-repeat;
  animation: loader-lock 2.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.loader__ticks {
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(150, 200, 255, 0.2);
  border-radius: 50%;
  animation: loader-spin 16s linear infinite reverse;
}
.loader__count {
  position: relative;
  font: 400 34px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.loader__count small {
  margin-left: 3px;
  font-size: 12px;
  opacity: 0.6;
}
.loader__status {
  position: relative;
  min-height: 1em;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.22em;
  white-space: pre;
  color: rgba(160, 200, 240, 0.72);
}
/* 100%になったら、リングの位置から円が開いてページが現れる */
.loader.is-opening {
  -webkit-mask-image: radial-gradient(circle at var(--cx, 50%) var(--cy, 50%), transparent var(--hole, 0px), #000 calc(var(--hole, 0px) + 2px));
  mask-image: radial-gradient(circle at var(--cx, 50%) var(--cy, 50%), transparent var(--hole, 0px), #000 calc(var(--hole, 0px) + 2px));
}
.loader.is-opening .loader__count,
.loader.is-opening .loader__status {
  opacity: 0;
  transition: opacity 0.25s ease;
}
.loader.is-fading {
  opacity: 0;
  transition: opacity 0.35s ease;
}
/* WebGLが使えない時の輪 */
.loader--flat .loader__ring { display: none; }
.loader--flat .loader__core::before {
  content: '';
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 25%, #1d4fd8 55%, #62c6ff 90%, #eaf6ff 100%);
  -webkit-mask: radial-gradient(closest-side, transparent 62%, #000 64%);
  mask: radial-gradient(closest-side, transparent 62%, #000 64%);
  animation: loader-spin 1.6s linear infinite;
}
@keyframes loader-spin {
  to { transform: rotate(360deg); }
}
@keyframes loader-lock {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.07); opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .loader__frame,
  .loader__ticks,
  .loader--flat .loader__core::before { animation: none; }
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0;
  transition: background var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}
.header.scrolled {
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav__logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav__logo-sub {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(108,99,255,0.35);
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(108,99,255,0.10);
  line-height: 1;
  margin-top: 2px;
}
.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__link {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.nav__link:hover { color: var(--text); background: var(--surface); }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text) !important;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  background: transparent !important;
}
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Buttons: HUDパネル型（角を切り落とした近未来の操作卓） ===== */
/* 背景のWebGLと同じ紺〜水色で組む。層は3枚：
   .btn::before = 光る枠（ゆっくり流れるグラデ）／ .btn__edge = 中の塗り＋走査線／ .btn::after = 入れ替わる文字
   ★ clip-path は .btn 本体に掛けない。掛けるとキーボード操作の focus の輪まで切られる */
.btn {
  --cut: 11px;                     /* 角を落とす大きさ */
  --rim: 1.5px;                    /* 枠の太さ */
  --rim-a: #62c6ff;                /* 水色（背景の映り込みと同じ） */
  --rim-b: #9d97ff;                /* 藤色 */
  --rim-c: rgba(98,198,255,0.12);  /* 枠が消える所 */
  --fill: linear-gradient(150deg, rgba(13,24,66,0.92), rgba(8,13,38,0.96));
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 22px;
  border-radius: 0;
  font-family: var(--font-jp);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #eaf6ff;
  cursor: pointer;
  border: none;
  background: none;
  isolation: isolate;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease,
    filter 0.35s ease;
}
/* 枠：角を落とした形に切り抜いたグラデーション。ゆっくり流れ続ける */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(115deg, var(--rim-c), var(--rim-a) 22%, var(--rim-b) 45%, var(--rim-c) 62%, var(--rim-a) 88%, var(--rim-c));
  background-size: 300% 100%;
  animation: btn-rim 7s linear infinite;
  clip-path: polygon(
    0 var(--cut), var(--cut) 0, 100% 0,
    100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
}
@keyframes btn-rim {
  to { background-position: -300% 0; }
}
/* 中の塗り。枠の太さだけ内側に置くので、外周がそのまま光る縁になる */
.btn__edge {
  position: absolute;
  inset: var(--rim);
  z-index: -1;
  overflow: hidden;
  background: var(--fill);
  clip-path: polygon(
    0 calc(var(--cut) - var(--rim)), calc(var(--cut) - var(--rim)) 0, 100% 0,
    100% calc(100% - var(--cut) + var(--rim)), calc(100% - var(--cut) + var(--rim)) 100%, 0 100%);
  transition: background 0.35s ease;
}
/* 走査線：モニタに映っているような細い横縞（Uiverse 全5981件で0.9%しか使っていない） */
.btn__edge::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(
    0deg, rgba(120,190,255,0.09) 0 1px, transparent 1px 4px);
  opacity: 0.55;
  transition: opacity 0.35s ease;
}
/* 斜めに走る光 */
.btn__edge::after {
  content: '';
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: -75%;
  width: 42%;
  background: linear-gradient(100deg, transparent, rgba(190,230,255,0.4), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn__text,
.btn__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
/* カーソルを乗せると入れ替わって出てくる文字。DOMを複製しないので読み上げは二重にならない */
.btn::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  letter-spacing: 0.05em;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--rim-a); outline-offset: 4px; }
/* 触る端末では hover が残るので、マウスがある端末だけ動かす */
@media (hover: hover) {
  .btn:hover { transform: translateY(-3px); }
  .btn:hover::before { animation-duration: 1.6s; }
  .btn:hover .btn__text { transform: translateY(-140%); opacity: 0; }
  .btn:hover .btn__icon { transform: translate(1.9em, -0.1em) rotate(45deg) scale(1.08); opacity: 0; }
  .btn:hover::after { transform: translateY(0); opacity: 1; }
  .btn:hover .btn__edge::after { left: 130%; }
}

/* --- 1. 制作実績を見る：一番強い。青く発光して枠が速く流れる --- */
.btn--primary {
  --fill: linear-gradient(150deg, #2a44c8, #1d2f9e 55%, #16217a);
  color: #fff;
  filter: drop-shadow(0 12px 26px rgba(50,90,220,0.5));
}
.btn--primary .btn__edge::before { opacity: 0.35; }
@media (hover: hover) {
  .btn--primary:hover { filter: drop-shadow(0 20px 40px rgba(70,140,255,0.72)); }
  .btn--primary:hover .btn__edge { background: linear-gradient(150deg, #3554e8, #2438b8 55%, #1b2a94); }
}

/* --- 2. 作れるもの：押すと画面が点く。走査線が明るくなって流れる --- */
.btn--outline { color: #d6e6ff; }
@media (hover: hover) {
  .btn--outline:hover { filter: drop-shadow(0 16px 34px rgba(98,198,255,0.45)); }
  .btn--outline:hover .btn__edge::before {
    opacity: 1;
    animation: btn-scan 0.75s linear infinite;
  }
}
@keyframes btn-scan {
  to { transform: translateY(4px); }
}

/* --- 3. お問い合わせ：控えめ。乗せると水色の走査が上から1度だけ降りる --- */
.btn--ghost {
  --rim-a: rgba(140,170,220,0.55);
  --rim-b: rgba(120,190,255,0.5);
  --rim-c: rgba(255,255,255,0.05);
  /* 白い膜だと背景から浮いて灰色の板に見える。紺で沈めて背景を透かす */
  --fill: linear-gradient(150deg, rgba(18,28,64,0.5), rgba(8,13,34,0.66));
  color: #c3cfe8;
}
.btn--ghost .btn__edge::before { opacity: 0.25; }
@media (hover: hover) {
  .btn--ghost:hover {
    --rim-a: #62c6ff;
    --rim-b: #9d97ff;
    color: #eaf6ff;
  }
  .btn--ghost:hover .btn__edge::after {
    left: 0;
    top: -100%;
    bottom: auto;
    width: 100%;
    height: 100%;
    transform: none;
    background: linear-gradient(180deg, transparent, rgba(98,198,255,0.5), transparent);
    animation: btn-drop 0.7s cubic-bezier(0.4, 0, 0.2, 1) 1;
  }
}
@keyframes btn-drop {
  from { top: -100%; }
  to { top: 100%; }
}

.btn--full { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn__text,
  .btn__icon,
  .btn__edge,
  .btn__edge::after,
  .btn::after { transition: none; }
  .btn::before,
  .btn__edge::before,
  .btn__edge::after { animation: none; }
  .btn:hover .btn__text,
  .btn:hover .btn__icon { transform: none; opacity: 1; }
  .btn:hover::after { opacity: 0; }
}

/* ===== Section Common ===== */
.section { padding: 100px 0; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 540px;
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-header .section-label { justify-content: center; }
.section-header .section-desc { margin: 0 auto; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 72px;
}
/* 背景の布は curtain.js が canvas に描く。WebGLが無い時はこのグラデーションだけ残る */
.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 33%, rgba(255,120,180,0.05) 39%, rgba(120,255,220,0.045) 45%, transparent 52%),
    radial-gradient(80% 60% at 68% 22%, rgba(0,136,221,0.10), transparent 70%),
    radial-gradient(120% 40% at 60% 100%, rgba(40,60,210,0.16), transparent 70%),
    linear-gradient(180deg, #010812 0%, #020b18 60%, var(--bg) 100%);
}
.hero__curtain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* 文字の下を暗くして読みやすくし、下端は次のセクションの色へつなぐ */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(1,8,18,0.6) 0, rgba(1,8,18,0) 120px),
    linear-gradient(90deg, rgba(1,8,18,0.6) 0%, rgba(1,8,18,0.28) 40%, rgba(1,8,18,0) 70%),
    linear-gradient(180deg, rgba(10,10,15,0) 90%, var(--bg) 100%);
}

.hero__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 80px 24px;
  position: relative;
}
.hero__text { min-width: 0; }
.hero__visual { min-width: 0; }
.hero__title {
  position: relative;
  font-family: var(--font-jp);
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.045em;
  color: #eaf1ff;
  margin-bottom: 26px;
  text-shadow: 0 2px 24px rgba(1,7,20,0.85), 0 1px 3px rgba(1,7,20,0.6);
}
/* 1行ずつ、行の箱で切って下から立ち上げる（line-height を詰めた見出しの下端が切れないよう逃がす） */
.hero__title.reveal { transform: none; }
.hero__title-line {
  display: block;
  position: relative;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
/* 立ち上がりは「奥からピントが合う」。ぼけ → くっきり を上りと同時にやる */
.hero__title-inner {
  position: relative;
  display: block;
  transform: translateY(110%);
  /* ★ filter をそのまま書き換えると、2行目に掛けた影まで消える。ぼけ量だけ変数で渡す */
  --tblur: 9px;
  filter: blur(var(--tblur));
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1), filter 0.9s ease;
}
.hero__title.visible .hero__title-inner { transform: none; --tblur: 0px; }
.hero__title-line:nth-child(2) .hero__title-inner { transition-delay: 0.1s; }
.hero__title-line:nth-child(3) .hero__title-inner { transition-delay: 0.2s; }
/* 2行目：背景と同じ水色〜藤色が文字の中をゆっくり流れる。
   文字を切り抜くと text-shadow が効かないので、影は drop-shadow で掛ける */
.hero__title-inner--accent {
  /* ★ 多色のグラデ文字は「AIが作った見出し」の典型。地は単色のままにして、
     細い白帯だけを通す。止まっている時は単色、動いている時だけ光が走って見える */
  background: linear-gradient(100deg,
    #9d97ff 0%, #9d97ff 42%,
    #cfe0ff 47%, #eaf6ff 50%, #cfe0ff 53%,
    #9d97ff 58%, #9d97ff 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* ★ 文字を切り抜くと、親から継いだ text-shadow が「グラデの上」に塗られて文字が沈む。
     影は必ず消して、代わりに drop-shadow で掛ける（実測: 輝度 0.09 → 0.88） */
  text-shadow: none;
  filter: blur(var(--tblur)) drop-shadow(0 2px 10px rgba(1,7,20,0.95))
    drop-shadow(0 0 26px rgba(8,16,44,0.8));
  animation: title-sheen 11s linear infinite;
}
@keyframes title-sheen {
  to { background-position: -300% 0; }
}
/* 3行目の下に引く線。幅ではなく scaleX で伸ばす（レイアウトを揺らさない） */
.hero__title-line:nth-child(3)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.15em;
  width: 4.4em;
  height: 2px;
  background: linear-gradient(90deg, #62c6ff, rgba(157,151,255,0.55) 55%, rgba(157,151,255,0));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}
.hero__title.visible .hero__title-line:nth-child(3)::after { transform: scaleX(1); }
/* 見出しの上を1度だけ通る走査線。背景が乱れた時にも走って、画面と見出しがつながって見える */
.hero__title-scan {
  position: absolute;
  left: -2%;
  right: -2%;
  top: 0;
  height: 24%;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background: linear-gradient(180deg, transparent, rgba(98,198,255,0.14) 42%,
    rgba(234,246,255,0.45) 50%, rgba(98,198,255,0.14) 58%, transparent);
}
.hero__title.visible .hero__title-scan {
  animation: title-scan 1.6s cubic-bezier(0.3, 0, 0.2, 1) 0.4s 1;
}
@keyframes title-scan {
  0% { opacity: 0; transform: translateY(-130%); }
  14% { opacity: 1; }
  86% { opacity: 1; }
  100% { opacity: 0; transform: translateY(400%); }
}
/* 背景がザザッと乱れる一瞬だけ、見出しにも赤と水色のずれを重ねる
   （複製は疑似要素なので、読み上げが二重にならない） */
.hero__title.is-glitch .hero__title-scan { animation: title-scan 0.42s linear 1; }
.hero__title.is-glitch .hero__title-inner::before,
.hero__title.is-glitch .hero__title-inner::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}
.hero__title.is-glitch .hero__title-inner::before {
  color: #ff5f7a;
  clip-path: inset(4% 0 58% 0);
  animation: title-glitch-a 0.3s steps(3, end) 1;
}
.hero__title.is-glitch .hero__title-inner::after {
  color: #62c6ff;
  clip-path: inset(56% 0 6% 0);
  animation: title-glitch-b 0.3s steps(3, end) 1;
}
@keyframes title-glitch-a {
  0% { transform: translate(-8px, -2px) skewX(-6deg); opacity: 0.95; }
  45% { transform: translate(9px, 2px) skewX(4deg); opacity: 0.6; }
  100% { transform: none; opacity: 0; }
}
@keyframes title-glitch-b {
  0% { transform: translate(8px, 2px) skewX(5deg); opacity: 0.95; }
  45% { transform: translate(-9px, -2px) skewX(-4deg); opacity: 0.6; }
  100% { transform: none; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__title-inner { transform: none; transition: none; --tblur: 0px; }
  .hero__title-inner--accent { animation: none; }
  .hero__title-line:nth-child(3)::after { transform: scaleX(1); transition: none; }
  .hero__title-scan { display: none; }
  .hero__title.is-glitch .hero__title-inner::before,
  .hero__title.is-glitch .hero__title-inner::after { display: none; }
}
.hero__desc {
  color: #a3b0d4;
  font-size: 1rem;
  line-height: 2;
  letter-spacing: 0.015em;
  max-width: 29em;
  text-wrap: pretty;
  margin-bottom: 34px;
  text-shadow: 0 1px 12px rgba(1,7,20,0.9);
}
.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* Tech Stack Strip: 上段=言語・実装、下段=品質・SEO（逆方向に流れる） */
.hero__stack {
  margin-top: 36px;
  display: grid;
  gap: 8px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,0.25) 7%, #000 24%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,0.25) 7%, #000 24%, #000 80%, transparent 100%);
}
.hero__stack-track {
  display: flex;
  width: max-content;
  animation: stack-slide 36s linear infinite;
}
.hero__stack-track--alt {
  animation-duration: 46s;
  animation-direction: reverse;
}
.hero__stack-set {
  display: flex;
  gap: 8px;
  padding-right: 8px;
}
.hero__stack-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #9aa6c8;
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
  flex-shrink: 0;
}
.hero__stack-item::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #62c6ff;
  opacity: 0.85;
}
.hero__stack-track--alt .hero__stack-item::before { background: #7ef0b0; }
@media (prefers-reduced-motion: reduce) {
  .hero__stack-track { animation: none; }
}
@keyframes stack-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Hero code editor: コードが打ち込まれ、右に結果が組み上がる */
.hero__visual { position: relative; overflow: visible; }
.editor {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  font-family: var(--font-mono);
  background: linear-gradient(180deg, #0b1024 0%, #070b1a 100%);
  border: 1px solid rgba(120,140,255,0.18);
  box-shadow:
    0 30px 70px -30px rgba(0,0,0,0.9),
    0 0 0 1px rgba(255,255,255,0.03),
    0 0 90px -40px rgba(108,99,255,0.55);
}
.editor__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(7,11,26,0.92);
  border-bottom: 1px solid rgba(120,140,255,0.14);
}
.editor__dots { display: flex; gap: 6px; }
.editor__dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.editor__dots i:nth-child(1) { background: #ff5f57; }
.editor__dots i:nth-child(2) { background: #febc2e; }
.editor__dots i:nth-child(3) { background: #28c840; }
.editor__tabs { display: flex; gap: 2px; margin-left: 4px; }
.editor__tab {
  padding: 6px 11px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #7b87b4;
  font-family: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.editor__tab:hover { color: #c7d0f0; background: rgba(255,255,255,0.05); }
.editor__tab.is-active {
  color: #e9eeff;
  background: rgba(108,99,255,0.18);
  box-shadow: inset 0 -2px 0 var(--accent-light);
}
.editor__tab:focus-visible,
.editor__run:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.editor__run {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid rgba(12,206,107,0.35);
  background: rgba(12,206,107,0.12);
  color: #7ef0b0;
  font-family: inherit;
  font-size: 0.66rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.editor__run:hover { background: rgba(12,206,107,0.2); transform: translateY(-1px); }
.editor__body { display: grid; grid-template-columns: 1.1fr 0.9fr; min-height: 292px; }
.editor__code {
  margin: 0;
  padding: 14px 10px;
  font-size: 0.64rem;
  line-height: 1.95;
  color: #93a4d4;
  white-space: pre;
  overflow: hidden;
  counter-reset: line;
  border-right: 1px solid rgba(120,140,255,0.12);
}
.editor__code .ln { display: block; }
.editor__code .ln::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 1.4em;
  margin-right: 0.9em;
  text-align: right;
  color: #39426e;
}
.editor__code .caret {
  display: inline-block;
  width: 0.5em;
  height: 0.95em;
  vertical-align: -0.1em;
  background: #9d97ff;
  animation: caret-blink 1.05s steps(1, end) infinite;
}
@keyframes caret-blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}
.tok-tag { color: #7fb6ff; }
.tok-attr { color: #9d97ff; }
.tok-str { color: #7ee0b8; }
.tok-com { color: #4d5684; }
.tok-kw { color: #c88bff; }
.tok-num { color: #ffc978; }
.tok-fn { color: #62c6ff; }
.tok-sel { color: #ffb4a2; }
.tok-prop { color: #8fa2ff; }
/* 右側：コードの結果。押すとそのセクションへ飛ぶ */
.editor__preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: radial-gradient(120% 80% at 85% 0%, rgba(108,99,255,0.1), transparent 62%);
}
.mini {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.mini.is-shown { opacity: 1; transform: none; }
.mini--nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}
.mini--nav b { width: 22px; height: 7px; border-radius: 3px; background: #62c6ff; opacity: 0.8; }
.mini--nav i { width: 14px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.18); margin-left: auto; }
.mini--nav i + i { margin-left: 0; }
.mini--hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px;
  border-radius: 0;
  background: linear-gradient(150deg, #2a44c8, #1d2f9e 55%, #16217a);
  color: #fff;
  font-family: var(--font-jp);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  /* 本物のボタンと同じく左上・右下の角を落とす */
  clip-path: polygon(0 9px, 9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  box-shadow: 0 12px 30px -16px rgba(60,110,230,0.95);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background 0.3s ease;
}
.mini--hero:hover {
  transform: translateY(-2px);
  background: linear-gradient(150deg, #3554e8, #2438b8 55%, #1b2a94);
  box-shadow: 0 18px 36px -18px rgba(90,150,255,1);
}
.mini__arrow { transition: transform 0.25s ease; }
.mini--hero:hover .mini__arrow { transform: translateX(4px); }
.mini--cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini__card {
  display: grid;
  place-items: center;
  padding: 14px 4px;
  border-radius: 0;
  clip-path: polygon(0 7px, 7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  background: rgba(120,160,255,0.06);
  border: 1px solid rgba(140,180,255,0.1);
  color: #b9c4e8;
  font-family: var(--font-jp);
  font-size: 0.62rem;
  font-weight: 500;
  text-align: center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.mini__card:hover {
  transform: translateY(-3px);
  background: rgba(98,198,255,0.16);
  border-color: rgba(98,198,255,0.45);
  color: #fff;
}
/* ★ clip-path はフォーカスの輪まで切る。キーボードで来た時だけ形を四角に戻して輪を見せる */
.mini--hero:focus-visible,
.mini__card:focus-visible {
  clip-path: none;
  outline: 2px solid #62c6ff;
  outline-offset: 2px;
}
.editor__status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid rgba(120,140,255,0.12);
  background: rgba(7,11,26,0.85);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: #6f7bad;
}
.editor__status-msg { color: #7ef0b0; }
.editor__status-meta { margin-left: auto; }
@media (prefers-reduced-motion: reduce) {
  .editor__code .caret { animation: none; }
  .mini { opacity: 1; transform: none; transition: none; }
}

/* Score Badges */
.score-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  animation: badge-float 4s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.score-badge strong { font-weight: 800; font-size: 0.92rem; }
.score-badge--perf {
  background: rgba(12,206,107,0.12);
  border-color: rgba(12,206,107,0.3);
  color: #e0ffe0;
  top: -18px; right: 16px;
  animation-delay: 0s;
  box-shadow: 0 4px 20px rgba(12,206,107,0.15);
}
.score-badge--perf strong { color: var(--green); }
.score-badge--seo {
  background: rgba(108,99,255,0.12);
  border-color: rgba(108,99,255,0.3);
  color: #e8e4ff;
  bottom: 70px; left: -30px;
  animation-delay: -1.5s;
  box-shadow: 0 4px 20px rgba(108,99,255,0.15);
}
.score-badge--seo strong { color: var(--accent-light); }
.score-badge--a11y {
  background: rgba(255,189,46,0.12);
  border-color: rgba(255,189,46,0.3);
  color: #fff8e0;
  bottom: -18px; right: 36px;
  animation-delay: -3s;
  box-shadow: 0 4px 20px rgba(255,189,46,0.12);
}
.score-badge--a11y strong { color: #ffbd2e; }
@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Scroll indicator */
.hero__scroll {
  position: absolute;
  bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* ===== About ===== */
.about { background: var(--bg-2); }
.about__inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: center;
}
/* ---- 写真：角を2つ落とした形に切るだけ。後ろには何も敷かない ---- */
.about__img-wrap { --cut: 16px; }
.about__img-placeholder {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  z-index: 1;
  clip-path: polygon(
    0 var(--cut), var(--cut) 0, 100% 0,
    100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
}
.about__tag {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid rgba(157,190,255,0.35);
  background: rgba(8,13,34,0.72);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: #cfe0ff;
  clip-path: polygon(0 7px, 7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.55s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.55s;
}
.about__visual.visible .about__tag { opacity: 1; transform: none; }
.about__tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #62c6ff;
  box-shadow: 0 0 0 0 rgba(98,198,255,0.55);
  animation: about-pulse 2.6s ease-out infinite;
}
@keyframes about-pulse {
  0%, 72% { box-shadow: 0 0 0 0 rgba(98,198,255,0.55); }
  100% { box-shadow: 0 0 0 7px rgba(98,198,255,0); }
}
/* ---- 本文：左を走る背骨の線。読み進んだぶんだけ下へ伸びる ---- */
.about__spine {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.about__spine i {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(180deg, #62c6ff, #9d97ff 60%, rgba(157,151,255,0.25));
  /* --p = 読み進み具合（about.js が 0〜1 で書く）。高さではなく scaleY で伸ばす */
  transform: scaleY(var(--p, 0));
  transform-origin: top center;
}
/* ---- 本文：要素ごとに出る距離を変えて奥行きを作る（全部同じだと平面に見える） ---- */
.about__text > *:not(.about__spine) {
  opacity: 0;
  transform: translateY(var(--d, 40px));
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--t, 0s);
}
.about__text.visible > *:not(.about__spine) { opacity: 1; transform: none; }
.about__text .section-label { --d: 24px; --t: 0s; }
.about__greeting { --d: 38px; --t: 0.08s; }
.about__text .section-title { --d: 52px; --t: 0.16s; }
.about__desc:nth-of-type(1) { --d: 66px; --t: 0.26s; }
.about__desc:nth-of-type(2) { --d: 78px; --t: 0.34s; }
.about__skills { --d: 96px; --t: 0.44s; }
/* ---- 実績3行：読み終わる頃に下線が左から伸びる ---- */
.about__skill-item { position: relative; }
.about__skill-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, #62c6ff, rgba(157,151,255,0.15));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.about__skills.is-drawn .about__skill-bar { transform: scaleX(1); }
.about__skill-item:nth-child(2) .about__skill-bar { transition-delay: 0.14s; }
.about__skill-item:nth-child(3) .about__skill-bar { transition-delay: 0.28s; }
.about__skill-item:nth-child(4) .about__skill-bar { transition-delay: 0.42s; }
.about__img-wrap {
  position: relative;
  aspect-ratio: 1;
  max-width: 360px;
}
.about__img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.about__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.about__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}
/* --c = 点く順（HTML側で 0,2,1,4,3… とわざと崩してある。等間隔だと機械に見える） */
.about__tools .tool-chip {
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    border-color var(--transition), color var(--transition), box-shadow var(--transition);
  transition-delay: calc(var(--c, 0) * 70ms);
}
.about__visual.visible .about__tools .tool-chip { opacity: 1; transform: none; }
.tool-chip {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
  cursor: default;
}
.tool-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 16px rgba(108,99,255,0.2);
  z-index: 10;
}
/* ツールチップ。
   ★ 中身は長い日本語で、以前は white-space: nowrap のまま幅440pxを占めていた。
     見えていなくても場所は取るので、スマホではページ全体が横に広がり、
     指で縮めると本文が左に寄って右に余白が出ていた。
     ・触る端末には出さない（そもそも重ねられないので出番がない）
     ・折り返しと上限幅を入れて、画面の外まで伸びないようにする */
@media (hover: hover) and (pointer: fine) {
  .tool-chip[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: var(--bg-3);
    border: 1px solid rgba(108,99,255,0.3);
    color: var(--text-muted);
    font-size: 0.72rem;
    width: max-content;
    max-width: min(260px, calc(100vw - 40px));
    white-space: normal;
    line-height: 1.7;
    text-align: center;
    padding: 7px 12px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    z-index: 20;
  }
  .tool-chip[data-tip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    border: 5px solid transparent;
    border-top-color: rgba(108,99,255,0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 20;
  }
  .tool-chip[data-tip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .tool-chip[data-tip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
.about__text { position: relative; padding-left: 30px; }
.about__greeting { font-size: 1rem; color: var(--text-muted); line-height: 1.9; margin-bottom: 24px; }
.about__desc { color: var(--text-muted); margin-bottom: 22px; }
.about__skills { margin-top: 40px; display: flex; flex-direction: column; }
.about__skill-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.about__skill-name { color: var(--text); }
.about__skill-note { color: var(--text-muted); font-size: 0.8rem; }

/* ===== Services: カードのデッキ ===== */
/* JSが動かない時は普通のカード並び。JSが動くと（.is-ready）扇状に開く */
.services {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}
/* 背景：舞台の照明に見立てた光だけ。
   ★ 細い線を一定間隔で敷き詰めた「方眼」はやめた。図面・地図・計測画面でないのに方眼を敷くと、
     中身と関係のない模様が主張するだけになる。ここはカードが主役なので、当てるのは光にする */
.services::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    /* 真ん中のカードに当たる主光源 */
    radial-gradient(52% 40% at 50% 42%, rgba(80,120,240,0.13), transparent 72%),
    /* 左右から回り込む弱い光。1つだけだと平たく見える */
    radial-gradient(38% 46% at 12% 30%, rgba(98,198,255,0.07), transparent 70%),
    radial-gradient(38% 46% at 88% 62%, rgba(157,151,255,0.07), transparent 70%),
    /* 上から下へわずかに沈ませて、床があるように見せる */
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 40%, rgba(0,0,0,0.25));
}
.services > .container { position: relative; z-index: 1; }
.deck { position: relative; }
.deck__stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 18px;
}
.deck-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(22,28,62,0.72), rgba(10,14,34,0.92));
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.deck-card:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }
.deck-card__face {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 22px 22px;
  transform-style: preserve-3d;
  transition: opacity 0.35s ease;
}
.deck-card__sheen {
  position: absolute;
  inset: 0;
  background: radial-gradient(180px 180px at var(--mx, 50%) var(--my, 50%), rgba(150,175,255,0.22), transparent 72%);
  opacity: var(--lift, 0);
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.deck-card__num {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: #6d78a8;
}
.deck-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: rgba(108,99,255,0.14);
  color: var(--accent-light);
  transition: background 0.3s ease, color 0.3s ease;
}
.deck-card__title {
  font-family: var(--font-jp);
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.deck-card__lead {
  font-size: 0.82rem;
  line-height: 1.85;
  color: #93a0c4;
}
.deck-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.deck-card__tags i {
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-style: normal;
  color: #8e9ac0;
}
.deck-card__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.deck-card--featured { border-color: rgba(108,99,255,0.42); }
.deck-card__detail {
  display: block;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.deck-card__detail-title {
  display: block;
  padding: 14px 0 10px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: #6d78a8;
}
.deck-card__detail ul { display: flex; flex-direction: column; gap: 9px; }
.deck-card__detail li {
  position: relative;
  padding-left: 16px;
  font-size: 0.78rem;
  line-height: 1.75;
  color: #9aa6c8;
}
.deck-card__detail li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.deck__panel-title {
  font-family: var(--font-jp);
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.deck__panel-lead {
  font-size: 0.82rem;
  line-height: 1.85;
  color: #93a0c4;
  margin-bottom: 16px;
}
.deck__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: #aab4d8;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.deck__close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.deck__close:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.deck__panel-body ul { display: flex; flex-direction: column; gap: 10px; }
.deck__panel-body li {
  position: relative;
  padding-left: 17px;
  font-size: 0.84rem;
  line-height: 1.8;
  color: #a4b0d2;
}
.deck__panel-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.64em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-light);
}

/* --- JSが動いている時：扇状に開く（広い画面だけ） --- */
@media (min-width: 901px) {
  .deck.is-ready .deck__stage {
    display: block;
    position: relative;
    /* 高さ = カード300 + 扇の山48 + 余白6。中身は実測250pxなので、これ以上高くすると下が空く */
    height: 354px;
    perspective: 1500px;
    /* 右へ流れて消えたカードは、左から戻ってくる */
    overflow: hidden;
    /* ★ 端は「地の色で塗って隠す」のではなく「カードごと薄くする」。
       色で塗ると、背景に当てた光の上に帯が乗って継ぎ目が出る */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  }
  .deck.is-ready .deck-card {
    position: absolute;
    left: 50%;
    top: 0;
    width: 250px;
    height: 300px;
    margin-left: -125px;
    z-index: 10;
    /* 位置と角度は services-deck.js が毎フレーム書く（扇 → 平行 → 流れる） */
    transform-origin: 50% 50%;
    transition: opacity 0.4s ease, filter 0.4s ease;
  }
  .deck.is-ready .deck-card__face {
    height: 100%;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.25s ease;
  }
  .deck.is-ready .deck-card__title { transform: translateZ(26px); }
  .deck.is-ready .deck-card__icon { transform: translateZ(34px); }
  .deck.is-ready .deck-card__lead,
  .deck.is-ready .deck-card__tags { transform: translateZ(14px); }
  .deck.is-ready .deck-card__detail { display: none; }
  /* 真ん中に来た1枚が明るくなる。カーソルを使わないので、流れを止めずに目の行き先が作れる */
  .deck.is-ready .deck-card {
    border-color: rgba(255,255,255, calc(0.08 + var(--mid, 0) * 0.34));
    box-shadow:
      0 calc(18px + var(--mid, 0) * 20px) calc(40px + var(--mid, 0) * 26px)
        calc(-22px - var(--mid, 0) * 6px) rgba(0,0,0,0.9),
      0 0 calc(var(--mid, 0) * 54px) -20px rgba(108,99,255, calc(var(--mid, 0) * 0.85));
  }
  .deck.is-ready .deck-card__face { opacity: calc(0.8 + var(--mid, 0) * 0.2); }
  .deck.is-ready .deck-card__icon {
    background: rgba(108,99,255, calc(0.14 + var(--mid, 0) * 0.16));
  }
  .deck.is-ready .deck-card:hover,
  .deck.is-ready .deck-card:focus-visible {
    border-color: rgba(157,151,255,0.55);
  }
  .deck.is-ready .deck-card:hover .deck-card__face,
  .deck.is-ready .deck-card:focus-visible .deck-card__face { opacity: 1; }
  .deck.is-ready .deck-card:hover .deck-card__icon {
    background: rgba(108,99,255,0.3);
    color: #fff;
  }
  /* 開いている時：選んだカードは前へ、ほかは奥へ引く */
  .deck.is-open .deck-card {
    opacity: 0.2;
    filter: blur(1.5px);
    pointer-events: none;
  }
  /* ★ 位置は services-deck.js が舞台の縦中央に置く。
     ここで transform を書くと top:0 起点のまま拡大されて、カードの上が切れる */
  .deck.is-open .deck-card.is-active {
    opacity: 1;
    filter: none;
    pointer-events: auto;
    border-color: rgba(157,151,255,0.55);
    box-shadow: 0 40px 80px -36px rgba(0,0,0,1), 0 0 60px -22px rgba(108,99,255,0.7);
    transition: opacity 0.4s ease, filter 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  }
  .deck__panel {
    position: absolute;
    top: 6px;
    right: 0;
    width: min(510px, 55%);
    padding: 26px 26px 24px;
    border: 1px solid rgba(157,151,255,0.3);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(20,26,58,0.96), rgba(9,12,30,0.98));
    box-shadow: 0 40px 80px -40px rgba(0,0,0,1);
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
  }
  .deck.is-open .deck__panel { opacity: 1; transform: none; pointer-events: auto; }
}
/* 狭い画面：普通に並べて、押した1枚だけ中身を開く */
@media (max-width: 900px) {
  .deck.is-ready .deck-card__detail { display: none; }
  .deck.is-ready .deck-card.is-active .deck-card__detail { display: block; }
  .deck.is-ready .deck-card.is-active { border-color: rgba(157,151,255,0.5); }
}
/* 見出しの1文字ずつ立ち上がり（3D Text Reveal） */
.section-title[data-split] { perspective: 700px; }
.section-title .char {
  display: inline-block;
  transform-origin: 50% 100%;
  opacity: 0;
  transform: rotateX(-88deg) translateY(0.3em);
}
.section-title.is-shown .char {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--c) * 55ms);
}
/* 動きを減らす設定（広い画面）：扇も流れも使わないので、素のグリッドに戻して6枚全部見せる */
@media (prefers-reduced-motion: reduce) and (min-width: 901px) {
  .deck.is-ready .deck__stage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
    gap: 18px;
    height: auto;
    overflow: visible;
    perspective: none;
  }
  .deck.is-ready .deck__stage::before,
  .deck.is-ready .deck__stage::after { display: none; }
  .deck.is-ready .deck-card {
    position: static;
    width: 100%;
    height: auto;
    margin-left: 0;
  }
  .deck.is-ready .deck-card__face { opacity: 1; }
  .deck.is-ready .deck-card__title,
  .deck.is-ready .deck-card__icon,
  .deck.is-ready .deck-card__lead,
  .deck.is-ready .deck-card__tags { transform: none; }
  .deck.is-ready .deck-card.is-active .deck-card__detail { display: block; }
  .deck__panel { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .section-title .char { opacity: 1; transform: none; }
  .deck.is-ready .deck-card,
  .deck.is-ready .deck-card__face { transition: none; }
}

/* ===== Works ===== */
.works { background: var(--bg-2); }
.works__filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}
.filter-btn {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.filter-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }
.works__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.work-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}
.work-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(108,99,255,0.3); }
.work-card__img {
  height: 200px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
}
.work-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  backdrop-filter: blur(4px);
}
.work-card:hover .work-card__overlay { opacity: 1; }
.work-card__view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: 2px solid #fff;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}
.work-card__mockup {
  position: absolute;
  inset: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(4px);
}
.wm-header { height: 20px; background: rgba(0,0,0,0.2); }
.wm-body { padding: 8px; }
.wm-hero { height: 60px; background: rgba(255,255,255,0.15); border-radius: 4px; margin-bottom: 8px; }
.wm-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; }
.wm-block { height: 30px; background: rgba(255,255,255,0.1); border-radius: 4px; }
.work-card__info { padding: 20px; }
.work-card__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(108,99,255,0.1);
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}
.work-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.work-card__meta .work-card__tag { margin-bottom: 0; }
.work-card__date { font-size: 0.72rem; font-weight: 500; color: var(--text-dim); letter-spacing: 0.04em; white-space: nowrap; }
.work-card__title { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.work-card__tech { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 12px; }
.work-card__scores { display: flex; gap: 6px; }
.score-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}
.score-pill--green { background: rgba(12,206,107,0.1); color: var(--green); }
.work-card.hidden { display: none; }

/* ===== 進め方（PROCESS）=====
   ------------------------------------------------------------
   HARC のサイトに置いた「このサイトをつくった人」区画から、
   中身と動きだけを持ってきて、見た目はこのポートフォリオに作り直したもの。

   ★向こうの配色（紺＋金）はひとつも持ち込んでいない★
     金 --gold-*        → var(--accent) / var(--accent-light)
     紺 --navy-*        → var(--bg) / var(--bg-2)
     細線 --line-soft   → var(--border)
     角丸 4px           → var(--radius)（このサイトのカードと同じ16px）
     ラベル --font-ui   → var(--font-mono)
   面・角丸・枠線・近づくと光る出方は、このページの .q-card / .service-card と揃えてある。

   ★動きの作り（向こうから持ってきたのはここ）★
   ① 連続と離散を分ける
      左のレールだけがスクロール量に連動して伸びる（連続）。
      段の中身は一度だけ、部位ごとに時間差で入る（離散）。
      文字までスクロール連動にすると、動かすたびに全文字の描き直しが走ってがたつく。
   ② 1変数駆動
      段ごとに --lit（0→1）が1つ切り替わるだけで、
      番号・見出しの1文字ずつ・本文・タグ・節点・光の帯が全部そこから出る。
      途中で止めても絵が破綻しない。
   ③ 動く距離を部位ごとに変える
      全部同じだと1枚の板が動いたように見える。見出し40px → 本文60px の階段にしてある。
   ============================================================ */
.process {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(76% 80% at 10% 100%, rgba(108,99,255,0.12), transparent 62%),
    radial-gradient(88% 100% at 86% 0%, rgba(157,151,255,0.07), transparent 58%),
    var(--bg);
}
.process > .container { position: relative; z-index: 1; }

/* ---- 名乗り ---- */
.pr-intro { max-width: 40em; margin: 0 auto 56px; text-align: center; }
.pr-intro__name {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--accent-light);
  margin-bottom: 20px;
}
.pr-intro__name::before,
.pr-intro__name::after {
  content: '';
  width: 30px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}
.pr-intro__lead {
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.75;
  margin-bottom: 22px;
}
.pr-intro__body {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.95;
}
.pr-intro__body + .pr-intro__body { margin-top: 1.2em; }

/* ---- できること3枚 ---- */
.pr-pick {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
.pr-pick__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(26px, 3vw, 34px);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--transition), border-color var(--transition);
}
/* 上辺を線が横切る。触れると端から端まで伸びる */
.pr-pick__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
/* カーソルを追う光。--mx/--my は process.js が入れる */
.pr-pick__card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(420px 220px at var(--mx, 50%) var(--my, 0%),
    rgba(108,99,255,0.18), transparent 70%);
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.pr-pick__card:hover,
.pr-pick__card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(108,99,255,0.34);
}
.pr-pick__card:hover::before,
.pr-pick__card:focus-visible::before { transform: scaleX(1); }
.pr-pick__card:hover::after,
.pr-pick__card:focus-visible::after { opacity: 1; }
.pr-pick__card:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

.pr-pick__num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--accent-light);
  margin-bottom: 18px;
}
.pr-pick__icon { color: var(--accent-light); margin-bottom: 16px; }
.pr-pick__icon svg { width: 28px; height: 28px; display: block; }
.pr-pick__title {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 10px;
}
.pr-pick__lead { color: var(--text-muted); font-size: 0.84rem; line-height: 1.8; margin-bottom: 20px; }
.pr-pick__list {
  list-style: none;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-bottom: 22px;
}
.pr-pick__list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.8rem;
  line-height: 1.95;
  color: var(--text-muted);
}
.pr-pick__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.92em;
  width: 7px;
  height: 1px;
  background: var(--accent-light);
}
.pr-pick__go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--accent-light);
}
/* 伸びる矢印。★width は動かさない★
   幅を動かすと毎フレーム版組みの計算が走る。伸びきった長さで場所を取っておき、
   線は scaleX、矢じりは translateX で送る。どちらも版組みを触らない */
.pr-pick__go i {
  position: relative;
  width: 34px;
  height: 7px;
}
.pr-pick__go i::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  width: 34px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.647);          /* 22 / 34 */
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
/* ★translateX を rotate より前に書く★
   後ろに書くと、45度回った側の座標で動いて斜めに飛んでいく */
.pr-pick__go i::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.pr-pick__card:hover .pr-pick__go i::before { transform: scaleX(1); }
.pr-pick__card:hover .pr-pick__go i::after { transform: translateX(12px) rotate(45deg); }

/* 真ん中の1枚だけ立てる。面を塗るのではなく、上から差す空気と上辺の線で差をつける */
.pr-pick__card--lead {
  background:
    radial-gradient(124% 58% at 50% 0%, rgba(108,99,255,0.16), transparent 64%),
    var(--bg-3);
  border-color: rgba(108,99,255,0.3);
}
.pr-pick__card--lead::before {
  transform: scaleX(1);
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 45%, #62c6ff 100%);
}
.pr-pick__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--bg);
  background: linear-gradient(90deg, var(--accent-light), #62c6ff);
  padding: 5px 11px;
  border-radius: 999px;
}

/* ---- 強み4つ：順に灯る4段 ---- */
.pr-edge {
  position: relative;
  display: grid;
  margin-top: clamp(48px, 6vw, 76px);
  padding-left: clamp(26px, 3.6vw, 46px);
  border-top: 1px solid var(--border);
}
/* 左のレール。地の線はうっすら、その上を光が下へ伸びる */
.pr-edge__rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.pr-edge__rail i {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  transform: scaleY(var(--p, 0));
  transform-origin: top;
}
/* 伸びていく先端の光。線だけだと「描かれている」感が出ない */
.pr-edge__rail i::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 5px;
  height: 5px;
  translate: -50% 50%;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 9px 2px rgba(157,151,255,0.55), 0 0 20px 6px rgba(108,99,255,0.3);
}

/* 段。箱ではなく細線で区切る */
.pr-edge__row {
  --lit: 0;                       /* この1つで段の中身すべてが決まる */
  position: relative;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: clamp(14px, 2.6vw, 36px);
  padding: clamp(24px, 2.8vw, 34px) clamp(14px, 1.8vw, 24px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.pr-edge__row.is-lit { --lit: 1; border-color: rgba(108,99,255,0.26); }
/* ★止めるのではなく「終わった状態」に飛ばす★
   止めるだけだと opacity が初期値のまま固まって中身が消える */
.pr-edge.is-done .pr-edge__row { --lit: 1; border-color: rgba(108,99,255,0.26); }
.pr-edge.is-done .pr-edge__rail i { --p: 1; }
@media (scripting: none) {
  .pr-edge__row { --lit: 1; }
  .pr-edge__rail i { --p: 1; }
}
/* 灯った瞬間に左から光が流れて残る。どこまで読んだかの目印にもなる */
.pr-edge__row::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(108,99,255,0.13), rgba(108,99,255,0.03) 46%, transparent 74%);
  opacity: calc(0.001 + 0.999 * var(--lit));
  transform: scaleX(var(--lit));
  transform-origin: left;
  transition: transform 1.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.4s ease-out;
}
/* 節点。レールの光が通りかかると灯る */
.pr-edge__node {
  position: absolute;
  left: calc(clamp(26px, 3.6vw, 46px) * -1);
  top: 30px;
  width: 11px;
  height: 11px;
  translate: -50% 0;
  scale: calc(0.45 + 0.55 * var(--lit));
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  opacity: calc(0.001 + 0.999 * var(--lit));
  transition: scale 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease-out,
    background-color 0.8s ease-out, border-color 0.8s ease-out, box-shadow 1s ease-out;
}
.pr-edge__row.is-lit .pr-edge__node,
.pr-edge.is-done .pr-edge__node {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.14),
    0 0 12px 2px rgba(157,151,255,0.32), 0 0 24px 7px rgba(108,99,255,0.2);
}

/* 番号とカテゴリ。左から差し込む（移動20px＝いちばん小さい） */
.pr-edge__label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: calc(0.001 + 0.999 * var(--lit));
  translate: calc(-20px * (1 - var(--lit))) 0;
  transition: translate 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.04s, opacity 0.9s ease-out 0.04s;
}
.pr-edge__no {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
}
.pr-edge__cat {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--text-dim);
  transition: color 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.pr-edge__row.is-lit .pr-edge__cat,
.pr-edge.is-done .pr-edge__cat { color: var(--text-muted); }

/* 見出し。1文字ずつ、ぼけたまま浮上する（移動40px）。
   blur を1行足すだけで「1文字ずつ登場」の上位互換になる。--i は process.js が入れる */
.pr-edge__title { font-size: clamp(1rem, 2vw, 1.18rem); font-weight: 700; line-height: 1.6; }
.pr-edge__title .char {
  display: inline-block;
  opacity: calc(0.001 + 0.999 * var(--lit));
  translate: 0 calc(40px * (1 - var(--lit)));
  filter: blur(calc(10px * (1 - var(--lit))));
  transition:
    translate 0.95s cubic-bezier(0.16, 1, 0.3, 1) calc(0.10s + var(--i, 0) * 0.026s),
    opacity   0.70s ease-out calc(0.10s + var(--i, 0) * 0.026s),
    filter    0.80s ease-out calc(0.10s + var(--i, 0) * 0.026s);
}
/* 本文（移動60px＝見出しより大きい＝奥行き） */
.pr-edge__desc {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.95;
  max-width: 44em;
  opacity: calc(0.001 + 0.999 * var(--lit));
  translate: 0 calc(60px * (1 - var(--lit)));
  transition: translate 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.32s, opacity 0.8s ease-out 0.32s;
}
/* タグ。縮んだ状態から湧いて出る。
   translateY だけだと「流れてきた」。scale を混ぜると「湧いて出た」になる */
.pr-edge__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pr-edge__tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  opacity: calc(0.001 + 0.999 * var(--lit));
  scale: calc(0.2 + 0.8 * var(--lit));
  transition: scale 0.8s cubic-bezier(0.16, 1, 0.3, 1) calc(0.50s + var(--i, 0) * 0.07s),
    opacity 0.6s ease-out calc(0.50s + var(--i, 0) * 0.07s);
}

/* ---- 閉じ ---- */
.pr-close {
  margin-top: clamp(48px, 6vw, 76px);
  padding-top: clamp(36px, 4.5vw, 56px);
  border-top: 1px solid var(--border);
  text-align: center;
}
.pr-close__title {
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 12px;
}
.pr-close__desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 32px; }
.pr-close__actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  /* 「終わった状態」は .is-done 側で出す。ここでは動きだけ消す */
  .pr-edge__rail i, .pr-edge__row, .pr-edge__row::before, .pr-edge__node,
  .pr-edge__label, .pr-edge__cat, .pr-edge__title .char, .pr-edge__desc,
  .pr-edge__tag, .pr-pick__card, .pr-pick__card::before, .pr-pick__card::after { transition: none; }
  .pr-pick__card:hover { transform: none; }
}

@media (max-width: 980px) {
  .pr-pick { grid-template-columns: 1fr; }
  .pr-pick__card--lead { order: -1; }         /* 得意なものを先頭へ */
}
@media (max-width: 768px) {
  /* 4段：番号を本文の上へ回して横に並べる */
  .pr-edge { padding-left: 22px; }
  .pr-edge__row { grid-template-columns: 1fr; gap: 12px; padding: 22px 0 22px 14px; }
  .pr-edge__node { left: -22px; top: 26px; }
  .pr-edge__label { flex-direction: row; align-items: baseline; gap: 12px; }
  .pr-edge__no { font-size: 1.5rem; }
  .pr-close__actions .btn { width: 100%; justify-content: center; }
}

/* ===== Contact ===== */
.contact { background: var(--bg-2); }
.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: start;
}
.contact__desc { color: var(--text-muted); margin-bottom: 20px; line-height: 1.8; }
.contact__urgent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255,189,46,0.08);
  border: 1px solid rgba(255,189,46,0.3);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
}
.contact__urgent strong { color: #ffbd2e; }
.contact__urgent-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,189,46,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #ffbd2e;
  margin-top: 2px;
}
.contact__info { display: flex; flex-direction: column; gap: 16px; }
.contact__info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.contact__info-item svg { color: var(--accent); flex-shrink: 0; }
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.required { color: var(--accent); }
.form-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.1); }
.form-input::placeholder { color: var(--text-dim); }
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 120px; }
.form-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 40px;
  text-align: center;
  color: var(--green);
}
.form-success h3 { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.form-success p { color: var(--text-muted); }

/* ===== Footer ===== */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 20px;
}
.footer__tagline { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }
.footer__nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer__link { font-size: 0.85rem; color: var(--text-muted); transition: color var(--transition); }
.footer__link:hover { color: var(--text); }
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.footer__bottom p { font-size: 0.8rem; color: var(--text-dim); }
.back-to-top {
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}
.back-to-top:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ===== Showcase ===== */
.showcase { background: var(--bg-2); }

.sc-tabs {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px;
  width: fit-content;
  margin: 0 auto 40px;
  flex-wrap: wrap;
  justify-content: center;
}
.sc-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.sc-tab:hover { color: var(--text); }
.sc-tab--active { background: var(--accent); color: #fff; }

.sc-panel--hidden { display: none; }
.sc-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.sc-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.sc-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.sc-card__title { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.sc-card__note { font-size: 0.74rem; color: var(--text-dim); }

/* Donut */
.sc-donut-wrap { display: flex; align-items: center; gap: 20px; }
.sc-donut {
  width: 110px; height: 110px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-donut__hole {
  width: 66px; height: 66px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.sc-donut__val { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.sc-donut__sub { font-size: 0.6rem; color: var(--text-muted); }
.sc-donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sc-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--text-muted); }
.sc-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Vertical bar chart */
.sc-bar-chart { height: 170px; }
.sc-bar-chart__bars { display: flex; gap: 8px; height: 100%; }
.sc-bar-col {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 6px;
  height: 100%;
}
.sc-bar {
  align-self: end;
  width: 100%;
  /* 高さは最初から最終値。伸びるのは scaleY だけなので、周りの配置が動かない */
  height: var(--h);
  background: rgba(108,99,255,0.35);
  border-radius: 4px 4px 0 0;
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform 0.9s cubic-bezier(0.4,0,0.2,1);
}
.sc-bar--accent { background: linear-gradient(180deg,#6c63ff 0%,#4e46d6 100%); }
.sc-bar-chart--visible .sc-bar { transform: scaleY(1); }
.sc-bar-label { font-size: 0.68rem; color: var(--text-dim); text-align: center; }

/* Line chart */
.sc-line-wrap { display: flex; flex-direction: column; gap: 6px; }
.sc-line-svg { width: 100%; height: auto; }
.sc-line-path {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  transition: stroke-dashoffset 1.4s ease 0.2s;
}
.sc-line-fill { opacity: 0; transition: opacity 0.8s ease 0.5s; }
.sc-line-wrap--visible .sc-line-path { stroke-dashoffset: 0; }
.sc-line-wrap--visible .sc-line-fill { opacity: 1; }
.sc-line-labels { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-dim); }

/* H-bar chart */
.sc-hbar-chart { display: flex; flex-direction: column; gap: 18px; }
.sc-hbar-item { display: flex; flex-direction: column; gap: 6px; }
.sc-hbar-meta { display: flex; justify-content: space-between; }
.sc-hbar-name { font-size: 0.8rem; color: var(--text-muted); }
.sc-hbar-val { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.sc-hbar-track { height: 8px; background: var(--bg-3); border-radius: 100px; overflow: hidden; }
.sc-hbar-fill {
  height: 100%;
  width: 100%;
  border-radius: 100px;
  clip-path: inset(0 calc(100% - var(--w, 0%)) 0 0 round 100px);
  transition: clip-path 1s cubic-bezier(0.4,0,0.2,1);
}

/* Accordion */
.sc-accordion { display: flex; flex-direction: column; }
.sc-acc-item { border-bottom: 1px solid var(--border); }
.sc-acc-item:last-child { border-bottom: none; }
.sc-acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  gap: 12px;
}
.sc-acc-btn:hover { color: var(--accent); }
.sc-acc-icon { flex-shrink: 0; color: var(--text-dim); transition: transform var(--transition); }
.sc-acc-item--open .sc-acc-icon { transform: rotate(180deg); }
.sc-acc-body {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.4s ease;
}
/* ★ 余白は「行そのもの」ではなく、器の中に入れる。
   p を直接グリッド項目にすると、0fr にしても p の padding だけ高さが残る（実測14px） */
.sc-acc-inner { overflow: hidden; min-height: 0; }
.sc-acc-item--open .sc-acc-body { grid-template-rows: 1fr; }
.sc-acc-body p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-bottom: 14px;
}

/* Progress bars */
.sc-progress-list { display: flex; flex-direction: column; gap: 18px; }
.sc-progress-item { display: flex; flex-direction: column; gap: 6px; }
.sc-progress-header { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-muted); }
.sc-progress-pct { font-weight: 600; }
.sc-progress-track { height: 8px; background: var(--bg-3); border-radius: 100px; overflow: hidden; }
.sc-progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 100px;
  clip-path: inset(0 calc(100% - var(--w, 0%)) 0 0 round 100px);
  transition: clip-path 1s cubic-bezier(0.4,0,0.2,1);
}

/* Table */
.sc-table-wrap { overflow-x: auto; }
.sc-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.sc-table th {
  padding: 10px 12px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.sc-table th:first-child { text-align: left; }
.sc-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.sc-table td:first-child { text-align: left; font-weight: 500; color: var(--text); }
.sc-table tr:last-child td { border-bottom: none; }
.sc-check { color: var(--green); font-weight: 700; }
.sc-cross { color: var(--text-dim); }
.sc-table-best { color: var(--text) !important; font-weight: 600 !important; }
.sc-table thead th.sc-table-best { background: rgba(108,99,255,0.12); color: var(--accent-light) !important; border-radius: 0; }
.sc-table tbody tr td.sc-table-best { background: rgba(108,99,255,0.07); }

/* Timeline */
.sc-timeline { display: flex; flex-direction: column; }
.sc-tl-item {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}
.sc-tl-item:last-child { padding-bottom: 0; }
.sc-tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px; top: 16px; bottom: 0;
  width: 2px;
  background: var(--border);
}
.sc-tl-item--done:not(:last-child)::before { background: rgba(12,206,107,0.3); }
.sc-tl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.sc-tl-item--done .sc-tl-dot { background: var(--green); border-color: var(--green); }
.sc-tl-item--active .sc-tl-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(108,99,255,0.5);
}
.sc-tl-body { flex: 1; }
.sc-tl-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sc-tl-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.sc-tl-desc { font-size: 0.76rem; color: var(--text-dim); }

/* Badge */
.sc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
}
.sc-badge--green { background: rgba(12,206,107,0.12); color: var(--green); }
.sc-badge--accent { background: rgba(108,99,255,0.12); color: var(--accent-light); }
.sc-badge--gray { background: var(--bg-3); color: var(--text-dim); }
.sc-badge--orange { background: rgba(240,160,48,0.12); color: #f0a030; }

/* Product grid */
.sc-product-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.sc-product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}
.sc-product-card:hover { transform: translateY(-3px); border-color: rgba(108,99,255,0.3); }
.sc-product-img {
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 8px;
}
.sc-product-tag {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}
.sc-product-tag--sale { background: #e84040; }
.sc-product-info { padding: 10px; }
/* 文字の大きさは3段だけ。0.95 / 0.75 / 0.6 でそれぞれ1.25倍以上あける
   （前は 0.82 / 0.74 / 0.72 / 0.65 と4つが近すぎて、どれが主役か分からなかった） */
.sc-product-name { font-size: 0.75rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.sc-product-price { font-size: 0.95rem; font-weight: 700; color: var(--accent-light); margin-bottom: 4px; }
.sc-product-price del { font-size: 0.6rem; font-weight: 400; color: var(--text-dim); margin-left: 3px; }
.sc-product-stars { font-size: 0.6rem; color: #f0a030; }

/* Profile cards */
.sc-profile-cards { display: flex; flex-direction: column; gap: 10px; }
.sc-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  transition: transform var(--transition);
}
.sc-profile-card:hover { transform: translateX(4px); }
.sc-profile-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sc-profile-name { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.sc-profile-role { font-size: 0.74rem; color: var(--text-muted); margin-bottom: 6px; }
.sc-profile-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-profile-tags span {
  font-size: 0.64rem;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(108,99,255,0.1);
  color: var(--accent-light);
}

/* Dashboard KPI */
.sc-kpi-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.sc-kpi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.sc-kpi-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sc-kpi-val { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.sc-kpi-label { font-size: 0.68rem; color: var(--text-dim); }
.sc-kpi-diff { margin-left: auto; font-size: 0.7rem; font-weight: 600; }
.sc-kpi-diff--up { color: var(--green); }
.sc-kpi-diff--down { color: #e84040; }

/* News list */
.sc-news-list { display: flex; flex-direction: column; gap: 10px; }
.sc-news-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  transition: transform var(--transition);
}
.sc-news-item:hover { transform: translateX(4px); }
.sc-news-thumb { width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0; }
.sc-news-body { flex: 1; min-width: 0; }
.sc-news-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sc-news-date { font-size: 0.7rem; color: var(--text-dim); }
.sc-news-title { font-size: 0.8rem; font-weight: 500; color: var(--text); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .hero__content { grid-template-columns: 1fr; gap: 60px; }
  .hero__visual { order: -1; }
  .editor__body { grid-template-columns: 1fr; min-height: 0; }
  .editor__code {
    border-right: none;
    border-bottom: 1px solid rgba(120,140,255,0.12);
    font-size: 0.58rem;
    line-height: 1.8;
    padding: 12px 8px;
  }
  .editor__dots { display: none; }
  .editor__bar { gap: 6px; padding: 8px 10px; }
  .editor__tab { padding: 5px 8px; font-size: 0.6rem; }
  .editor__run { padding: 5px 9px; font-size: 0.6rem; }
  .editor__status { font-size: 0.56rem; gap: 8px; }
  .hero__title { font-size: 2.4rem; }
  .hero__bg::after {
    background:
      linear-gradient(180deg, rgba(1,8,18,0.6) 0, rgba(1,8,18,0) 120px),
      linear-gradient(180deg, rgba(1,8,18,0.22) 0%, rgba(1,8,18,0.38) 100%),
      linear-gradient(180deg, rgba(10,10,15,0) 92%, var(--bg) 100%);
  }
  .about__inner { grid-template-columns: 1fr; gap: 48px; }
  .about__text { padding-left: 22px; }
  /* スマホは1つずつ灯すと待たされるので、間隔を詰めてまとめて出す */
  .about__tools .tool-chip { transition-delay: calc(var(--c, 0) * 28ms); }
  .about__tag { left: 12px; bottom: 12px; font-size: 0.55rem; }
  .contact__inner { grid-template-columns: 1fr; gap: 48px; }
  .works__grid { grid-template-columns: repeat(2, 1fr); }
  .sc-grid-2x2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .section { padding: 72px 0; }
  .nav__list {
    display: none;
    position: fixed;
    inset: 72px 0 0;
    background: rgba(10,10,15,0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 99;
  }
  .nav__list.open { display: flex; }
  .nav__toggle { display: flex; }
  .nav__link { font-size: 1.1rem; padding: 14px 32px; }
  .works__grid { grid-template-columns: 1fr; }
  .hero__stack { margin-top: 28px; }
  .hero__detail-badge { display: none; }
  .nav__logo-sub { display: none; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .sc-tab { padding: 8px 14px; font-size: 0.8rem; }
  .sc-product-grid { grid-template-columns: repeat(3,1fr); }
  .sc-kpi-grid { grid-template-columns: 1fr; }
}

/* ===== Work Card Carousel ===== */
.work-card__carousel {
  position: relative;
  height: 200px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.work-card__carousel:active { cursor: grabbing; }

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

/* Arrow buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10,10,15,0.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
  backdrop-filter: blur(6px);
  padding: 0;
}
.carousel-btn--prev { left: 8px; }
.carousel-btn--next { right: 8px; }
.work-card:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover { background: var(--accent); border-color: var(--accent); }

/* Dots */
.carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 12;
}
.c-dot {
  width: 18px;
  height: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.c-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: rgba(255,255,255,0.3);
  /* 左右から削って 6px の丸にする。round 3px があるので丸みは保たれる */
  clip-path: inset(0 33.34% round 3px);
  transition: background 0.25s, clip-path 0.3s cubic-bezier(0.4,0,0.2,1);
}
.c-dot.active::before {
  background: var(--accent);
  clip-path: inset(0 round 3px);
}

/* Slide section label tag */
.slide-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.65);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  backdrop-filter: blur(4px);
  z-index: 5;
  font-family: var(--font-mono);
}

/* ===== Slide mockup shared elements ===== */
.sm-wrap {
  width: 100%;
  height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sm-nav {
  height: 8px;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.sm-hero {
  flex: 0 0 52%;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.sm-h { height: 9px; border-radius: 3px; background: rgba(255,255,255,0.65); }
.sm-h--sm { width: 55%; background: rgba(255,255,255,0.35); height: 6px; }
.sm-h--xs { width: 38%; background: rgba(255,255,255,0.2); height: 5px; }
.sm-btn {
  height: 16px; width: 54px;
  border-radius: 4px;
  margin-top: 4px;
  flex-shrink: 0;
}
.sm-cards {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.sm-card {
  border-radius: 5px;
  background: rgba(255,255,255,0.08);
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sm-icon {
  width: 12px; height: 12px;
  border-radius: 3px;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.sm-line { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.18); }
.sm-line--lg { width: 85%; }
.sm-line--md { width: 65%; }
.sm-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sm-row {
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  height: 18px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 7px;
  flex-shrink: 0;
}
.sm-row-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.sm-row-line { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.14); }
.sm-grid2 {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.sm-item {
  border-radius: 5px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sm-num { font-size: 1rem; font-weight: 900; line-height: 1; font-family: var(--font-mono); }
.sm-stats {
  display: flex;
  gap: 4px;
}
.sm-stat {
  flex: 1;
  border-radius: 5px;
  background: rgba(255,255,255,0.08);
  padding: 6px;
  text-align: center;
}
.sm-stat-num { font-size: 0.75rem; font-weight: 900; font-family: var(--font-mono); line-height: 1; }
.sm-stat-label { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.2); margin-top: 4px; width: 70%; margin-left: auto; margin-right: auto; }

/* ===== Interactive Showcase Panel ===== */
.sc-interactive-intro {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(108,99,255,0.08), rgba(12,206,107,0.06));
  border: 1px solid rgba(108,99,255,0.18);
  border-radius: 10px;
}
.sc-interactive-lead {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.sc-interactive-lead strong { color: var(--accent); }

/* Demo Carousel */

/* Before/After Slider */

/* FAQ Accordion Demo */

/* Tab Demo */
.sc-tab-demo__tabs { display: flex; gap: 0; border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.sc-tab-demo__btn {
  flex: 1; padding: 8px 4px; border: none; background: var(--surface);
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted); cursor: pointer;
  transition: all 0.2s; border-right: 1px solid var(--border-subtle);
}
.sc-tab-demo__btn:last-child { border-right: none; }
.sc-tab-demo__btn--active { background: var(--accent); color: #fff; }
.sc-tab-demo__panel { display: none; }
.sc-tab-demo__panel--active { display: block; }
.sc-plan-price { font-size: 1.2rem; font-weight: 900; color: var(--accent); margin-bottom: 10px; font-family: var(--font-mono); }
.sc-plan-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.sc-plan-list li { font-size: 0.78rem; color: var(--text-muted); }
.sc-plan-no { color: var(--text-dim) !important; }

/* ===== スマホ表示の改行最適化（本文中のPC用<br>を無効化） ===== */
@media (max-width: 768px){
  .hero__desc br,.about__greeting br,p br{display:none;}
}

/* 自己紹介：動きを減らす設定では、演出後の状態に飛ばして止める（止めるだけだと中身が消える） */
@media (prefers-reduced-motion: reduce) {
  .about__text > *:not(.about__spine),
  .about__tools .tool-chip,
  .about__tag {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .about__tag i { animation: none; }
  .about__spine i { transform: scaleY(1); }
  .about__skill-bar { transform: scaleX(1); transition: none; }
}

@media (hover: hover) {
    }

/* ===== グラフ（motion.html とトップページで共有） ===== */
.ch-box { position: relative; width: 100%; }
.ch-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-svg--donut { max-width: 220px; margin: 0 auto; }
/* 目盛り線は「あるのが分かる」程度に薄く。濃いと数字より線が目立つ */
.ch-grid { stroke: rgba(255,255,255,0.07); stroke-width: 1; }
.ch-axis { fill: #7b88ae; font-family: var(--font-mono); font-size: 10px; }
.ch-line { fill: none; stroke: #9d97ff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ch-area { opacity: 0; }
/* 点は見た目より広い当たり判定を持たせる（小さい丸は触りにくい） */
.ch-pt { cursor: pointer; }
.ch-pt__hit { fill: transparent; }
.ch-pt__dot { fill: #0a0e1e; stroke: #9d97ff; stroke-width: 2.4; transition: r 0.2s ease, stroke 0.2s ease; }
.ch-pt:hover .ch-pt__dot,
.ch-pt:focus .ch-pt__dot { r: 6.5; stroke: #fff; }
.ch-pt:focus { outline: none; }
.ch-pt:focus-visible .ch-pt__dot { stroke: #62c6ff; }
.ch-bar { cursor: pointer; }
.ch-bar__r { transition: opacity 0.2s ease; }
.ch-bar:hover .ch-bar__r,
.ch-bar:focus .ch-bar__r { opacity: 0.78; }
.ch-bar__v { fill: #c7d2ee; font-family: var(--font-mono); font-size: 9.5px; opacity: 0; }
.ch-bar:focus { outline: none; }
.ch-bar:focus-visible .ch-bar__r { stroke: #62c6ff; stroke-width: 2; }
.ch-donut__track { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 20; }
.ch-donut__arc { fill: none; stroke-width: 20; stroke-linecap: butt; transition: opacity 0.25s ease; }
/* 「前に出る」は太さではなく、弧そのものを少し外へ広げて出す
   （SVGの stroke-width を動かしてもよいが、拡大の方が「手前に来た」と読める） */
.ch-arc { cursor: pointer; transform-origin: center; transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.ch-svg--donut.is-focus .ch-donut__arc { opacity: 0.32; }
.ch-svg--donut .ch-arc.is-on { transform: scale(1.055); }
.ch-svg--donut .ch-arc.is-on .ch-donut__arc { opacity: 1; }
.ch-arc:focus { outline: none; }
.ch-donut__num { fill: #eaf1ff; font-family: var(--font-en); font-size: 30px; font-weight: 700; }
.ch-donut__sub { fill: #7b88ae; font-family: var(--font-mono); font-size: 11px; }
.ch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.ch-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ch-legend i { width: 9px; height: 9px; border-radius: 2px; }
.ch-legend b { color: var(--text); margin-left: 2px; }
/* 値の札 */
.ch-tip {
  position: absolute;
  z-index: 3;
  padding: 6px 10px;
  border: 1px solid rgba(157,151,255,0.4);
  border-radius: 8px;
  background: rgba(10,14,32,0.95);
  color: #eaf1ff;
  font-size: 0.72rem;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%) scale(0.94);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.ch-tip.is-on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.ch-tip b { display: block; font-size: 0.64rem; color: #9aa8cf; font-weight: 500; }
/* 画面には出さないが読み上げには乗せる表 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: reduce) {
  .ch-tip, .ch-pt__dot, .ch-bar__r, .ch-donut__arc { transition: none; }
  .ch-area { opacity: 1; }
  .ch-bar__v { opacity: 1; }
}

/* 表の下の注記。本文（0.82rem）から1.28倍下げて、注記だと一目で分かるようにする */
.sc-note {
  margin-top: 12px;
  font-size: 0.64rem;
  line-height: 1.8;
  color: var(--text-dim);
}

/* ===== スライドカルーセル（3Dの回り込み） ===== */
/* 位置・奥行き・回転は main.js が毎フレーム書く。CSSは見た目と間合いだけ持つ */
.cv { position: relative; padding-top: 6px; }
.cv__sample {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  padding: 3px 9px;
  border: 1px solid rgba(140,170,220,0.26);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: #7f8cb0;
}
.cv__stage {
  position: relative;
  height: 236px;
  /* 横に掴んで送る所。上下はページのスクロールに渡す */
  touch-action: pan-y;
  perspective: 1100px;
  perspective-origin: 50% 46%;
  /* 横のスライドを端で溶かす。切り落とすと「はみ出した」ように見える */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.cv__slide {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(330px, 84%);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--edge, #62c6ff);
  border-radius: 16px;
  background: linear-gradient(170deg, rgba(24,31,64,0.96), rgba(11,15,34,0.99));
  box-shadow: 0 30px 60px -34px rgba(0,0,0,1);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.72s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.5s ease, filter 0.5s ease, box-shadow 0.5s ease;
}
/* 手前の1枚だけ、上辺の色をほのかに床へ落とす */
.cv__slide::after {
  content: '';
  position: absolute;
  inset: -1px -1px auto;
  height: 74px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, color-mix(in oklab, var(--edge), transparent 86%), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.cv__slide.is-front::after { opacity: 1; }
.cv__mark {
  font-family: var(--font-en);
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 0.52;
  height: 0.5em;
  margin-left: -2px;
  color: var(--edge, #62c6ff);
  opacity: 0.32;
}
.cv__quote {
  flex: 1;
  font-family: var(--font-jp);
  font-size: 0.82rem;
  line-height: 1.95;
  color: #d5deF2;
  text-wrap: pretty;
}
.cv__by {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.cv__by b { font-size: 0.78rem; color: #eaf1ff; }
.cv__by i { font-style: normal; font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.1em; color: #7f8cb0; }
.cv__ctrl { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.cv__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(140,170,220,0.26);
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  color: #b5c2e4;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
@media (hover: hover) {
  .cv__btn:hover { color: #fff; background: rgba(108,99,255,0.24); border-color: rgba(157,151,255,0.55); transform: scale(1.08); }
}
.cv__btn:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }
.cv__dots { display: flex; gap: 7px; }
.cv__dot {
  width: 18px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 100px;
  background: rgba(255,255,255,0.18);
  cursor: pointer;
  /* 幅ではなく切り抜きで伸ばす */
  clip-path: inset(0 33.34% round 3px);
  transition: background 0.25s ease, clip-path 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.cv__dot.is-on { background: var(--accent-light); clip-path: inset(0 round 3px); }
.cv__dot:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

/* ===== Before / After（実際のページの見た目をCSSで描く） ===== */
.ba { --p: 50%; }
.ba__view {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #0b0f20;
  touch-action: none;
}
.ba__side { position: absolute; inset: 0; }
/* 左側は「削って出す」。幅を動かさないのでレイアウトが揺れない */
.ba__side--before { clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.ba__lab {
  position: absolute;
  bottom: 10px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(6,9,20,0.82);
  backdrop-filter: blur(4px);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  color: #cfdcff;
  pointer-events: none;
}
.ba__lab--l { left: 10px; }
.ba__lab--r { right: 10px; }
.ba__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--p);
  z-index: 5;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, rgba(234,241,255,0.35), #eaf1ff 30%, #eaf1ff 70%, rgba(234,241,255,0.35));
  pointer-events: none;
}
.ba__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  border: 2px solid #eaf1ff;
  background: rgba(10,14,32,0.72);
  backdrop-filter: blur(5px);
  color: #eaf1ff;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.9);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.ba__view:hover .ba__handle { transform: scale(1.12); }
/* つまみ自体はキーボードで動かせる range。見た目は上の丸が担う */
.ba__range { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; }
.ba__range input { width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba__range input:focus-visible ~ * { outline: none; }
.ba__view:has(.ba__range input:focus-visible) .ba__handle { outline: 2px solid #62c6ff; outline-offset: 3px; }
.ba__hint {
  margin-top: 10px;
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* --- 中に描く「ページの見た目」 --- */
.bam { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.bam u { display: block; border-radius: 2px; }
/* 旧：詰まっていて、色がうるさく、強弱がない */
.bam--old { background: #f2f1ee; padding: 0 0 10px; gap: 7px; }
.bam--old .bam__bar {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 7px 9px;
  background: #cfd4dd;
}
.bam--old .bam__bar i { width: 26px; height: 5px; border-radius: 2px; background: #8c94a6; }
.bam__hero-old {
  display: grid;
  place-items: center;
  height: 27%;
  margin: 0 9px;
  background: repeating-linear-gradient(45deg, #e04a3f 0 9px, #cf3d33 9px 18px);
  color: #fff;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}
.bam__cols { display: flex; gap: 7px; padding: 0 9px; flex: 1; }
.bam__col { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.bam__col u { height: 4px; background: #b3b8c4; }
.bam__col u:nth-child(3n) { background: #c8ccd5; }
.bam__foot-old { display: flex; gap: 6px; padding: 0 9px; }
.bam__foot-old u { flex: 1; height: 8px; background: #9aa1b0; }
/* 新：余白があり、主役が1つに決まっている */
.bam--new { background: #0e1430; padding: 0 0 14px; gap: 14px; }
.bam--new .bam__bar--new {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
}
.bam--new .bam__bar--new b { width: 34px; height: 7px; border-radius: 3px; background: #9d97ff; }
.bam--new .bam__bar--new i { width: 20px; height: 4px; border-radius: 2px; background: rgba(214,230,255,0.35); margin-left: auto; }
.bam--new .bam__bar--new i + i { margin-left: 0; }
.bam__hero-new {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
}
.bam__hero-new em { display: block; width: 62%; height: 13px; border-radius: 4px; background: linear-gradient(90deg, #eaf1ff, #9d97ff); }
.bam__hero-new u { width: 76%; height: 5px; background: rgba(214,230,255,0.3); }
.bam__hero-new u + u { width: 54%; }
.bam__cta { width: 86px; height: 20px; margin-top: 6px; border-radius: 6px; background: linear-gradient(150deg, #3554e8, #1d2f9e); }
.bam__cards { display: flex; gap: 10px; padding: 0 18px; }
.bam__cards div {
  flex: 1;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(157,151,255,0.2);
  background: rgba(255,255,255,0.04);
}

@media (prefers-reduced-motion: reduce) {
  .cv__slide, .cv__slide::after, .cv__btn, .cv__dot, .ba__handle { transition: none; }
}
@media (max-width: 640px) {
  .cv__stage { height: 258px; }
  .cv__slide { width: 90%; }
}

/* ===== 作れるもの：動き・モーションのタブ ===== */
.sc-motion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.sc-card--wide { grid-column: 1 / -1; }
/* トップに置く背景：カード1つぶん（＝画面のおよそ左半分）に収める。
   高さは決め打ちせず比率で決める（横幅が変わっても崩れない）。
   切り替えは絵の下に敷き詰める（カードの中に縦一列を作ると、絵が細く潰れる） */
.bg-stage--mini { gap: 9px; max-width: none; }
.bg-stage--mini .bg-stage__canvas { aspect-ratio: 16 / 11; }
.bg-stage--mini .bg-stage__tabs { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 4px; }
.bg-stage--mini .bg-tab { --cut: 6px; padding: 6px 5px; font-size: 0.64rem; }
.bg-stage--mini .bg-stage__note { font-size: 0.62rem; min-height: 3.2em; }
.bg-stage--mini .bg-stage__side-label,
.bg-stage--mini .bg-stage__count { font-size: 0.5rem; }
/* ★ カードの中にさらに枠を作らない。部品だけを直に並べる */
/* ★背の低いカードの余りを、下に溜めない★
   グリッドは行の中で背の高いカードに高さを合わせる。中身が上に固まったままだと、
   低い方のカードの下だけが大きく空いて見える（「ダウンロードの動き」がそうなっていた）。
   カードを縦の並びにして部品の段を伸ばすと、余りが段の中の余白として散る */
#sc-motion .sc-card { display: flex; flex-direction: column; }
#sc-motion .sc-parts { flex: 1 1 auto; }

/* ★詰めた並び★
   部品を増やしたら、このカードだけ縦に伸びて、隣の「ダウンロードの動き」の下に
   大きな空白ができた（グリッドは背の高い方に高さを合わせるため）。
   隙間・余白・大きいトグルの寸法を詰めて、隣とほぼ同じ高さに戻してある */
.sc-parts--dense {
  gap: 10px 12px;
  padding: 14px 6px;
  min-height: 0;
}
/* 昼夜トグルだけ figure 級に大きいので、この並びの中では一段縮める */
.sc-parts--dense .bb8-toggle { --toggle-size: 12px; }
/* 文字入りの横長は上限を付けて、1行に2つ並ぶようにする */
.sc-parts--dense .ui-iconbar { max-width: 210px; }

.sc-parts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 18px;
  min-height: 104px;
  padding: 20px 10px;
}
/* 数十秒かかる処理向けの、大きめの待ち3つ。
   上の「数秒の待ち」と役割が違うので、細い線で段を分けて置く。
   洗濯機は足が箱の外へ出るので、下の余白は base より少し広く取る */
.sc-parts--long {
  gap: 22px 26px;
  min-height: 0;
  padding: 24px 10px 26px;
  border-top: 1px solid var(--border);
}
/* 切り替えを持たない1種類だけの背景。カードの中に絵だけを置く */
.bg-stage--solo { gap: 0; max-width: none; }
.bg-stage--solo .bg-stage__canvas { aspect-ratio: 16 / 10; }
.bg-stage--solo .bg-stage__view { border-radius: 10px; }
.bg-stage--solo .bg-stage__overlay { align-content: end; padding-bottom: 12px; }
.bg-stage--solo .bg-stage__hint { color: rgba(214,230,255,0.72); text-shadow: 0 2px 12px rgba(2,6,18,0.9); }

/* 別ページの .mo-card をそのまま使うが、トップでは外枠を二重にしない */
.mo-card--bare { border: none; border-radius: 0; background: none; }
.mo-card--bare .mo-card__stage { border-radius: 10px; border-bottom: none; min-height: 118px; }
.mo-card--bare .mo-card__foot { padding: 14px 2px 0; }
.sc-motion-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 118px;
  padding: 22px 18px;
  border-radius: 10px;
  background: radial-gradient(90% 80% at 50% 0%, rgba(70,110,235,0.12), transparent 70%), #080c1c;
}
/* 写真のカードは横いっぱい。中の絵は大きく、説明は右に添える */
.sc-card--media .mo-card__stage--media { min-height: 220px; }
@media (min-width: 861px) {
  .sc-card--media .mo-card__stage--media { padding: 20px; }
  .sc-card--media .md-tilt { width: min(300px, 92%); }
}
.sc-motion-cap {
  margin-top: 14px;
  font-size: 0.74rem;
  line-height: 1.8;
  color: var(--text-muted);
}

/* ---- 5枠目：もっと見る ---- */
.sc-more {
  --cut: 16px;
  position: relative;
  grid-column: 1 / -1;
  display: block;
  overflow: hidden;
  padding: 34px 32px;
  border: 1px solid rgba(157,151,255,0.32);
  clip-path: polygon(0 var(--cut), var(--cut) 0, 100% 0,
    100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  background: linear-gradient(140deg, rgba(26,34,78,0.85), rgba(10,14,32,0.95));
  isolation: isolate;
  transition: border-color 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
/* 中を斜めに流れる光。「押せる」と気づかせるための動き */
.sc-more__bg {
  position: absolute;
  inset: -40%;
  z-index: -1;
  background:
    radial-gradient(42% 60% at 18% 30%, rgba(98,198,255,0.22), transparent 70%),
    radial-gradient(46% 62% at 82% 74%, rgba(157,151,255,0.24), transparent 70%);
  animation: sc-more-drift 12s ease-in-out infinite alternate;
}
@keyframes sc-more-drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.08); }
}
.sc-more__body { position: relative; display: flex; flex-direction: column; gap: 10px; max-width: 46em; }
.sc-more__label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  color: #8fb6ff;
}
.sc-more__title {
  font-family: var(--font-jp);
  font-size: clamp(1.2rem, 2.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.45;
  color: #f2f6ff;
}
.sc-more__desc { font-size: 0.8rem; line-height: 1.9; color: #aab7da; text-wrap: pretty; }
/* ★ 押せることが一目で分かる大きさにする。小さいと「ただの飾り」に見える */
.sc-more__go {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  align-self: flex-start;
  margin-top: 18px;
  padding: 17px 20px 17px 34px;
  border-radius: 100px;
  background: linear-gradient(150deg, #3554e8, #1d2f9e);
  color: #fff;
  font-family: var(--font-jp);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(70,120,240,0.95), 0 0 0 1px rgba(150,190,255,0.28) inset;
  transition: box-shadow 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.sc-more__goT { position: relative; }
/* 斜めの光が一定の間隔で走る＝止まって見えない */
.sc-more__shine {
  position: absolute;
  top: -60%;
  left: -40%;
  width: 40%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.32), transparent);
  rotate: 18deg;
  animation: sc-more-shine 3.6s ease-in-out infinite;
}
@keyframes sc-more-shine {
  0%, 62% { transform: translateX(0); }
  92%, 100% { transform: translateX(460%); }
}
/* 矢印は2本重ねて、押す時に「出ていって次が入ってくる」形にする */
.sc-more__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  overflow: hidden;
}
.sc-more__ring svg { grid-area: 1 / 1; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.sc-more__ring svg:last-child { transform: translateX(-140%); }
.sc-more:focus-visible .sc-more__go,
.sc-more__go:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.sc-more:focus-visible { clip-path: none; outline: 2px solid var(--accent-light); outline-offset: 4px; }
@media (hover: hover) {
  .sc-more:hover { border-color: rgba(157,151,255,0.7); transform: translateY(-3px); }
  .sc-more:hover .sc-more__go { box-shadow: 0 28px 54px -18px rgba(90,150,255,1), 0 0 0 1px rgba(190,220,255,0.55) inset; transform: translateY(-2px); }
  .sc-more:hover .sc-more__ring { background: rgba(255,255,255,0.28); }
  .sc-more:hover .sc-more__ring svg:first-child { transform: translateX(140%); }
  .sc-more:hover .sc-more__ring svg:last-child { transform: translateX(0); }
  .sc-more:hover .sc-more__bg { animation-duration: 5s; }
}

@media (max-width: 860px) {
  .sc-motion-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-more, .sc-more__go, .sc-more__go svg { transition: none; }
  .sc-more__bg { animation: none; }
}

/* トップの「作れるもの」：タブと前置きを詰める（以前の大きさに戻す） */
.showcase .sc-tabs { gap: 6px; margin-bottom: 22px; }
.showcase .sc-tab {
  padding: 8px 14px;
  font-size: 0.78rem;
  gap: 6px;
}
.showcase .sc-tab svg { width: 14px; height: 14px; }
.sc-interactive-intro { margin-bottom: 16px; }
.sc-interactive-lead { font-size: 0.8rem; line-height: 1.8; }
/* 動き・モーションのタブ：カードの間合いも詰める */
.sc-motion-grid { gap: 14px; }
#sc-motion .sc-card { padding: 16px 16px 18px; }
#sc-motion .sc-card__header { margin-bottom: 12px; }
#sc-motion .sc-motion-cap { margin-top: 10px; font-size: 0.72rem; }
#sc-motion .mo-card--bare .mo-card__stage { min-height: 104px; padding: 20px 16px; }
#sc-motion .sc-motion-pair { min-height: 104px; padding: 18px 14px; }


/* ---- 導入文のすぐ下に置く、カタログへの入口 ---- */
.sc-jump {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding: 11px 13px 11px 20px;
  border: 1px solid rgba(157,151,255,0.38);
  border-radius: 100px;
  background: rgba(108,99,255,0.08);
  color: #dbe4ff;
  font-family: var(--font-jp);
  font-size: 0.86rem;
  font-weight: 700;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.sc-jump__a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) {
  .sc-jump:hover { border-color: rgba(157,151,255,0.8); background: rgba(108,99,255,0.18); transform: translateY(-2px); }
  .sc-jump:hover .sc-jump__a { transform: translateX(4px); }
}
.sc-jump:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .sc-more__shine { animation: none; opacity: 0; }
  .sc-more__ring svg, .sc-jump, .sc-jump__a, .sc-more__go { transition: none; }
}
