/* The Island Path: units of lessons as a winding path, Chess.com style, in the island palette. */
.path-head,
.path-lesson-head {
  max-width: 720px;
  margin: 0 auto 28px;
  text-align: center;
}

.path-kicker {
  margin: 0 0 6px;
  color: #b07d1a;
  font: 800 0.76rem / 1 "Google Sans Flex", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.path-head h1,
.path-lesson-head h1 {
  margin: 0;
  color: #1c2924;
  font: 800 clamp(2rem, 5vw, 2.8rem) / 1.05 "Google Sans Flex", sans-serif;
  letter-spacing: -0.02em;
}

.path-lede {
  margin: 12px auto 0;
  max-width: 34rem;
  color: #3d4b45;
  font-size: 1.05rem;
  line-height: 1.5;
}

.path-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 20px auto 0;
}

.path-progress-bar {
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(45, 76, 54, 0.14);
}

.path-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #36905b, #f2c75c);
  transition: width 600ms ease;
}

.path-progress-count {
  color: #2d4c36;
  font: 800 0.85rem / 1 "Google Sans Flex", sans-serif;
  white-space: nowrap;
}

.path {
  display: grid;
  gap: 28px;
  max-width: 720px;
  margin: 0 auto;
}

.path-unit {
  --unit-hue: calc(150 + var(--unit-index) * 38);
  padding: 22px 22px 26px;
  border-radius: 26px;
  background: #fbf6e8;
  box-shadow: 0 14px 42px rgba(23, 42, 34, 0.08);
}

.path-unit-head {
  margin: -22px -22px 18px;
  padding: 20px 24px;
  border-radius: 26px 26px 18px 18px;
  background: linear-gradient(135deg, hsl(var(--unit-hue) 45% 30%), hsl(var(--unit-hue) 40% 22%));
  color: #fffaf0;
}

.path-unit-number {
  margin: 0;
  color: rgba(255, 250, 240, 0.72);
  font: 800 0.72rem / 1 "Google Sans Flex", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.path-unit-head h2 {
  margin: 6px 0 4px;
  font: 800 1.45rem / 1.15 "Google Sans Flex", sans-serif;
}

.path-unit-head p:last-child {
  margin: 0;
  color: rgba(255, 250, 240, 0.86);
  line-height: 1.4;
}

.path-steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The path winds: each step sits a little left or right of the one before. */
.path-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: calc(12% + 14% * sin(var(--step-index) * 1.3rad));
}

.path-node {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #d7d1c0;
  box-shadow: 0 6px 0 #b4ad99;
  color: #7a7464;
  font: 800 1.25rem / 1 "Google Sans Flex", sans-serif;
  text-decoration: none;
  transition: transform 120ms ease;
}

.path-node:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b4ad99;
}

.path-step.is-open .path-node {
  background: #36905b;
  box-shadow: 0 6px 0 #22653d;
  color: #fffaf0;
}

.path-step.is-done .path-node {
  background: #f2c75c;
  box-shadow: 0 6px 0 #c4962c;
  color: #3b2b06;
}

.path-step.is-done .path-node-mark {
  font-size: 0;
}

.path-step.is-done .path-node-mark::after {
  content: "✓";
  font-size: 1.6rem;
}

.path-step.is-locked .path-node-mark {
  font-size: 0;
}

.path-step.is-locked .path-node-mark::after {
  content: "🔒";
  font-size: 1.2rem;
  filter: grayscale(1);
}

.path-step.is-current .path-node::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 3px solid rgba(54, 144, 91, 0.45);
  border-radius: 50%;
  animation: path-pulse 1.6s ease-out infinite;
}

.path-step.is-current .path-node::after {
  content: "Start";
  position: absolute;
  top: -30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #1c2924;
  color: #fffaf0;
  font: 800 0.72rem / 1 "Google Sans Flex", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@keyframes path-pulse {
  from { transform: scale(0.9); opacity: 1; }
  to { transform: scale(1.25); opacity: 0; }
}

.path-step.is-shaking {
  animation: path-shake 320ms ease;
}

@keyframes path-shake {
  25% { translate: -6px 0; }
  75% { translate: 6px 0; }
}

.path-step-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #1c2924;
  text-decoration: none;
}

