/*
  e-function.jp Phase 1
  実装設計書: Notion「📜 e-function.jp Phase1 実装設計書 2026-09-20」

  旧デザイン (黒/グレー分割・WORKS・PRODUCT) 用の CSS は全面的に置き換えた。
  唯一そのまま引き継いでいるのは Hero の <E/F> マーク (.hero__mark .part) で、
  設計書の「既存 SVG <E/F> スクロール維持」に従い、寸法・遅延・clip-path の
  出方・Rellax のパララックスを旧実装のまま移植している。

  フォント: エックスサーバー Webフォント (新ゴ R / ゴシックMB101 B)。
  読み込みは BaseLayout.astro の xserver.js。落ちた場合に明朝へ落ちないよう、
  どちらもゴシックのフォールバックを明示する。
*/

:root {
  --bg: #111111;
  --bg-raised: #171717;
  --line: #2a2a2a;
  --line-soft: #1e1e1e;
  --fg: #f2f2f2;
  --fg-dim: #9a9a9a;
  --fg-faint: #6a6a6a;
  --header-solid: #d8d8d8;
  --header-solid-fg: #111111;
  --accent: #ffffff;
  --btn-bg: #3b3d40;
  /* 05 Object の輪を回る光と同じ青 (product.ts の orbit uColor 0x46b4ff) */
  --glow-blue: #46b4ff;

  --font-display: "ゴシックMB101 B", "Gothic MB101", "Yu Gothic", "Yu Gothic UI",
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --font-gothic: "新ゴ R", "Shin Go Regular", "Yu Gothic", "Yu Gothic UI",
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 88px;
  --gutter: 7vw;
  --maxw: 1320px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-gothic);
  font-size: 15px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* 見出しは全てゴシックMB101 B。Webフォントが落ちても明朝に落ちないこと。 */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: 0.01em;
}

/* 視覚的には隠すがアクセシビリティツリーには残す */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ===================================================================
   格子 (設計書 7章: 縦横 1px 格子線 #2a2a2a)
   固定レイヤー。スクロールで動かさず、巨大見出しがこの上に載る。
   =================================================================== */
/* 縦線の間隔ちょうど 1 マス (--grid-step) 分だけ右へ流して折り返す。
   1 マス動いた状態は動く前と同じ絵なので、戻る瞬間が見えない無限ループになる。
   左に 1 マス分はみ出させて描いておき、transform だけで動かす (再描画なし)。 */
.grid-bg {
  --grid-step: 20vw;
  --grid-row: 180px;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.grid-bg::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(-1 * var(--grid-step));
  width: calc(100% + var(--grid-step));
  background-image:
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px var(--grid-step)),
    repeating-linear-gradient(to bottom, var(--line-soft) 0 1px, transparent 1px var(--grid-row));
  will-change: transform;
  animation: grid-drift 30s linear infinite;
}

@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(var(--grid-step), 0, 0); }
}

.page {
  position: relative;
  z-index: 1;
}

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* セクション左のラベル (• SERVICE / • ABOUT) */
.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--fg-dim);
  margin-bottom: 28px;
}

.section-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ===================================================================
   ヘッダー (設計書 8-4: Hero内は透明、抜けたら明灰 200ms)
   =================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  background: transparent;
  color: var(--fg);
  transition: background-color 0.2s linear, color 0.2s linear;
}

.site-header.is-solid {
  background: var(--header-solid);
  color: var(--header-solid-fg);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* PC ではナビと CTA を横一列に。SP では下のメディアクエリでドロワーに畳む。 */
.site-header__menu {
  display: flex;
  align-items: center;
  gap: 34px;
}

.site-header__logo {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.site-nav a {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  position: relative;
  padding: 4px 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* 角丸CTA。ヘッダー / Hero / CONTACT / /contact/ 共通。 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--btn-bg);
  color: #fff;
  border-radius: 999px;
  padding: 0 26px;
  height: 46px;
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  opacity: 0.82;
  transform: translateY(-1px);
}

.btn--lg {
  height: 58px;
  padding: 0 34px;
  font-size: 14.5px;
}

.btn__arrow {
  display: block;
  width: 16px;
  height: 1px;
  background: currentColor;
  position: relative;
}

.btn__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

/* ハンバーガー (SP) */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  margin: 6px auto;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.2s linear;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===================================================================
   Hero
   =================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 40px) 0 120px;
  overflow: hidden;
}

