:root {
  --bg: #070b14;
  --bg-alt: #0c1220;
  --surface: #111a2c;
  --border: rgba(120, 160, 220, 0.14);
  --text: #e6edf7;
  --text-sub: #8d9bb3;
  --accent: #22d3ee;
  --accent-2: #3b82f6;
  --gradient: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  --radius: 14px;
  --header-h: 72px;
  --font-en: "Inter", sans-serif;
  --font-ja: "Noto Sans JP", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 780px; }
.accent { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
/* ぼかし背景は疑似要素に持たせる。header 自体に backdrop-filter を付けると、
   中の position: fixed（スマホメニュー）がヘッダーの高さに閉じ込められるため */
.header::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transition: opacity .3s;
}
.header.is-scrolled { border-bottom-color: var(--border); }
.header.is-scrolled::before { opacity: 1; }
.header__inner { position: relative; height: 100%; display: flex; align-items: center; justify-content: space-between; }

.logo { font-family: var(--font-en); font-weight: 800; font-size: 1.4rem; letter-spacing: .04em; }
.logo span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 32px; font-size: .92rem; }
.nav a { color: var(--text-sub); transition: color .2s; }
.nav a:hover { color: var(--text); }
.nav .nav__cta {
  color: var(--bg); background: var(--gradient);
  padding: 8px 20px; border-radius: 999px; font-weight: 700;
}
.nav .nav__cta:hover { color: var(--bg); opacity: .9; }

.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 32px; border-radius: 999px; font-weight: 700;
  font-size: 1rem; font-family: inherit; cursor: pointer; border: none;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn--primary { background: var(--gradient); color: var(--bg); box-shadow: 0 8px 30px rgba(34, 211, 238, .25); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(34, 211, 238, .4); }
.btn--ghost { border: 1px solid var(--border); color: var(--text); background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; overflow: hidden;
  padding: calc(var(--header-h) + 40px) 0 80px;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%);
}
.hero__glow {
  position: absolute; width: 640px; height: 640px; right: -120px; top: 5%;
  background: radial-gradient(circle, rgba(34,211,238,.22) 0%, rgba(59,130,246,.12) 40%, transparent 70%);
  filter: blur(20px);
  animation: float 10s ease-in-out infinite;
}
@keyframes float { 50% { transform: translate(-30px, 30px); } }

