/* ==============================================
   CSS Custom Properties
============================================== */
:root {
  --color-logo-amp:      #1D3E99;   /* "&" の青 */
  --color-logo-name:     #3A7E28;   /* "Nanoview" の緑 */
  --color-nav-text:      #444444;
  --color-body-text:     #333333;
  --color-research-link: #1a96d0;   /* 研究開発一覧リンク */
  --color-header-bg:     #ffffff;
  --color-section-bg:    #ffffff;
  --header-height:       58px;
  --font-main: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN',
               'Hiragino Sans', Meiryo, sans-serif;
  --font-logo: Georgia, 'Times New Roman', serif;
}

/* ==============================================
   Reset & Base
============================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;   /* スクロールはスナップコンテナが管理 */
}

body {
  font-family: var(--font-main);
  font-size: 17px;
  font-weight: 500;
  color: var(--color-body-text);
  line-height: 1.8;
  background: #fff;
}

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

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}


/* ==============================================
   Header
============================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-header-bg);
  z-index: 1000;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 48px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ---- Logo ---- */
.logo {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.logo-img {
  height: 34px;
  width: auto;
  display: block;
}

/* ---- Global Nav ---- */
.global-nav ul {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-nav-text);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--color-logo-amp);
}


/* ==============================================
   Scroll Snap Container
============================================== */
.snap-container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  /* scroll-behavior: smooth は削除。
     mandatory snap と競合し、連続ホイール入力時に
     スナップが止まり操作不能になる原因となるため。
     JS の scrollTo() には個別に behavior:'smooth' を渡すので問題なし。 */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE / Edge */
}

.snap-container::-webkit-scrollbar {
  display: none;                /* Chrome / Safari */
}


/* ==============================================
   Section 共通
============================================== */
.section {
  position: relative;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;  /* 高速スクロール時もセクションを飛ばさず必ず停止 */
}


/* ==============================================
   Section 1 : Hero
============================================== */
.section--hero {
  overflow: hidden;
}

