/* LEGACIA_BASE — Site styles(静けさ・余白・映画的演出・広告的でないトーン) */

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

html, body {
  width: 100%;
  height: auto;
  background: #05070d;
}
/* PUBLIC FIXED NAV POSITION CONSISTENCY 001: ページごとに縦scrollbarの
   有無が異なる(TOPはdocument高さがviewportを超えるためscrollbarが必要、
   BLOG/DOCUMENTARY/LEGACIA_OSはちょうどviewport高さで不要)ため、ブラウザが
   scrollbar分の幅を予約する環境では document.documentElement.clientWidth
   がページごとに変わり、position:fixedのFixed Navigation(left:0;right:0で
   viewportいっぱいに広がる)の中央位置がページ間でわずかにずれて見える
   原因になる。scrollbar-gutter:stableで、実際にscroll可能かどうかに関わらず
   全ページで同じ幅のgutterを常に予約させ、page間のclientWidthを揺らさない
   ようにする(scrollbar自体が常時見えるわけではなく、scroll不要なページでは
   透明な余白として確保されるだけ)。overlay方式のscrollbarを使う環境
   (このテスト環境のヘッドレスChromium含む)では実質no-opで副作用なし。 */
html {
  scrollbar-gutter: stable;
}
/* TOPページのみ読み込むcss/style.css側の html,body{height:100%} を打ち消す
   ための明示指定(style.css本体は変更していない)。これがないと、bodyの
   実ボックスがviewport高さに固定され、下部safe-space用padding-bottomが
   Footer等の実際の下端に反映されず、Fixed Navと重なる(PUBLIC FIXED BOTTOM
   NAVIGATION INTEGRATION 001で発見・修正、Prototype_v0.1でも同じ原因で
   同じ修正を適用済み)。Heroの高さ制御は.hero側のmin-height:100vhで別途
   行われるため、この上書きはHeroの見た目・構図には影響しない。 */

body {
  font-family: "Hiragino Sans", "Yu Gothic", "Helvetica Neue", Arial, sans-serif;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 300;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

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

.proto-badge {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: #1a1500;
  color: #ffd76a;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 215, 106, 0.35);
}

.proto-nav {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 14px 8vw;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 7, 13, 0.9);
}

.proto-nav a,
.proto-nav span {
  text-transform: uppercase;
}

.proto-nav a {
  opacity: 0.75;
  padding: 4px 2px;
}

.proto-nav a:hover,
.proto-nav a:focus {
  opacity: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* Cars/Movies: Heroと同様、公開先未確定のため非リンク(クリック不可)。
   opacityを下げてリンクと視覚的に区別する(title="準備中"と併用)。 */
.proto-nav span {
  opacity: 0.4;
  padding: 4px 2px;
}

/* ---- 汎用セクション ---- */
.proto-section {
  padding: 9vh 8vw;
  max-width: 960px;
  margin: 0 auto;
}

.proto-section + .proto-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.proto-section-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 14px;
}

.proto-heading {
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  font-weight: 300;
  margin-bottom: 18px;
}

.proto-lede {
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  opacity: 0.85;
  max-width: 640px;
  margin-bottom: 28px;
}

.proto-link-out {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 22px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.proto-link-out:hover {
  border-color: rgba(255, 255, 255, 0.9);
}

.proto-unconfirmed {
  font-size: 0.68rem;
  opacity: 0.5;
  margin-top: 6px;
}

/* ---- TOP: セクションカード群(LATEST/BLOG, DOCUMENTARY, LEGACIA_OS) ---- */
.proto-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.proto-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 20px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.proto-card-title {
  font-size: 1rem;
  margin-bottom: 8px;
}

.proto-card-excerpt {
  font-size: 0.82rem;
  opacity: 0.7;
}

.proto-card-meta {
  font-size: 0.68rem;
  opacity: 0.5;
  margin-top: 12px;
}

/* ---- AI(legacia-os)ページ: メイン画像(AI Page Image Replacement 001)
   AI Page Image Replacement 002により、Desktopで横幅100%表示を優先する
   指示を受け、AI Page Viewport Fit 001の1画面内(viewport高さ)制約は
   解除した。width:100%; height:autoで縦横比を保ったまま横幅いっぱいに
   表示する(トリミングなし)。Fixed Navはposition:fixedで、bodyの
   padding-bottom(既存の安全margin)の範囲に重なるだけで本文とは重ならない
   (Replacement 001時点から検証済みの挙動)。 ---- */
.ai-page-visual {
  background: #000000;
}

.ai-page-visual img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- BLOG INDEX: 記事カード ---- */
.blog-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.blog-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-card[data-state="placeholder"] {
  opacity: 0.45;
  border-style: dashed;
}

.blog-card-category {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}

.blog-card-title {
  font-size: 1.02rem;
}

.blog-card-date {
  font-size: 0.7rem;
  opacity: 0.55;
}

.blog-card-excerpt {
  font-size: 0.82rem;
  opacity: 0.75;
}

/* ---- BLOG ARTICLE ---- */
.article-header {
  padding: 9vh 8vw 4vh 8vw;
  max-width: 720px;
  margin: 0 auto;
}

.article-category {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 10px;
}

.article-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 300;
  margin-bottom: 10px;
}