/* 背景: 抽象UIパネルの遅速縦ループ (設計書 8-2)。写真は使わない。 */
.hero__panels {
  position: absolute;
  inset: -10% 0;
  z-index: 0;
  display: flex;
  justify-content: space-between;
  gap: 2vw;
  padding: 0 4vw;
  opacity: 0.5;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 70%, transparent);
}

.hero__col {
  flex: 1 1 0;
  max-width: 220px;
  will-change: transform;
  animation: panel-drift linear infinite;
}

.hero__col:nth-child(1) { animation-duration: 22s; }
.hero__col:nth-child(2) { animation-duration: 28s; animation-direction: reverse; }
.hero__col:nth-child(3) { animation-duration: 18s; }
.hero__col:nth-child(4) { animation-duration: 25s; animation-direction: reverse; }

@keyframes panel-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(0, -50%, 0); }
}

/* パネル1枚 = 抽象的なUI面。中身は罫線だけで作る。 */
.hero__panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  height: 132px;
  margin-bottom: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero__panel span {
  display: block;
  height: 1px;
  background: var(--line);
}

.hero__panel span:nth-child(1) { width: 62%; }
.hero__panel span:nth-child(2) { width: 88%; }
.hero__panel span:nth-child(3) { width: 40%; }

.hero__panel--tall { height: 196px; }
.hero__panel--short { height: 88px; }

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
  gap: 48px;
  align-items: center;
}

.hero__en {
  font-size: clamp(44px, 7.4vw, 104px);
  margin-bottom: 26px;
}

.hero__en span {
  display: block;
}

.hero__ja {
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.95;
  color: var(--fg);
  letter-spacing: 0.04em;
  margin-bottom: 34px;
}

/* <E/F> マーク。旧実装からそのまま移植 (寸法・遅延・clip-path・Rellax)。
   846x384 の実寸で組まれているので、外側で縮小率ぶんの高さを確保してから
   scale する。scale() はレイアウト箱を縮めないため、これをやらないと
   下に余白が残り、SP では CTA と重なる。 */
.hero__mark-wrap {
  position: relative;
  height: 270px; /* 384*0.55 + part04 のはみ出し 100*0.55 */
  /* 飾りなので、ドラッグ選択・画像ドラッグ・長押しメニューの対象にしない */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.hero__mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 846px;
  height: 384px;
  transform: scale(0.55);
  transform-origin: left top;
}

.hero__mark .part {
  position: absolute;
  bottom: 0;
  width: 160px;
  opacity: 0;
  clip-path: inset(0 0 0 100%);
  transition: clip-path 1s cubic-bezier(0.79, 0.17, 0.15, 0.96);
}

main.active .hero__mark .part {
  opacity: 1;
  clip-path: inset(0);
}

.hero__mark .part img {
  width: 100%;
  -webkit-user-drag: none;
  transition: transform 0.2s linear;
}

.hero__mark .part.part01 { left: 0; transition-delay: 1.5s; }
.hero__mark .part.part01 img { height: 384px; }
.hero__mark .part.part02 { width: 160px; left: 200px; bottom: 150px; transition-delay: 1.6s; }
.hero__mark .part.part03 { width: 400px; left: 235px; transition-delay: 1.7s; }
.hero__mark .part.part03 img { height: 384px; }
.hero__mark .part.part04 { left: 460px; width: 160px; bottom: -100px; transition-delay: 1.8s; }
.hero__mark .part.part04 img { height: 384px; }
.hero__mark .part.part05 { left: 662px; transition-delay: 1.9s; }
.hero__mark .part.part05 img { height: 384px; }

