.supplement {
  --supplement-rule: #e7e3db;
  background: var(--paper);
}

.supplement-header {
  border-bottom: 1px solid var(--supplement-rule);
  background: var(--sheet);
}

.supplement-header .header-inner {
  min-height: 3.75rem;
}

.supplement .link-action {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-block: 0.35rem;
  color: var(--green-dark);
  font-size: 0.9375rem;
  font-weight: 550;
  text-underline-offset: 0.2em;
}

.supplement-main {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-content: start;
  gap: clamp(1rem, 2.2vw, 1.5rem);
  padding-block: clamp(1.5rem, 5vw, 4rem);
}

.supplement-main > * {
  min-width: 0;
}

.supplement-intro { grid-column: 1 / -1; }

.supplement-intro h1 {
  max-width: 28ch;
  font-size: clamp(1.5rem, 1.275rem + 0.9vw, 2rem);
  text-wrap: balance;
}

.supplement-intro p {
  max-width: 58ch;
  margin-top: 0.7rem;
  color: var(--muted);
}

.supplement-main > .supplement-intro > .link-action {
  margin-bottom: 0.6rem;
}

.paper-section {
  grid-column: span 8;
  padding: clamp(1.1rem, 3.7vw, 2.35rem);
  border: 1px solid var(--supplement-rule);
  border-radius: 0.8rem;
  background: var(--sheet);
}

.margin-section {
  grid-column: span 4;
  align-self: start;
  padding: clamp(1rem, 2.8vw, 1.6rem);
  border-radius: 0.8rem;
  background: var(--sage-soft);
}

.paper-section > * + *, .margin-section > * + * { margin-top: 1rem; }

.margin-section p { max-width: 36ch; }

.section-actions {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.supplement .section-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  max-width: 100%;
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--green-dark);
  border-radius: 0.45rem;
  background: var(--green-dark);
  color: var(--white);
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.supplement .section-button:hover { background: var(--green); }

.supplement .section-button:disabled {
  border-color: var(--rule-strong);
  background: var(--paper-deep);
  color: var(--muted);
  cursor: auto;
}

.supplement button.link-action {
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: underline;
}

.practice-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.practice-list li + li { border-top: 1px solid var(--supplement-rule); }

.practice-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1rem;
  min-height: 4rem;
  padding-block: 0.75rem;
  text-decoration: none;
}

.practice-list li:first-child a { padding-top: 0; }
.practice-list li:last-child a { padding-bottom: 0; }
.practice-list a:hover .row-title { text-decoration: underline; text-underline-offset: 0.2em; }
.row-title { font: 500 1.15rem/1.3 var(--display); }
.row-note { display: block; margin-top: 0.25rem; color: var(--muted); }
.row-arrow { color: var(--green); }

.practice-window {
  display: block;
  width: 100%;
  height: auto;
  margin-block: 0.75rem 0.25rem;
  background: var(--sage-soft);
  border-radius: 0.35rem;
}

.practice-steps {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0;
  padding-left: 1.35em;
}

.practice-steps li { padding-left: 0.28em; }

.notebook-quote {
  padding-left: 0.85rem;
  border-left: 2px solid var(--control);
  font: italic 400 1.08rem/1.55 var(--display);
}

.supplement details > summary {
  display: list-item;
  min-height: 2.75rem;
  padding-block: 0.65rem;
  color: var(--green-dark);
  font-weight: 550;
  cursor: pointer;
}

.supplement details > p { margin-block: 0.3rem 0.55rem; }

.practice-privacy {
  max-width: 54ch;
  color: var(--muted);
  font-size: 0.9375rem;
}

.practice-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-block: 0.7rem 0;
}

.practice-prompt {
  min-height: 2.75rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 0.32rem;
  background: var(--surface);
  color: var(--green-dark);
  cursor: pointer;
}

.practice-prompt:hover { background: var(--sage-soft); }

.practice-field { display: grid; gap: 0.5rem; }
.practice-field label { font-weight: 600; }
.practice-field textarea { max-width: 100%; }
#draft { min-height: 7rem; }
.practice-result > * + * { margin-top: 0.85rem; }
.practice-result h2:focus { outline: none; }

.burn-stage {
  --ash-dark: #645851;
  --ash-mid: #8b7464;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 14rem;
  overflow: hidden;
  isolation: isolate;
}

.burn-paper {
  width: min(15rem, 80%);
  height: 10rem;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  animation: burn-paper 960ms ease-out forwards;
}

.ash {
  position: absolute;
  top: 54%;
  left: 53%;
  width: 0.5rem;
  height: 0.42rem;
  background: var(--ash-dark);
  clip-path: polygon(0 35%, 80% 0, 100% 60%, 44% 100%);
  opacity: 0;
  animation: ash-drop 550ms 380ms ease-out forwards;
}

.ash:nth-of-type(2) { --dx: 3.1rem; --dy: 3.4rem; --spin: 96deg; }
.ash:nth-of-type(3) { --dx: 4.2rem; --dy: 2.6rem; --spin: -52deg; left: 57%; background: var(--ash-mid); }
.ash:nth-of-type(4) { --dx: -1.2rem; --dy: 3.9rem; --spin: 140deg; left: 49%; }
.ash:nth-of-type(5) { --dx: 2.3rem; --dy: 4.1rem; --spin: -68deg; left: 55%; background: var(--ash-mid); }
.ash:nth-of-type(6) { --dx: -3.25rem; --dy: 4rem; --spin: 119deg; left: 47%; }

@keyframes burn-paper {
  0% { clip-path: polygon(0 0, 100% 0, 100% 22%, 100% 43%, 100% 66%, 100% 100%, 0 100%); }
  35% {
    box-shadow: inset -0.65rem -0.3rem 0 var(--ash-mid); /* taste-skill-ignore: scorched edge during the paper effect only */
    clip-path: polygon(0 0, 97% 0, 89% 22%, 96% 43%, 88% 66%, 93% 100%, 0 100%);
  }
  72% {
    box-shadow: inset -1rem -0.5rem 0 var(--ash-dark); /* taste-skill-ignore: scorched edge during the paper effect only */
    clip-path: polygon(5% 12%, 63% 18%, 56% 35%, 64% 56%, 53% 79%, 59% 100%, 8% 90%);
  }
  100% {
    clip-path: polygon(20% 90%, 26% 92%, 24% 95%, 28% 100%, 23% 100%, 20% 100%, 16% 96%);
    opacity: 0;
    transform: translateY(1rem) rotate(-7deg);
  }
}

@keyframes ash-drop {
  25% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--spin)); }
}

@media (max-width: 52rem) {
  .supplement-main > :is(.paper-section, .margin-section) { grid-column: 1 / -1; }
}

@media (min-width: 36rem) and (max-width: 52rem) {
  .window-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 45%);
    align-content: center;
    gap: 0 1rem;
  }
  .window-section .practice-window { grid-area: 1 / 2 / 3; margin: 0; }
  .window-section .link-action { justify-self: start; align-self: start; margin-top: 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .burn-stage { display: none; }
}
