/* ==========================================================
   TOPページ専用CSS
   ========================================================== */

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 240vh;
  background: var(--color-ink);
}

.hero__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.hero__radar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

.hero__radar circle,
.hero__radar line {
  fill: none;
  stroke: var(--color-line-dark);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}

.hero__canvas.is-ready {
  opacity: 1;
}

.no-webgl .hero__canvas {
  display: none;
}

.hero__copy {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  z-index: 2;
  opacity: calc(1 - var(--p) * 1.6);
  transform: translateY(calc(-50% + var(--p) * -48px));
  pointer-events: none;
}

.hero__sub {
  margin-bottom: var(--space-2);
  color: var(--color-primary-soft);
}

.hero__title {
  font-family: var(--font-jp-head);
  font-weight: 900;
  font-feature-settings: "palt";
  font-size: clamp(2.4rem, 6.2vw, 5.6rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
}

.hero__lead {
  margin-top: var(--space-3);
  color: var(--color-muted-dark);
}

.line {
  display: block;
  overflow: hidden;
  padding-block: 0.06em;
}

.line > span {
  display: block;
  transform: translateY(110%);
  animation: rise 0.95s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 0.13s + 0.25s);
}

@keyframes rise {
  to {
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  animation: fade 1s var(--ease) forwards;
  animation-delay: 0.9s;
}

@keyframes fade {
  to {
    opacity: 1;
  }
}

/* ---------- 見出し共通 ---------- */
.sec-head h2 {
  margin-top: var(--space-1);
  font-family: var(--font-jp-head);
  font-weight: 900;
  font-size: clamp(1.9rem, 4vw, 3.25rem);
  line-height: 1.4;
  font-feature-settings: "palt";
}

.sec-head--sm h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  line-height: 1.45;
}

.label--soft {
  color: var(--color-primary-soft);
}

/* ---------- BRIDGE（操縦室：3つの事業） ---------- */
.bridge {
  position: relative;
  background: var(--color-ink);
}

.bridge__sticky {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--header-h) + 32px) 64px;
  background: var(--color-ink);
}

.bridge__panel {
  position: relative;
  width: min(1240px, 100% - 40px);
  margin-inline: auto;
}

.bridge__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: clamp(16px, 2.4vw, 28px);
  padding-bottom: clamp(14px, 1.8vw, 22px);
  border-bottom: 1px solid var(--color-line-dark);
}

.bridge__head h2 {
  margin-top: 6px;
  font-family: var(--font-jp-head);
  font-weight: 900;
  font-feature-settings: "palt";
  font-size: clamp(1.5rem, 3.2vw, 2.8rem);
  line-height: 1.4;
}

.about__grid {
  display: grid;
  gap: var(--space-3);
}

.about__body p + p {
  margin-top: 1.4em;
}
/* ---------- RECRUIT ---------- */
.recruit {
  padding-block: var(--space-section);
}

.recruit__grid {
  display: grid;
  gap: var(--space-3);
}

.recruit__fig img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.recruit__text {
  margin-top: var(--space-2);
  color: var(--color-muted-dark);
  max-width: 30em;
}

.recruit__link {
  margin-top: var(--space-3);
}

.recruit__link:hover {
  color: var(--color-primary-soft);
}

/* ---------- CONTACT ---------- */
.contact-cta {
  padding-block: 112px;
}

.contact-cta__inner {
  display: grid;
  gap: var(--space-3);
  align-items: end;
}

.contact-cta__text {
  margin-top: var(--space-2);
  color: var(--color-muted-light);
}

/* ---------- PC ---------- */
@media (min-width: 1024px) {
  .about__grid {
    grid-template-columns: 5fr 5fr;
    gap: var(--space-4);
  }

  .about__body {
    padding-top: 36px;
  }

  .recruit__grid {
    grid-template-columns: 7fr 4fr;
    align-items: end;
    gap: var(--space-4);
  }

  .contact-cta__inner {
    grid-template-columns: 1fr auto;
    gap: var(--space-4);
  }
}

/* ---------- タブレット・スマホ ---------- */
@media (max-width: 767px) {
  .bridge__head {
    align-items: flex-start;
  }
}

@media (max-width: 639px) {
  .hero__copy {
    top: 96px;
    transform: translateY(calc(var(--p) * -48px));
  }

  .hero__title {
    font-size: clamp(2.2rem, 11vw, 3.2rem);
  }

  .contact-cta {
    padding-block: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .line > span,
  .fade-in {
    animation: none;
    transform: none;
    opacity: 1;
  }

  .hero__canvas {
    transform: none;
  }

}

/* ---------- 3つの事業：立体の箱（クリックで事業概要へ） ---------- */
.cubes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
  padding-block: 10px 14px;
}

.cubes > li:nth-child(1) {
  --ry: 20deg;
}

.cubes > li:nth-child(2) {
  --ry: -4deg;
}

.cubes > li:nth-child(3) {
  --ry: -20deg;
}

.cube {
  --depth: 120px;
  display: block;
  perspective: 1500px;
  perspective-origin: 50% 35%;
  outline: none;
}

.cube__body {
  position: relative;
  display: block;
  transform-style: preserve-3d;
  transform: rotateX(-9deg) rotateY(var(--ry, 0deg));
  transition: transform 0.45s var(--ease);
  animation: cube-float 7s ease-in-out infinite;
}

.cubes > li:nth-child(2) .cube__body {
  animation-delay: -2.3s;
}

.cubes > li:nth-child(3) .cube__body {
  animation-delay: -4.6s;
}

@keyframes cube-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -7px;
  }
}

.cube:hover .cube__body,
.cube:focus-visible .cube__body {
  animation-play-state: paused;
  transform: rotateX(calc(var(--ty, 0) * -7deg)) rotateY(calc(var(--tx, 0) * 9deg)) translateZ(40px);
}

