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

:root {
  /* Color Palette - Deep Purple Theme */
  --bg-primary: #120322;
  --bg-secondary: #1E0738;
  --bg-tertiary: #2D0F50;
  --text-primary: #FFFFFF;
  --text-secondary: #B094C9;
  --accent-color: #E238EC; /* Purple Pink */
  --cta-color: #F72585;   /* Vivid Pink for CTA */
  --cta-hover: #D6126B;
  
  /* Spacing */
  --section-padding: 8rem 2rem;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--accent-color);
  transition: width var(--transition-normal);
}

.section-title:hover::after {
  width: 100%;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  padding: var(--section-padding);
}

/* Base Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  outline: none;
}

.btn-primary {
  background-color: var(--cta-color);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
  background-color: var(--cta-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.btn-outline:hover {
  background-color: rgba(0, 240, 255, 0.1);
  transform: translateY(-2px);
}

/* Header */
header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1.5rem 0;
  z-index: 100;
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center; /* 縦方向の中央揃えを追加 */
}

.nav-links a {
  position: relative;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

/* Glassmorphism Cards */
.glass-card {
  background: rgba(20, 27, 45, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 2.5rem;
  transition: transform var(--transition-normal), background var(--transition-normal);
}

.glass-card:hover {
  transform: translateY(-5px);
  background: rgba(30, 39, 60, 0.7);
}

/* Animations (Intersection Observer) */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* CTA Section globally */
.global-cta {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  text-align: center;
  border-top: 1px solid rgba(255,255,255, 0.05);
}

.global-cta h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.global-cta p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Footer */
footer {
  background-color: var(--bg-primary);
  padding: 3rem 0;
  text-align: center;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255,255,255, 0.05);
}

/* --- Page Specific Styles --- */

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: radial-gradient(circle at top right, rgba(226, 56, 236, 0.1), transparent 50%),
              radial-gradient(circle at bottom left, rgba(247, 37, 133, 0.1), transparent 50%);
  padding-top: 5rem;
  overflow: hidden;
}

.hero-bg-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-content {
  text-align: left;
  padding-left: 0; /* 左寄せにするためパディングをリセット */
  max-width: 800px;
  position: relative;
  z-index: 2;
}





/* Line Art Animations */
.hero-line-art {
  position: absolute;
  top: 50%;
  left: 50%; /* 画面中央に配置 */
  transform: translate(-50%, -50%);
  width: 100vw; /* 画面全体に広げる */
  height: 100vh;
  max-width: none; /* 上限を解除 */
  max-height: none;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35; /* 薄くする */
  filter: drop-shadow(0 0 10px rgba(226, 56, 236, 0.5));
}

@media (max-width: 768px) {
  .hero-line-art {
    width: 150vw;
    height: 150vh;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.25; /* モバイルではさらに薄く */
  }
}

.rotating-lines {
  transform-origin: center;
  animation: rotateLinear 40s linear infinite;
}

@keyframes rotateLinear {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.draw-path {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawLine 8s ease-in-out infinite alternate;
}

.draw-path-reverse {
  stroke-dasharray: 2000;
  stroke-dashoffset: -2000;
  animation: drawLineReverse 10s ease-in-out infinite alternate;
}

@keyframes drawLine {
  0% { stroke-dashoffset: 2000; }
  100% { stroke-dashoffset: 0; }
}

@keyframes drawLineReverse {
  0% { stroke-dashoffset: -2000; }
  100% { stroke-dashoffset: 0; }
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: floatShape 15s infinite alternate ease-in-out;
  transform-origin: center;
}

.shape-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: rgba(226, 56, 236, 0.3);
  animation-duration: 20s;
}

.shape-2 {
  bottom: -10%;
  right: -5%;
  width: 40vw;
  height: 40vw;
  background: rgba(247, 37, 133, 0.3);
  animation-duration: 15s;
  animation-direction: alternate-reverse;
}

.shape-3 {
  top: 20%;
  right: 20%;
  width: 30vw;
  height: 30vw;
  background: rgba(0, 240, 255, 0.2);
  animation-duration: 18s;
  animation-delay: -5s;
}

@keyframes floatShape {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(5%, 5%) scale(1.1);
  }
  66% {
    transform: translate(-2%, 8%) scale(0.9);
  }
  100% {
    transform: translate(-5%, -5%) scale(1);
  }
}


