.learning-foundation-week {
  margin-bottom: var(--ds-section-gap);
}

.foundation-week-shell {
  overflow: hidden;
  border: 1px solid var(--ds-brand-border);
  border-radius: var(--ds-radius-surface);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-surface);
}

.foundation-week-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--ds-space-6);
  align-items: end;
  padding: clamp(22px, 3vw, 34px);
  background:
    linear-gradient(90deg, rgb(91 92 226 / 7%) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgb(91 92 226 / 7%) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--ds-brand-soft);
}

.foundation-week-kicker,
.foundation-day-command,
.foundation-day-index {
  font-family: var(--ds-font-mono);
}

.foundation-week-kicker {
  display: inline-flex;
  margin-bottom: var(--ds-space-2);
  color: var(--ds-brand-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.foundation-week-hero h2 {
  margin: 0;
  color: var(--ds-text);
  font-size: clamp(22px, 2.5vw, 32px);
  letter-spacing: -0.03em;
}

.foundation-week-hero p {
  max-width: 760px;
  margin: var(--ds-space-2) 0 0;
  color: var(--ds-text-secondary);
  line-height: var(--ds-line-height-body);
}

.foundation-week-actions {
  display: grid;
  justify-items: end;
  gap: var(--ds-space-3);
}

.foundation-week-progress-copy {
  display: flex;
  gap: var(--ds-space-2);
  align-items: baseline;
  color: var(--ds-text-muted);
  font-size: var(--ds-font-size-meta);
}

.foundation-week-progress-copy strong {
  color: var(--ds-brand-strong);
  font-size: 22px;
}

.foundation-week-progress {
  width: min(240px, 32vw);
  height: 7px;
  overflow: hidden;
  border-radius: var(--ds-radius-pill);
  background: rgb(91 92 226 / 14%);
}

.foundation-week-progress span {
  display: block;
  width: var(--foundation-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--ds-brand);
  transition: width var(--ds-motion-base) ease;
}

.foundation-week-actions button {
  min-height: var(--ds-control-height);
  padding-inline: var(--ds-space-5);
}

.foundation-week-actions button:disabled {
  cursor: default;
  opacity: 0.68;
}

.foundation-week-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
  padding: var(--ds-space-3) clamp(22px, 3vw, 34px);
  border-top: 1px solid rgb(91 92 226 / 10%);
  border-bottom: 1px solid var(--ds-border);
  background: var(--ds-surface);
}

.foundation-week-meta span {
  padding: 5px 10px;
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface-muted);
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-meta);
}

.foundation-day-list {
  position: relative;
  display: grid;
  gap: 0;
  padding: var(--ds-space-3) clamp(18px, 2.5vw, 30px) var(--ds-space-5);
}

.foundation-day-list::before {
  position: absolute;
  top: 30px;
  bottom: 34px;
  left: calc(clamp(18px, 2.5vw, 30px) + 21px);
  width: 2px;
  background: var(--ds-brand-border);
  content: "";
}

.foundation-day {
  position: relative;
  border-bottom: 1px solid var(--ds-border);
}

.foundation-day:last-child {
  border-bottom: 0;
}

.foundation-day summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: var(--ds-space-4);
  align-items: center;
  min-height: 82px;
  padding: var(--ds-space-3) 0;
  cursor: pointer;
  list-style: none;
}

.foundation-day summary::-webkit-details-marker {
  display: none;
}

.foundation-day summary:focus-visible {
  border-radius: var(--ds-radius-control);
  outline: 3px solid var(--ds-focus-color);
  outline-offset: 2px;
}

.foundation-day-index {
  position: relative;
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid var(--ds-brand-border);
  border-radius: 50%;
  background: var(--ds-surface);
  color: var(--ds-brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.foundation-day.is-complete .foundation-day-index {
  border-color: var(--ds-success);
  background: var(--ds-success-soft);
  color: var(--ds-success);
}

.foundation-day-heading {
  min-width: 0;
}

.foundation-day-heading span {
  display: block;
  margin-bottom: 3px;
  color: var(--ds-text-muted);
  font-size: var(--ds-font-size-meta);
}

.foundation-day-heading strong {
  display: block;
  color: var(--ds-text);
  font-size: 16px;
}

.foundation-day-command {
  display: inline-block;
  margin-top: 7px;
  color: var(--ds-brand-strong);
  font-size: 12px;
}

.foundation-day-status {
  display: inline-flex;
  gap: var(--ds-space-2);
  align-items: center;
  color: var(--ds-text-muted);
  font-size: var(--ds-font-size-meta);
  white-space: nowrap;
}

.foundation-day-status::after {
  width: 8px;
  height: 8px;
  border: solid var(--ds-text-faint);
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--ds-motion-fast) ease;
}

.foundation-day[open] .foundation-day-status::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.foundation-day.is-complete .foundation-day-status {
  color: var(--ds-success);
  font-weight: 700;
}

.foundation-day-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ds-space-3);
  padding: 0 0 var(--ds-space-5) calc(44px + var(--ds-space-4));
}

.foundation-day-block,
.foundation-day-review {
  padding: var(--ds-space-4);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-nested);
  background: var(--ds-surface-subtle);
}

.foundation-day-block h3,
.foundation-day-review h3 {
  margin: 0 0 var(--ds-space-2);
  color: var(--ds-text);
  font-size: var(--ds-font-size-label);
}

.foundation-day-block p,
.foundation-day-block li,
.foundation-day-review p {
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body-sm);
  line-height: 1.65;
}

.foundation-day-block p,
.foundation-day-review p {
  margin: 0;
}

.foundation-day-block ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.foundation-day-review {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(280px, 1.25fr);
  gap: var(--ds-space-4);
  align-items: center;
}

.foundation-day-review textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}

.foundation-day-check {
  display: inline-flex;
  gap: var(--ds-space-2);
  align-items: center;
  margin-top: var(--ds-space-3);
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body-sm);
}

.foundation-day-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--ds-brand);
}

@media (max-width: 1024px) {
  .foundation-day-body {
    grid-template-columns: 1fr 1fr;
  }

  .foundation-day-block:last-of-type,
  .foundation-day-review {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .foundation-week-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .foundation-week-actions {
    width: 100%;
    justify-items: stretch;
  }

  .foundation-week-progress {
    width: 100%;
  }

  .foundation-week-actions button {
    width: 100%;
  }

  .foundation-day-body,
  .foundation-day-review {
    grid-template-columns: 1fr;
  }

  .foundation-day-block,
  .foundation-day-block:last-of-type,
  .foundation-day-review {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .foundation-week-hero,
  .foundation-week-meta {
    padding-inline: 18px;
  }

  .foundation-day-list {
    padding-inline: 14px;
  }

  .foundation-day-list::before {
    left: 35px;
  }

  .foundation-day summary {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: var(--ds-space-3);
  }

  .foundation-day-status {
    grid-column: 2;
    justify-self: start;
  }

  .foundation-day-body {
    padding-left: calc(42px + var(--ds-space-3));
  }
}

@media (prefers-reduced-motion: reduce) {
  .foundation-week-progress span,
  .foundation-day-status::after {
    transition: none;
  }
}
