:root {
  --bg: #efefec;
  --panel: #1d1d22;
  --panel-soft: #24252b;
  --paper: #ffffff;
  --ink: #22242a;
  --muted: #737882;
  --accent: #c084fc;
  --accent-deep: #8b5cf6;
  --accent-soft: #e9d5ff;
  --accent-rgb: 192, 132, 252;
  --accent-deep-rgb: 139, 92, 246;
  --accent-soft-rgb: 233, 213, 255;
  --line: rgba(34, 36, 42, 0.12);
  --success: #4be28a;
  --error: #ff7272;
  --shadow: 0 24px 60px rgba(26, 28, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(125% 125% at 50% 10%, #fff 40%, #7c3aed 100%);
}

body::before {
  content: none;
}

body.modal-open {
  overflow: hidden;
}

.page-shell {
  position: relative;
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0 3rem;
}

.hero {
  text-align: center;
  margin-bottom: 1.8rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.8rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.lede {
  max-width: 42ch;
  margin: 0.55rem auto 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted);
}

.support-footer {
  margin: 1.6rem 0 2.75rem;
  text-align: center;
}

.support-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #111;
  transition: color 160ms ease, opacity 160ms ease;
}

.support-link-icon {
  width: 1.50rem;
  height: 1.50rem;
  flex: 0 0 auto;
  fill: #db61a2;
}

.support-link:hover {
  color: #111;
}

.quick-guide {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.guide-card {
  padding: 1.2rem 1.15rem 1.05rem;
  border-radius: 20px;
  background: linear-gradient(180deg, #22232a, #1a1b20);
  box-shadow: var(--shadow);
  color: #f4f7fb;
}

.guide-card h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.guide-card p {
  margin: 0.35rem 0 0;
  color: rgba(244, 247, 251, 0.72);
  line-height: 1.5;
  font-size: 0.92rem;
}

.guide-card code {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-soft);
}

.guide-number {
  margin: 0 0 0.85rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.panel {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(340px, 1.1fr) minmax(280px, 0.9fr);
  align-items: stretch;
}

.commit-form,
.status-card {
  position: relative;
  overflow: hidden;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  background: linear-gradient(180deg, #23242b, #1b1c22);
  box-shadow: var(--shadow);
  color: #f4f7fb;
}

.commit-form::after,
.status-card::after {
  content: "";
  position: absolute;
  inset: auto auto 0 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), transparent 78%);
}

.commit-form {
  display: grid;
  gap: 1rem;
}

.panel-head {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.2rem;
}

.panel-label,
.panel-copy {
  margin: 0;
}

.panel-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel-copy {
  color: rgba(244, 247, 251, 0.66);
  line-height: 1.5;
  font-size: 0.92rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field-hint {
  margin: -0.4rem 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(244, 247, 251, 0.68);
}

.field span,
.status-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 247, 251, 0.72);
}

.field input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  font: inherit;
  color: #f4f7fb;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder {
  color: rgba(244, 247, 251, 0.38);
}

.field input:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.7);
  transform: translateY(-1px);
  box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.16);
}

.token-help-trigger {
  justify-self: start;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(var(--accent-soft-rgb), 0.34);
  color: var(--accent-soft);
  background: rgba(var(--accent-soft-rgb), 0.1);
  box-shadow: none;
}

.token-help-trigger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: none;
  background: rgba(var(--accent-soft-rgb), 0.16);
}

.token-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: rgba(244, 247, 251, 0.84);
}

.token-steps li {
  line-height: 1.6;
}

.token-steps li + li {
  margin-top: 0.35rem;
}

.token-steps code {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-soft);
}

.token-links {
  display: grid;
  gap: 0.55rem;
}

.token-links a {
  color: var(--accent-soft);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  word-break: break-word;
}

.token-note {
  margin: 0;
  line-height: 1.6;
  color: rgba(244, 247, 251, 0.74);
}

