/* EeeeMO SHELTER 共通トークン。後続セクションもここを使う。 */
:root {
  /* 色 */
  --color-bg: #0A0A0A;
  --color-navy: #142B4F;
  --color-gold: #D4A72C;
  --color-gold-hover: #E0B740;
  --color-white: #FFFFFF;
  --color-text: rgba(255, 255, 255, .85);
  --color-text-sub: rgba(255, 255, 255, .72);
  --color-text-quiet: rgba(255, 255, 255, .7);
  --color-line: rgba(255, 255, 255, .34);
  --color-hairline: rgba(255, 255, 255, .1);
  --color-field: rgba(255, 255, 255, .07);
  --color-notice: #EBDFB8; /* 入力エラー。赤を使わない控えめな色 */
  --color-header: rgba(255, 255, 255, .92);
  /* 明るいセクション（/brain/ と同じ淡いグレーと白を交互に） */
  --color-mist: #F0F2F6;
  --color-paper: #FFFFFF;
  --color-ink-strong: #141A26;
  --color-ink: #3B4352;
  --color-ink-sub: #5B6475;
  --color-rule: #DCE1E9;
  /* ロゴの青（assets/logo.svg の #0878D1）。使う場所は英字の小ラベル・本文中のリンク・フォーカス枠だけ */
  --cm-blue: #0878D1;           /* ロゴと同じ。フォーカス枠など文字以外に使う */
  --cm-blue-text: #0670C4;      /* 明るい背景の文字用。白 5.09:1／淡いグレー 4.54:1（ロゴの青はグレー上で 4.06:1 のため少し濃く） */
  --cm-blue-on-dark: #3B9BEA;   /* 黒い背景の文字用。#0A0A0A 上で 6.66:1 */

  /* 書体 */
  --font-sans: "Noto Sans JP", Inter, -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  --font-figure: Inter, "Noto Sans JP", sans-serif;
  --weight-medium: 500;
  --weight-bold: 700;
  --weight-black: 800;

  /* 文字サイズ。大見出しは /brain/ と同じ大きさ（1440幅で約90px、1920幅で112px）を保つ */
  --text-hero: clamp(64px, 6.25vw, 112px);
  --text-lead: 20px;
  --text-intro: 18px;
  --text-field: 18px;
  --text-body: 16px;
  --text-small: 14px;
  --text-news: 13px;
  --text-section: 56px;
  --text-section-lead: 20px;
  --text-section-body: 18px;
  --text-eyebrow: 14px;
  --text-card-title: 22px;
  --leading-hero: 1.15;
  --leading-lead: 1.85;
  --tracking-hero: -.02em;

  /* 余白・寸法（段落ごとの差：見出し→説明 40 / 説明→入力 48 / 入力内 12〜16 / 安心の3点の上 24） */
  --header-height: 72px;
  --gutter: clamp(20px, 4vw, 77px);
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 40px;
  --gap-title-lead: 40px;
  --gap-lead-form: 48px;
  --gap-form: 12px;
  --gap-promises: 24px;
  --control-height: 64px;
  --content-width: 600px; /* 説明文が 1440 幅で 5 行に収まる幅。入力欄も同じ幅 */
  --radius-pill: 9999px;
  --radius-card: 16px;
  --section-pad: 120px;
  --container: 1120px;

  /* 動き */
  --ease-calm: cubic-bezier(.2, .7, .2, 1);
  --duration-press: 140ms;
  --duration-swap: 480ms;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-height); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  -webkit-font-smoothing: antialiased;
  line-break: strict;
  word-break: normal;
  overflow-wrap: anywhere;
}

ul { list-style: none; }

:focus-visible { outline: 2px solid var(--cm-blue); outline-offset: 3px; }