.article-date {
  font-size: 0.78rem;
  opacity: 0.55;
}

.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 8vw 9vh 8vw;
}

.article-body p {
  margin-bottom: 22px;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* 単一写真 */
.article-media-single {
  margin: 32px 0;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.06) 10px,
    rgba(255, 255, 255, 0.02) 10px,
    rgba(255, 255, 255, 0.02) 20px
  );
  border: 1px dashed rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0.6;
  text-align: center;
  padding: 12px;
}

/* 複数写真 */
.article-media-gallery {
  margin: 32px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.article-media-gallery .gallery-item {
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.06) 10px,
    rgba(255, 255, 255, 0.02) 10px,
    rgba(255, 255, 255, 0.02) 20px
  );
  border: 1px dashed rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  opacity: 0.6;
  text-align: center;
  padding: 8px;
}

/* 短い動画 */
.article-media-video {
  margin: 32px 0;
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0.6;
  text-align: center;
  padding: 12px;
}

/* YouTube埋め込み領域 */
.article-media-youtube {
  margin: 32px 0;
  aspect-ratio: 16 / 9;
  background: rgba(255, 0, 0, 0.04);
  border: 1px dashed rgba(255, 120, 120, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0.65;
  text-align: center;
  padding: 12px;
}

.proto-footer {
  padding: 6vh 8vw;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  opacity: 0.65;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
}

.proto-footer a {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .proto-section {
    padding: 7vh 6vw;
  }
  .article-header,
  .article-body {
    padding-left: 6vw;
    padding-right: 6vw;
  }
  .proto-nav {
    gap: 14px;
    padding: 12px 6vw;
  }
  .proto-footer {
    padding: 5vh 6vw;
    flex-direction: column;
    gap: 10px;
  }
}

/* ---------------------------------------------------------------------
   Hero構図(Brand/Definition/Observation/Navigation要素の配置とサイズ)
   --------------------------------------------------------------------- */

.trial-hero .hero-media img {
  object-position: center calc(45% + 6.403588516746413px);
}

.trial-hero {
  position: relative;
}

.trial-el {
  position: absolute;
  color: #ffffff;
  pointer-events: none;
  user-select: none;
  font-family: system-ui, "Hiragino Sans", "Yu Gothic", sans-serif;
  font-weight: 300;
  z-index: 3;
}

.trial-brand {
  left: 44.3%;
  top: 91%;
  width: 10.5%;
  opacity: 0.55;
  z-index: 2;
}
.trial-brand img {
  width: 100%;
  display: block;
}
/* PUBLIC HERO BRAND SET VISIBILITY 001により、Hero下部の小さい
   「Mark + LEGACIA」Brand Setは非表示にする(Fixed Bottom Navigation左端の
   LEGACIA Markが正式なHOME導線となったため、ブランド表示の二重化を避ける)。
   Public表示のみの抑制であり、値そのもの(JSON由来のbrandSet実値)は変更
   していない。左上の大きなLEGACIA Logotype(.trial-footer-brand)は対象外。 */
.trial-brand {
  display: none;
}

.trial-footer-brand {
  left: 8.1%;
  top: 12.8%;
  width: 32.6%;
  opacity: 0.8;
  z-index: 1;
}
.trial-footer-brand img {
  width: 100%;
  display: block;
}

.trial-definition {
  left: 8%;
  top: 22.9%;
  max-width: 46%;
  font-size: 24px;
  line-height: 2.0;
  letter-spacing: 0.02em;
  text-align: left;
  opacity: 0.92;
  margin: 0;
}

.trial-observation {
  left: 8%;
  top: 40.8%;
  max-width: 40%;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-align: left;
  opacity: 1;
  margin: 0;
}

.trial-nav {
  left: 41.7%;
  top: 88%;
  max-width: 60%;
  display: flex;
  flex-wrap: wrap;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  opacity: 0.85;
}
.trial-nav-item {
  white-space: nowrap;
  text-transform: uppercase;
}
.trial-nav-item + .trial-nav-item {
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  margin-left: 12px;
  padding-left: 12px;
}
/* .trial-elの親要素はpointer-events:noneだが、実際にリンク先が決まっている
   5入口のうちAI/Stories/Blogだけはクリック可能にする(Cars/Moviesは
   href自体を持たないため元々操作不可、見た目・配置は変更していない)。 */
a.trial-nav-item {
  pointer-events: auto;
  cursor: pointer;
}

/* PUBLIC FIXED BOTTOM NAVIGATION INTEGRATION 001により、このHero内
   Navigationの表示は下記.fixed-navへ統合(Owner GOOD)。値そのもの(JSON
   由来のnavigation実値)は変更せず、上記ブロックはそのまま残している。 */
.trial-nav {
  display: none;
}

/* Hero直後のセクションのみ、境界線と上部余白を弱めてHeroとの連続性を出す
   (Owner評価用の最小限の調整。大規模なデザイン変更ではない)。 */
.proto-section--after-hero {
  border-top: none;
  padding-top: 6vh;
  background: linear-gradient(180deg, rgba(5, 7, 13, 1) 0%, rgba(5, 7, 13, 1) 100%);
}

@media (max-width: 768px) {
  .trial-hero .hero-media img {
    object-position: 80.76923076923077% 51.99052132701422%;
  }
  .trial-hero .hero-media::before {
    background-position: 80.76923076923077% 51.99052132701422%;
  }
  .trial-brand {
    left: 35.4%;
    top: 88.7%;
    width: 28.8%;
    opacity: 0.73;
  }
  .trial-footer-brand {
    left: 15.7%;
    top: 12.1%;
    width: 68.9%;
    opacity: 0.8;
  }
  .trial-definition {
    left: 18.3%;
    top: 17.2%;
    max-width: 84%;
    font-size: 14px;
    line-height: 1.7;
  }
  .trial-observation {
    left: 18.5%;
    top: 26.6%;
    max-width: 80%;
    font-size: 17px;
    line-height: 1.4;
  }
  .trial-nav {
    left: 15.4%;
    top: 86.4%;
    max-width: 84%;
    font-size: 11px;
    line-height: 1.3;
    letter-spacing: 0.1em;
  }
}

/* ---------------------------------------------------------------------
   Fixed Bottom Navigation(PUBLIC FIXED BOTTOM NAVIGATION INTEGRATION 001)

   Owner GOODとなったPrototype_v0.1の.fixed-nav実装をSource of Truthとして
   そのまま再現(font/size/letter-spacing/opacity/separator/gap/背景帯/
   center alignmentは再設計していない)。Public用にpathのみroot-absolute
   (例: /legacia-os/)へ変換している。左端LEGACIA Mark(ロゴタイプ・文字は
   使用しない)がHomeリンクを兼ねる。素材はImages/Logo/
   LEGACIA_Mark_White_v004_PROVISIONAL.pngをそのまま使用(加工していない、
   PROVISIONAL名称も変更していない)。全ページ共通。 --------------------- */
.fixed-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 8vw;
  background: rgba(5, 7, 13, 0.7);
}

