/* トップ「AI会社のしくみ」 */
#how.aico {
  --how-surface: #0b1526;
  --how-rule: #324967;
  --how-branch: #619bc3;
  --how-copy: #b7c6dc;
  padding-block: clamp(60px, 8vw, 112px);
  background: var(--how-surface);
  border-block: 1px solid var(--how-rule);
  overflow-wrap: anywhere;
}

#how .section-title {
  font-size: clamp(30px, 5vw, 64px);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 18px;
}

#how .section-lead {
  color: var(--how-copy);
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 37em;
  margin-bottom: clamp(28px, 4vw, 46px);
}

/* 3段は余白と細い矢印でつなぐ。 */
#how .aico-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 0 clamp(28px, 4vw, 46px);
  padding: 0;
  list-style: none;
}

#how .aico-flow > * {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: clamp(14px, 2.4vw, 24px);
  border: 1px solid var(--how-rule);
  border-inline-start: 3px solid var(--how-branch);
  background: #101e32;
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.45;
}

#how .aico-flow > :first-child {
  background: #183550;
}

#how .aico-flow > * + * {
  margin-top: 28px;
}

#how .aico-flow > * + *::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 26px;
  height: 23px;
  border-left: 1px solid var(--how-branch);
}

#how .aico-flow > * + *::after {
  content: "";
  position: absolute;
  top: -13px;
  left: 23px;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--how-branch);
  border-bottom: 1px solid var(--how-branch);
  transform: rotate(45deg);
}

#how .aico-flow span {
  display: block;
  margin-top: 4px;
  font-size: clamp(14px, 1.45vw, 16px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--how-copy);
}

#how .aico-video {
  margin-top: 28px;
  padding: clamp(16px, 3vw, 28px);
  background: #080f1c;
  border: 1px solid var(--how-rule);
  border-inline-start: 3px solid var(--how-branch);
  border-radius: 4px;
  color: var(--how-copy);
}

#how .aico-video-title {
  margin-bottom: 4px;
  color: #e5f1ff;
  font-weight: 700;
}

/* 縦長の比率は動画を追加したときだけ適用する。 */
#how .aico-video :is(video, iframe) {
  display: block;
  width: min(100%, 252px);
  height: auto;
  aspect-ratio: 9 / 16;
  margin: 16px auto 0;
  border: 0;
  border-radius: 4px;
  background: #080f1c;
  object-fit: contain;
}

/* 3項目を見出しと罫線で区切る。 */
#how .how-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0 clamp(24px, 5vw, 64px);
  border-bottom: 1px solid var(--how-rule);
}

#how .how {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 12px;
  padding: 20px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--how-rule);
  border-radius: 0;
}

#how .how .num {
  margin: 0;
  padding-top: 4px;
  font-size: 14px;
}

#how .how h3 {
  font-size: clamp(20px, 2.5vw, 30px);
}

#how .how p:not(.num) {
  grid-column: 2;
  color: var(--how-copy);
  font-size: 16px;
  line-height: 1.75;
}

#how .aico-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

#how .aico-actions .btn {
  max-width: 100%;
  border-radius: 4px;
  justify-content: center;
  text-align: center;
}

#how .aico-actions .btn-solid {
  background: var(--cyan);
  color: #06111f;
}

#how .aico-actions .btn-solid:hover {
  background: #a0dcff;
}

#how .aico-actions .btn:focus-visible {
  outline: 2px solid #d1eeff;
  outline-offset: 4px;
}

@media (min-width: 900px) {
  #how .aico-flow,
  #how .how-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #how .aico-flow {
    gap: 28px;
  }

  #how .aico-flow > * + * {
    margin-top: 0;
  }

  #how .aico-flow > * + *::before {
    top: 50%;
    left: -28px;
    width: 21px;
    height: 0;
    border: 0;
    border-top: 1px solid var(--how-branch);
  }

  #how .aico-flow > * + *::after {
    top: calc(50% - 3px);
    left: -15px;
    transform: rotate(-45deg);
  }
}

/* 2・3枚目は、画像と本文それぞれに表示領域を確保する。 */
:is(.slide-company, .slide-creative) {
  background: #0b1526;
}