/* ---- Slideshow ---- */
.slideshow {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  z-index: 1;
  transition: opacity 2s ease-in-out;  /* エフェクト時間のみ変更（待機間隔は4sのまま） */
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

/* 画像が前面、グラデーションは読み込み失敗時のフォールバック */
.slide--1 {
  background: url('../images/hero/hero_1.jpg') center / cover no-repeat,
              linear-gradient(155deg, #a8d0e8 0%, #5a9ec8 45%, #7ab8d8 100%);
}

.slide--2 {
  background: url('../images/hero/hero_2.jpg') center / cover no-repeat,
              linear-gradient(155deg, #90c0d8 0%, #4a8ab8 45%, #6aacc8 100%);
}

.slide--3 {
  background: url('../images/hero/hero_3.jpg') center / cover no-repeat,
              linear-gradient(155deg, #9ac8d4 0%, #5292b0 45%, #74b0c8 100%);
}

/* ---- Overlay ---- */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 3;
  pointer-events: none;
}

/* ---- Hero Text ---- */
.hero-content {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  color: #fff;
}

.hero-title {
  font-size: 70px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  margin-bottom: 18px;
  text-shadow:
    1px  2px  4px  rgba(0, 0, 0, 0.30),
    0    4px  16px rgba(0, 0, 0, 0.20),
    0    0    40px rgba(0, 0, 0, 0.12);
}

.hero-subtitle {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.05em;
  text-shadow:
    1px  1px  4px  rgba(0, 0, 0, 0.32),
    0    2px  10px rgba(0, 0, 0, 0.20);
}


/* ==============================================
   Section 2 : Greeting
============================================== */
.section--greeting {
  background: var(--color-section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height); /* ヘッダー分のオフセット */
}

.greeting-inner {
  width: 100%;
  max-width: 980px;
  padding: 0 40px;
}

/* ---- Section Title ---- */
.section-title {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  color: #333;
  letter-spacing: 0.14em;
  margin-bottom: 52px;
}

/* ---- Two-column layout ---- */
.greeting-layout {
  display: flex;
  gap: 60px;
  align-items: flex-start;
}

/* ---- Left: Image ---- */
.greeting-image-wrap {
  flex: 0 0 300px;
}

.image-placeholder {
  width: 100%;
  height: 360px;
  background-color: #eaeef2;
  border-left: 3px solid #b8c8d8;
  position: relative;
  overflow: hidden;
}

/* 画像なし時のラベル表示 */
.image-placeholder::after {
  content: '[ 画像挿入予定 ]';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #aab4c0;
  font-size: 13px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* 実際の画像 */
.greeting-image-wrap img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center top;
  border-left: 3px solid #b8c8d8;
  display: block;
}

/* ---- Right: Text ---- */
.greeting-text p {
  font-size: 17px;
  font-weight: 500;
  line-height: 2;
  color: #333;
}

/* 段落間のスペース */
.greeting-text p + p {
  margin-top: 6px;
}

.greeting-name {
  margin-top: 32px !important;
  font-size: 17px;
  font-weight: 500;
  color: #333;
}

.research-link {
  display: inline-block;
  margin-top: 28px;
  font-size: 17px;
  color: var(--color-research-link);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.2s ease;
}

.research-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}


/* ==============================================
   Section 3 : Company Overview（会社概要）
============================================== */
.section--company {
  background: var(--color-section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height);
}

/* Section 2（980px）より広めに設定 */
.company-inner {
  width: 100%;
  max-width: 1280px;
  padding: 0 40px;
}

/* タイトルは2カラムの上、中央揃え */
.section--company .section-title {
  text-align: center;
  letter-spacing: 0.06em;
  margin-bottom: 40px;
}

/* ---- 左右2カラム ---- */
.company-columns {
  display: flex;
  gap: 64px;
  align-items: flex-start;
}

/* ---- 左カラム：テーブル ---- */
.company-left {
  flex: 1;
  min-width: 0;   /* flex 子要素のテキスト溢れ防止 */
}

/* ---- Table ---- */
.company-table {
  border-top: 1px solid #d8d8d8;
  width: 100%;
}

.company-row {
  display: flex;
  align-items: flex-start;
  padding: 22px 0;
  border-bottom: 1px solid #d8d8d8;
}

.company-label {
  flex: 0 0 170px;
  font-size: 17px;
  font-weight: 700;
  color: #333;
  line-height: 1.8;
}

.company-value {
  flex: 1;
  font-size: 17px;
  font-weight: 400;
  color: #333;
  line-height: 1.8;
}

/* ---- 右カラム：Googleマップ ---- */
.company-right {
  flex: 0 0 min(600px, 47%);
  width: min(600px, 47%);
  align-self: stretch;   /* 左カラムと高さを揃える */
  display: flex;
  align-items: center;
}

.company-right iframe {
  width: 100%;
  height: min(600px, calc(100dvh - 240px));
  min-height: 420px;
  display: block;
  border: 0;
}

@media (min-width: 1366px) and (max-width: 1535px),
       (min-width: 1536px) and (max-height: 880px) {
  .company-inner {
    max-width: 1220px;
  }

  .section--company .section-title {
    margin-bottom: 24px;
  }

  .company-columns {
    gap: 44px;
  }

  .company-row {
    padding: 12px 0;
  }

  .company-label,
  .company-value {
    font-size: 16px;
    line-height: 1.55;
  }

  .company-label {
    flex-basis: 150px;
  }

  .company-right {
    flex-basis: 500px;
    width: 500px;
  }

  .company-right iframe {
    height: clamp(360px, calc(100dvh - 230px), 500px);
    min-height: 360px;
  }
}


/* ==============================================
   Section 4 : Topics（トピックス）
   .company-table / .company-row / .company-label /
   .company-value は Section 3 のものを流用
============================================== */
.section--topics {
  background: var(--color-section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height);
}

.topics-inner {
  width: 100%;
  max-width: 980px;   /* Section 2 と同じ幅基準 */
  padding: 0 40px;
}

.section--topics .section-title {
  letter-spacing: 0.06em;
  margin-bottom: 40px;
}


/* ==============================================
   Section 5 : Expertise（専門技術・業務）
   幅・カラム構造は Section 3 を流用
============================================== */
.section--expertise {
  background: var(--color-section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height);
}

.expertise-inner {
  width: 100%;
  max-width: 1280px;   /* Section 3 と同じ */
  padding: 0 40px;
}

.expertise-columns {
  display: flex;
  gap: 64px;           /* Section 3 と同じ */
  align-items: flex-start;
}

.expertise-col {
  flex: 1;
  min-width: 0;
}

/* ---- 列見出し ---- */
.expertise-heading {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.06em;
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid #d8d8d8;
}

/* ---- リスト ---- */
.expertise-list {
  list-style: none;
}

.expertise-list li {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  line-height: 1.8;
  padding: 11px 0 11px 1.4em;
  text-indent: -1.4em;
  border-bottom: 1px solid #ebebeb;
}

.expertise-list li::before {
  content: '・';
  color: #666;
}

/* 2カラム下・中央のリンク */
.expertise-link {
  display: block;
  margin-top: 32px;
  text-align: center;
}


/* ==============================================
   Section 1 : Hero — Entrance Animation
   スクロールでセクションに入った瞬間に発火。ループなし。
   戻ってきたとき再生。
============================================== */

/* @keyframes */
@keyframes heroImageIn {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes heroTextIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* .hero-anim クラス付与時にアニメーション発火 */
.section--hero.hero-anim .slideshow {
  animation: heroImageIn 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.section--hero.hero-anim .hero-title {
  animation: heroTextIn 0.9s ease-out 0.5s both;
}

.section--hero.hero-anim .hero-subtitle {
  animation: heroTextIn 0.9s ease-out 0.75s both;
}


/* ==============================================
   Research Page : セクション共通
============================================== */
.section--research {
  background: var(--color-section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height);
}

.research-inner {
  width: 100%;
  max-width: 1200px;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section--research .section-title {
  letter-spacing: 0.06em;
  margin-bottom: 40px;
  white-space: nowrap;
  font-size: clamp(18px, 2vw, 28px);
}

/* ---- 画像 ---- */
.research-image-wrap {
  display: flex;
  justify-content: center;
}

.research-image-wrap img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- セクション3以降：画像を小さめに ---- */
#research-3 .research-image-wrap img,
#research-4 .research-image-wrap img,
#research-5 .research-image-wrap img,
#research-6 .research-image-wrap img {
  max-width: 70%;
}

/* 最終セクションはタイトルと注釈を除いた高さを画像に割り当てる */
#research-6 .research-inner {
  height: calc(100dvh - var(--header-height));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#research-6 .research-image-wrap {
  min-height: 0;
  align-items: stretch;
}

#research-6 .research-image-wrap img {
  width: auto;
  height: 100%;
  max-width: 70%;
  max-height: 100%;
  object-fit: contain;
}

/* ---- 注釈テキスト ---- */
.research-caption {
  margin-top: 24px;
  font-size: 0.95rem;
  color: var(--color-text-sub, #555);
  line-height: 1.8;
  text-align: center;
}


/* ==============================================
   Responsive
============================================== */
@media (min-width: 1024px) and (max-width: 1365px) {
  .header-inner {
    padding: 0 32px;
  }

  .global-nav ul {
    gap: 28px;
  }

  .hero-title {
    font-size: 56px;
  }

  .hero-subtitle {
    font-size: 20px;
  }

  .section-title {
    font-size: 28px;
    margin-bottom: 32px;
  }

  .greeting-inner,
  .topics-inner {
    max-width: 900px;
  }

  .greeting-layout {
    gap: 40px;
  }

  .greeting-image-wrap {
    flex-basis: 260px;
  }

  .greeting-image-wrap img,
  .image-placeholder {
    height: 320px;
  }

  .greeting-text p {
    font-size: 16px;
    line-height: 1.8;
  }

  .company-inner,
  .expertise-inner {
    max-width: 1040px;
  }

  .company-columns,
  .expertise-columns {
    gap: 36px;
  }

  .company-row {
    padding: 12px 0;
  }

  .company-label,
  .company-value {
    font-size: 15px;
    line-height: 1.55;
  }

  .company-label {
    flex-basis: 130px;
  }

  .company-right {
    flex-basis: 390px;
    width: 390px;
  }

  .company-right iframe {
    height: clamp(320px, calc(100dvh - 230px), 430px);
    min-height: 320px;
  }

  .expertise-heading {
    font-size: 20px;
  }

  .expertise-list li {
    font-size: 15px;
    line-height: 1.65;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .research-inner {
    max-width: 1040px;
  }
}

@media (max-width: 1023px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  body {
    font-size: 16px;
  }

  .header {
    position: sticky;
    height: auto;
  }

  .header-inner {
    min-height: var(--header-height);
    padding: 10px 24px;
    gap: 16px;
  }

  .global-nav ul {
    gap: 24px;
  }

  .nav-link {
    font-size: 15px;
  }

  .snap-container {
    height: auto;
    overflow: visible;
    scroll-snap-type: none;
  }

  .section {
    height: auto;
    min-height: auto;
    scroll-snap-align: none;
  }

  .section--hero {
    min-height: min(720px, 92dvh);
  }

  .section--greeting,
  .section--company,
  .section--topics,
  .section--expertise,
  .section--research {
    display: block;
    padding: 56px 0;
  }

  .greeting-inner,
  .company-inner,
  .topics-inner,
  .expertise-inner,
  .research-inner {
    padding: 0 32px;
  }

  .section-title {
    font-size: 26px;
    margin-bottom: 32px;
  }

  .greeting-layout,
  .company-columns,
  .expertise-columns {
    flex-direction: column;
    gap: 32px;
  }

  .greeting-image-wrap {
    flex: none;
    width: min(320px, 100%);
    margin: 0 auto;
  }

  .greeting-image-wrap img,
  .image-placeholder {
    height: auto;
    aspect-ratio: 5 / 6;
  }

  .greeting-text p {
    font-size: 16px;
    line-height: 1.85;
  }

  .company-left,
  .company-right,
  .expertise-col {
    width: 100%;
  }

  .company-right {
    flex: none;
    align-self: auto;
  }

  .company-right iframe {
    height: 360px;
    min-height: 0;
  }

  .expertise-link {
    margin-top: 24px;
  }

  .research-image-wrap img,
  #research-3 .research-image-wrap img,
  #research-4 .research-image-wrap img,
  #research-5 .research-image-wrap img,
  #research-6 .research-image-wrap img {
    max-width: 100%;
    max-height: 62dvh;
    object-fit: contain;
  }
}

@media (max-width: 767px) {
  :root {
    --header-height: 54px;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 18px;
  }

  .logo-img {
    height: 30px;
  }

  .global-nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .global-nav::-webkit-scrollbar {
    display: none;
  }

  .global-nav ul {
    width: max-content;
    min-width: 100%;
    gap: 18px;
  }

  .nav-link {
    font-size: 14px;
    letter-spacing: 0.02em;
  }

  .section--hero {
    min-height: 76dvh;
  }

  .hero-content {
    padding: 0 20px;
  }

  .hero-title {
    font-size: clamp(34px, 11vw, 48px);
    letter-spacing: 0.02em;
    margin-bottom: 14px;
  }

  .hero-subtitle {
    font-size: clamp(15px, 4.5vw, 18px);
    line-height: 1.75;
    letter-spacing: 0.02em;
  }

  .section--greeting,
  .section--company,
  .section--topics,
  .section--expertise,
  .section--research {
    padding: 44px 0;
  }

  .greeting-inner,
  .company-inner,
  .topics-inner,
  .expertise-inner,
  .research-inner {
    padding: 0 20px;
  }

  .section-title {
    font-size: 23px;
    letter-spacing: 0.06em;
    margin-bottom: 24px;
  }

  .greeting-layout,
  .company-columns,
  .expertise-columns {
    gap: 26px;
  }

  .greeting-text p,
  .company-label,
  .company-value,
  .research-link {
    font-size: 15px;
  }

  .greeting-text p {
    line-height: 1.8;
  }

  .greeting-name {
    margin-top: 22px !important;
  }

  .research-link {
    margin-top: 20px;
  }

  .company-row {
    display: block;
    padding: 14px 0;
  }

  .company-label {
    margin-bottom: 4px;
    line-height: 1.5;
  }

  .company-value {
    line-height: 1.65;
  }

  .company-right iframe {
    height: 280px;
  }

  .expertise-heading {
    font-size: 19px;
  }

  .expertise-list li {
    font-size: 15px;
    line-height: 1.65;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .research-inner {
    align-items: stretch;
  }

  .section--research .section-title {
    white-space: normal;
    font-size: 22px;
    line-height: 1.45;
  }

  .research-caption {
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.75;
    text-align: left;
  }
}

@media (max-width: 374px) {
  .header-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .greeting-inner,
  .company-inner,
  .topics-inner,
  .expertise-inner,
  .research-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-title {
    font-size: 32px;
  }

  .section-title {
    font-size: 21px;
  }

  .company-right iframe {
    height: 240px;
  }
}

@media (max-height: 780px) and (min-width: 1024px) {
  .section-title {
    margin-bottom: 24px;
  }

  .greeting-layout {
    gap: 36px;
  }

  .greeting-image-wrap {
    flex-basis: 250px;
  }

  .greeting-image-wrap img,
  .image-placeholder {
    height: 300px;
  }

  .greeting-text p {
    font-size: 15px;
    line-height: 1.7;
  }

  .research-link {
    margin-top: 18px;
  }

  .expertise-list li {
    line-height: 1.55;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@media (min-width: 1024px) and (max-height: 880px),
       (min-width: 1366px) and (max-width: 1535px) {
  #research-4 .section-title,
  #research-5 .section-title {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 8px;
    font-size: clamp(20px, 1.55vw, 24px);
    line-height: 1.35;
  }

  #research-4 .research-image-wrap,
  #research-5 .research-image-wrap {
    align-items: center;
  }

  #research-4 .research-image-wrap img,
  #research-5 .research-image-wrap img {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    height: min(560px, calc(100dvh - 210px));
    max-height: none;
    object-fit: contain;
  }

  #research-4 .research-caption,
  #research-5 .research-caption {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.55;
  }
}

@media (min-width: 1024px) and (max-height: 760px) {
  #research-4 .section-title,
  #research-5 .section-title {
    margin-bottom: 12px;
  }

  #research-4 .research-image-wrap img,
  #research-5 .research-image-wrap img {
    height: min(530px, calc(100dvh - 220px));
  }

  #research-4 .research-caption,
  #research-5 .research-caption {
    margin-top: 10px;
  }
}
