* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1.5rem;
  background: #f4f1eb;
  color: #25231f;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: #174f52;
}

a:focus-visible {
  outline: 3px solid #c5551a;
  outline-offset: 3px;
}

.page {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0.75rem;
  background: #dce8e6;
  border: 1px solid #a8bfbc;
  border-radius: 0.75rem;
}

nav a {
  flex: 1 1 10rem;
  padding: 0.65rem 0.8rem;
  background: #ffffff;
  border: 1px solid #729490;
  border-radius: 0.5rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

nav a:hover,
nav a:focus-visible {
  background: #174f52;
  color: #ffffff;
}

header {
  margin: 0 0 1.5rem;
  padding: 2rem;
  background: #174f52;
  border-radius: 1rem;
  color: #ffffff;
  text-align: center;
}

header h1,
header p {
  margin: 0;
}

header p {
  margin-top: 0.5rem;
  color: #d8ece9;
}

.panel,
.panel-alt {
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid #d1cec5;
  border-radius: 0.875rem;
}

.panel-alt {
  background: #ece9e1;
}

.panel h2,
.panel-alt h2 {
  margin: 0 0 0.75rem;
  color: #174f52;
}

.comparison,
.transform-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.example,
.transform-card {
  padding: 1rem;
  background: #f8faf9;
  border-left: 0.35rem solid #c5551a;
}

.example h3,
.transform-card h3 {
  margin-top: 0;
}

.state-demo {
  display: inline-block;
  padding: 0.7rem 1rem;
  background: #dce8e6;
  border: 2px solid #174f52;
  border-radius: 999px;
  color: #174f52;
  font-weight: 700;
  text-decoration: none;
}

.state-demo:hover,
.state-demo:focus-visible {
  background: #174f52;
  border-color: #c5551a;
  color: #ffffff;
}

.state-demo-smooth {
  transition:
    background-color 240ms ease,
    border-color 240ms ease,
    color 240ms ease;
}

.code-sample {
  max-width: 100%;
  margin: 0.75rem 0;
  padding: 0.85rem;
  overflow: auto;
  background: #25231f;
  border-radius: 0.5rem;
  color: #ffffff;
}

code {
  font-family: "Courier New", Courier, monospace;
}

.transform-stage {
  position: relative;
  min-height: 8rem;
  margin-bottom: 1rem;
  background: #e5eeec;
  border: 1px dashed #729490;
  border-radius: 0.75rem;
}

.shape {
  position: absolute;
  top: 2.25rem;
  left: 50%;
  width: 3.5rem;
  height: 3.5rem;
  margin-left: -1.75rem;
  background: #c5551a;
  border: 0.25rem solid #ffffff;
  border-radius: 0.65rem;
  box-shadow: 0 0.25rem 0.7rem rgba(37, 35, 31, 0.2);
}

.shape-translate {
  transform: translate(1rem, -0.5rem);
}

.shape-scale {
  transform: scale(1.2);
}

.shape-rotate {
  transform: rotate(12deg);
}

.order-demo {
  position: relative;
  min-height: 10rem;
  overflow: hidden;
  background: #ffffff;
  border: 1px dashed #729490;
  border-radius: 0.75rem;
}

.order-shape {
  position: absolute;
  top: 3rem;
  left: calc(50% - 5rem);
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  background: #174f52;
  border-radius: 0.5rem;
  color: #ffffff;
  font-weight: 700;
  transform-origin: center;
}

.rotate-then-translate {
  background: #c5551a;
}

.translate-then-rotate {
  transform: translate(2rem) rotate(20deg);
}

.rotate-then-translate {
  transform: rotate(20deg) translate(2rem);
}

.animation-stage {
  display: grid;
  min-height: 12rem;
  padding: 1rem;
  place-items: center;
  overflow: hidden;
  background: #e5eeec;
  border-radius: 0.75rem;
}

.arrival-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 30rem;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid #a8bfbc;
  border-radius: 0.875rem;
  box-shadow: 0 0.5rem 1.25rem rgba(37, 35, 31, 0.18);
  animation: arrive 900ms ease-out both;
}

.arrival-card h3,
.arrival-card p {
  margin: 0;
}

.status-mark {
  display: grid;
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  place-items: center;
  background: #174f52;
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
}

@keyframes arrive {
  0% {
    opacity: 0;
    transform: translate(-3rem, 1rem) scale(0.92);
  }

  65% {
    opacity: 1;
    transform: translate(0.4rem, 0) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@media (min-width: 44rem) {
  .comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .transform-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  nav a,
  .state-demo-smooth {
    transition-duration: 0.01ms;
  }

  .arrival-card {
    animation: none;
  }
}