:is(.slide-company, .slide-creative)::before {
  content: none;
}

:is(.slide-company, .slide-creative) .slide-cut-ai {
  inset: 24px 8% auto auto;
  width: 42%;
  height: min(calc(100% - 112px), 24vw, 340px);
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  transform: none;
  filter: none;
  -webkit-mask-image: none;
  mask-image: none;
}

:is(.slide-company, .slide-creative) .wrap {
  padding-inline-end: 42%;
}

:is(.slide-company, .slide-creative) .hero-lead {
  max-width: 100%;
}

@media (min-width: 641px) and (max-width: 900px) {
  :is(.slide-company, .slide-creative) .wrap {
    padding-inline-end: 53%;
  }
}

@media (max-width: 640px) {
  :is(.slide-company, .slide-creative) {
    display: block;
  }

  :is(.slide-company, .slide-creative) .slide-cut-ai {
    position: static;
    width: calc(100% - 40px);
    height: clamp(180px, 51vw, 280px);
    margin: 24px auto 0;
  }

  :is(.slide-company, .slide-creative) .wrap {
    padding: 24px 20px 56px;
  }
}

/* Instagram はリンクを手前に、QRは白地と余白を確保する。 */
#videos .insta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
  padding: clamp(20px, 4vw, 38px);
  background: #101e32;
  border-block: 1px solid #324967;
}

#videos .insta > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

#videos .insta-title {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.35;
}

#videos .insta-id {
  color: var(--ink-soft);
  margin-block: 6px 16px;
}

#videos .insta-qr {
  flex: none;
  margin: 0;
  padding: 12px;
  background: #fff;
  color: #0b1526;
  text-align: center;
  font-size: 14px;
}

#videos .insta-qr img {
  width: 200px;
  height: auto;
}

#videos .insta .btn {
  max-width: 100%;
  min-height: 44px;
  border-radius: 4px;
  white-space: normal;
  text-align: center;
  justify-content: center;
}

@media (max-width: 640px) {
  #videos .insta {
    display: block;
  }

  #videos .insta > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  #videos .insta .btn {
    order: -1;
    margin-bottom: 14px;
  }

  #videos .insta-id {
    margin-bottom: 0;
  }

  #videos .insta-qr {
    display: none;
  }
}

/* 明るい背景に、見本と案内を収めた白い窓を置く。 */
#web.awa-win {
  padding-block: clamp(36px, 5vw, 64px);
}

#web .banner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(20px, 4vw, 44px);
}

#web .section-title {
  font-size: clamp(22px, 2.5vw, 30px);
}

#web .awa-full {
  margin-top: 14px;
}

#web .btn-light {
  margin-top: 18px;
}

#web .awa-shot {
  min-width: 0;
  margin: 0;
}

#web .awa-shot img {
  width: 100%;
  aspect-ratio: 1200 / 760;
  border: 1px solid var(--light-line);
  border-radius: var(--r-s);
}

#web .awa-shot figcaption {
  margin-top: 8px;
  color: var(--light-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* 2つの事業は同じ大きさのカードで紹介する。 */
#services.sub-biz {
  padding-block: clamp(32px, 5vw, 60px);
  background: var(--bg-2);
}

#services .wrap {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 18px;
  max-width: 940px;
}

#services .sub-card {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 3vw, 32px);
  min-height: 300px;
  padding: clamp(16px, 2.4vw, 28px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
}

#services .sub-card > img {
  width: 100%;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  border-radius: 4px;
}

#services .sub-card h2 {
  margin-bottom: 8px;
  font-size: clamp(20px, 2vw, 25px);
  overflow-wrap: anywhere;
}

#services .sub-card p:not(.eyebrow) {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

#services .sub-card p.sub-state {
  margin-top: 10px;
  color: var(--ink);
  font-weight: 700;
}

#services .sub-card .btn {
  min-height: 44px;
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 14px;
}

@media (max-width: 760px) {
  #web .banner,
  #services .sub-card {
    grid-template-columns: minmax(0, 1fr);
  }

  #services .sub-card {
    align-content: start;
    min-height: 470px;
  }
}