/* SCROLL — 縦書きラベルの下で、線が上から伸びて下へ抜けるループ。
   https://codepen.io/junpei-sugiyama/pen/jOROeme の組み方
   (::after が下地の線、::before が伸び縮みする線)。 */
.hero__scroll {
  --scroll-line: 100px;
  position: absolute;
  right: clamp(18px, 2.6vw, 44px);
  bottom: calc(var(--scroll-line) + 15px + 36px);
  z-index: 2;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  line-height: 1;
  color: var(--fg-dim);
  writing-mode: vertical-rl;
}

.hero__scroll::before,
.hero__scroll::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--scroll-line) - 15px);
  margin: auto;
  width: 1px;
  height: var(--scroll-line);
}

.hero__scroll::before {
  z-index: 2;
  background: var(--fg);
  animation: hero-scroll 2s infinite;
}

.hero__scroll::after {
  background: var(--line);
}

@keyframes hero-scroll {
  0% { transform: scale(1, 0); transform-origin: 0 0; }
  50% { transform: scale(1, 1); transform-origin: 0 0; }
  51% { transform: scale(1, 1); transform-origin: 0 100%; }
  100% { transform: scale(1, 0); transform-origin: 0 100%; }
}

/* ===================================================================
   セクション共通
   =================================================================== */
.section {
  padding: 132px 0;
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section__head {
  margin-bottom: 64px;
}

.section__title {
  font-size: clamp(34px, 5.4vw, 74px);
  margin-bottom: 22px;
}

.section__lead {
  font-size: clamp(14.5px, 1.5vw, 18px);
  color: var(--fg);
  max-width: 44em;
  line-height: 1.95;
}

/* ===================================================================
   SERVICE — 作る / 回す / 任せる
   =================================================================== */
/* 作る / 回す / 任せる — handmaid/004-loopstack の S1 ループを移植。
   .svc-loop を縦に長く取り、stage を sticky で留めてスクロール量で進める
   (動作は src/scripts/service-loop.ts)。 */
.svc {
  --loop-accent: var(--glow-blue);
  --loop-accent-glow: rgba(70, 180, 255, 0.7);
  padding-bottom: 0;
}

.svc .section__head {
  margin-bottom: 0;
}

.svc-loop {
  position: relative;
  height: 320vh;
}

.svc-loop__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: calc(var(--header-h) + 16px) 0 32px;
}

.svc-loop__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: center;
}

/* 3つを同じセルに重ねる。高さはいちばん長いフェーズに合う。 */
.svc-phases {
  display: grid;
}

.svc-phase {
  grid-area: 1 / 1;
  opacity: 0;
  filter: blur(20px);
  transition: opacity 0.35s ease, filter 0.35s ease;
  pointer-events: none;
}

.svc-phase.is-active {
  opacity: 1;
  filter: none;
  transition: none;
  pointer-events: auto;
}

.svc-phase__no {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--fg-faint);
}

.svc-phase__title {
  font-size: clamp(40px, 5vw, 72px);
  margin-top: 14px;
}

/* 見出しは切替のたびに下から上がる */
.svc-phase.is-active .svc-phase__title {
  animation: svc-rise 1.1s var(--ease) both;
}

.svc-phase__text,
.svc-phase__list {
  opacity: 0;
  transform: translateY(1rem);
}

.svc-phase.is-active .svc-phase__text,
.svc-phase.is-active .svc-phase__list {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s var(--ease) 0.25s, transform 1.1s var(--ease) 0.25s;
}

.svc-phase.is-active .svc-phase__list {
  transition-delay: 0.4s;
}

.svc-phase__text {
  margin-top: 22px;
  font-size: 14.5px;
  color: var(--fg);
  line-height: 1.95;
  max-width: 30em;
}

.svc-phase__list {
  margin-top: 20px;
  max-width: 30em;
}

.svc-phase__list li {
  font-size: 13.5px;
  color: var(--fg-dim);
  padding-left: 16px;
  position: relative;
  line-height: 1.85;
}

