:root {
  --blue: #123996;
  --blue-deep: #082567;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, .68);
  --faint: rgba(255, 255, 255, .45);
  --line: rgba(255, 255, 255, .17);
  --line-strong: rgba(255, 255, 255, .38);
  --accent: #bfd4ff;
  --accent-dim: rgba(191, 212, 255, .6);
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --header-height: 78px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

::selection {
  background: var(--white);
  color: var(--blue-deep);
}

:focus-visible {
  outline: 1px solid rgba(255, 255, 255, .75);
  outline-offset: 3px;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
}

/* ページ間はクロスフェードで静かに繋ぐ(対応ブラウザのみ) */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .4s;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 85% 8%, rgba(255, 255, 255, .09), transparent 30%),
    radial-gradient(circle at 6% 96%, rgba(255, 255, 255, .05), transparent 32%),
    linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: var(--white);
  font-family: Inter, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 日本語ディスプレイ文字はプロポーショナル詰めで組む */
h1, h2, h3,
.lead,
.stat-value,
.company-block-body {
  font-feature-settings: "palt";
}

/* 微細なフィルムグレインで質感を出す */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .06;
  mix-blend-mode: overlay;
  z-index: 0;
}

/* 青図面(ブループリント)の精細グリッド */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

.wrap {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ヒーロー上では溶け込み、スクロールで実体化する */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(18, 57, 150, 0);
  border-bottom: 1px solid transparent;
  transition: background .5s var(--ease), border-color .5s var(--ease);
}

body.scrolled header,
body.nav-open header {
  background: rgba(14, 45, 122, .72);
  border-bottom-color: var(--line);
}

/* 読み進めた分だけ伸びる進捗ヘアライン */
header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--accent-dim);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  pointer-events: none;
}

.nav {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand img {
  display: block;
  width: 210px;
  max-width: 46vw;
  height: auto;
}

.site-nav {
  display: flex;
  gap: 32px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.site-nav a {
  position: relative;
  padding: 4px 0;
  opacity: .64;
  transition: opacity .3s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right .45s var(--ease);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active {
  opacity: 1;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a.active::after {
  right: 0;
}

.nav-toggle {
  display: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
  transition: transform .32s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}

body.nav-open .nav-toggle__bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

body.nav-open .nav-toggle__bar:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-nav {
  display: none;
}

.mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.mobile-nav__list a {
  color: inherit;
  text-decoration: none;
}

.hero {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: calc(var(--header-height) + 52px) 0 80px;
  position: relative;
}

/* スクロールキュー：ヒーロー下端のヘアライン */
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 64px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .65));
}

@media (prefers-reduced-motion: no-preference) {
  .hero::after {
    animation: scroll-cue 2.8s ease-in-out infinite;
  }

  @keyframes scroll-cue {
    0%, 100% { opacity: .3; }
    50% { opacity: 1; }
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 34px;
}

.eyebrow::before {
  content: "";
  width: 56px;
  height: 1px;
  background: var(--accent);
}

/* 開演の所作：眉ラベルの線が左から引かれる */
@media (prefers-reduced-motion: no-preference) {
  .eyebrow::before {
    animation: rule-draw 1.1s var(--ease) .15s backwards;
  }

  @keyframes rule-draw {
    from { width: 0; }
  }
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 92px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.032em;
  max-width: 1100px;
}

/* アクセント行は線画(アウトライン)で組む：設計図の筆致 */
h1 span {
  display: block;
  margin-top: .06em;
  font-weight: 500;
  letter-spacing: -.038em;
}

@supports ((-webkit-text-stroke: 1px white)) {
  h1 span {
    color: transparent;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, .9);
    paint-order: stroke fill;
  }
}

.hero-bottom {
  margin-top: 64px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 48px;
  align-items: end;
}

.lead {
  font-size: clamp(18px, 2.1vw, 28px);
  font-weight: 400;
  line-height: 1.6;
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, .94);
}

.meta {
  justify-self: end;
  width: min(100%, 400px);
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.95;
  text-align: justify;
}

