:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* Dark theme colors */
body.theme-dark {
  --bg-color: #07090c;
  --text-color: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 210, 255, 0.3);
  --card-bg: rgba(12, 15, 20, 0.6);
  --glass-bg: rgba(12, 15, 20, 0.75);
  --accent-color: #00d2ff;
  --accent-hover: #00a8ff;
  --accent-glow: rgba(0, 210, 255, 0.35);
  --hint-bg: #eab308;
  --hint-text: #000000;
  --spot-1: rgba(0, 210, 255, 0.15);
  --spot-2: rgba(0, 168, 255, 0.12);
  --spot-3: rgba(0, 255, 200, 0.1);
  --header-bg: rgba(7, 9, 12, 0.75);
}

/* Light theme colors */
body.theme-light {
  --bg-color: #f8fafc;
  --text-color: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(0, 0, 0, 0.12);
  --card-bg: rgba(255, 255, 255, 0.65);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --accent-color: #4f46e5;
  --accent-hover: #4338ca;
  --accent-glow: rgba(79, 70, 229, 0.15);
  --hint-bg: #eab308;
  --hint-text: #000000;
  --spot-1: rgba(99, 102, 241, 0.08);
  --spot-2: rgba(168, 85, 247, 0.08);
  --spot-3: rgba(236, 72, 153, 0.06);
  --header-bg: rgba(248, 250, 252, 0.8);
}

/* Language Visibility Rules */
body.lang-en .lang-ja {
  display: none !important;
}
body.lang-ja .lang-en {
  display: none !important;
}

.text-nowrap {
  display: inline-block;
  white-space: nowrap;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  position: relative;
  min-height: 100vh;
}

/* Ambient Sequoia Wallpaper Glow */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: plus-lighter;
}

body.theme-light .ambient-glow {
  mix-blend-mode: multiply;
  filter: blur(140px);
}

.spot-1 {
  width: 50vw;
  height: 50vw;
  background-color: var(--spot-1);
  top: -10vw;
  right: -5vw;
  animation: orbit1 25s infinite alternate ease-in-out;
}

.spot-2 {
  width: 40vw;
  height: 40vw;
  background-color: var(--spot-2);
  top: 15vw;
  left: -10vw;
  animation: orbit2 30s infinite alternate ease-in-out;
}

.spot-3 {
  width: 35vw;
  height: 35vw;
  background-color: var(--spot-3);
  bottom: 10vw;
  right: 15vw;
  animation: orbit3 20s infinite alternate ease-in-out;
}

@keyframes orbit1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-8vw, 6vw) scale(1.15); }
}

@keyframes orbit2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6vw, -8vw) scale(1.1); }
}

@keyframes orbit3 {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-5vw, -5vw) scale(0.9); }
}

/* Header & Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background-color 0.4s ease;
}

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

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.site-nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-btn {
  background: none;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.control-btn:hover {
  background-color: var(--border-color);
}

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
}

body.theme-dark .icon-sun { display: block; }
body.theme-dark .icon-moon { display: none; }
body.theme-light .icon-sun { display: none; }
body.theme-light .icon-moon { display: block; }

/* Buttons & Elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 24px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-glow);
}

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

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
  transform: translateY(-1px);
}

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

/* Hero Section */
.hero-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  min-height: calc(100vh - 64px);
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 540px;
}

.hero-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #00f2fe, #4facfe, #00d2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.theme-light .gradient-text {
  background: linear-gradient(135deg, #4f46e5, #9333ea, #db2777);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

/* Simulator Window Mockup */
.hero-simulator {
  width: 100%;
  perspective: 1000px;
}

.simulator-wrapper {
  width: 100%;
  transform: rotateY(-3deg) rotateX(2deg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  transition: transform 0.3s ease;
}

body.theme-light .simulator-wrapper {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.simulator-wrapper:hover {
  transform: rotateY(0deg) rotateX(0deg) scale(1.01);
}

.mac-window {
  width: 100%;
  border-radius: 12px;
  background-color: var(--glass-bg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.window-header {
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
}

.window-controls {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.address-bar {
  background-color: rgba(0, 0, 0, 0.15);
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  border: 1px solid var(--border-color);
}

body.theme-light .address-bar {
  background-color: rgba(255, 255, 255, 0.5);
}

.lock-icon {
  opacity: 0.6;
}

.window-content {
  min-height: 280px;
  background-color: rgba(0, 0, 0, 0.1);
  padding: 24px;
  position: relative;
}

body.theme-light .window-content {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Keycap guide inside simulator */
.keycap-guide {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background-color: var(--accent-color);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 5;
  animation: float 2.5s infinite alternate ease-in-out;
}

@keyframes float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.guide-kbd {
  background: #ffffff;
  color: var(--accent-color) !important;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Simulated website styles */
.mock-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.mock-logo {
  font-weight: 700;
  font-size: 14px;
}

.mock-links {
  display: flex;
  gap: 16px;
}

.mock-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  position: relative;
  display: inline-block;
  padding: 2px 4px;
}

.mock-link:hover {
  color: var(--text-color);
}

.mock-hero {
  text-align: center;
  padding: 12px 0;
  max-width: 380px;
  margin: 0 auto;
}

.mock-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.mock-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 16px;
}

.mock-actions {
  display: flex;
  justify-content: center;
}

.mock-btn {
  background-color: var(--accent-color);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

/* Simulated Hint Overlays */
.sim-hint {
  position: absolute;
  background-color: var(--hint-bg);
  color: var(--hint-text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  top: -8px;
  left: -12px;
  z-index: 10;
  animation: popIn 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.sim-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background-color: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  z-index: 20;
}

.sim-toast.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Dynamic highlighting of target link */
.sim-target-active {
  background-color: rgba(99, 102, 241, 0.2);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

/* Sections */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.feature-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 18px;
  font-weight: 700;
}

.card-icon kbd {
  font-family: var(--font-mono);
  font-size: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
}

.card-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Setup Guide Section */
.setup-tabs {
  max-width: 680px;
  margin: 0 auto;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
}

.setup-tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.05);
}

body.theme-light .setup-tabs-header {
  background-color: rgba(0, 0, 0, 0.02);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

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

.tab-btn.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  background-color: var(--card-bg);
}

.setup-tabs-content {
  padding: 24px 32px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.setup-list {
  padding-left: 20px;
  display: grid;
  gap: 16px;
}

.setup-list li {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
}

.setup-list li strong {
  color: var(--text-color);
}

/* Keycap styling */
kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 4px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--border-color);
  color: var(--text-color);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  box-shadow: 0 1.5px 0 var(--border-glow);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  background-color: rgba(0, 0, 0, 0.05);
}

body.theme-light .site-footer {
  background-color: rgba(0, 0, 0, 0.01);
}

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

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

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

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

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

/* Responsive adjustments */
@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    padding-top: 100px;
    gap: 40px;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
    align-items: center;
  }

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

  .hero-actions {
    justify-content: center;
  }

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