.svc-phase__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 6px;
  height: 1px;
  background: var(--fg-faint);
}

@keyframes svc-rise {
  0% { opacity: 0; transform: translateY(60%); filter: blur(16px); }
  30% { opacity: 1; }
  100% { opacity: 1; transform: none; filter: none; }
}

/* 右: 円 */
.svc-ring {
  --d: min(56vmin, 30rem);
  position: relative;
  width: calc(var(--d) + 4.4rem);
  aspect-ratio: 1;
  margin-inline: auto;
}

.svc-ring__inner {
  position: absolute;
  left: 2.2rem;
  top: 2.2rem;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  transform: scale(0.72);
  will-change: transform;
}

.svc-ring__rows {
  position: absolute;
  inset: 0;
  mask-image: radial-gradient(circle, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 100%);
}

.svc-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.svc-ring__track {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
}

/* viewBox(100) 単位。円の直径 ~30rem で約 1.5px になる */
.svc-ring__arc {
  stroke: var(--loop-accent);
  stroke-width: 0.3;
  stroke-linecap: round;
}

.svc-ring__tip {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--loop-accent);
  animation: svc-pulse 2s infinite ease-in-out;
}

.svc-ring__tip::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: var(--loop-accent);
  opacity: 0.45;
  animation: svc-wave 2s infinite ease-in-out;
}

.svc-ring__node {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: #fff;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.svc-ring__node.is-on {
  background: var(--loop-accent);
  box-shadow: 0 0 10px var(--loop-accent-glow);
}

.svc-ring__label {
  position: absolute;
  font-size: 12.5px;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

.svc-ring__label small {
  display: block;
  color: var(--fg-faint);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.svc-loop__meter {
  position: absolute;
  right: var(--gutter);
  bottom: 28px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
}

.svc-loop__meter.is-done {
  color: var(--loop-accent);
}

@keyframes svc-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes svc-wave {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.3); opacity: 0; }
}

.svc-note {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--fg-faint);
}

/* ===================================================================
   How we work (SERVICE 内。設計書の改訂で ABOUT には置かない)
   =================================================================== */
.hww {
  margin-top: 96px;
}

.hww__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.hww__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
}

.hww__viewport {
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding-top: 34px;
}

.hww__track {
  display: flex;
  gap: 28px;
  transition: transform 700ms var(--ease);
  will-change: transform;
}

.hww__item {
  flex: 0 0 calc((100% - 84px) / 4);
  min-width: 0;
  opacity: 0.35;
  transition: opacity 700ms var(--ease);
}

.hww__item.is-active {
  opacity: 1;
}

.hww__item-num {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--fg-faint);
  margin-bottom: 12px;
}

.hww__item-en {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 42px);
  margin-bottom: 10px;
}

.hww__item-ja {
  font-size: 12.5px;
  color: var(--fg-dim);
  line-height: 1.8;
}

/* ===================================================================
   ABOUT — リード一文 + 強み3 + 会社概要
   (設計書の確定により見出しと旧本文は置かない)
   =================================================================== */
.about__lead {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.2vw, 44px);
  line-height: 1.5;
  max-width: 22em;
}

.strength {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin: 80px 0 96px;
}

.strength__num {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--fg-faint);
  margin-bottom: 14px;
}

.strength__title {
  font-family: var(--font-display);
  font-size: 19px;
  margin-bottom: 10px;
  line-height: 1.55;
}

.strength__text {
  font-size: 13.5px;
  color: var(--fg-dim);
}

.company {
  border-top: 1px solid var(--line);
}

.company__row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.company__row dt {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
}

.company__row dd {
  font-size: 14.5px;
}

/* ===================================================================
   CONTACT teaser
   =================================================================== */
.teaser {
  text-align: center;
  padding: 140px 0;
  border-top: 1px solid var(--line);
}

.teaser__title {
  font-size: clamp(40px, 7vw, 92px);
  margin-bottom: 26px;
}