.cube__face {
  display: block;
}

.cube__face--front {
  position: relative;
  padding: 14px 14px 24px;
  transform: translateZ(calc(var(--depth) / 2));
  background: linear-gradient(180deg, #1b1b21, #0f0f13);
  border: 1px solid rgba(224, 82, 127, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 0 70px rgba(155, 0, 63, 0.35);
  transition: box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.cube:hover .cube__face--front,
.cube:focus-visible .cube__face--front {
  border-color: #ff7aa6;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 0 110px rgba(224, 82, 127, 0.55);
}

.cube:focus-visible .cube__face--front {
  outline: 2px solid #fff;
  outline-offset: 6px;
}

/* 箱の側面と上下の面 */
.cube__face--top,
.cube__face--bottom,
.cube__face--left,
.cube__face--right {
  position: absolute;
  border: 1px solid rgba(255, 122, 166, 0.8);
  background: linear-gradient(135deg, #7a2a47, #3d1424);
}

.cube__face--top {
  left: 0;
  right: 0;
  top: 0;
  height: var(--depth);
  transform-origin: 50% 0;
  transform: translateZ(calc(var(--depth) / 2)) rotateX(-90deg);
  background: linear-gradient(180deg, #a63b61, #6b2440);
}

.cube__face--bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--depth);
  transform-origin: 50% 100%;
  transform: translateZ(calc(var(--depth) / 2)) rotateX(90deg);
}

.cube__face--left {
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--depth);
  transform-origin: 0 50%;
  transform: translateZ(calc(var(--depth) / 2)) rotateY(90deg);
}

.cube__face--right {
  right: 0;
  top: 0;
  bottom: 0;
  width: var(--depth);
  transform-origin: 100% 50%;
  transform: translateZ(calc(var(--depth) / 2)) rotateY(-90deg);
}

.cube__fig {
  display: block;
  overflow: hidden;
  background: var(--color-white);
}

.cube__fig img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.cube__txt {
  display: block;
}

.cube__no {
  display: block;
  margin-top: 16px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.22em;
  color: var(--color-primary-soft);
}

.cube__name {
  display: block;
  margin-top: 2px;
  font-family: var(--font-jp-head);
  font-weight: 900;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.35;
  color: #fff;
}

.cube__text {
  display: block;
  margin-top: 8px;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
}

.cube__go {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ff7aa6;
}

.cube__go::after {
  content: "";
  width: 30px;
  height: 2px;
  background: currentColor;
  transition: width 0.4s var(--ease);
}

.cube:hover .cube__go::after,
.cube:focus-visible .cube__go::after {
  width: 54px;
}

/* ---------- Sales / Recruiting / Advertising（大きなタイピング） ---------- */
.keys {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 80vh;
  min-height: 80svh;
  padding-block: 12vh;
}

.keys__inner {
  width: min(1200px, 100% - 40px);
}

.keys__line {
  margin-top: 0.02em;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: clamp(3.4rem, 14vw, 13.5rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--color-ink);
}

.keys__ini {
  color: var(--color-primary);
}

.keys .label {
  margin-bottom: var(--space-3);
}

/* 画面が低いとき：箱の説明文を省いて、収める */
@media (max-height: 880px) and (min-width: 1024px) {
  .cube__text {
    display: none;
  }

  .cube__fig img {
    aspect-ratio: 2 / 1;
  }
}

@media (max-height: 700px) and (min-width: 1024px) {
  .bridge__head {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .cube__fig img {
    aspect-ratio: 5 / 2;
  }

  .cube__no {
    margin-top: 10px;
  }
}

/* タブレット */
@media (max-width: 1023px) {
  .cube {
    --depth: 56px;
  }

  .cube__text {
    display: none;
  }

  .cube__name {
    font-size: 1.25rem;
  }
}

/* スマホ：PCと同じ縦型の箱（写真が上、文字が下）を、正方形に近い形で、縦に3つ。
   左右にずらして並べ、箱の向きもPCと同じように大きくつける */
@media (max-width: 767px) {
  .cubes {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-block: 10px 20px;
  }

  .cubes > li {
    width: min(78vw, 330px);
  }

  .cubes > li:nth-child(1) {
    --ry: 17deg;
    justify-self: start;
  }

  .cubes > li:nth-child(2) {
    --ry: -17deg;
    justify-self: end;
  }

  .cubes > li:nth-child(3) {
    --ry: 17deg;
    justify-self: start;
  }

  .cube {
    --depth: 76px;
    perspective: 900px;
  }

  .cube__body {
    transform: rotateX(-10deg) rotateY(var(--ry, 0deg));
  }

  .cube__face--front {
    padding: 12px 12px 18px;
  }

  .cube__fig img {
    aspect-ratio: 3 / 2;
  }

  .cube__no {
    margin-top: 12px;
    font-size: 0.875rem;
  }

  .cube__name {
    font-size: 1.5rem;
  }

  .cube__go {
    margin-top: 10px;
    font-size: 0.8125rem;
  }
}

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

/* ---------- タイピング表示 ---------- */
.is-typing {
  position: relative;
}

/* 全文を見えない状態で置いて、場所を確保する（打ち込み中も、レイアウトが動かない） */
.type-ghost {
  visibility: hidden;
}

.type-live {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}

.type-caret {
  display: inline-block;
  width: 0.09em;
  height: 0.82em;
  margin-left: 0.07em;
  vertical-align: -0.04em;
  background: var(--color-primary);
  animation: caret 0.9s steps(1) infinite;
}

.type-caret.is-done {
  animation-duration: 0.9s;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .type-caret {
    display: none;
  }
}
