@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600;700&family=Outfit:wght@400;600;800&display=swap');

:root {
  --bg-main: #f5f7fa;
  --bg-surface: rgba(255, 255, 255, 0.9);
  --bg-card: #ffffff;
  
  --primary: #7D4B8E; /* 上品で明るい京紫（京都の紫） */
  --primary-hover: #643b72;
  --accent: #f77f00; /* アクティブなオレンジ */
  
  --text-primary: #1a1d20;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  
  --border-light: rgba(0, 0, 0, 0.06);
  --border-active: rgba(125, 75, 142, 0.3);
  
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Manrope', sans-serif;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.7;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(125, 75, 142, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(247, 79, 0, 0.02) 0%, transparent 40%);
  background-attachment: fixed;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header / Nav */
header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

nav {
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.mobile-menu-toggle {
  display: none; /* デフォルト（PC）では非表示 */
}

.mobile-menu-toggle svg {
  width: 28px;
  height: 28px;
  stroke: var(--primary);
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.mobile-menu-toggle:hover svg {
  stroke: var(--primary-hover);
  transform: scale(1.08);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.85rem; /* 45度傾いたキノコと文字の間隔を最適に確保 */
  color: var(--text-primary);
}

.logo-icon {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
}

.logo-icon-svg {
  width: 1.8rem;
  height: 1.8rem;
  color: var(--primary);
  fill: rgba(125, 75, 142, 0.1);
  transform: translateY(-3px) rotate(45deg); /* 上に3px持ち上げて重心バランスを文字と同期 */
  transform-origin: center bottom; /* キノコの根元を基準に設定 */
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), fill 0.3s ease;
}

.logo:hover .logo-icon-svg {
  /* 根元からひょこっと起き上がり（45度➔15度）、さらに上にホップ（6px）＆ふっくら拡大 */
  transform: translateY(-6px) rotate(15deg) scale(1.08, 1.05);
  fill: rgba(125, 75, 142, 0.25);
}

.logo-text {
  background: linear-gradient(135deg, var(--primary), #a364b5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  list-style: none;
}

.nav-links li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.nav-links li a:hover {
  color: var(--primary);
  background: rgba(125, 75, 142, 0.05);
}

/* Active Nav Tab */
.nav-links li.active a {
  color: var(--primary);
  background: rgba(125, 75, 142, 0.08);
  box-shadow: inset 0 0 0 1px rgba(125, 75, 142, 0.15);
}

/* Main Content Area */
main {
  padding-top: 3rem;
  padding-bottom: 5rem;
}

.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#content {
  padding: 4rem;
}

/* Markdown elements styling inside Light Mode */
#content h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 2rem;
  color: var(--text-primary);
  border-bottom: 2px solid rgba(125, 75, 142, 0.15);
  padding-bottom: 1.2rem;
  letter-spacing: -0.8px;
}

#content h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.2rem;
  color: var(--primary);
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
}

#content h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

#content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

#content blockquote {
  border-left: 5px solid var(--primary);
  background: rgba(125, 75, 142, 0.03);
  padding: 1.2rem 2rem;
  margin: 2rem 0;
  border-radius: 0 16px 16px 0;
}

#content blockquote p {
  margin: 0;
  color: var(--text-primary);
  font-weight: 500;
}

#content ul, #content ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

#content li {
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

#content hr {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 3.5rem 0;
}

/* Beautiful corporate tables for company overview */
#content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.01);
}

#content th {
  background-color: rgba(125, 75, 142, 0.06);
  color: var(--primary);
  font-weight: 700;
  text-align: left;
  padding: 1rem 1.2rem;
  border-bottom: 2px solid rgba(125, 75, 142, 0.1);
  font-size: 1rem;
}

#content td {
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 1rem;
  background-color: var(--bg-card);
}

#content tr:last-child td {
  border-bottom: none;
}

#content tr:hover td {
  background-color: rgba(125, 75, 142, 0.01);
}

/* Footer */
footer {
  padding: 4rem 0;
  border-top: 1px solid var(--border-light);
  background-color: #ffffff;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Loading indicator styling */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 5rem 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(125, 75, 142, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
  }
  main {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
  }
  #content {
    padding: 1.5rem;
    border-radius: 16px;
  }
  #content h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }
  #content h2 {
    font-size: 1.45rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
  }
  #content h3 {
    font-size: 1.2rem;
  }
  #content p, #content li {
    font-size: 0.98rem;
  }
  #content blockquote {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
  }

  /* テーブルのモバイルはみ出し防止・横スクロール強制 */
  #content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    border: 1px solid var(--border-light);
  }
  #content th, #content td {
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
  }

  /* ナビゲーションのモバイル・ハンバーガーメニュー化 */
  nav {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem;
    width: 100%;
    position: relative;
  }
  .logo {
    font-size: 1.35rem;
  }
  .logo-icon {
    font-size: 1.45rem;
  }
  .mobile-menu-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    outline: none;
    transition: background 0.2s ease;
  }
  .mobile-menu-toggle:hover {
    background: rgba(125, 75, 142, 0.06);
  }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
    gap: 0.8rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.04);
    z-index: 99;
  }
  .nav-links.active {
    display: flex;
    animation: menuSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes menuSlideDown {
    from {
      opacity: 0;
      transform: translateY(-12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .nav-links li {
    width: 100%;
    text-align: center;
    flex-shrink: unset;
  }
  .nav-links li a {
    display: block;
    width: 100%;
    font-size: 1.05rem;
    padding: 0.7rem 0;
  }

  /* フッターのモバイル適正配置 */
  footer {
    padding: 3rem 1rem;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    line-height: 1.6;
  }
}

/* Substack Teaser CTA Button Styling */
.substack-cta-container {
  display: flex;
  justify-content: center;
  margin: 3rem 0;
}

.btn-substack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #FF6719; /* Substack Brand Orange */
  color: #ffffff !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  padding: 1rem 2.5rem;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(255, 103, 25, 0.25);
  transition: all 0.2s ease-in-out;
  border: none;
  cursor: pointer;
  letter-spacing: -0.2px;
}

.btn-substack:hover {
  background-color: #e55c16;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 103, 25, 0.35);
}

.btn-substack:active {
  transform: translateY(0);
}
