:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, sans-serif;
  color: #243331;
  background: #f2eee7;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(1rem, 3vw, 3rem);
  background: #f2eee7;
}

.application-shell {
  display: grid;
  grid-template-rows: auto minmax(32rem, 1fr) auto;
  width: min(78rem, 100%);
  min-height: calc(100vh - clamp(2rem, 6vw, 6rem));
  margin: 0 auto;
}

.application-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid #b8c2ba;
}

.brand h1 {
  margin: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.progress-text {
  margin: 0.85rem 0 0;
  color: #52635c;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.step-indicator {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.45rem 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.step-indicator li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #66756f;
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.step-number {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid #9baaa3;
  border-radius: 50%;
  font-size: 0.75rem;
}

.step-indicator li.is-current {
  color: #1f5c59;
}

.step-indicator li.is-current .step-number {
  color: #ffffff;
  background: #1f5c59;
  border-color: #1f5c59;
}

.workflow-content {
  display: grid;
  align-items: start;
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.step-content {
  width: min(100%, 48rem);
  min-height: 18rem;
}

h2 {
  max-width: 24ch;
  margin: 0 0 1.25rem;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

h2:focus {
  outline: none;
}

p,
li {
  max-width: 66ch;
  line-height: 1.6;
}

.step-lead {
  max-width: 48ch;
  margin: -0.25rem 0 2rem;
  color: #40514b;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  line-height: 1.45;
}

.section-heading {
  margin: 0 0 0.7rem;
  color: #1f5c59;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-note {
  margin: -0.15rem 0 1.25rem;
  color: #52635c;
}

.content-block {
  max-width: 66ch;
  padding: 1.35rem 1.4rem;
  color: #30413c;
  background: #e8e5dd;
  border-left: 3px solid #1f5c59;
}

.content-block p {
  margin: 0;
}

.content-block p + p {
  margin-top: 0.8rem;
}

.choice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.writing-hints {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0 0 0 1.3rem;
}

.hint-panel {
  display: grid;
  gap: 0.3rem;
  max-width: 48rem;
  padding: 1.35rem 1.4rem;
  background: #e8e5dd;
  border-left: 3px solid #1f5c59;
}

.examples {
  display: grid;
  gap: 0.75rem;
  max-width: 48rem;
}

.example-card {
  color: #30413c;
  background: #e8e5dd;
  border-left: 3px solid #1f5c59;
}

.example-card summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.75rem;
  padding: 0.8rem 1.15rem 0.8rem 1rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.example-card summary::-webkit-details-marker {
  display: none;
}

.example-card summary::after {
  width: 1.2rem;
  margin-left: auto;
  color: #1f5c59;
  content: '+';
  font-size: 1.35rem;
  font-weight: 500;
  text-align: center;
}

.example-card[open] summary {
  border-bottom: 1px solid #b8c2ba;
}

.example-card[open] summary::after {
  content: '–';
}

.example-number {
  color: #1f5c59;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.example-title {
  font-size: 1.05rem;
}

.example-card-body {
  padding: 1rem;
}

.example-card .content-block {
  max-width: none;
  padding: 0;
  background: transparent;
  border-left: 0;
}

.workflow-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid #b8c2ba;
}

.navigation-actions {
  display: flex;
  justify-content: end;
  gap: 0.75rem;
}

.navigation-actions[hidden],
.button[hidden] {
  display: none !important;
}

.button,
.restart-button {
  min-height: 2.8rem;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0.2rem;
}

.button {
  color: #ffffff;
  background: #1f5c59;
  border-color: #1f5c59;
}

.button-secondary,
.restart-button {
  color: #1f5c59;
  background: transparent;
  border-color: #1f5c59;
}

.restart-button {
  justify-self: start;
}

.restart-button.is-start-over {
  color: #ffffff;
  background: #1f5c59;
}

.submission-form {
  display: grid;
  gap: 0.75rem;
  max-width: 48rem;
  padding: 1.35rem 1.4rem;
  background: #e8e5dd;
  border-left: 3px solid #1f5c59;
}

.submission-form label {
  font-weight: 750;
}

.submission-form textarea {
  width: 100%;
  min-height: 18rem;
  padding: 1rem;
  resize: vertical;
  font: inherit;
  line-height: 1.6;
  color: inherit;
  background: #fbf9f4;
  border: 1px solid #778980;
  border-radius: 0.2rem;
}

.character-count,
.submission-notice,
.submission-status {
  margin: 0;
  color: #52635c;
}

.submission-status {
  min-height: 1.6rem;
}

.submission-status.is-error {
  color: #9d3022;
  font-weight: 750;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.submission-identifier {
  margin: 1.75rem 0;
  padding: 1rem 0 1rem 1.25rem;
  color: #1f5c59;
  font-size: 1.15rem;
  font-weight: 750;
  background: #e8e5dd;
  border-left: 3px solid #1f5c59;
}

.button:focus-visible,
.restart-button:focus-visible,
.submission-form textarea:focus-visible,
.example-card summary:focus-visible,
a:focus-visible {
  outline: 3px solid #b54c2e;
  outline-offset: 3px;
}

@media (max-width: 70rem) {
  .application-header {
    align-items: start;
    flex-direction: column;
  }

  .application-header nav,
  .step-indicator {
    width: 100%;
    justify-content: start;
  }
}

@media (max-width: 40rem) {
  body {
    padding: 1rem;
  }

  .application-shell {
    grid-template-rows: auto minmax(24rem, 1fr) auto;
    min-height: calc(100vh - 2rem);
  }

  .application-header {
    gap: 1.5rem;
    padding-bottom: 1.25rem;
  }

  .step-indicator {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .step-label {
    display: none;
  }

  .workflow-content {
    padding: 2.5rem 0;
  }

  .step-lead {
    margin-bottom: 1.5rem;
  }

  .content-block,
  .hint-panel,
  .submission-form {
    padding: 1.1rem;
  }

  .example-card summary {
    min-height: 3.5rem;
    padding-right: 0.9rem;
  }

  .example-card-body {
    padding: 0.85rem;
  }

  .workflow-footer {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .restart-button,
  .navigation-actions,
  .button {
    width: 100%;
  }

  .navigation-actions {
    flex-direction: column;
  }

  .choice-actions {
    flex-direction: column;
  }
}
