:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0d0d0d;
  --surface-2: #161616;
  --surface-hover: #1a1a1a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f2f2f2;
  --text-muted: #8a8a8e;
  --text-faint: #55555a;
  --accent: #ffffff;
  --accent-contrast: #000000;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
}

:focus-visible {
  outline: 1px solid var(--border-strong);
  outline-offset: 2px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 8px;
  border-bottom: 1px solid transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-name {
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  .brand-name {
    background: linear-gradient(
      100deg,
      var(--text-muted) 0%,
      var(--text-muted) 40%,
      #ffffff 50%,
      var(--text-muted) 60%,
      var(--text-muted) 100%
    );
    background-size: 220% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: brand-shimmer 3.5s ease-in-out infinite;
  }
}

@keyframes brand-shimmer {
  0% {
    background-position: 160% 0;
  }
  100% {
    background-position: -60% 0;
  }
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  top: -3px;
  right: -3px;
}

.site-header nav {
  color: var(--text-faint);
  font-size: 13px;
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 8px;
}

.hero h1 {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0;
  max-width: 520px;
}

.sales-paused-banner {
  width: calc(100% - 48px);
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 12px 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13.5px;
  text-align: center;
}

.recent-orders {
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 0 24px;
}

.recent-orders-heading {
  margin: 0 0 10px;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recent-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.recent-order-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-wrap: wrap;
}

.recent-order-name {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.recent-order-info code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: var(--text);
  word-break: break-all;
}

.recent-order-pending {
  font-size: 12.5px;
  color: var(--text-faint);
}

.recent-order-copy {
  flex-shrink: 0;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-weight: 600;
  font-size: 12px;
  color: var(--accent-contrast);
  background: var(--accent);
  cursor: pointer;
  font-family: inherit;
}

.recent-order-copy:disabled {
  opacity: 0.6;
  cursor: default;
}

.product-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-media {
  aspect-ratio: 16 / 9;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
  position: relative;
  border-bottom: 1px solid var(--border);
}

.card-media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.06);
  letter-spacing: -0.02em;
}

.card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.card-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
  min-height: 40px;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.tier-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.tier-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.tier-pill.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.tier-label {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10.5px;
}

.tier-price {
  font-size: 12px;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.price-block {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.price-value {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.buy-btn {
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--accent-contrast);
  background: var(--accent);
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.buy-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.buy-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.buy-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.error-message,
.empty-message {
  color: var(--text-muted);
  font-size: 14px;
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 0;
}

.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 48px;
  color: var(--text-faint);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

/* ---------- Success page ---------- */

.success-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.success-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
}

.success-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.success-card h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

#status {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.result-label {
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.key-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.key-box code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  word-break: break-all;
  text-align: left;
  color: var(--text);
}

.key-box button {
  flex-shrink: 0;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-weight: 600;
  font-size: 12px;
  color: var(--accent-contrast);
  background: var(--accent);
  cursor: pointer;
  font-family: inherit;
}

.reference {
  margin-top: 16px;
  color: var(--text-faint);
  font-size: 12px;
  word-break: break-all;
}

.recheck-btn {
  display: block;
  margin: 20px auto 0;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent-contrast);
  background: var(--accent);
  cursor: pointer;
  font-family: inherit;
}

.recheck-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
}

.back-link:hover {
  color: var(--text);
}

/* ---------- Buy confirmation modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.modal-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-order-summary {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text);
}

.modal-notice {
  margin: 0 0 24px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.modal-notice li {
  margin-bottom: 8px;
}

.modal-notice li:last-child {
  margin-bottom: 0;
}

.modal-notice strong {
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-cancel {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.modal-cancel:hover {
  color: var(--text);
  border-color: var(--text);
}

.modal-confirm {
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent-contrast);
  background: var(--accent);
  cursor: pointer;
  font-family: inherit;
}

.modal-confirm:hover {
  opacity: 0.85;
}

.modal-confirm:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---------- Toast notifications ---------- */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  padding: 0 16px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.2s ease;
  pointer-events: auto;
}

.toast-message {
  flex: 1;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}

.toast-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.toast-close:hover {
  color: var(--text);
}

.toast-hide {
  animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(4px);
  }
}

[hidden] {
  display: none !important;
}
