:root {
  --bg: #091018;
  --surface: rgba(11, 18, 27, 0.88);
  --surface-strong: rgba(9, 15, 23, 0.9);
  --line: rgba(136, 166, 197, 0.16);
  --line-strong: rgba(136, 166, 197, 0.28);
  --text: #edf4fb;
  --muted: #9fadc0;
  --accent: #7cc7ff;
  --accent-pressed: #65b8f0;
  --accent-ink: #081723;
  --focus: rgba(124, 199, 255, 0.28);
  --shadow: 0 20px 46px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background-color: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top center, rgba(124, 199, 255, 0.12), transparent 34%),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-color: var(--bg);
  background-size: auto, 18px 18px, 18px 18px;
}

.app-shell {
  width: 100%;
  padding: 0 0 2rem;
}

.app-column {
  width: min(100%, 30rem);
  margin: 0 auto;
}

.hero-stage {
  min-height: calc(100vh - 7rem);
  min-height: calc(100svh - 7rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 0.9rem 0.2rem;
}

.app-panel {
  display: grid;
  gap: 1.1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(124, 199, 255, 0.08), transparent 26%),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.app-panel-hero {
  width: 100%;
}

.hero-copy {
  display: grid;
  gap: 0.55rem;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-message,
.history-section h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.status-message {
  max-width: 13ch;
  font-size: clamp(1.9rem, 8.8vw, 2.7rem);
  line-height: 1.02;
  text-wrap: balance;
}

.clean-button {
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08) 34%, transparent 70%),
    linear-gradient(135deg, rgba(160, 220, 255, 0.22), transparent 58%),
    var(--accent);
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  cursor: pointer;
  overflow: visible;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16),
    0 10px 22px rgba(0, 0, 0, 0.18);
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

.clean-button::before,
.clean-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.clean-button::before {
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.34) 50%, transparent 80%);
  opacity: 0;
  transform: translateX(-40%);
}

.clean-button::after {
  inset: -0.25rem;
  border: 1px solid rgba(124, 199, 255, 0.26);
  opacity: 0;
  transform: scale(0.96);
}

.clean-button:active {
  transform: translateY(1px);
  background: var(--accent-pressed);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 6px 14px rgba(0, 0, 0, 0.14);
}

.clean-button.is-bursting {
  animation: button-pop 460ms cubic-bezier(0.2, 0.84, 0.24, 1);
}

.clean-button.is-bursting::before {
  animation: button-sheen 420ms ease;
}

.clean-button.is-bursting::after {
  animation: button-halo 460ms ease-out;
}

.clean-button-label {
  position: relative;
  z-index: 1;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.button-success {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.button-checkmark {
  width: 1.1rem;
  height: 0.6rem;
  border-left: 0.22rem solid rgba(8, 23, 35, 0.92);
  border-bottom: 0.22rem solid rgba(8, 23, 35, 0.92);
  transform: rotate(-45deg) scale(0.4);
  transform-origin: center;
  opacity: 0;
}

.clean-button.is-success {
  animation: button-success-settle 620ms cubic-bezier(0.2, 0.84, 0.24, 1);
}

.clean-button.is-success .clean-button-label {
  animation: button-label-swap 620ms ease;
}

.clean-button.is-success .button-success {
  animation: button-success-inout 620ms ease;
}

.clean-button.is-success .button-checkmark {
  animation: checkmark-pop 360ms cubic-bezier(0.2, 0.84, 0.24, 1) 110ms both;
}

.button-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--spark-size, 0.4rem);
  height: var(--spark-size, 0.4rem);
  margin: calc(var(--spark-size, 0.4rem) * -0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(0.2);
}

.clean-button.is-bursting .button-spark {
  animation: spark-fly 560ms cubic-bezier(0.18, 0.7, 0.24, 1) forwards;
  animation-delay: var(--spark-delay, 0ms);
}

.clean-button:focus-visible,
.history-link:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--focus),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16),
    0 10px 22px rgba(0, 0, 0, 0.18);
}

.clean-button[disabled] {
  cursor: progress;
  opacity: 0.74;
}

.history-section {
  margin-top: -3.1rem;
  display: grid;
  gap: 0.8rem;
}

.history-header {
  display: grid;
  gap: 0.25rem;
}

.history-section h2 {
  font-size: 1.08rem;
  line-height: 1.1;
}

.history-summary,
.history-empty,
.history-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.history-item {
  animation: fade-in 180ms ease;
}

.history-link {
  display: block;
  padding: 0.85rem 0.9rem;
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(90deg, rgba(124, 199, 255, 0.08), transparent 24%),
    rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.history-url {
  display: block;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.history-meta {
  display: block;
  margin-top: 0.38rem;
}

.history-empty {
  padding: 0.95rem 0.9rem;
  border: 1px dashed var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.history-empty[hidden] {
  display: none;
}

@media (hover: hover) {
  .clean-button:hover:not([disabled]) {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      inset 0 -1px 0 rgba(0, 0, 0, 0.16),
      0 12px 24px rgba(0, 0, 0, 0.2);
  }

  .history-link:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background:
      linear-gradient(90deg, rgba(124, 199, 255, 0.12), transparent 24%),
      rgba(255, 255, 255, 0.025);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  }
}

@keyframes button-pop {
  0% {
    transform: scale(1) rotate(0deg);
  }

  32% {
    transform: scale(1.035) rotate(var(--button-tilt, 0deg));
  }

  58% {
    transform: scale(0.985) rotate(calc(var(--button-tilt, 0deg) * -0.4));
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes button-sheen {
  0% {
    opacity: 0;
    transform: translateX(-46%);
  }

  35% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
    transform: translateX(42%);
  }
}

@keyframes button-halo {
  0% {
    opacity: 0.65;
    transform: scale(0.92);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes spark-fly {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.2);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--spark-x, 0), var(--spark-y, 0), 0) scale(1);
  }
}

@keyframes button-success-settle {
  0% {
    transform: scale(1);
    background: var(--accent);
  }

  35% {
    transform: scale(1.02);
    background: #93d7ff;
  }

  100% {
    transform: scale(1);
    background: var(--accent);
  }
}

@keyframes button-label-swap {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  24%,
  68% {
    opacity: 0;
    transform: translateY(-0.2rem);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes button-success-inout {
  0% {
    opacity: 0;
  }

  28%,
  68% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes checkmark-pop {
  0% {
    opacity: 0;
    transform: rotate(-45deg) scale(0.25);
  }

  60% {
    opacity: 1;
    transform: rotate(-45deg) scale(1.08);
  }

  100% {
    opacity: 0;
    transform: rotate(-45deg) scale(0.92);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 540px) {
  .hero-stage {
    padding: 1.1rem 1.1rem 0.35rem;
  }

  .app-panel {
    padding: 1.1rem;
  }

  .history-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 1rem;
  }

  .history-summary {
    text-align: right;
    max-width: 18ch;
  }
}

@media (min-width: 700px) {
  .app-column {
    width: min(100%, 33rem);
  }

  .app-panel {
    gap: 1.2rem;
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
