:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #152029;
  background: #eff2ed;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 14% 8%, rgba(205, 226, 206, 0.82), transparent 27rem),
    radial-gradient(circle at 89% 39%, rgba(229, 217, 186, 0.58), transparent 24rem),
    #f6f7f2;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 76px 0 52px;
}

.hero {
  max-width: 720px;
  margin-bottom: 60px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: #467157;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  color: #12261b;
  font-size: clamp(2.65rem, 7vw, 5.9rem);
  font-weight: 780;
  letter-spacing: -0.085em;
  line-height: 0.97;
}

.hero-copy {
  max-width: 670px;
  margin-bottom: 0;
  color: #5e6a65;
  font-size: 1.04rem;
  line-height: 1.8;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

h2 {
  margin-bottom: 0;
  color: #1b3126;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.section-heading > p {
  max-width: 380px;
  margin-bottom: 0;
  color: #77827d;
  font-size: 0.83rem;
  line-height: 1.6;
  text-align: right;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.character-card,
.composer,
.note {
  border: 1px solid rgba(65, 83, 73, 0.12);
  background: rgba(255, 255, 252, 0.75);
  box-shadow: 0 15px 42px rgba(50, 72, 58, 0.07);
  backdrop-filter: blur(13px);
}

.character-card {
  display: flex;
  min-height: 274px;
  flex-direction: column;
  padding: 19px;
  border-radius: 18px;
}

.character-visual {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 32px;
  border: 1px dashed #87a28f;
  border-radius: 13px;
  color: #598269;
  font-size: 0.73rem;
}

.character-code {
  color: #3e7853;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
}

.character-card h3 {
  margin: 7px 0 8px;
  color: #1c3327;
  font-size: 1rem;
}

.character-card p {
  min-height: 44px;
  margin-bottom: 18px;
  color: #738079;
  font-size: 0.76rem;
  line-height: 1.55;
}

.button {
  border: 0;
  border-radius: 10px;
  font-weight: 750;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.card-button {
  width: 100%;
  margin-top: auto;
  padding: 10px 12px;
  color: #386b4c;
  background: #e7f1e8;
  font-size: 0.8rem;
}

.card-button:hover {
  background: #d9eadb;
}

.composer {
  margin-top: 58px;
  padding: 24px;
  border-radius: 22px;
}

.composer-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(63, 82, 71, 0.1);
  border-bottom: 1px solid rgba(63, 82, 71, 0.1);
}

.option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #516159;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
}

.option-label input {
  width: 17px;
  height: 17px;
  accent-color: #4b895f;
}

.composer-footer {
  display: flex;
  align-items: end;
  gap: 26px;
  padding-top: 19px;
}

.repeat-field {
  display: grid;
  gap: 6px;
  color: #68756f;
  font-size: 0.75rem;
  font-weight: 700;
}

.repeat-field input {
  width: 116px;
  padding: 10px;
  border: 1px solid #d9e0da;
  border-radius: 10px;
  color: #23392e;
  background: #fff;
}

.summary {
  display: grid;
  gap: 6px;
  margin-right: auto;
  color: #68756f;
  font-size: 0.75rem;
}

.summary strong {
  color: #263c31;
  font-size: 1rem;
}

.primary-button {
  padding: 13px 25px;
  color: #fff;
  background: #367349;
  font-size: 0.88rem;
}

.primary-button:hover {
  background: #2b613c;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.note {
  display: flex;
  gap: 14px;
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 15px;
}

.note-mark {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #709078;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-weight: 700;
}

.note h2 {
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.note p {
  margin-bottom: 0;
  color: #6e7a74;
  font-size: 0.77rem;
  line-height: 1.65;
}

code {
  color: #477454;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: #285d3a;
  box-shadow: 0 15px 36px rgba(42, 80, 55, 0.25);
  font-size: 0.86rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #935447;
}

@media (max-width: 900px) {
  .character-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 22px, 520px);
    padding-top: 44px;
  }

  .hero {
    margin-bottom: 45px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 8px;
    text-align: left;
  }

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

  .character-card {
    min-height: 250px;
    padding: 15px;
  }

  .character-visual {
    margin-bottom: 23px;
  }

  .composer {
    margin-top: 44px;
    padding: 17px;
  }

  .composer-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .composer-footer {
    flex-wrap: wrap;
    gap: 16px;
  }

  .primary-button {
    width: 100%;
  }
}
