/* ========================================
   MAGOKORO AI - Corporate Website
   Dark Premium Theme
   ======================================== */

:root,
[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a26;
  --bg-card-hover: #22222f;
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent-1: #667eea;
  --accent-2: #764ba2;
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-glow: rgba(102, 126, 234, 0.15);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --nav-scrolled-bg: rgba(10, 10, 15, 0.85);
  --hero-grid-line: rgba(255, 255, 255, 0.02);
  --hero-glow-1: rgba(102, 126, 234, 0.08);
  --hero-glow-2: rgba(118, 75, 162, 0.06);
  --scrollbar-thumb: #333;
  --card-shadow: none;
}

[data-theme="light"] {
  --bg-primary: #f0f1f7;
  --bg-secondary: #e8e9f2;
  --bg-card: #ffffff;
  --bg-card-hover: #f6f6fb;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888a0;
  --accent-1: #5568d8;
  --accent-2: #6b42a0;
  --accent-gradient: linear-gradient(135deg, #5568d8 0%, #6b42a0 100%);
  --accent-glow: rgba(85, 104, 216, 0.1);
  --border: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.18);
  --card-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  --nav-scrolled-bg: rgba(240, 241, 247, 0.9);
  --hero-grid-line: rgba(0, 0, 0, 0.04);
  --hero-glow-1: rgba(85, 104, 216, 0.08);
  --hero-glow-2: rgba(107, 66, 160, 0.06);
  --scrollbar-thumb: #c0c0d0;
}

/* Light mode animated background */
[data-theme="light"] body {
  animation: lightBgShift 20s ease-in-out infinite;
}

@keyframes lightBgShift {
  0%   { background-color: #f0f1f7; }
  25%  { background-color: #eef0fa; }
  50%  { background-color: #f2eff8; }
  75%  { background-color: #edf2fb; }
  100% { background-color: #f0f1f7; }
}

/* Light mode card shadows & borders */
[data-theme="light"] .about-card,
[data-theme="light"] .service-card,
[data-theme="light"] .tech-card,
[data-theme="light"] .company-info-table,
[data-theme="light"] .directions-info {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .about-card:hover,
[data-theme="light"] .service-card:hover,
[data-theme="light"] .tech-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Light mode section contrast */
[data-theme="light"] #about,
[data-theme="light"] #technology,
[data-theme="light"] #contact {
  background: #e8e9f2;
}

[data-theme="light"] #service,
[data-theme="light"] #company,
[data-theme="light"] #directions {
  background: #f0f1f7;
}

/* Light mode nav */
[data-theme="light"] .nav.scrolled {
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

/* Light mode lang switcher */
[data-theme="light"] .lang-switcher {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .lang-btn {
  color: #8888a0;
}

[data-theme="light"] .lang-btn:hover {
  color: #4a4a6a;
}

/* Light mode map */
[data-theme="light"] .map-embed {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

/* Light mode footer */
[data-theme="light"] .footer {
  background: #e2e3ee;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', 'Pretendard', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* ---- Section Common ---- */
.section {
  padding: 140px 24px;
  position: relative;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.8;
}

/* ---- Animations ---- */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  transition: var(--transition);
}

.nav.scrolled {
  background: var(--nav-scrolled-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo .logo-magokoro {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo .logo-ai {
  font-weight: 300;
  opacity: 0.6;
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s;
  position: relative;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
}

.lang-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 100px;
  transition: all 0.3s;
  letter-spacing: 0.5px;
}

.lang-btn:hover {
  color: var(--text-secondary);
}

.lang-btn.active {
  background: var(--accent-gradient);
  color: white;
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--accent-glow);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Mobile Menu */
.nav-mobile {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: 0.3s;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, var(--hero-glow-1) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, var(--hero-glow-2) 0%, transparent 50%);
  animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -2%) rotate(1deg); }
  66% { transform: translate(-1%, 1%) rotate(-0.5deg); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hero-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 32px;
}

.hero-title {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.hero-title .gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(102, 126, 234, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-hover);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
}

.btn-arrow {
  transition: transform 0.3s;
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 2px;
  animation: scrollBounce 2s infinite;
}

.scroll-indicator .line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ========================================
   ABOUT SECTION
   ======================================== */
#about {
  background: var(--bg-secondary);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 64px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.4s;
}

.about-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.about-card:hover::before {
  opacity: 1;
}

.about-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent-1);
  margin-bottom: 20px;
}

.about-card-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.about-card-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ========================================
   SERVICE SECTION
   ======================================== */
.service-header {
  text-align: center;
  margin-bottom: 80px;
}

.service-header .section-desc {
  margin: 0 auto;
}

.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px;
  transition: all var(--transition);
  position: relative;
}

.service-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 24px;
}

.service-card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========================================
   TECHNOLOGY SECTION
   ======================================== */
#technology {
  background: var(--bg-secondary);
}

.tech-header {
  text-align: center;
  margin-bottom: 80px;
}

.tech-header .section-desc {
  margin: 0 auto;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.tech-card {
  text-align: center;
  padding: 48px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.tech-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.tech-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 26px;
}

.tech-card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}

.tech-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========================================
   COMPANY SECTION
   ======================================== */
.company-info-table {
  max-width: 700px;
  margin: 48px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.company-row {
  display: flex;
  padding: 20px 36px;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.company-row:last-child {
  border-bottom: none;
}

.company-row:hover {
  background: var(--bg-card-hover);
}

.company-label {
  width: 140px;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
}

.company-value {
  font-size: 15px;
  color: var(--text-primary);
}

/* ========================================
   DIRECTIONS SECTION
   ======================================== */
.map-embed {
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-bottom: none;
}

.directions-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 40px;
}

.directions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.direction-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.direction-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.direction-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.direction-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

@media (max-width: 900px) {
  .directions-grid { grid-template-columns: 1fr; gap: 24px; }
  .directions-info { padding: 28px; }
}

/* ========================================
   CONTACT SECTION
   ======================================== */
#contact {
  background: var(--bg-secondary);
  text-align: center;
}

#contact .section-desc {
  margin: 0 auto 48px;
}

.contact-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.3s;
}

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

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
  .section { padding: 100px 20px; }

  .nav-links { display: none; }

  .nav-toggle { display: flex; }

  .nav-mobile {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--nav-scrolled-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    padding: 40px 24px;
  }

  .nav-mobile.open {
    display: block;
  }

  .nav-mobile-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .nav-mobile-links a {
    display: block;
    padding: 16px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    transition: color 0.3s;
  }

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

  .nav-mobile .lang-switcher {
    margin-top: 32px;
    justify-content: center;
  }

  .about-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr 1fr; }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .tech-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 36px; }
  .company-row { flex-direction: column; gap: 4px; }
  .company-label { width: auto; }
}
