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

body {
  font-family: sans-serif;
  color: #333;
  background-color: #e8f4fc;
  background-image: radial-gradient(#d0e8f5 10%, transparent 10%);
  background-size: 30px 30px;
  line-height: 1.7;
}

section {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

h1 {
  font-size: 1.8rem;
  color: #4a90c4;
}

h2 {
  font-size: 1.4rem;
  color: #4a90c4;
  margin-bottom: 20px;
  text-align: center;
  background-image: linear-gradient(transparent 60%, #f5d99a88 60%);
  display: inline;
}

h3 {
  font-size: 1.1rem;
  color: #4a90c4;
  margin-bottom: 8px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(180deg, #d0e8f5 0%, #e8f4fc 100%);
}

.hero-wave {
  margin-top: -1px;
}

.hero-wave svg {
  display: block;
  width: 100%;
  height: 60px;
}

.hero .cta-btn {
  display: block;
  width: fit-content;
  margin: 0 auto 0;
}

.hero-screenshot-wrapper {
  position: relative;
  display: inline-block;
  margin: 20px 0;
}

.hero-screenshot {
  max-width: 300px;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.hero-mascot {
  position: absolute;
  right: -80px;
  bottom: -30px;
  width: 200px;
  height: auto;
  animation: float 3s ease-in-out infinite;
}

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

.hero-catch {
  font-size: 1.2rem;
  color: #555;
  margin: 16px 0 8px;
}

.hero-sub {
  font-size: 1rem;
  color: #888;
  margin-bottom: 24px;
}

/* CTA Button */
.cta-btn {
  display: inline-block;
  background: #ff8c42;
  color: #fff;
  font-weight: bold;
  font-size: 1.1rem;
  padding: 14px 40px;
  border-radius: 20px;
  text-decoration: none;
}

.cta-btn:hover {
  background: #e67a35;
  opacity: 1;
}

.cta-btn-large {
  font-size: 1.3rem;
  padding: 18px 56px;
}

/* Problems */
.problems {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #b8d8e8;
}

.problem-list {
  list-style: none;
  text-align: start;
}

.problem-list li {
  padding: 12px 0;
  border-bottom: 1px solid #e8f4fc;
  padding-inline-start: 8px;
}

.problem-list li:last-child {
  border-bottom: none;
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.feature-card {
  background: #f0f8ff;
  border: 2px solid #b8d8e8;
  border-radius: 12px;
  padding: 20px;
  border-top: 4px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: start;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.feature-card--blue   { border-top-color: #7ec8e3; }
.feature-card--green  { border-top-color: #a8d8a8; }
.feature-card--pink   { border-top-color: #f5c6d0; }
.feature-card--yellow { border-top-color: #f5d99a; }

.feature-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.feature-card p {
  color: #555;
}

/* Examples */
.example-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.example-card {
  background: #fff;
  border: 2px solid #b8d8e8;
  border-radius: 12px;
  padding: 16px;
  border-inline-start: 4px solid #ff8c42;
}

.example-code {
  background: #f8f8f8;
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 0.9rem;
  margin: 8px 0;
  overflow-x: auto;
}

.example-result {
  background: #e8f4fc;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 0.9rem;
  color: #333;
  border-inline-start: 3px solid #a8d8a8;
}

/* Safety */
.safety {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #b8d8e8;
}

.safety-list {
  text-align: start;
}

.safety-list dt {
  font-weight: bold;
  color: #4a90c4;
  margin-top: 16px;
}

.safety-list dt:nth-of-type(1) { color: #4a90c4; } /* 青: 安全 */
.safety-list dt:nth-of-type(2) { color: #6ab06a; } /* 緑: 本物のPython */
.safety-list dt:nth-of-type(3) { color: #d4798a; } /* ピンク: 将来も役立つ */
.safety-list dt:nth-of-type(4) { color: #c9a84c; } /* 黄: 完全無料 */

.safety-list dt:first-child {
  margin-top: 0;
}

.safety-list dd {
  color: #555;
  margin-inline-start: 0;
  margin-top: 4px;
}

/* How-to Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step {
  text-align: center;
  background: #f0f8ff;
  border: 2px solid #b8d8e8;
  border-radius: 12px;
  padding: 20px;
}

.step-number {
  display: inline-block;
  width: 36px;
  height: 36px;
  line-height: 36px;
  border-radius: 50%;
  background: #7ec8e3;
  color: #fff;
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.step:nth-child(1) .step-number { background: #7ec8e3; } /* 水色 */
.step:nth-child(2) .step-number { background: #a8d8a8; } /* 緑 */
.step:nth-child(3) .step-number { background: #f5c6d0; } /* ピンク */

.step img {
  width: 100%;
  border: 2px solid #b8d8e8;
  border-radius: 8px;
  margin: 12px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.step p {
  color: #555;
}

/* CTA Section */
.cta-section {
  text-align: center;
  padding: 48px 20px;
}

.cta-note {
  margin-top: 12px;
  color: #888;
  font-size: 0.9rem;
}

/* Error Demo */
.error-demo {
  text-align: center;
}

.error-demo-intro {
  color: #555;
  margin-bottom: 24px;
}

.error-demo-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.error-demo-item {
  background: #fff;
  border: 2px solid #b8d8e8;
  border-radius: 12px;
  padding: 16px;
  text-align: start;
}

.error-before, .error-after {
  margin: 4px 0;
}

.error-label {
  display: block;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.error-before .error-label {
  color: #cc4444;
}

.error-after .error-label {
  color: #4a90c4;
}

.error-before code {
  display: block;
  color: #cc4444;
  font-size: 0.85rem;
  word-break: break-all;
}

.error-after code {
  display: block;
  color: #4a90c4;
  font-size: 0.95rem;
  font-weight: bold;
  word-break: break-all;
}

.error-arrow {
  text-align: center;
  font-size: 1.2rem;
  color: #888;
  margin: 4px 0;
}

.error-demo-note {
  margin-top: 16px;
  color: #888;
  font-size: 0.85rem;
}

/* Scratch Story */
.scratch-story {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #b8d8e8;
}

.story-content {
  line-height: 2;
  text-align: start;
}

.story-content p {
  margin-bottom: 16px;
  color: #555;
}

.story-content .cta-btn {
  margin-top: 8px;
}

/* Share Section */
.share-section {
  margin-top: 24px;
}

.share-label {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.share-links {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.share-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
}

.share-btn:hover {
  opacity: 0.85;
}

.share-line {
  background: #06C755;
}

.share-x {
  background: #000;
}

.share-fb {
  background: #1877F2;
}

/* Community (Discord) Section */
.community-section {
  margin-top: 20px;
}

.community-label {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.community-btn {
  display: inline-block;
  background: #5865F2;
  color: #fff;
  font-weight: bold;
  padding: 10px 24px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.95rem;
}

.community-btn:hover {
  background: #4752C4;
}

/* Fade-in Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Bounce Animation */
@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.howto.visible .step:nth-child(1) .step-number {
  animation: bounce 0.4s ease 0.1s;
}
.howto.visible .step:nth-child(2) .step-number {
  animation: bounce 0.4s ease 0.3s;
}
.howto.visible .step:nth-child(3) .step-number {
  animation: bounce 0.4s ease 0.5s;
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(255, 140, 66, 0); }
}

.cta-btn {
  animation: pulse 2s ease-in-out infinite;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .hero-mascot {
    animation: none;
  }
  .feature-card {
    transition: none;
  }
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cta-btn {
    animation: none;
  }
  .howto.visible .step .step-number {
    animation: none;
  }
}

/* Responsive - Mobile */
@media (max-width: 375px) {
  .hero-screenshot {
    max-width: 80%;
  }

  .hero-mascot {
    right: -40px;
    bottom: -15px;
    width: 120px;
  }
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  margin-top: 20px;
  font-size: 0.8rem;
  color: #888;
}

.site-footer a {
  color: #4a90c4;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer p {
  margin: 4px 0;
}

/* Responsive */
@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .example-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .steps {
    flex-direction: row;
  }

  .step {
    flex: 1;
  }
}

/* Language Selector */
#lp-lang-selector {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 200;
}

#lp-lang-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #b8d8e8;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lp-lang-btn:hover {
  background: #f0f8ff;
}

#lp-lang-list {
  position: absolute;
  right: 0;
  top: 46px;
  background: white;
  border: 2px solid #b8d8e8;
  border-radius: 12px;
  padding: 8px 0;
  margin: 0;
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  z-index: 200;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#lp-lang-list li {
  padding: 6px 16px;
  cursor: pointer;
  font-size: 0.9rem;
}

#lp-lang-list li:hover {
  background: #e8f4fc;
}