section,
.company-page {
  padding: 140px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.section-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  margin-bottom: 72px;
}

.section-no {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* 見出しラベルの後にヘアラインを引き、hero の eyebrow と質感を揃える */
.section-head .section-no,
.contact-box .section-no {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-head .section-no::after,
.contact-box .section-no::after {
  content: "";
  flex: 1;
  max-width: 240px;
  height: 1px;
  background: var(--line);
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4.2vw, 52px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -.018em;
  color: rgba(255, 255, 255, .92);
}

.section-head h2,
.contact-box h2 {
  max-width: 14em;
}

.section-head h2.section-head__title-inline {
  max-width: 14em;
}

#services .section-head,
#cases .section-head,
#concept .section-head {
  margin-bottom: 32px;
}

.section-intro {
  margin: 0 0 72px 248px;
  max-width: 42em;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: .02em;
}

.section-intro::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin-left: 10px;
  vertical-align: middle;
  background: var(--accent-dim);
}

.concept-grid,
.service-grid,
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px 44px;
}

.concept-grid {
  grid-template-rows: auto auto 1fr;
}

.concept-grid .card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  row-gap: 20px;
  justify-content: flex-start;
  min-height: 0;
}

.service-grid .card {
  justify-content: flex-start;
}

.case-grid .card {
  justify-content: flex-start;
}

.case-grid .card h3 {
  margin: 24px 0 18px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -.01em;
  color: rgba(255, 255, 255, .95);
}

.case-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  counter-reset: case;
}

.case-list li {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0 14px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 13.5px;
}

.case-list li::before {
  content: "EX.\A" counter(case, decimal-leading-zero);
  counter-increment: case;
  white-space: pre;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .08em;
  line-height: 1.5;
  color: var(--accent-dim);
}

.case-list li + li {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* 面で囲わず、罫線で区切る。ホバーでヘアラインが走る */
.card {
  position: relative;
  padding: 30px 0 0;
  border-top: 1px solid var(--line);
  background: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s var(--ease);
}

.card:hover::before,
.card:focus-within::before {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .card::before { transition: none; }
}

.card .index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--accent-dim);
  letter-spacing: .12em;
}

/* ロゴの菱形モチーフを反響させる小さなマーカー */
.card .index::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid var(--accent-dim);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.card h3 {
  margin: 24px 0 18px;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -.02em;
}

.service-grid .card h3 {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -.01em;
  color: rgba(255, 255, 255, .95);
}

.concept-grid .card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -.01em;
  color: rgba(255, 255, 255, .95);
  align-self: start;
}

.concept-grid .card p {
  align-self: start;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
  font-size: 13.5px;
}

.service-track {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
  color: var(--faint);
}