.fixed-nav-mark {
  display: block;
  flex-shrink: 0;
  line-height: 0;
}
.fixed-nav-mark img {
  display: block;
  height: 20px;
  width: auto;
}

.fixed-nav-items {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  font-family: system-ui, "Hiragino Sans", "Yu Gothic", sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  opacity: 0.85;
  color: #ffffff;
}
.fixed-nav-items a,
.fixed-nav-items span {
  white-space: nowrap;
  text-transform: uppercase;
}
.fixed-nav-items > * + * {
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  margin-left: 12px;
  padding-left: 12px;
}

@media (max-width: 768px) {
  .fixed-nav {
    gap: 14px;
    padding: 14px 6vw;
  }
  .fixed-nav-mark img {
    height: 16px;
  }
  .fixed-nav-items {
    font-size: 11px;
    line-height: 1.3;
    letter-spacing: 0.1em;
  }
  .fixed-nav-items > * + * {
    margin-left: 9px;
    padding-left: 9px;
  }
}

/* Fixed Navが常に画面下部を占有するため、本文/Footerが隠れないよう
   bodyに下部セーフスペースを確保する(Prototype_v0.1と同じ考え方)。 */
body {
  padding-bottom: 64px;
}
@media (max-width: 768px) {
  body {
    padding-bottom: 56px;
  }
}