.path-step-copy strong {
  font: 800 1.02rem / 1.2 "Google Sans Flex", sans-serif;
}

.path-step-copy span {
  color: #5a665f;
  font-size: 0.88rem;
  line-height: 1.35;
}

.path-step.is-locked .path-step-copy {
  opacity: 0.55;
}

.path-foot {
  display: block;
}

.path-foot,
.path-hands {
  max-width: 720px;
  margin: 28px auto 0;
  color: #3d4b45;
  text-align: center;
}

.path-foot a,
.path-hands a {
  color: #22653d;
  font-weight: 800;
}

/* A lesson: its steps as cards, then the check. */
.path-lesson {
  max-width: 640px;
  margin: 0 auto;
}

.path-lesson-steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.path-card {
  position: relative;
  padding: 22px 22px 22px 64px;
  border-radius: 22px;
  background: #fbf6e8;
  box-shadow: 0 10px 30px rgba(23, 42, 34, 0.07);
  animation: path-rise 420ms ease both;
  animation-delay: calc(var(--step-index) * 90ms);
}

@keyframes path-rise {
  from { opacity: 0; translate: 0 12px; }
}

.path-card-number {
  position: absolute;
  top: 20px;
  left: 20px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1f5a3a;
  color: #fffaf0;
  font: 800 0.9rem / 1 "Google Sans Flex", sans-serif;
}

.path-card-say {
  margin: 4px 0 0;
  color: #1c2924;
  font: 700 1.12rem / 1.45 "Google Sans Flex", sans-serif;
}

.path-card-note {
  margin: 10px 0 0;
  color: #5a665f;
}

.path-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1f5a3a, #174a2f);
}

.path-tile-group {
  display: inline-flex;
}

.path-tile-group img {
  width: clamp(26px, 6.4vw, 38px);
  height: auto;
  margin-right: -1px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.path-check {
  margin-top: 26px;
  padding: 24px;
  border-radius: 24px;
  background: #1c2924;
  color: #fffaf0;
  text-align: center;
}

.path-check h2 {
  margin: 0 0 16px;
  font: 800 1.3rem / 1.3 "Google Sans Flex", sans-serif;
}

.path-check .path-kicker {
  color: #f2c75c;
}

.path-options {
  display: grid;
  gap: 10px;
}

.path-option {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: #fffaf0;
  box-shadow: 0 4px 0 #c9bf9f;
  color: #1c2924;
  font: 800 1rem / 1.2 "Google Sans Flex", sans-serif;
  cursor: pointer;
}

.path-option.is-right {
  background: #36905b;
  box-shadow: 0 4px 0 #22653d;
  color: #fffaf0;
}

.path-option.is-wrong {
  background: #e7c3c3;
  box-shadow: 0 4px 0 #b98d8d;
  animation: path-shake 320ms ease;
}

.path-option:disabled {
  cursor: default;
}

.path-why,
.path-miss {
  margin: 16px 0 0;
  line-height: 1.45;
}

.path-miss {
  color: #f0b4b4;
}

.path-finish {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.path-button {
  display: block;
  padding: 16px;
  border-radius: 16px;
  background: #f2c75c;
  box-shadow: 0 5px 0 #c4962c;
  color: #3b2b06;
  font: 800 1.05rem / 1.2 "Google Sans Flex", sans-serif;
  text-decoration: none;
}

.path-link {
  color: #f2c75c;
  font-weight: 800;
}

@media (max-width: 560px) {
  .path-unit {
    padding: 18px 14px 22px;
  }

  .path-unit-head {
    margin: -18px -14px 16px;
  }

  .path-step {
    padding-left: calc(4% + 8% * sin(var(--step-index) * 1.3rad));
  }

  .path-node {
    width: 54px;
    height: 54px;
  }

  .path-card {
    padding: 18px 16px 18px 54px;
  }

  .path-card-number {
    left: 14px;
  }
}