/* ---- ピル型ボタン ---- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-gold);
  color: var(--color-navy);
  font: var(--weight-bold) 17px/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-press) ease, transform var(--duration-press) var(--ease-calm);
}
.pill:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .pill:hover { background: var(--color-gold-hover); }
}
.pill--sm { height: 48px; padding: 0 32px; font-size: 16px; }

/* ---- ヘッダー ---- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 clamp(20px, 2.8vw, 40px);
  background: var(--color-header);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.site-header__logo { display: block; line-height: 0; border-radius: 8px; }
.site-header__right { display: flex; align-items: center; gap: var(--space-5); }
.site-nav { display: flex; gap: 28px; }
.site-nav a {
  color: var(--color-ink-strong);
  font-size: 15px;
  font-weight: var(--weight-bold);
  text-decoration: none;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { color: var(--color-navy); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
}
@media (max-width: 1023px) {
  .site-nav { display: none; }
}
.site-header__logo img { width: auto; height: 60px; }

/* ---- ヒーロー ---- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--header-height) var(--gutter) 40px;
  overflow: hidden;
  background: var(--color-bg);
}

/* 背景動画（白いサーバールーム）。明るい映像なので、文字のある左側と帯のある上端を暗く落として読みやすさを保つ。
   線画の後ろの暗がりは hero-scene.js が線画の位置に合わせて描く（ぼかした楕円） */
.hero__photo { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__photo img, .hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
/* 動画は再生が始まってから静止画の上にふわっと重ねる（読み込み中・再生できない環境では静止画のまま） */
.hero__video { opacity: 0; transition: opacity 900ms ease; }
.hero__video.is-playing { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero__video { display: none; } }
.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, .96) 0%, rgba(10, 10, 10, .9) 40%, rgba(10, 10, 10, .72) 58%, rgba(10, 10, 10, .5) 76%, rgba(10, 10, 10, .42) 100%),
    linear-gradient(180deg, rgba(10, 10, 10, .78) 0%, rgba(10, 10, 10, .55) 120px, rgba(10, 10, 10, 0) 260px, rgba(10, 10, 10, 0) 70%, rgba(10, 10, 10, .55) 100%);
}
/* 線画（hero-scene.js）。PC はヒーロー全面に重ね、描く位置はスクリプト側で右側に限る */
.hero__scene { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; }

/* 帯の下の残りの高さの中で縦中央に置く（内容が画面より高いときはそのまま伸びる） */
.hero__body {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: auto 0;
  padding-top: 14px; /* 帯との間隔 */
}

.hero__label {
  margin-bottom: var(--space-1);
  color: var(--color-white);
  font-size: var(--text-intro);
  font-weight: var(--weight-bold);
  line-height: 1.3;
}

.hero__title {
  color: var(--color-white);
  font-size: var(--text-hero);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-hero);
  line-height: var(--leading-hero);
}
.hero__title span { display: block; white-space: nowrap; }

.hero__lead {
  max-width: var(--content-width);
  margin-top: var(--gap-title-lead);
  font-size: var(--text-lead);
  font-weight: var(--weight-medium);
  line-height: var(--leading-lead);
  word-break: auto-phrase;
  text-wrap: pretty;
}
.hero__lead p + p { margin-top: .4em; }

/* ---- 帯（最近の動き） ---- */
.news {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-hairline);
  font-size: var(--text-news);
  line-height: 1.6;
}

.news__list {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

/* 日付の右で本文の行頭をそろえる */
.news__entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  color: var(--color-text-quiet);
  text-decoration: none;
}
.news__text { word-break: auto-phrase; }
a.news__entry .news__text {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .28);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  a.news__entry:hover { color: var(--color-white); }
}

.news__date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 12px;
  color: var(--color-text-quiet);
  font-family: var(--font-figure);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
}
.news__date::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-gold);
}

.news__pause {
  display: none;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-hairline);
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-quiet);
  cursor: pointer;
}
.news__pause svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.news__icon-play { display: none; }
.news__pause[aria-pressed="true"] .news__icon-pause { display: none; }
.news__pause[aria-pressed="true"] .news__icon-play { display: inline; }

/* ---- 診断フォーム（ページで一番押したい場所） ---- */
.check { max-width: var(--content-width); margin-top: var(--gap-lead-form); }

.check__intro {
  margin-bottom: var(--gap-form);
  color: var(--color-white);
  font-size: var(--text-intro);
  font-weight: var(--weight-bold);
  line-height: 1.5;
}