.contact-note {
  margin: 28px 0 0;
  max-width: 420px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.contact-links {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 1.2em;
}

.contact-secondary {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color .3s ease;
}

.contact-secondary:hover {
  color: var(--white);
}

.copy-email {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 7.25rem;
  height: 1.2em;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.copy-email__label,
.copy-email__done {
  grid-area: 1 / 1;
  transition: opacity .28s ease, transform .28s ease;
}

.copy-email__done {
  opacity: 0;
  transform: translateY(3px);
  pointer-events: none;
}

.copy-email:hover {
  color: var(--white);
}

.copy-email:active {
  opacity: .72;
}

.copy-email.is-copied .copy-email__label {
  opacity: 0;
  transform: translateY(-3px);
}

.copy-email.is-copied .copy-email__done {
  opacity: 1;
  transform: translateY(0);
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .copy-email__label,
  .copy-email__done {
    transition: none;
  }

  .copy-email.is-copied .copy-email__label {
    transform: none;
  }

  .copy-email.is-copied .copy-email__done {
    transform: none;
  }
}

.company-page {
  padding-top: calc(var(--header-height) + 56px);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 48px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color .3s ease;
}

.back-link:hover { color: var(--white); }

.company-intro {
  margin-bottom: 72px;
}

.company-intro h1 {
  margin: 18px 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.018em;
}

.company-legal {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: .04em;
}

.company-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 56px;
  margin-bottom: 64px;
}

.stat {
  position: relative;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  background: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s var(--ease);
}

.stat:hover::before {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .stat::before { transition: none; }
}

.stat-label {
  color: var(--accent-dim);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.stat-value {
  font-size: clamp(18px, 2.5vw, 23px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -.02em;
}

.stat-value a {
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .3s ease, opacity .3s ease;
}

.stat-value a:hover {
  border-color: var(--accent);
}

.company-block {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.company-block--muted .company-block-body {
  color: var(--muted);
}

.company-block-title {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-dim);
  font-weight: 400;
}

.company-block-body {
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.75;
  letter-spacing: -.01em;
}

.company-representative {
  margin-top: 72px;
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.company-representative .section-no {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 32px;
}

.company-representative .section-no::after {
  content: "";
  flex: 1;
  max-width: 240px;
  height: 1px;
  background: var(--line);
}

.profile-timeline .company-block:first-child {
  border-top: none;
  padding-top: 0;
}

.profile-entry {
  display: grid;
  gap: 12px;
}

.profile-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
}

.profile-entry a {
  border-bottom: 1px solid rgba(255, 255, 255, .24);
  transition: border-color .3s ease, color .3s ease;
}

.profile-entry a:hover {
  color: var(--white);
  border-color: var(--accent);
}

.contact {
  min-height: 72vh;
  display: flex;
  align-items: center;
}

.contact-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: end;
}

.contact a.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: clamp(20px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: -.02em;
}

/* カードと同じ言語：ホバーでヘアラインが走る */
.contact a.cta::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s var(--ease);
}

.contact a.cta:hover::after,
.contact a.cta:focus-visible::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .contact a.cta::after { transition: none; }
}

.arrow {
  display: inline-block;
  color: var(--accent);
  transition: transform .4s var(--ease);
}

.cta:hover .arrow { transform: translateX(10px); }

footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 44px;
  color: var(--muted);
  font-size: 12px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.footer-links a {
  opacity: .68;
  transition: opacity .3s ease;
}

.footer-links a:hover { opacity: 1; }

.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(5px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
}

.reveal.show {
  opacity: 1;
  transform: none;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

@media (max-width: 820px) {
  .site-nav--desktop { display: none; }

  .brand,
  .nav-toggle {
    position: relative;
    z-index: 32;
  }

  .nav-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    margin: 0;
    padding: calc(var(--header-height) + 36px) min(28px, calc(100vw - 40px)) 48px;
    background: var(--blue-deep);
    z-index: 30;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav__list li {
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav__list li:first-child {
    border-top: 1px solid var(--line);
  }

  .mobile-nav__list a {
    display: block;
    width: 100%;
    padding: 20px 0;
    font-size: clamp(22px, 6vw, 32px);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -.015em;
    text-transform: none;
    opacity: .88;
    transition: opacity .2s ease, padding-left .2s ease;
  }

  .mobile-nav__list a:hover,
  .mobile-nav__list a:focus-visible,
  .mobile-nav__list a.active {
    opacity: 1;
    padding-left: 8px;
  }

  body.nav-open .mobile-nav {
    display: block;
  }

  body.nav-open header {
    z-index: 31;
  }

  body.nav-open { overflow: hidden; }

  @media (prefers-reduced-motion: reduce) {
    .mobile-nav__list a,
    .nav-toggle__bar {
      transition: none;
    }
  }

  .hero-bottom,
  .section-head,
  .contact-box {
    grid-template-columns: 1fr;
  }

  .meta { justify-self: start; }

  .section-intro {
    margin-left: 0;
    margin-bottom: 56px;
  }

  .concept-grid,
  .service-grid,
  .case-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .concept-grid {
    grid-template-rows: none;
  }

  .concept-grid .card {
    display: flex;
    flex-direction: column;
    grid-row: auto;
    row-gap: 20px;
    min-height: 0;
  }

  .concept-grid .card h3 {
    margin: 0;
  }

  section,
  .company-page {
    padding: 96px 0;
  }

  .company-stats {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .footer-row { flex-direction: column; }
}
