/* Reset all heading styles */
:root {
  --bs-heading-color: #000;
  --bs-body-color: #000;
  --bs-link-color: #000;
  --bs-link-hover-color: #000;
  --header-height: 60px;
  --carousel-height: 30vh;
  --section-spacing-large: clamp(4rem, 8vw, 6rem);  /* 大きい間隔（セクション間） */
  --section-spacing-medium: clamp(3rem, 6vw, 4rem); /* 中間の間隔（サブセクション間） */
  --section-spacing-small: clamp(2rem, 4vw, 3rem);  /* 小さい間隔（要素間） */
  --section-padding: clamp(2rem, 4vw, 3rem);        /* セクション内のパディング */
  --content-spacing: clamp(2rem, 4vw, 4rem);
  --element-spacing: clamp(1rem, 2vw, 2rem);
  --animation-duration: 0.5s;
  --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ベーススタイル */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, 
.display-4, .display-5, .display-6,
.head {
  margin: 0;
  padding: 0;
  color: #000;
  border: none;
  text-decoration: none;
  font-weight: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}

/* カルーセル */
.carousel {
  height: var(--carousel-height);
  margin-top: var(--header-height);
  padding-top: 0;
}

.carousel-inner {
  height: 100%;
}

.carousel-item {
  height: 100%;
  position: relative;
}

.carousel-item img {
  object-fit: cover;
  height: var(--carousel-height);
  width: 100%;
}

.carousel-caption {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  left: 0;
  right: 0;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* タイプライター効果のテキスト */
.typewriter-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
}

.typewriter-text {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  color: #333;
  text-align: center !important;
  width: 100%;
  margin: 0;
  padding: 0;
}

.typewriter-text-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  padding: 0;
}

.typewriter-text-description {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  opacity: 0.9;
}

/* ヘッダー */
.header {
  background-color: orangered;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0.5rem 0;
  height: var(--header-height);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(1rem, 3vw, 2rem);
  height: 100%;
}

.logo {
  height: clamp(35px, 6vw, 45px);
  width: auto;
  filter: brightness(0) invert(1);
}

/* ナビゲーション */
.nav-menu {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  color: white !important;
  text-decoration: none;
  font-weight: bold;
  font-size: clamp(0.9rem, 2vw, 1rem);
  padding: 0.5rem;
  transition: opacity var(--animation-duration) var(--animation-timing);
}

/* モバイルメニュー */
@media (max-width: 768px) {
  .hamburger {
    display: block;
    padding: 0.5rem;
    margin: -0.5rem;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    transition: transform var(--animation-duration) var(--animation-timing);
    position: relative;
    z-index: 1002;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hamburger:active {
    transform: scale(0.95);
  }

  .hamburger-icon,
  .close-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity var(--animation-duration) var(--animation-timing);
    line-height: 1;
  }

  .hamburger-icon {
    opacity: 1;
    font-size: 40px;
  }

  .close-icon {
    opacity: 0;
    font-size: 45px;
  }

  .nav-menu.active ~ .hamburger .hamburger-icon,
  .nav-menu.active + .hamburger .hamburger-icon {
    opacity: 0;
  }

  .nav-menu.active ~ .hamburger .close-icon,
  .nav-menu.active + .hamburger .close-icon {
    opacity: 1;
  }

  .hamburger span {
    color: white;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: orangered;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 2rem);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--animation-duration) var(--animation-timing);
    display: flex !important;
    transform: translateY(-100%);
  }

  .nav-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-link {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    padding: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--animation-duration) var(--animation-timing);
  }

  .nav-menu.active .nav-link {
    opacity: 1;
    transform: translateY(0);
  }
}

/* デスクトップメニュー */
@media (min-width: 769px) {
  :root {
    --header-height: 64px;
  }

  .hamburger {
    display: none;
  }

  .nav-menu {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static;
    width: auto;
    height: auto;
    background: none;
    padding: 0;
    transform: none;
    pointer-events: auto;
  }

  .nav-link {
    opacity: 1;
    transform: none;
  }
}

/* マップ */
.map-container {
  position: relative;
  width: 100%;
  padding-bottom: clamp(56.25%, 75%, 75%);
  margin-bottom: clamp(2rem, 5vw, 5rem);
}

.google-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* フッター */
.footer {
  background-color: orangered;
  padding: clamp(2rem, 5vw, 4rem) 0;
  color: white;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-link {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  transition: opacity 0.3s ease;
}

.footer-link:hover {
  color: white;
  opacity: 0.8;
}

.footer-separator {
  color: white;
  opacity: 0.6;
  margin: 0 0.5rem;
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    text-align: center;
  }

  .footer-separator {
    display: none;
  }

  .footer-link {
    font-size: 1rem;
    padding: 0.5rem 0;
  }
}

/* モーダルウィンドウ内の画像サイズ調整 */
.modal-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.modal-body .container {
  width: 100%;
  padding: 0;
}

.modal-body .row {
  margin: 0;
}

.modal-body .col-11 {
  padding: 0;
}

/* その他のスタイルは維持 */
.container-fluid {
  padding: 0;
}

.logo-link {
  display: block;
  z-index: 1001;
}

.logo-text {
  fill: #333;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .logo-text {
    fill: #fff;
  }
}

.navbar {
  background-color: orangered;
  width: 100vw;
  margin: 0;
  padding: 1rem 0;
}