.check__label {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--color-text);
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  line-height: 1.5;
}

.check__row {
  display: flex;
  gap: var(--space-1);
  height: var(--control-height);
  padding: 6px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-field);
  transition: border-color var(--duration-press) ease;
}
.check__row:focus-within { border-color: var(--color-gold); }

.check__input {
  flex: 1;
  min-width: 0;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-white);
  font: var(--weight-medium) var(--text-field)/1.4 var(--font-sans);
}
.check__input::placeholder { color: var(--color-text-sub); opacity: 1; }
.check__input:focus { outline: none; }

.check__button { flex: none; height: 100%; padding: 0 36px; }
.check__button:disabled { cursor: wait; }
.check__button:disabled:active { transform: none; }

.check__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: check-spin .8s linear infinite;
}
.check__button.is-loading .check__spinner { display: block; }

@keyframes check-spin { to { transform: rotate(360deg); } }

.check__error {
  margin-top: var(--gap-form);
  color: var(--color-notice);
  font-size: var(--text-small);
  font-weight: var(--weight-bold);
  line-height: 1.6;
}
.check__error[hidden] { display: none; }

.check__note {
  margin-top: var(--gap-form);
  color: var(--color-text-sub);
  font-size: var(--text-small);
  line-height: 1.7;
}
.check__error + .check__note { margin-top: 4px; }

/* ---- 安心の3点 ---- */
.promises {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin-top: var(--gap-promises);
  color: var(--color-white);
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
  line-height: 1.5;
}
.promises li { display: flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.promises svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hero__escape {
  display: inline-block;
  margin-top: var(--space-1);
  color: var(--color-text);
  font-size: var(--text-small);
  line-height: 1.7;
  text-underline-offset: 3px;
}

/* ---- 幅が狭いPC：線画を右へ寄せ、文字に近い側を暗闇へ溶かす ---- */
@media (min-width: 900px) and (max-width: 1199px) {
  :root { --text-news: 12.5px; }
  .news__list { gap: var(--space-3); }

}

/* ---- タブレット以下：線画を文字の後ろへ敷き、帯は 1 件ずつ ---- */
@media (max-width: 899px) {
  :root {
    --text-hero: clamp(36px, 11.3vw, 56px);
    --text-lead: 16px;
    --leading-lead: 1.75;
    --gap-title-lead: 24px;
    --gap-lead-form: 32px;
    --gap-form: 12px;
    --gap-promises: 20px;
    --control-height: 60px;
  }
  .hero__photo img { object-position: 50% 50%; }
  .hero__photo::after { background: linear-gradient(180deg, rgba(10, 10, 10, .66) 0%, rgba(10, 10, 10, .8) 55%, rgba(10, 10, 10, .9) 100%); }
  .hero__body { margin: 0; padding-top: var(--space-4); }
  /* 線画は文字の後ろに敷かず、入力欄の下に小さく置く（本文が画面いっぱいにあり、後ろに敷くと読みにくくなるため） */
  .hero__scene { position: relative; inset: auto; z-index: 1; height: 300px; margin-top: var(--space-4); }

  .news__list { display: grid; grid-template-columns: 1fr; }
  .news__item {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-swap) ease, visibility 0s linear var(--duration-swap);
  }
  .news__item.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--duration-swap) ease, visibility 0s;
  }
  .news__pause { display: grid; }
}

@media (max-width: 559px) {
  .site-header__logo img { height: 48px; }
  .pill--sm { height: 44px; padding: 0 22px; font-size: 15px; }
  .check__row { flex-direction: column; height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .check__input {
    flex: none;
    height: var(--control-height);
    border: 1px solid var(--color-line);
    background: var(--color-field);
  }
  .check__input:focus { border-color: var(--color-gold); }
  .check__button { width: 100%; height: var(--control-height); }
  .promises { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .pill, .check__row { transition: none; }
  .pill:active { transform: none; }
  .check__spinner { animation-duration: 2s; }
  .news__item, .news__item.is-active { transition: none; }
}