.teaser__text {
  font-size: clamp(14px, 1.5vw, 17px);
  color: var(--fg-dim);
  margin-bottom: 40px;
  line-height: 1.95;
}

/* ===================================================================
   Footer
   =================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  background: var(--bg-raised);
}

.site-footer__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 38px;
}

.site-footer__name {
  font-family: var(--font-display);
  font-size: 17px;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.site-footer__addr {
  font-size: 13px;
  color: var(--fg-dim);
  font-style: normal;
}

.site-footer__links {
  display: flex;
  gap: 26px;
  font-size: 13px;
  color: var(--fg-dim);
  flex-wrap: wrap;
}

.site-footer__links a:hover {
  color: var(--fg);
}

.site-footer__copy {
  font-size: 11.5px;
  color: var(--fg-faint);
  letter-spacing: 0.06em;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

/* ===================================================================
   /privacy/
   =================================================================== */
.doc {
  padding: calc(var(--header-h) + 90px) var(--gutter) 130px;
}

.doc__title {
  font-size: clamp(34px, 5vw, 62px);
  margin-bottom: 18px;
}

.doc__meta {
  font-size: 12.5px;
  color: var(--fg-faint);
  margin-bottom: 64px;
}

.doc h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 52px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.doc p,
.doc li {
  font-size: 14.5px;
  color: var(--fg-dim);
  line-height: 2;
  max-width: none;
}

.doc ul {
  margin-top: 8px;
}

.doc li {
  padding-left: 16px;
  position: relative;
}

.doc li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95em;
  width: 6px;
  height: 1px;
  background: var(--fg-faint);
}

.doc a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===================================================================
   登場アニメーション (設計書 8-1: 40px fade-up 700ms、JA は 120ms 遅らせ)
   =================================================================== */
html.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

html.js [data-reveal="delay"] {
  transition-delay: 120ms;
}

html.js [data-reveal].is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* JS が動かなかった場合 (無効・読み込み失敗・実行時エラー) は最終状態で出す。
   html.js は BaseLayout のインラインスクリプトが付け、3秒ウォッチドッグで外す。 */
html:not(.js) [data-reveal],
html:not(.js) .hero__mark .part {
  opacity: 1;
  transform: none;
  clip-path: none;
}

html:not(.js) .site-header {
  background: var(--header-solid);
  color: var(--header-solid-fg);
}

/* ===================================================================
   prefers-reduced-motion (設計書 8章: 2〜5 を停止)
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hero__col,
  .grid-bg::before {
    animation: none;
  }

  .hero__mark .part {
    transition: none;
    opacity: 1;
    clip-path: none;
  }

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .site-header {
    transition: none;
  }

  /* 自動送りなしで4列固定 */
  .hww__track {
    transition: none;
    transform: none !important;
    flex-wrap: wrap;
  }

  .hww__item {
    opacity: 1;
  }

  .hero__scroll::before {
    animation: none;
  }

  /* SERVICE: sticky を外して 01〜03 を縦に並べる */
  .svc-loop {
    height: auto;
  }

  .svc-loop__stage {
    position: static;
    height: auto;
    padding: 64px 0 0;
  }

  .svc-phases {
    display: flex;
    flex-direction: column;
    gap: 56px;
  }

  .svc-phase,
  .svc-phase__text,
  .svc-phase__list {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none !important;
    transition: none !important;
  }

  .svc-ring__inner {
    transform: none;
  }

  .svc-ring__tip,
  .svc-ring__tip::after,
  .svc-loop__meter {
    display: none;
  }
}

/* ===================================================================
   Responsive
   =================================================================== */
