:root {
  --black: #000000;
  --coal: #0c110e;
  --line: #22302a;
  --white: #ffffff;
  --mist: #eef3f0;
  --rule: #cbd6d0;
  --green: #22e57f;
  --blue: #1d4ff0;
  --blue-soft: #7aa2ff;
  --muted: #a3b3aa;
  --ink: #06100b;
  --danger: #a3190d;
  --danger-bg: #fdeceb;
  --display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--black);
  color: var(--white);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

:focus-visible {
  outline: 3px solid var(--blue-soft);
  outline-offset: 2px;
}

.top {
  padding-top: 20px;
  padding-bottom: 4px;
}

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

.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--green);
  color: var(--black);
}

.word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.word b {
  font-weight: 800;
  color: var(--green);
}

.hero {
  padding: 40px 0 28px;
}

h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero p {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.panel {
  margin-right: 8px;
  padding: 20px;
  background: var(--white);
  color: var(--ink);
  border: 3px solid var(--blue);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--green);
}

.panel :focus-visible {
  outline-color: var(--blue);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.field {
  display: flex;
  gap: 8px;
}

input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 14px;
  background: var(--white);
  color: var(--ink);
  border: 2px solid var(--rule);
  border-radius: 10px;
  font-family: var(--body);
  font-size: 16px;
}

input::placeholder {
  color: #7d8b84;
}

input:focus {
  border-color: var(--blue);
}

.paste {
  height: 54px;
  padding: 0 16px;
  background: var(--mist);
  color: var(--ink);
  border: 2px solid var(--rule);
  border-radius: 10px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.paste:hover {
  border-color: var(--ink);
}

.go {
  width: 100%;
  height: 58px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--green);
  color: var(--black);
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.go:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--black);
}

.go:active:not(:disabled) {
  transform: none;
  box-shadow: none;
}

.go:disabled {
  cursor: progress;
}

.go.loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid var(--black);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.paste:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--danger-bg);
  color: var(--danger);
  border-left: 6px solid var(--danger);
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
}

.result {
  margin-top: 18px;
  padding: 16px;
  background: var(--mist);
  border-left: 6px solid var(--green);
  border-radius: 10px;
  animation: rise 0.2s ease-out;
}

.result-title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.result-link {
  display: block;
  margin-bottom: 14px;
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 12px;
  border: 2px solid transparent;
  border-radius: 10px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
}

.btn-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.btn-blue {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.btn:hover {
  filter: brightness(1.15);
}

.meta {
  margin: 12px 0 0;
  color: #44544b;
  font-size: 0.85rem;
}

.history {
  margin-top: 40px;
}

.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.history h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
}

.clear {
  padding: 4px 0;
  background: none;
  border: 0;
  color: var(--blue-soft);
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.history-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.h-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--coal);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.h-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.h-result {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.95rem;
}

.h-host {
  color: var(--muted);
  font-size: 0.82rem;
}

.h-copy {
  min-width: 76px;
  height: 38px;
  padding: 0 14px;
  background: transparent;
  color: var(--white);
  border: 2px solid var(--blue);
  border-radius: 8px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.h-copy:hover {
  background: var(--blue);
}

.foot {
  margin-top: auto;
  padding-top: 44px;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 0.85rem;
}

.foot p {
  margin: 0;
  max-width: 52ch;
}

main {
  padding-bottom: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 640px) {
  .wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  .top {
    padding-top: 28px;
  }

  .hero {
    padding: 64px 0 36px;
  }

  .panel {
    margin-right: 10px;
    padding: 28px;
    box-shadow: 10px 10px 0 var(--green);
  }
}

@media (prefers-reduced-motion: reduce) {
  .go,
  .result {
    transition: none;
    animation: none;
  }

  .go.loading::before {
    animation-duration: 1.6s;
  }
}
