/*
  Button 03 — Magnetic CTA — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is. `--button-accent` is a
  plain custom property — override it wherever this button is used to
  change the focus-visible color.
*/

:root {
  --button-accent: #39ff14;
  --button-foreground: #0f172a;
  --button-foreground-hover: #262f3d;
  --button-border: #d4d4d8;
  --button-border-hover: #a1a1aa;
}

.magnetic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  border: 1px solid transparent;
  padding: 1rem 2.25rem;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.magnetic-btn:active {
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0.98);
}

.magnetic-btn--primary {
  background-color: var(--button-foreground);
  border-color: var(--button-foreground);
  color: #ffffff;
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.45);
}

.magnetic-btn--primary:hover {
  background-color: var(--button-foreground-hover);
  box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.55);
}

.magnetic-btn--secondary {
  background-color: #ffffff;
  border-color: var(--button-border);
  color: var(--button-foreground);
  box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.25);
}

.magnetic-btn--secondary:hover {
  border-color: var(--button-border-hover);
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.3);
}

.magnetic-btn:focus-visible {
  outline: 2px solid var(--button-accent);
  outline-offset: 2px;
}

.magnetic-btn:disabled,
.magnetic-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .magnetic-btn {
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
    transform: none;
  }

  .magnetic-btn:active {
    transform: none;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

body {
  margin: 0;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
.button03-layout {
  display: flex;
  min-height: 20rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.button03-layout__panel {
  display: flex;
  width: 100%;
  max-width: 42rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  padding: 2rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
@media (min-width: 640px) {
  .button03-layout__panel {
    padding: 3rem;
  }
}
