:root {
  color-scheme: dark;
  --font-display: "Inter", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

  --beep-yellow: #ffc700;
  --beep-yellow-glow: #ffd84d;
  --beep-black: #0b0b0b;
  --beep-white: #ffffff;

  --bg: #0b0b0b;
  --bg-alt: #101010;
  --surface: rgba(17, 17, 17, 0.96);
  --surface-strong: rgba(14, 14, 14, 0.98);
  --surface-soft: rgba(22, 22, 22, 0.94);
  --surface-contrast: rgba(9, 9, 9, 0.98);
  --border: rgba(255, 199, 0, 0.24);
  --border-strong: rgba(255, 199, 0, 0.42);

  --text: #ffffff;
  --text-muted: #d4d4d4;
  --text-subtle: #9a9a9a;

  --accent: var(--beep-yellow);
  --accent-strong: #e6b400;
  --accent-2: var(--beep-yellow-glow);
  --accent-warn: #ffe899;

  --ok: #ffc700;
  --danger: #ff6f79;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-md: 0 12px 26px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 20px 36px rgba(0, 0, 0, 0.52);

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 22px;
  --space-5: 30px;
  --space-6: 42px;

  --content-width: 1460px;
  --motion-fast: 200ms;
  --motion-base: 260ms;
  --motion-slow: 300ms;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-theme="carbon"] {
  --bg: #090909;
  --bg-alt: #111111;
  --surface: rgba(15, 15, 15, 0.96);
  --surface-strong: rgba(11, 11, 11, 0.98);
  --surface-soft: rgba(20, 20, 20, 0.94);
  --surface-contrast: rgba(6, 6, 6, 0.98);
  --border: rgba(255, 199, 0, 0.22);
  --border-strong: rgba(255, 199, 0, 0.42);
}

body[data-theme="midnight"] {
  --bg: #080808;
  --bg-alt: #101010;
  --surface: rgba(14, 14, 14, 0.96);
  --surface-strong: rgba(10, 10, 10, 0.98);
  --surface-soft: rgba(19, 19, 19, 0.94);
  --surface-contrast: rgba(6, 6, 6, 0.98);
  --border: rgba(255, 199, 0, 0.22);
  --border-strong: rgba(255, 199, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: #000000;
  padding: clamp(8px, 1.2vw, 16px);
  position: relative;
  overflow-x: hidden;
  animation: page-fade-in var(--motion-slow) var(--ease-standard) both;
}

body::before,
body::after {
  content: none;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.app-shell {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  display: grid;
  gap: clamp(12px, 1.2vw, 18px);
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), transform var(--motion-base) var(--ease-standard);
}

.surface-strong {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.surface-body {
  padding: clamp(14px, 1.35vw, 20px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(255, 199, 0, 0.28);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.brand-logo {
  width: clamp(188px, 19vw, 270px);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.28));
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
}

.brand-text {
  display: grid;
  gap: 3px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.theme-select {
  width: auto;
  min-width: 140px;
}

.eyebrow {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
}

.headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.06rem, 0.98rem + 0.6vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.text-muted {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.52;
}

.stack {
  display: grid;
  gap: var(--space-3);
}

.grid-2 {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

input,
select,
textarea,
button {
  font: inherit;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  color: var(--text);
  background: rgba(11, 11, 11, 0.92);
  transition: border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard), background-color var(--motion-fast) var(--ease-standard);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-subtle);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent), #000000 26%);
  box-shadow: 0 0 0 3px rgba(255, 199, 0, 0.22);
}

textarea {
  resize: vertical;
  min-height: 116px;
}

.btn,
button {
  border: 1px solid rgba(255, 199, 0, 0.28);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  transition: transform var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), filter var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard);
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
}

.btn:active,
button:active {
  transform: translateY(0);
}

.btn-primary {
  color: #0b0b0b;
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent), #000000 18%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 10px 18px rgba(255, 199, 0, 0.24);
}

.btn-primary:hover {
  background: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2), #000000 18%);
  filter: none;
}

.btn-secondary {
  border-color: rgba(255, 199, 0, 0.7);
  background: transparent;
  color: var(--accent);
}

.btn-secondary:hover {
  border-color: var(--accent-2);
  background: rgba(255, 199, 0, 0.12);
  color: var(--accent-2);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 199, 0, 0.48);
}

button:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(11, 11, 11, 0.84);
}

.badge-accent {
  color: #ffeaa1;
  border-color: rgba(255, 199, 0, 0.56);
  background: rgba(255, 199, 0, 0.12);
}

.badge-warm {
  color: #ffeaa1;
  border-color: rgba(255, 216, 77, 0.56);
  background: rgba(255, 216, 77, 0.12);
}

.status-text {
  margin: 0;
  min-height: 1em;
  font-size: 0.85rem;
  line-height: 1.4;
}

.status-ok {
  color: var(--ok);
}

.status-error {
  color: var(--danger);
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.scroll-y {
  overflow: auto;
}

.reveal {
  animation: rise-in var(--motion-slow) var(--ease-standard) both;
}

.reveal:nth-child(2) {
  animation-delay: 60ms;
}

.reveal:nth-child(3) {
  animation-delay: 120ms;
}

.site-footer {
  width: min(var(--content-width), 100%);
  margin: 2px auto 0;
  padding: 8px 6px 4px;
  text-align: center;
  font-size: 0.73rem;
  color: var(--text-subtle);
}

body[data-page="gateway"] .site-footer,
body[data-page="buyer-form"] .site-footer,
body[data-page="marketplace"] .site-footer,
body[data-page="seller-auth"] .site-footer {
  color: #6b7685;
}

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

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

@keyframes page-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes ambient-drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(10px, 12px, 0);
  }
}

@media (max-width: 1100px) {
  :root {
    --content-width: 1120px;
  }

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

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    min-height: 0;
  }

  .topbar-actions {
    width: 100%;
  }
}

@media (max-width: 760px) {
  body {
    padding: 8px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions > * {
    flex: 1;
  }

  .theme-select {
    min-width: 0;
  }

  .brand-logo {
    width: clamp(150px, 42vw, 210px);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    padding: 6px;
  }

  .surface-body {
    padding: 12px;
  }

  .headline {
    font-size: clamp(1.34rem, 1.1rem + 1vw, 1.72rem);
  }

  .brand-logo {
    width: 164px;
  }

  .btn,
  button {
    width: 100%;
  }
}

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