.navbar-toggler {
  border-color: white;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: #007bff;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

.navbar-brand svg {
  height: 30px;
  width: auto;
}

.company-info {
  margin: 0;
}

.company-info .scroll-reveal {
  margin-bottom: 1.5rem;
}

.company-info dt,
.company-info dd {
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.company-info dt {
  font-weight: bold;
  float: left;
  clear: left;
  width: 7em;
}

.company-info dd {
  margin-left: 7em;
}

@media (max-width: 768px) {
  .company-info dt {
    width: 5em;
  }
  
  .company-info dd {
    margin-left: 5em;
  }
}

.modal-title {
  margin: 0;
  color: white;
}

.btn-secondary {
  color: #fff;
  background-color: #6c757d;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.ceo {
  border: 3px solid #f8f9fa;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

.modal {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop {
  display: none;
}

.nav-masthead {
  margin-left: auto;
}

/* セクション共通スタイル */
section {
  padding: var(--section-padding) 0;
  margin: 0;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--animation-duration) var(--animation-timing) forwards;
}

/* 通常のセクション間の間隔 */
section:not(:last-child) {
  margin-bottom: var(--section-spacing-large);
}

/* アクセスセクションの特別な間隔 */
#access {
  padding-top: 2rem;
}

#access .section-title {
  margin-top: 0;
  margin-bottom: 2rem;
}

/* セクション内の要素間の間隔 */
.section .container > *:not(:last-child) {
  margin-bottom: var(--section-spacing-small);
}

/* 画像を含むコンテナの間隔 */
.col-md-8.offset-md-2:not(:last-child) {
  margin-bottom: var(--section-spacing-medium);
}

/* セクションタイトル */
.section-title {
  margin-bottom: var(--content-spacing);
  text-align: center;
}

/* カード */
.card {
  margin-bottom: var(--content-spacing);
  transition: transform var(--animation-duration) var(--animation-timing);
}

.card:hover {
  transform: translateY(-5px);
}

/* フッター */
footer {
  margin-top: var(--section-spacing-large);
  padding: clamp(3rem, 6vw, 6rem) 0;
  background-color: orangered;
  color: white;
}

/* メインコンテンツ */
main {
  padding-top: calc(var(--header-height) + var(--section-spacing-large));
}

/* アニメーション */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ストアボタン */
.store-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.store-button {
  width: 140px;
  height: auto;
  object-fit: contain;
  object-position: center;
}

/* App Store特有の調整 */
.store-button[src*="App_Store"] {
  padding: 1px; /* App Storeバッジの余白を微調整 */
}

/* Google Play特有の調整 */
.store-button[src*="google-play-badge"] {
  padding: 1px; /* Google Playバッジの余白を微調整 */
  transition: transform 0.2s ease;
}

.store-button:hover {
  transform: translateY(-2px);
}

/* テキストセンター */
.text-center {
  text-align: center;
}

/* パネルのフラッシュアニメーション */
.tech-card {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.08s ease-out;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    z-index: 1;
}

.tech-card .card-header {
    position: relative;
    z-index: 2;
}

.tech-card .list-unstyled {
    position: relative;
    z-index: 2;
}

.tech-card.flash {
    background-color: rgba(255, 69, 0, 0.95);
    border-color: rgba(255, 69, 0, 1);
    box-shadow: 0 0 40px rgba(255, 69, 0, 0.8);
    transform: scale(1.03);
}

.tech-card.flash .icon,
.tech-card.flash h4,
.tech-card.flash li {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ホバー時の挙動 */
.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(203, 213, 225, 0.5);
}

/* ===== DTx セクション折り返し（スマホ用）===== */
@media (max-width: 767px) {
  .dtx-flex {
    flex-direction: column !important; /* 縦並びにする */
    gap: 2rem !important;              /* 上下余白 */
  }

  .dtx-flex > div {
    width: 100% !important;    /* 子要素を全幅に */
    min-width: 0 !important;   /* inline の min-width を打ち消す */
  }
}

/* Healthcare Security テキストのスタイル */
.message-en {
    font-size: 2rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .message-en {
        font-size: 1.5rem;
    }
}

/* ===== タイムラインテーブルのレスポンシブ対応 ===== */
.timeline-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.timeline-table th,
.timeline-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.timeline-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.timeline-table tbody tr {
    transition: background-color 0.2s ease;
}

.timeline-table tbody tr:hover {
    background-color: #f9fafb;
}

.activity-cell {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.timeline-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background-color: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

/* スマートフォン用カード表示 */
@media (max-width: 768px) {
    .timeline-table {
        display: none;
    }
    
    .timeline-container {
        margin: 2rem 0;
    }
    
    .timeline-mobile-cards {
        display: block;
    }
    
    .timeline-card {
        background: white;
        border-radius: 12px;
        padding: 1.5rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-left: 4px solid #3b82f6;
    }
    
    .timeline-card-day {
        font-size: 1.5rem;
        font-weight: bold;
        color: #3b82f6;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .timeline-card-activity {
        margin-bottom: 1rem;
    }
    
    .timeline-card-activity .activity-cell {
        margin-bottom: 0.75rem;
    }
    
    .timeline-card-skill {
        background-color: #f0f9ff;
        padding: 0.75rem;
        border-radius: 8px;
        font-size: 0.9rem;
        color: #1e40af;
        font-weight: 500;
    }
    
    .timeline-card-skill::before {
        content: "💡 ";
        margin-right: 0.25rem;
    }
}

/* デスクトップ表示では.timeline-mobile-cardsを非表示 */
@media (min-width: 769px) {
    .timeline-mobile-cards {
        display: none;
    }
}