:root {
  color-scheme: dark;
  --page: #191b19;
  --surface: #222522;
  --surface-2: #1e211e;
  --ink: #f0f2eb;
  --muted: #b0b5aa;
  --line: #383d35;
  --accent: #ef91b6;
  --ok: #8fd6a4;
  --warn: #e8c37a;
  --danger: #ef8f8f;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(239, 145, 182, 0.09), transparent 60%),
    radial-gradient(700px 500px at 105% 10%, rgba(143, 214, 164, 0.05), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 10;
  background: var(--ink);
  color: var(--page);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* ---------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(25, 27, 25, 0.82);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-inner {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.wordmark {
  font-family: "Outfit", sans-serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.055em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.brand-dot { color: var(--accent); }

.portal-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  margin-left: 2px;
}

/* ---------------------------------------------------------------- layout */

.page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 64px;
  padding: 72px 0 88px;
  align-items: start;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 26px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(239, 145, 182, 0.14);
}

h1 {
  font-family: "Outfit", sans-serif;
  font-weight: 400;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  margin: 0 0 22px;
  text-wrap: balance;
}

.lede {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  max-width: 46ch;
  margin: 0 0 34px;
  text-wrap: pretty;
}

/* facts */

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 30px;
}

.fact {
  background: var(--surface-2);
  padding: 16px 18px;
}
.fact dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.fact dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* buttons */

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-height: 50px;
  padding: 13px 24px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--page);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.15s;
}
.primary-button:hover { background: var(--accent); color: #fff; }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: 0.55; cursor: progress; }
.primary-button.compact { gap: 12px; min-height: 44px; padding: 10px 20px; margin-top: 22px; }

.ghost-button {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.ghost-button:hover { border-color: var(--muted); background: var(--surface); }
.ghost-button.danger:hover { border-color: var(--danger); color: var(--danger); }
.ghost-button:disabled { opacity: 0.5; cursor: progress; }

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.hint {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.hint.is-error { color: var(--danger); }

.notice {
  margin-top: 28px;
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 18px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 50ch;
}
.notice strong { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- panel */

.panel {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.75);
  position: sticky;
  top: 104px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge[data-status="pending"] { color: var(--warn); border-color: rgba(232, 195, 122, 0.4); background: rgba(232, 195, 122, 0.08); }
.badge[data-status="paid"] { color: var(--ok); border-color: rgba(143, 214, 164, 0.4); background: rgba(143, 214, 164, 0.08); }
.badge[data-status="expired"] { color: var(--danger); border-color: rgba(239, 143, 143, 0.35); background: rgba(239, 143, 143, 0.07); }

.panel-body { padding: 28px 22px 26px; min-height: 372px; display: grid; }

.state { display: none; }
.page[data-state="idle"] .state-idle,
.page[data-state="loading"] .state-loading,
.page[data-state="pending"] .state-pending,
.page[data-state="paid"] .state-paid,
.page[data-state="expired"] .state-closed,
.page[data-state="error"] .state-closed { display: flex; }

.state {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.state-text {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  max-width: 34ch;
  margin: 10px 0 0;
}

.state-title {
  font-family: "Outfit", sans-serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}

.placeholder-qr {
  color: var(--line);
  width: 132px;
  height: 132px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* qr */

.qr-frame {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  line-height: 0;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
}
.qr-frame img { display: block; width: 240px; height: 240px; image-rendering: pixelated; }

.amount {
  font-family: "Outfit", sans-serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 20px 0 0;
  line-height: 1.1;
}

.amount-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 16px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.countdown strong { color: var(--ink); font-weight: 500; letter-spacing: 0.04em; }
.countdown.is-low strong { color: var(--danger); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

/* paid */

.success-mark { color: var(--ok); margin-bottom: 6px; }

.receipt {
  width: 100%;
  margin: 20px 0 0;
  border-top: 1px solid var(--line);
}
.receipt > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; font-family: "JetBrains Mono", monospace; font-size: 11px; overflow-wrap: anywhere; text-align: right; }

/* panel footer */

.panel-foot {
  border-top: 1px solid var(--line);
  padding: 14px 22px 16px;
  background: rgba(0, 0, 0, 0.14);
}
.meta { margin: 0; display: grid; gap: 6px; }
.meta > div { display: flex; justify-content: space-between; gap: 16px; }
.meta dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta dd {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: right;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 0;
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 960px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
    padding: 48px 0 64px;
  }
  .panel { position: static; }
  .intro h1 { font-size: clamp(36px, 8vw, 52px); }
}

@media (max-width: 520px) {
  .container { width: calc(100% - 32px); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .qr-frame img { width: 216px; height: 216px; }
  .panel-body { padding: 24px 16px; }
  .header-inner { height: 68px; }
  .amount { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
