@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --ink: #17211f;
  --muted: #697773;
  --paper: #f4f1e9;
  --panel: #fbfaf6;
  --line: #d8ddd4;
  --green: #1b6b59;
  --green-dark: #124a3e;
  --mint: #dcebe0;
  --coral: #d86d4c;
  --yellow: #f5ce72;
  --shadow: 0 20px 55px rgba(33, 54, 45, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", sans-serif;
  min-width: 320px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(27, 107, 89, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 107, 89, 0.055) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.shell {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 72px;
  position: relative;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  margin-bottom: 62px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: var(--mint);
  color: var(--green-dark);
  transform: rotate(-8deg);
}

.brand-letter {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.brand-switch {
  position: absolute;
  right: -8px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  transform: rotate(8deg);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 23px;
  letter-spacing: -0.045em;
}

.brand-copy small {
  color: var(--muted);
  font:
    10px "DM Mono",
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-signals {
  display: flex;
  align-items: center;
  gap: 8px;
}

.signal {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--green);
  font-size: 15px;
}

.signal:nth-child(2) {
  color: var(--coral);
  transform: translateY(5px);
}

.signal:nth-child(3) {
  transform: translateY(-3px);
}

.signal:nth-child(4) {
  color: var(--coral);
  transform: translateY(4px);
}

.signal:nth-child(5) {
  color: var(--muted);
  transform: translateY(-1px);
}

.hero {
  max-width: none;
  margin-bottom: 46px;
  animation: rise 0.65s ease-out both;
}

.eyebrow {
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin: 18px 0 16px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 800;
}

h1 em {
  color: var(--coral);
  font-style: normal;
}

.intro {
  max-width: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  white-space: nowrap;
}

.generator {
  margin-top: 34px;
  padding: 20px;
  width: 100%;
  max-width: none;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px auto;
  gap: 10px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

input {
  width: 100%;
  padding: 0 16px;
  font-size: 16px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 107, 89, 0.12);
}

.count-field {
  position: relative;
  display: block;
}

.count-field span {
  position: absolute;
  top: 7px;
  left: 12px;
  z-index: 1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

select {
  width: 100%;
  padding: 17px 10px 0;
}

.primary-button,
.quiet-button {
  border: 0;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.primary-button {
  min-width: 148px;
  padding: 0 24px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
}
.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.form-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
}

.form-status {
  color: var(--muted);
  text-align: right;
}

.form-status.success {
  color: var(--green);
}

.form-status.error {
  color: var(--coral);
}

.workspace,
.history-panel {
  animation: rise 0.65s 0.1s ease-out both;
}
.workspace {
  margin-top: 30px;
}

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

h2 {
  margin: 8px 0 0;
  font-size: 27px;
  letter-spacing: -0.04em;
}
.result-count {
  color: var(--muted);
  font:
    12px "DM Mono",
    monospace;
}

.results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed #b9c6ba;
  color: var(--muted);
}

.results.empty-state {
  min-height: 64px;
}

.empty-state p {
  margin: 8px 0 0;
  font-size: 13px;
}
.suggestion {
  position: relative;
  min-height: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  animation: reveal 0.35s ease-out both;
}

.suggestion:hover {
  border-color: var(--green);
  transform: translateY(-3px);
}
.suggestion.picked {
  background: var(--mint);
  border-color: var(--green);
}
.suggestion-name {
  display: block;
  flex: 1;
  margin: 0;
  font-size: 18px;
  line-height: 1.18;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.suggestion-meta {
  position: static;
  order: 2;
  color: var(--green);
  font:
    10px "DM Mono",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.suggestion-state {
  position: static;
  order: 3;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.selection-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.history-panel {
  margin-top: 58px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.history-heading {
  align-items: center;
}
.quiet-button {
  padding: 8px 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.quiet-button:hover {
  color: var(--coral);
}

.history-list {
  display: grid;
  gap: 10px;
}
.history-empty {
  padding: 26px;
  border: 1px dashed #b9c6ba;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.history-entry {
  padding: 17px 19px;
  border: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.7);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}
.history-entry:hover,
.history-entry:focus-visible {
  border-color: var(--green);
  background: var(--panel);
  outline: none;
  transform: translateY(-2px);
}
.history-entry-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: baseline;
}
.history-input {
  font-weight: 800;
}
.history-date {
  color: var(--muted);
  font:
    11px "DM Mono",
    monospace;
  white-space: nowrap;
}
.history-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}
.history-count {
  color: var(--green);
  font-family: "DM Mono", monospace;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid #b9cfc0;
  background: var(--mint);
  font-size: 10px;
}
.history-names {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.history-name {
  padding: 6px 9px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 12px;
}
.history-name.picked {
  background: var(--yellow);
  color: var(--ink);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .results {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 28px, 540px);
    padding-top: 34px;
  }
  .intro {
    white-space: normal;
  }
  .app-header {
    margin-bottom: 42px;
  }
  .brand-mark {
    width: 40px;
    height: 40px;
  }
  .brand-copy strong {
    font-size: 20px;
  }
  .brand-copy small {
    display: none;
  }
  .header-signals {
    gap: 5px;
  }
  .signal {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
  h1 {
    font-size: 48px;
  }
  .input-row {
    grid-template-columns: 1fr 100px;
  }
  .primary-button {
    grid-column: 1 / -1;
    min-height: 52px;
  }
  .results {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .suggestion {
    min-height: 0;
    padding: 12px 14px;
  }
  .suggestion-meta {
    font-size: 9px;
  }
  .suggestion-name {
    font-size: 16px;
  }
  .form-foot {
    align-items: start;
    flex-direction: column;
  }
  .form-status {
    text-align: left;
  }
  .history-entry-top {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }
}
