* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #07111f;
  --card: #0f1d33;
  --card-2: #132642;
  --text: #f4f7fb;
  --muted: #aab6c8;
  --blue: #2f80ed;
  --cyan: #00d4ff;
  --green: #36d399;
  --yellow: #ffd166;
  --red: #ff5c7a;
  --line: rgba(255, 255, 255, 0.12);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(0, 212, 255, 0.18), transparent 35%),
    radial-gradient(circle at bottom right, rgba(47, 128, 237, 0.16), transparent 35%),
    var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
}

.app {
  width: min(1400px, 94%);
  margin: auto;
  padding: 32px 0;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.tag {
  color: var(--cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 13px;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  margin-bottom: 12px;
}

.description {
  color: var(--muted);
  max-width: 700px;
  font-size: 17px;
}

.status-card {
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 28px;
  min-width: 150px;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.status-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.status-card strong {
  font-size: 34px;
  color: var(--yellow);
}

.scene-card,
.formula-card,
.timeline-card {
  background: rgba(15, 29, 51, 0.86);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(14px);
  margin-bottom: 22px;
}

.scene-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.scene-header h2 {
  font-size: 26px;
  margin-bottom: 6px;
}

.scene-header p {
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: none;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

#pauseBtn {
  background: #263b5f;
}

#resetBtn {
  background: var(--red);
}

.railway-scene {
  position: relative;
  height: 340px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(#92d9ff 0%, #d8f3ff 55%, #a7d67f 56%, #4a7a3d 100%);
  border: 1px solid rgba(255,255,255,0.18);
}

.sky {
  position: absolute;
  inset: 0;
}

.sun {
  position: absolute;
  right: 8%;
  top: 38px;
  width: 66px;
  height: 66px;
  background: #ffcf5a;
  border-radius: 50%;
  box-shadow: 0 0 45px rgba(255, 207, 90, 0.75);
}

.cloud {
  position: absolute;
  width: 130px;
  height: 36px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  filter: blur(0.2px);
  animation: clouds 30s linear infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud::before {
  width: 56px;
  height: 56px;
  left: 22px;
  top: -25px;
}

.cloud::after {
  width: 70px;
  height: 70px;
  right: 18px;
  top: -34px;
}

.cloud-1 {
  left: 5%;
  top: 52px;
}

.cloud-2 {
  left: 42%;
  top: 86px;
  transform: scale(0.75);
  animation-duration: 44s;
}

.cloud-3 {
  left: 70%;
  top: 38px;
  transform: scale(0.65);
  animation-duration: 38s;
}

@keyframes clouds {
  from {
    translate: -60px 0;
  }
  to {
    translate: 260px 0;
  }
}

.mountains {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 110px;
  height: 120px;
  background:
    linear-gradient(135deg, transparent 50%, rgba(48, 90, 71, 0.9) 50%) 0 0 / 260px 120px repeat-x,
    linear-gradient(225deg, transparent 50%, rgba(36, 72, 60, 0.9) 50%) 0 0 / 260px 120px repeat-x;
  opacity: 0.7;
}

.track-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  background: linear-gradient(#476f38, #31482f);
}

.background-lines {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.16) 0,
      rgba(255,255,255,0.16) 2px,
      transparent 2px,
      transparent 72px
    );
  opacity: 0.5;
}

.train {
  position: absolute;
  left: 40px;
  bottom: 60px;
  width: 330px;
  height: 92px;
  transform: translateX(0);
  transition: filter 0.2s ease;
  z-index: 5;
}

.train-body {
  position: absolute;
  left: 0;
  bottom: 18px;
  width: 285px;
  height: 74px;
  background: linear-gradient(180deg, #f5f7fb 0%, #d9e4f2 100%);
  border-radius: 22px 12px 12px 12px;
  border: 4px solid #23364f;
  box-shadow: inset 0 -12px 0 rgba(47, 128, 237, 0.18);
}

.train-front {
  position: absolute;
  right: 4px;
  bottom: 18px;
  width: 86px;
  height: 74px;
  background: linear-gradient(145deg, #2f80ed, #0b4fb3);
  clip-path: polygon(0 0, 68% 0, 100% 50%, 68% 100%, 0 100%);
  border: 4px solid #23364f;
  border-left: none;
}

.front-window {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 44px;
  height: 28px;
  background: linear-gradient(135deg, #0de1ff, #e7fbff);
  border-radius: 8px;
  border: 3px solid #23364f;
}

.window {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 28px;
  margin-left: 18px;
  margin-top: 14px;
  background: linear-gradient(135deg, #0de1ff, #e7fbff);
  border-radius: 8px;
  border: 3px solid #23364f;
}

.door {
  position: absolute;
  left: 208px;
  bottom: 0;
  width: 38px;
  height: 54px;
  background: #2f80ed;
  border-left: 3px solid #23364f;
  border-right: 3px solid #23364f;
  border-top: 3px solid #23364f;
  border-radius: 10px 10px 0 0;
}

.wheels {
  position: absolute;
  left: 18px;
  bottom: 2px;
  width: 250px;
  display: flex;
  justify-content: space-between;
}

.wheels span {
  width: 34px;
  height: 34px;
  background: #172033;
  border: 6px solid #53657f;
  border-radius: 50%;
  display: block;
}

.train.moving .wheels span {
  animation: wheelSpin 0.5s linear infinite;
}

@keyframes wheelSpin {
  to {
    transform: rotate(360deg);
  }
}

.rails {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  height: 36px;
}

.rail {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: #d7d7d7;
  box-shadow: 0 2px 0 #777;
}

.rail-top {
  top: 4px;
}

.rail-bottom {
  bottom: 4px;
}

.sleepers {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    #8c5a32 0,
    #8c5a32 14px,
    transparent 14px,
    transparent 54px
  );
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.metric {
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.22);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.metric strong {
  font-size: clamp(22px, 3vw, 32px);
}

.formula-card h2,
.timeline-card h2 {
  margin-bottom: 18px;
  font-size: 26px;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.formula-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.formula-box span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.formula-box strong {
  font-size: 18px;
  color: var(--yellow);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.chart-card {
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  min-height: 310px;
  box-shadow: 0 18px 70px rgba(0,0,0,0.24);
}

.chart-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.chart-title h3 {
  font-size: 19px;
}

.chart-title span {
  color: var(--cyan);
  font-weight: 700;
}

canvas {
  width: 100%;
  height: 240px;
  display: block;
  background: rgba(3, 10, 22, 0.52);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.step {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  transition: 0.25s ease;
}

.step strong {
  display: block;
  margin-bottom: 8px;
}

.step span {
  color: var(--muted);
  font-size: 14px;
}

.step.active {
  background: linear-gradient(145deg, rgba(47,128,237,0.55), rgba(0,212,255,0.25));
  border-color: rgba(0,212,255,0.75);
  box-shadow: 0 0 24px rgba(0,212,255,0.2);
}

@media (max-width: 1050px) {
  .dashboard,
  .formula-grid,
  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero,
  .scene-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .dashboard,
  .formula-grid,
  .charts-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .railway-scene {
    height: 300px;
  }

  .train {
    width: 260px;
    transform: scale(0.78);
    transform-origin: left bottom;
  }

  .scene-card,
  .formula-card,
  .timeline-card {
    padding: 18px;
  }
}

.cypictronic-footer {
  margin-top: 28px;
  text-align: center;
  padding: 18px;
  color: var(--muted);
}

.cypictronic-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.4px;
  transition: color 0.25s ease, transform 0.25s ease;
}

.cypictronic-footer a strong {
  color: var(--cyan);
}

.cypictronic-footer a:hover {
  color: white;
  transform: translateY(-2px);
}

.cypictronic-footer a:hover strong {
  color: var(--yellow);
}