.token-note code {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-soft);
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  padding: 0.95rem 1.15rem;
  font: inherit;
  font-weight: 700;
  color: #241335;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 16px 28px rgba(var(--accent-deep-rgb), 0.3);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(var(--accent-deep-rgb), 0.38);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal:not([hidden]) .modal-backdrop {
  animation: modal-backdrop-fade 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal:not([hidden]) .modal-panel {
  transform-origin: center top;
  will-change: opacity, transform;
  animation: modal-panel-enter 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal:not([hidden]) .modal-panel-loading .loading-modal-player {
  animation: modal-content-rise 420ms 70ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal:not([hidden]) .modal-panel-loading .loading-modal-copy {
  animation: modal-content-rise 420ms 130ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(6px);
  cursor: pointer;
  box-shadow: none;
}

.modal-backdrop:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}

.modal-backdrop-static {
  cursor: wait;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 1.35rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(255, 114, 114, 0.13), transparent 32%),
    linear-gradient(180deg, #23242b, #1b1c22);
  color: #f4f7fb;
  box-shadow: 0 28px 70px rgba(10, 11, 16, 0.42);
}

.modal-panel-loading {
  display: grid;
  gap: 1rem;
  justify-items: center;
  width: min(540px, calc(100% - 1.25rem));
  padding: 1.85rem 2rem 2rem;
  text-align: center;
  background:
    radial-gradient(circle at top center, rgba(var(--accent-rgb), 0.18), transparent 38%),
    linear-gradient(180deg, #23242b, #1b1c22);
}

.modal-panel-token {
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.18), transparent 34%),
    linear-gradient(180deg, #23242b, #1b1c22);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-label {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--error);
}

.modal-label-token {
  color: var(--accent);
}

.modal-icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7fb;
  box-shadow: none;
}

.modal-icon-button:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.14);
}

.modal-panel h2 {
  margin: 0.9rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.modal-text,
.modal-hint {
  margin: 0.8rem 0 0;
  line-height: 1.65;
  color: rgba(244, 247, 251, 0.8);
}

.modal-hint {
  color: rgba(var(--accent-soft-rgb), 0.9);
}

.token-steps-modal {
  margin-top: 1rem;
}

.modal-action {
  width: 100%;
  margin-top: 1.1rem;
}

.status-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100%;
}

.loading-modal-player {
  display: block;
  width: min(220px, 100%);
  height: 240px;
  margin: 0 auto;
  background: transparent;
}

.loading-modal-copy {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  width: 100%;
  text-align: center;
}

.modal-panel-loading h2 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.loading-modal-text {
  max-width: 34ch;
  margin: 0 auto;
  font-size: 1.04rem;
  line-height: 1.7;
  color: rgba(244, 247, 251, 0.72);
}

.status-card h2 {
  margin: 0.7rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.status-text {
  margin: 0.9rem 0 0;
  line-height: 1.65;
  color: rgba(244, 247, 251, 0.72);
}

.status-card.is-loading {
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.22), transparent 32%),
    linear-gradient(180deg, #24252b, #1b1c22);
}

.status-card.is-success {
  background:
    radial-gradient(circle at top right, rgba(75, 226, 138, 0.16), transparent 34%),
    linear-gradient(180deg, #24252b, #1b1c22);
}

.status-card.is-success h2 {
  color: var(--success);
}

.status-card.is-error {
  background:
    radial-gradient(circle at top right, rgba(255, 114, 114, 0.16), transparent 32%),
    linear-gradient(180deg, #24252b, #1b1c22);
}

.status-card.is-error h2 {
  color: var(--error);
}

@keyframes modal-backdrop-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modal-panel-enter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.965);
  }

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

@keyframes modal-content-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

@media (prefers-reduced-motion: reduce) {
  .modal:not([hidden]) .modal-backdrop,
  .modal:not([hidden]) .modal-panel,
  .modal:not([hidden]) .modal-panel-loading .loading-modal-player,
  .modal:not([hidden]) .modal-panel-loading .loading-modal-copy {
    animation: none;
  }
}

@media (max-width: 820px) {
  .page-shell {
    padding-top: 2.6rem;
  }

  .quick-guide {
    grid-template-columns: 1fr;
  }

  .panel {
    grid-template-columns: 1fr;
  }

  .modal-panel {
    padding: 1.2rem;
  }

  .modal-panel-loading {
    gap: 0.9rem;
    width: min(500px, calc(100% - 1rem));
    padding: 1.45rem 1.35rem 1.55rem;
  }

  .loading-modal-player {
    width: min(200px, 100%);
    height: 200px;
  }

  .modal-panel-loading h2 {
    font-size: clamp(1.7rem, 6vw, 2.2rem);
  }

  .loading-modal-copy {
    gap: 0.6rem;
    width: 100%;
  }

  .loading-modal-text {
    font-size: 1rem;
  }
}