.hero h1 {
  font-size: 4.5rem;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.hero .highlight-text {
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  background-image: linear-gradient(135deg, var(--accent-color), var(--cta-color));
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Grid Layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* Works */
.works-grid {
  display: grid;
  gap: 4rem;
}

.work-card {
  display: flex;
  align-items: center;
  gap: 3rem;
  background: rgba(20, 27, 45, 0.4);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.work-card.reversed {
  flex-direction: row-reverse;
}

.work-image {
  flex: 1;
  max-width: 55%;
}

.work-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.work-card:hover .work-image img {
  transform: scale(1.03);
}

.work-info {
  flex: 1;
  padding: 3rem;
}

.work-info h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

.work-info p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* ハンバーガーメニュー追加スタイル */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  position: relative;
  transition: all var(--transition-fast);
}
.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  left: 0;
  transition: all var(--transition-fast);
}
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

/* 展開時のXマーク化 */
.menu-toggle.active .hamburger { background-color: transparent; }
.menu-toggle.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}
.menu-toggle.active .hamburger::after {
  bottom: 0;
  transform: rotate(-45deg);
}
[data-theme="light"] .hamburger, 
[data-theme="light"] .hamburger::before, 
[data-theme="light"] .hamburger::after {
  background-color: var(--text-primary);
}

/* Responsive (Mobile Only) */
@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 1.5rem;
  }

  .menu-toggle {
    display: block; /* モバイルで表示 */
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 3, 34, 0.98);
    backdrop-filter: blur(15px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    padding: 2rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 100;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a:not(.btn) {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 1.5rem 1rem;
    display: block;
    width: 100%;
    text-align: center;
  }

  .nav-links .theme-toggle {
    margin: 1rem 0;
    transform: scale(1.5);
  }

  [data-theme="light"] .nav-links {
    background: rgba(248, 249, 250, 0.98);
  }

  .nav-links .btn {
    font-size: 1.2rem;
    width: 80%;
    max-width: 300px;
    margin-top: 1rem;
  }


  .section-title {
    font-size: 2rem;
  }

  /* ヒーローセクション調整 */
  .hero-container {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .hero-content {
    padding-left: 0; /* 余白をモバイル用にリセット */
    max-width: 100%;
  }
  .hero h1 {
    font-size: 2.5rem; /* タイトル縮小 */
  }
  .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }
  .hero-actions {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
  }
  .hero-actions .btn {
    width: 100%;
    margin-left: 0 !important;
  }
  .hero-slider {
    max-width: 100%;
    width: 100%;
    margin-top: 1rem;
  }

  /* グリッドレイアウト 1カラム化 */
  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* works-card 1カラム化 */
  .work-card, .work-card.reversed {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
  }
  .work-image {
    max-width: 100%;
  }
  .work-info {
    padding: 1.5rem 0;
  }

  /* 会社概要 テーブルのレスポンシブ化 */
  .company-info, .company-info tbody, .company-info tr, .company-info th, .company-info td {
      display: block;
      width: 100%;
  }
  .company-info th {
      border-bottom: none;
      padding-bottom: 0.2rem;
  }
  .company-info td {
      padding-top: 0;
      margin-bottom: 1rem;
  }
}

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(226, 56, 236, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background-color: var(--cta-hover);
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(226, 56, 236, 0.6);
}

/* Header Scroll State */
header.scrolled {
  background: rgba(10, 15, 28, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* --- Light Mode Theme --- */
[data-theme="light"] {
  --bg-primary: #F8F9FA;
  --bg-secondary: #EAE6EF;
  --bg-tertiary: #DBCDE9;
  --text-primary: #120322;
  --text-secondary: #6B5B7E;
  --accent-color: #C121CA;
  --cta-color: #D6126B;
  --cta-hover: #A40951;
}

[data-theme="light"] header {
  background: rgba(248, 249, 250, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
[data-theme="light"] header.scrolled {
  background: rgba(248, 249, 250, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .glass-card:hover {
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .work-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .global-cta {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .shape-1 {
  background: rgba(193, 33, 202, 0.2);
}
[data-theme="light"] .shape-2 {
  background: rgba(214, 18, 107, 0.2);
}
[data-theme="light"] .shape-3 {
  background: rgba(100, 200, 255, 0.2);
}

[data-theme="light"] .service-block {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .service-number {
    color: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .timeline-item::before {
    box-shadow: 0 0 10px rgba(193, 33, 202, 0.4);
}
[data-theme="light"] .company-info th, 
[data-theme="light"] .company-info td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: transform var(--transition-fast);
}
.theme-toggle:hover {
    transform: scale(1.2);
}
