* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: #e4eef7;
  background:
    radial-gradient(circle at top left, rgba(55, 199, 177, 0.2), transparent 30%),
    radial-gradient(circle at top right, rgba(106, 169, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #04101b 0%, #071521 55%, #050b12 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.24;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.left,
.right {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 17, 28, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  border-radius: 28px;
}

.left {
  flex: 1 1 360px;
  min-width: 320px;
  padding: 28px;
}

.right {
  flex: 1 1 600px;
  min-width: 320px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(55, 199, 177, 0.28);
  background: rgba(55, 199, 177, 0.08);
  color: #c9f7f0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

#intro-wrapper {
  color: #a8b7c9;
  font-size: 1.05rem;
  line-height: 1.75;
}

#pendulum-text {
  white-space: pre-line;
  text-align: justify;
  text-justify: inter-word;
}

#textBox {
  width: 100%;
  margin: 0;
  padding: 14px 18px;
  color: #dce8f4;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  font-size: 0.98rem;
  line-height: 1.55;
}

#canvasContainer {
  width: min(650px, 100%);
}

#canvasContainer canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

#actionButton {
  appearance: none;
  width: min(280px, 100%);
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  color: #06111b;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(90deg, #8bf8e8, #8cb8ff);
  box-shadow: 0 12px 30px rgba(55, 199, 177, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

#actionButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(55, 199, 177, 0.24);
}

#actionButton:active {
  transform: translateY(0);
}

@media (max-width: 960px) {
  .page-shell {
    width: min(100% - 18px, 1240px);
    padding-top: 14px;
  }

  .left,
  .right {
    border-radius: 22px;
  }
}

@media (max-width: 640px) {
  .layout {
    gap: 16px;
  }

  .left,
  .right {
    padding: 20px;
  }

  .section-label {
    margin-bottom: 12px;
  }
}
