:root {
  --bg: #f6f3ee;
  --card-bg: #ffffff;
  --text: #24211d;
  --muted: #6f675d;
  --border: #d8d0c4;
  --button-bg: #2f5d50;
  --button-bg-hover: #254a40;
  --button-text: #ffffff;
  --soft-accent: #ece4d8;
  --shadow: 0 12px 30px rgba(40, 32, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

.page {
  width: min(100%, 56rem);
  margin: 0 auto;
  padding: 1rem;
}

.result-card {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
}

.result-label {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--soft-accent);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 8vw, 3.25rem);
  line-height: 1.05;
}

.result-text {
  margin: 1rem 0 0;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
}

.permalink-box {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.permalink-box label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.permalink-row {
  display: flex;
  gap: 0.5rem;
}

.permalink-row input {
  min-width: 0;
  flex: 1;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: #fbfaf8;
  color: var(--text);
  font: inherit;
}

.copy-button,
.endpoint-button {
  border: 0;
  border-radius: 0.8rem;
  background: var(--button-bg);
  color: var(--button-text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.copy-button {
  padding: 0.85rem 1rem;
  white-space: nowrap;
}

.copy-button:hover,
.endpoint-button:hover {
  background: var(--button-bg-hover);
  transform: translateY(-1px);
}

.copy-button:active,
.endpoint-button:active {
  transform: translateY(0);
}

.copy-status {
  min-height: 1.25rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.links-section {
  margin-top: 1.5rem;
}

.links-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.endpoint-button {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  text-align: center;
}

@media (min-width: 42rem) {
  .page {
    padding: 2rem;
  }

  .result-card {
    margin-top: 2rem;
    padding: 2rem;
  }

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

@media (min-width: 56rem) {
  .endpoint-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 26rem) {
  .permalink-row {
    flex-direction: column;
  }

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