@media screen and (max-width: 1100px) {
  :root {
    --gutter: 6vw;
  }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .hero__mark-wrap {
    height: 232px;
  }

  .hero__mark {
    transform: scale(0.47);
  }

  .svc-loop__stage {
    align-items: start;
  }

  .svc-loop__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .svc-ring {
    --d: min(44vw, 38svh);
    order: -1;
  }

  .svc-phase__title {
    font-size: clamp(30px, 5vw, 44px);
    margin-top: 8px;
  }

  .svc-phase__text {
    margin-top: 10px;
  }

  .svc-phase__list {
    margin-top: 10px;
  }

  .strength {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hww__item {
    flex-basis: calc((100% - 28px) / 2);
  }
}

@media screen and (max-width: 750px) {
  :root {
    --gutter: 22px;
    --header-h: 68px;
  }

  body {
    font-size: 14px;
  }

  .grid-bg {
    --grid-step: 33.33vw;
    --grid-row: 140px;
  }

  /* SP ではナビをドロワーに畳む */
  .nav-toggle {
    display: block;
  }

  .site-header__menu {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 30px;
    display: grid;
    gap: 4px;
    transform: translate3d(0, -12px, 0);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
    color: var(--fg);
  }

  .site-header__menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav a {
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    letter-spacing: 0.1em;
  }

  .site-nav a::after {
    display: none;
  }

  .site-header__menu .btn {
    margin-top: 18px;
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding: calc(var(--header-h) + 64px) 0 96px;
  }

  .hero__panels {
    padding: 0;
    opacity: 0.35;
  }

  /* CTA とマークが白同士で接してしまうので、SP では間隔を広めに取る */
  .hero__mark-wrap {
    height: 168px;
    margin-top: 56px;
  }

  .hero__mark {
    transform: scale(0.32);
  }

  .hero__scroll {
    display: none;
  }

  .section {
    padding: 82px 0;
  }

  .section__head {
    margin-bottom: 40px;
  }


  .svc-ring {
    --d: min(52vw, 30svh);
  }

  .svc-ring__label {
    display: none;
  }

  .svc-phase__text {
    font-size: 13px;
    line-height: 1.8;
  }

  .svc-phase__list li {
    font-size: 12px;
    line-height: 1.7;
  }

  .svc-loop__meter {
    bottom: 14px;
  }

  .hww {
    margin-top: 64px;
  }

  .hww__item {
    flex-basis: 100%;
  }

  .strength {
    margin: 52px 0 64px;
  }

  .company__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 18px 0;
  }

  .teaser {
    padding: 92px 0;
  }

  .site-footer__grid {
    flex-direction: column;
    gap: 22px;
  }

  .doc {
    padding: calc(var(--header-h) + 56px) var(--gutter) 90px;
  }
}

/* ===================================================================
   サンプル比較用 (/samples/)。本番トップには出ない。
   Hero 背景差し替え5案の共通土台。
   =================================================================== */
.hero__fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 76%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 76%, transparent);
}

.hero__fx canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* The complete brand is one stable composition, shared with the particle silhouette. */
.hero .hero__mark-wrap--stable {
  width: min(100%, 480px);
  height: auto;
  aspect-ratio: 846 / 594;
}
.hero__signature { display: block; width: 100%; height: auto; transition: opacity 0.5s ease; }
.hero[data-particle-ready="true"] .hero__signature { opacity: .14; animation: hero-signature-breathe 5s ease-in-out infinite; }
@keyframes hero-signature-breathe {
  0%, 100% { opacity: .20; }
  50% { opacity: .08; }
}
@media screen and (max-width: 760px) {
  .hero .hero__mark-wrap--stable { width: min(66vw, 260px); margin-top: 24px; }
  .hero { padding-bottom: max(72px, env(safe-area-inset-bottom)); }
}
.hero__fx[data-fx="particles"] {
  mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .hero__signature { transition: none; }
  .hero[data-particle-ready="true"] .hero__signature { animation: none; opacity: .14; }
}

/* 04 loopstack: 流れ続ける行 */
.fx-row {
  position: absolute;
  left: 0;
  white-space: nowrap;
  display: flex;
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  color: var(--fg);
  will-change: transform;
}

.fx-row span {
  padding-right: 2em;
}

/* サンプル一覧 */
.samples {
  padding: calc(var(--header-h) + 80px) 0 120px;
}

.samples__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 48px;
}