/* 画像は窓の幅いっぱいに出す・スマホのカードは約5% */
#web.awa-win .awa-shot a{ display:block; width:100%; }
#web.awa-win .awa-shot img{ display:block; width:100%; height:auto; }
#web.awa-win .awa-shot{ width:100%; align-self:center; }
@media (max-width:640px){ #services.sub-biz .sub-card img{ aspect-ratio:16/8; height:auto; } }

/* 進化の欄（Codex の回数切れのため、並べ方だけ課で指定） */
#videos .evo{ margin:0 0 44px; }
#videos .evo-title{ font-size:clamp(18px,2.2vw,24px); text-align:center; margin-bottom:20px; }
#videos .evo-row{ display:flex; align-items:center; justify-content:center; gap:clamp(8px,3vw,32px); }
#videos .evo figure{ margin:0; flex:0 1 260px; min-width:0; }
#videos .evo-video{ display:block; width:100%; aspect-ratio:9/16; object-fit:cover; background:#05080f; border:1px solid var(--line); border-radius:var(--r-s); }
#videos .evo figcaption{ margin-top:10px; text-align:center; }
#videos .evo figcaption b{ display:block; font-size:16px; }
#videos .evo figcaption span{ display:block; font-size:13px; color:var(--ink-soft); }
#videos .evo-arrow{ flex:0 0 auto; color:var(--cyan); font-size:clamp(20px,3vw,34px); }

/* ジャービス: 頭と肩・全身が切れないように（Codex の回数切れのため課で指定） */
@media (min-width:641px){
  .slide-ai::after{ inset:0; background:url("images/jarvis_hero.jpg?v=1126c") right 6% center/auto 100% no-repeat; }
}
@media (max-width:640px){
  .slide-ai::after{ inset:0; background:url("images/jarvis_face.jpg?v=1126c") center 8px/100% auto no-repeat; }
}
#jarvis .jarvis-figure{ width:100%; max-width:360px; justify-self:center; background:#000212; }
#jarvis .jarvis-figure video{ width:100%; height:auto; aspect-ratio:9/16; object-fit:contain; background:#000212; }

/* 呼んでみるボタン */
#jarvis .jarvis-figure{ position:relative; }
#jarvis .jarvis-figure video.jarvis-talk{ position:absolute; left:0; top:0; width:100%; opacity:0; transition:opacity .25s; pointer-events:none; }
#jarvis .jarvis-figure video.jarvis-talk.is-on{ opacity:1; }
#jarvis .jarvis-bubble{ position:absolute; bottom:80px; right:6%; z-index:2; margin:0; padding:8px 18px; border-radius:18px 18px 4px 18px; background:var(--cyan); color:#06111f; font-weight:700; font-size:20px; opacity:0; transform:translateY(6px); transition:opacity .2s, transform .2s; pointer-events:none; }
#jarvis .jarvis-bubble.is-on{ opacity:1; transform:none; }
#jarvis .jarvis-call{ display:block; width:100%; padding:16px 12px; border:0; border-top:1px solid var(--line); background:var(--cyan); color:#06111f; font:inherit; font-weight:700; font-size:15px; cursor:pointer; }
#jarvis .jarvis-call:hover{ background:#7fd3ff; }
#jarvis .jarvis-call:focus-visible{ outline:3px solid #fff; outline-offset:-5px; }

/* トップのジャービスは瞬きする動画（静止画の背景は使わない） */
.hero .slide-ai::after{ content:none; }
.slide-ai .hero-face{ position:absolute; z-index:0; top:6%; right:10%; height:92%; width:auto; aspect-ratio:4/5; object-fit:cover; pointer-events:none; animation:hero-float 3.5s ease-in-out infinite alternate;
  -webkit-mask-image:radial-gradient(ellipse 58% 66% at 50% 44%, #000 66%, transparent 100%); mask-image:radial-gradient(ellipse 58% 66% at 50% 44%, #000 66%, transparent 100%); }
@media (max-width:900px){
  .slide-ai .hero-face{ top:16px; right:auto; left:calc(50% - 148px); width:296px; height:370px; }
}

/* 隣の画面があると分かる矢印（本人「矢印だけでいい・邪魔にならない程度に」） */
.hero .hero-arrow{ display:flex; align-items:center; justify-content:center; position:absolute; z-index:4; width:40px; height:40px; padding:0; border-radius:50%; border:1px solid rgba(88,196,255,.65); background:rgba(5,8,15,.45); color:#cfeaff; font-size:24px; line-height:1; cursor:pointer; opacity:.85; }
.hero .hero-arrow:hover, .hero .hero-arrow:focus-visible{ opacity:1; background:rgba(88,196,255,.22); }
.hero .arrow-label{ display:none; }
@media (min-width:641px){ .hero .hero-arrow{ top:50%; transform:translateY(-50%); } }
@media (max-width:640px){
  .hero .hero-arrow{ top:188px; transform:none; width:36px; height:36px; font-size:22px; }
  .hero .hero-prev{ left:8px; } .hero .hero-next{ right:8px; }
}

/* ===== タブレット（11-27 本人「タブレットは表示が酷かった」） ===== */
/* 同意の印が横いっぱいに伸びて文と離れていたのを直す */
.form .consent input{ width:auto; flex:none; margin:4px 0 0; padding:0; }

/* たて向き（641〜900）: 左に見出し、右に顔・画像（11-27 本人「真ん中にドンは怖い。右に寄せて左にタイトル」） */
@media (min-width:641px) and (max-width:900px){
  .hero{ height:620px; }
  .hero .slide .wrap{ position:absolute; left:0; right:0; top:50%; transform:translateY(-50%); max-width:none; padding:0 0 12px 64px; text-align:left; }
  .hero h1{ min-height:0; font-size:clamp(28px, 4.5vw, 40px); }
  .hero .slide .hero-lead{ min-height:0; max-width:min(calc(46vw - 40px), 360px); margin-bottom:24px; }
  .hero .hero-actions{ max-width:min(calc(46vw - 24px), 380px); }
  .hero .hero-note{ margin-top:18px; max-width:calc(46vw - 16px); font-size:clamp(10px, 1.45vw, 12px); }
  .hero .slide-ai .hero-face{ right:40px; left:auto; width:min(46vw, 400px); height:auto; aspect-ratio:4/5; top:calc(50% - min(28.75vw, 250px)); }
  .hero .slide-ai::before{ background:linear-gradient(90deg, rgba(5,8,15,.94) 0%, rgba(5,8,15,.7) 40%, rgba(5,8,15,0) 56%); }
  .hero :is(.slide-company, .slide-creative) .slide-cut-ai{ inset:50% 56px auto auto; transform:translateY(-50%); width:calc(48vw - 56px); height:440px; }
  .hero .hero-arrow{ top:50%; }
  .hero .hero-prev{ left:12px; } .hero .hero-next{ right:12px; }
  #web.awa-win .banner{ grid-template-columns:minmax(0,1fr); }
  #web.awa-win .awa-shot{ max-width:620px; justify-self:center; }
  #note .ep-list{ grid-template-columns:minmax(0,1fr); }
}

/* よこ向き（901〜1200） */
@media (min-width:901px) and (max-width:1200px){
  .section .wrap, .footer .wrap{ max-width:86%; }
  .hero{ height:600px; }
  .hero .slide-ai::before{ background:linear-gradient(90deg, rgba(5,8,15,.92) 0%, rgba(5,8,15,.6) 34%, rgba(5,8,15,0) 52%); }
  .hero .slide .wrap{ padding-top:84px; }
  .hero .slide-ai .hero-face{ top:5%; right:3%; height:90%; }
  .hero .slide-ai .hero-lead{ max-width:390px; }
  .hero .hero-dots{ justify-content:flex-start; padding-left:12%; }
  .hero :is(.slide-company, .slide-creative) .slide-cut-ai{ inset:48px 8% auto auto; width:42%; height:calc(100% - 96px); }
  #how .how-grid{ grid-template-columns:minmax(0,1fr); }
  #web.awa-win .banner{ grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); }
  #note .ep-list{ grid-template-columns:repeat(2, minmax(0,1fr)); max-width:none; }
}

/* 検索に絵を知らせる静止画（顔の動画の下）。動画が出る前に見えても頭が切れないように全体を入れる */
.slide-ai img.hero-face-still{ object-fit:contain; }