.hero__inner { position: relative; }
.hero__label {
  font-family: var(--font-en); font-size: .8rem; letter-spacing: .25em;
  color: var(--accent); margin-bottom: 24px;
}
.hero__title {
  font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 700;
  line-height: 1.25; letter-spacing: .02em; margin-bottom: 28px;
}
/* キャッチコピーを1文字ずつ表示（文字の分割と遅延は main.js） */
.hero__title .char {
  display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(.35em);
  animation: char-in .9s cubic-bezier(.22, .61, .36, 1) forwards;
}
@keyframes char-in { to { opacity: 1; filter: blur(0); transform: none; } }
.hero__title.is-split .accent { background: none; }
.hero__title .accent .char {
  background-image: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* 分割前のチラつき防止。JSが動かなかった場合も1.5秒後には表示する */
.js .hero__title:not(.is-split) { visibility: hidden; animation: title-fallback 0s 1.5s forwards; }
@keyframes title-fallback { to { visibility: visible; } }

.hero__lead { color: var(--text-sub); font-size: clamp(1rem, 1.6vw, 1.15rem); margin-bottom: 44px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 14px;
}
.hero__scroll span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--accent); animation: scroll 1.8s infinite;
}
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Section ---------- */
.section { padding: 120px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { text-align: center; margin-bottom: 64px; }
.section__en {
  font-family: var(--font-en); font-weight: 600; font-size: .8rem;
  letter-spacing: .3em; color: var(--accent); margin-bottom: 8px;
}
.section__title { font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 700; }
.section__desc { color: var(--text-sub); margin-top: 20px; }

/* ---------- Services ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  position: relative; padding: 40px 32px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .3s, border-color .3s;
}
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--gradient); border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0; transition: opacity .3s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(34,211,238,.35); }
.card:hover::before { opacity: 1; }
.card__icon {
  width: 56px; height: 56px; border-radius: 12px; margin-bottom: 24px;
  display: grid; place-items: center;
  background: rgba(34, 211, 238, .08); border: 1px solid rgba(34, 211, 238, .25);
}
.card__icon svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card__title { font-size: 1.3rem; margin-bottom: 14px; }
.card__text { color: var(--text-sub); font-size: .95rem; margin-bottom: 24px; }
.card__tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.card__tags li {
  font-size: .75rem; padding: 4px 12px; border-radius: 999px;
  color: var(--accent); background: rgba(34, 211, 238, .08);
}

/* ---------- Strengths ---------- */
.strengths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.strength { border-top: 1px solid var(--border); padding-top: 28px; }
.strength__num {
  display: block; font-family: var(--font-en); font-weight: 800; font-size: 3rem; line-height: 1;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 20px;
}
.strength__title { font-size: 1.15rem; margin-bottom: 12px; }
.strength p { color: var(--text-sub); font-size: .95rem; }

/* ---------- Works ---------- */
/* 中央に1枚、左右の案件は両端でフェードアウト。ループ処理は main.js */
.works-slider { --card-w: 380px; --gap: 24px; position: relative; }
.works-viewport {
  overflow: hidden; padding: 10px 0;
  touch-action: pan-y;               /* 縦スクロールはブラウザ、横フリックはJSで処理 */
  cursor: grab; user-select: none; -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
}
.works-viewport:focus-visible { outline: none; }
.works-viewport:focus-visible .work.is-current { border-color: var(--accent); }
.works-viewport.is-dragging { cursor: grabbing; }
.works {
  display: flex; gap: var(--gap); width: max-content;
  transition: transform .5s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.works.no-anim { transition: none; }

.works-arrow {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(17, 26, 44, .92); border: 1px solid rgba(34,211,238,.4); color: var(--text);
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
  transition: border-color .2s, color .2s, background .2s;
}
/* 画面の左右端 */
.works-arrow--prev { left: 24px; }
.works-arrow--next { right: 24px; }
.works-arrow:hover { border-color: var(--accent); color: var(--accent); background: rgba(17, 26, 44, 1); }
.works-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.works-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.work {
  flex: 0 0 var(--card-w);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .3s, border-color .3s;
}
.work:hover { transform: translateY(-6px); border-color: rgba(34,211,238,.35); }
.work__visual {
  aspect-ratio: 16 / 9; overflow: hidden;
  background:
    radial-gradient(circle at 80% 20%, rgba(34,211,238,.14), transparent 60%),
    linear-gradient(160deg, #0f1a30, #0a1122);
  border-bottom: 1px solid var(--border);
}
.work__visual img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.work__visual .mock { width: 100%; height: 100%; }

.mock { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mock__frame { fill: rgba(7,11,20,.6); stroke: rgba(120,160,220,.3); stroke-width: 1.5; }
.mock__line { stroke: rgba(141,155,179,.35); stroke-width: 4; }
.mock__fill { fill: rgba(120,160,220,.08); }
.mock__soft { fill: rgba(120,160,220,.12); }
.mock__accent { fill: var(--accent); opacity: .75; }
.mock__accent-line { stroke: var(--accent); stroke-width: 6; opacity: .8; }
.mock__dot { fill: rgba(141,155,179,.4); }
.mock__arrow { stroke: var(--accent); stroke-width: 2; }
.mock__check { stroke: var(--accent); stroke-width: 5; }

.work__body { display: flex; flex-direction: column; flex: 1; padding: 24px 24px 28px; }
.work__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.work__badge {
  font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 4px;
  color: var(--accent); border: 1px solid rgba(34,211,238,.45);
}
.work__cat { font-size: .78rem; color: var(--text-sub); }
.work__title { font-size: 1.12rem; line-height: 1.5; margin-bottom: 8px; }
.work__catch { font-weight: 700; font-size: .95rem; color: var(--accent); margin-bottom: 12px; }
.work__text { color: var(--text-sub); font-size: .9rem; margin-bottom: 16px; }
.work__info { display: flex; gap: 12px; margin: auto 0 14px; font-size: .85rem; }
.work__info dt { color: var(--text-sub); flex-shrink: 0; }
.work__info dd { margin: 0; }
.work__tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.work__tags li {
  font-size: .72rem; padding: 3px 10px; border-radius: 999px;
  color: var(--text-sub); background: rgba(120,160,220,.08);
}

/* ---------- Flow ---------- */
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: none; }
.flow__item {
  position: relative; padding: 32px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.flow__item:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; right: -15px; z-index: 1;
  width: 10px; height: 10px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
}
.flow__step { font-family: var(--font-en); font-size: .75rem; font-weight: 600; letter-spacing: .15em; color: var(--accent); }
.flow__item h3 { font-size: 1.15rem; margin: 8px 0 10px; }
.flow__item p { color: var(--text-sub); font-size: .9rem; }

/* ---------- Company ---------- */
.company { margin: 0; border-top: 1px solid var(--border); }
.company__row { display: grid; grid-template-columns: 180px 1fr; border-bottom: 1px solid var(--border); padding: 22px 8px; }
.company dt { color: var(--text-sub); font-weight: 500; }
.company dd { margin: 0; }

/* ---------- Form ---------- */
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 48px; }
.form__row { margin-bottom: 24px; }
.form label { display: block; font-size: .92rem; font-weight: 500; margin-bottom: 8px; }
.req {
  display: inline-block; font-size: .7rem; padding: 1px 8px; margin-left: 6px; border-radius: 4px;
  background: var(--accent); color: var(--bg); vertical-align: middle;
}
.form input, .form select, .form textarea {
  width: 100%; padding: 14px 16px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.form textarea { resize: vertical; min-height: 160px; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15);
}
.form .is-invalid { border-color: #f87171; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__error { color: #f87171; font-size: .9rem; margin-bottom: 16px; }
.form__captcha { min-height: 65px; margin-bottom: 20px; } /* ウィジェット表示前後で高さが変わらないように */

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__copy { color: var(--text-sub); font-size: .8rem; font-family: var(--font-en); }

/* ---------- Reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .works { transition: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero__glow, .hero__scroll span { animation: none; }
  .hero__title .char { animation: none; opacity: 1; filter: none; transform: none; }
}

/* ---------- Simple page (thanks / error) ---------- */
.simple { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 40px 24px; }
.simple__title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 16px 0 20px; }
.simple p { color: var(--text-sub); margin-bottom: 36px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .cards, .strengths { grid-template-columns: 1fr; }
  .strengths { gap: 32px; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow__item::after { display: none; }
}

@media (max-width: 768px) {
  :root { --header-h: 64px; }
  .pc-only { display: none; }

  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    position: relative; z-index: 110; /* 開いたメニューの上に×ボタンを出す */
    width: 44px; height: 44px; padding: 10px; background: none; border: none; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--text); transition: transform .3s, opacity .3s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav {
    position: fixed; inset: 0; z-index: 105; flex-direction: column; justify-content: center; gap: 28px;
    background: rgba(7, 11, 20, .97); font-size: 1.1rem;
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .nav.is-open { opacity: 1; visibility: visible; }

  .section { padding: 80px 0; }
  .section__head { margin-bottom: 44px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__glow { width: 400px; height: 400px; right: -160px; }
  .flow { grid-template-columns: 1fr; }
  .works-slider { --card-w: min(78vw, 340px); --gap: 14px; }
  .works-viewport {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  }
  .works-arrow { width: 42px; height: 42px; }
  .works-arrow--prev { left: 8px; }
  .works-arrow--next { right: 8px; }
  .company__row { grid-template-columns: 1fr; gap: 4px; padding: 18px 4px; }
  .form { padding: 28px 20px; }
  .footer__inner { flex-direction: column; text-align: center; }
}