.samples__card {
  background: var(--bg);
  padding: 30px 26px 34px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color 0.25s var(--ease);
}

.samples__card:hover {
  background: var(--bg-raised);
}

.samples__num {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--fg-faint);
}

.samples__name {
  font-family: var(--font-display);
  font-size: 23px;
}

.samples__tech {
  font-size: 12px;
  color: var(--fg-dim);
}

.samples__desc {
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.85;
}

.samples__cost {
  margin-top: auto;
  padding-top: 14px;
  font-size: 11.5px;
  color: var(--fg-faint);
  border-top: 1px solid var(--line);
}

/* サンプルであることを常に見せておく帯 */
.sample-flag {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: var(--accent);
  color: #111;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.sample-flag a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Concrete services; workflow content lives in its own section. */
.service-offers .section__title {
  font-size: clamp(30px, 4.2vw, 60px);
  line-height: 1.3;
  letter-spacing: 0.02em;
}
.service-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.service-card { min-width: 0; display: flex; flex-direction: column; background: var(--bg-raised); border: 1px solid var(--line); }
.service-card__image { aspect-ratio: 3 / 2; overflow: hidden; background: #171b20; border-bottom: 1px solid var(--line); }
.service-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.service-card__body { display: flex; flex: 1; flex-direction: column; padding: 28px; }
.service-card__eyebrow { color: #aaa; font-size: 10.5px; letter-spacing: 0.11em; line-height: 1.6; }
.service-card__title { margin: 14px 0 20px; font-size: clamp(25px, 2.2vw, 33px); line-height: 1.35; }
.service-card__text { font-size: 14.5px; line-height: 1.95; }
.service-card__list { margin: 22px 0 28px; font-size: 13px; color: #bbb; line-height: 1.85; }
.service-card__list li { padding-left: 13px; position: relative; }
.service-card__list li::before { content: ''; position: absolute; left: 0; top: 0.85em; width: 5px; height: 1px; background: var(--glow-blue); }
.service-card__link { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.service-card__link span { color: var(--glow-blue); }
.service-card__link:hover, .service-workflow-link:hover { color: var(--glow-blue); }
.service-card__link:focus-visible, .service-workflow-link:focus-visible, .workflow-motion__toggle:focus-visible { outline: 2px solid var(--glow-blue); outline-offset: 6px; }
.service-card:focus-within { border-color: var(--glow-blue); }
.service-workflow-link { display: inline-flex; gap: 28px; margin-top: 34px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.service-workflow-link span { color: var(--glow-blue); }

.workflow .svc-phase__title { font-size: clamp(30px, 3.1vw, 48px); line-height: 1.35; }
.workflow .svc-phase__text { font-size: 15px; }
.workflow .svc-phase__list li { font-size: 14px; }
.workflow .section__title { margin-bottom: 16px; }
@media (min-width: 751px) and (min-height: 781px) and (prefers-reduced-motion: no-preference) {
  html.js .workflow .svc-loop__stage { padding-bottom: 112px; }
}
.workflow-ring-wrap { min-width: 0; }
.svc-ring { outline: none; }
.svc-ring:focus-visible { outline: 2px solid var(--glow-blue); outline-offset: 12px; border-radius: 50%; }
.svc-ring__texture { position: absolute; inset: 0; opacity: 0.25; background-image: linear-gradient(#38444b 1px, transparent 1px), linear-gradient(90deg, #38444b 1px, transparent 1px); background-size: 36px 36px; }
.svc-ring__skills { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 70%; z-index: 1; }
.svc-ring__skills-title { color: var(--glow-blue); text-align: center; font-size: 13px; letter-spacing: 0.12em; margin-bottom: 16px; }
.svc-skill-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.svc-skill-list li { font-size: 15px; line-height: 1.6; color: #e1e5e8; white-space: nowrap; }
.svc-ring.is-reduced-motion .svc-ring__rows,
html:not(.js) .workflow .svc-ring__rows { display: none; }
.svc-ring.is-reduced-motion .svc-skill-list,
html:not(.js) .workflow .svc-skill-list {
  left: 50%; top: 50%; width: 70%; height: auto; margin: 0;
  clip: auto; clip-path: none; overflow: visible; white-space: normal;
  transform: translate(-50%, -50%); z-index: 1;
}
.svc-ring.is-motion-paused .svc-ring__tip, .svc-ring.is-motion-paused .svc-ring__tip::after { animation-play-state: paused; }
.workflow-motion { width: min(100%, 30rem); margin: 24px auto 0; text-align: center; }
.workflow-motion__toggle { font: inherit; font-size: 13px; line-height: 1.5; color: var(--fg); background: var(--btn-bg); border: 1px solid #6a6e73; padding: 10px 18px; cursor: pointer; }
.workflow-motion__toggle:hover { border-color: var(--glow-blue); }
.workflow-motion__toggle:disabled { cursor: default; color: #c5c9cd; }
.workflow-motion p { margin-top: 12px; font-size: 12px; line-height: 1.8; color: #aaa; }
.workflow .hww { margin: 64px 0 96px; }
.workflow .hww[hidden] { display: none; }
.hww-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; padding-top: 32px; border-top: 1px solid var(--line); }
.hww-summary .hww__item-ja { font-size: 14px; color: #bbb; }

@media (max-width: 1100px) {
  .service-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-card:last-child { grid-column: 1 / -1; width: auto; justify-self: stretch; }
  .workflow-ring-wrap { order: -1; }
  .workflow .svc-ring { --d: min(44vw, 38svh); }
  .svc-skill-list { gap: 2px 16px; }
  .svc-skill-list li { font-size: 13.5px; }
}
@media (max-width: 750px) {
  .service-cards { grid-template-columns: minmax(0, 1fr); }
  .service-card:last-child { grid-column: auto; width: auto; justify-self: stretch; }
  .service-card__body { padding: 24px; }
  .service-card__title { font-size: 28px; }
  .workflow .svc-ring { --d: min(74vw, 19rem); width: calc(var(--d) + 3rem); }
  .workflow .svc-ring__inner { left: 1.5rem; top: 1.5rem; }
  .svc-ring__skills { width: 70%; }
  .svc-ring__skills-title { margin-bottom: 12px; }
  .svc-skill-list { gap: 3px 14px; }
  .svc-skill-list li { font-size: 13.5px; }
  .workflow .hww { margin: 48px 0 64px; }
  .hww-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 22px; }
}
/* Short/phone viewports expose every process paragraph; no sticky clipping. */
@media (max-width: 750px), (max-height: 780px) {
  .workflow .svc-loop { height: auto; }
  .workflow .svc-loop__stage { position: relative; height: auto; overflow: visible; padding: 32px 0 0; }
  .workflow .svc-loop__grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .workflow-ring-wrap { order: -1; }
  .workflow .svc-phases { display: flex; flex-direction: column; gap: 48px; }
  .workflow .svc-phase { opacity: 1; filter: none; pointer-events: auto; }
  .workflow .svc-phase__title, .workflow .svc-phase__text, .workflow .svc-phase__list { opacity: 1; transform: none; filter: none; animation: none !important; transition: none !important; }
  .workflow .svc-loop__meter { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .workflow .svc-loop__stage { overflow: visible; }
  .workflow .svc-loop__grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .workflow-ring-wrap { order: -1; }
}
html:not(.js) .workflow .svc-loop { height: auto; }
html:not(.js) .workflow .svc-loop__stage { position: relative; height: auto; overflow: visible; padding: 32px 0 0; }
html:not(.js) .workflow .svc-phases { display: flex; flex-direction: column; gap: 48px; }
html:not(.js) .workflow .svc-phase, html:not(.js) .workflow .svc-phase__text, html:not(.js) .workflow .svc-phase__list { opacity: 1; filter: none; transform: none; pointer-events: auto; }
html:not(.js) .workflow .svc-loop__meter, html:not(.js) .workflow .workflow-motion__toggle { display: none; }
