:root {
  --bg: #0a0c10;
  --bg-elevated: #12151c;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaef;
  --muted: #8b93a7;
  --accent: #d50d0f;
  --accent-dim: rgba(213, 13, 15, 0.16);
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Sora", system-ui, sans-serif;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% -10%, black, transparent);
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: relative;
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem max(1.25rem, env(safe-area-inset-left)) 1rem max(1.25rem, env(safe-area-inset-right));
  max-width: 1120px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.logo {
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.nav-toggle:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

.nav-toggle-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 20px;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: flex-end;
}

.header-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--text);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nav-backdrop:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-flex;
  }

  .header-nav {
    display: none;
    flex-direction: column;
    flex-basis: 100%;
    width: 100%;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0.5rem 0 0.25rem;
    margin: 0.25rem 0 0;
    border-top: 1px solid var(--border);
  }

  .header-nav a {
    padding: 0.85rem 0.15rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    font-size: 0.9375rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .header-nav a:last-child {
    border-bottom: none;
  }

  .site-header.is-nav-open .header-nav {
    display: flex;
  }
}

@media (min-width: 768px) {
  .site-header {
    flex-wrap: nowrap;
    padding: 1.25rem max(1.5rem, env(safe-area-inset-left)) 1.25rem max(1.5rem, env(safe-area-inset-right));
  }

  .header-nav {
    margin-left: auto;
  }
}

.api-error {
  background: rgba(213, 13, 15, 0.12);
  border: 1px solid rgba(213, 13, 15, 0.35);
  color: #fecaca;
  font-size: 0.875rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  margin: 0 0 1rem;
}

.api-error.is-hidden,
.field-error.is-hidden,
.is-hidden {
  display: none !important;
}

.field-error {
  color: #fecaca;
  font-size: 0.8125rem;
  margin: -0.25rem 0 0.5rem;
}

.integrity-box {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.integrity-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem max(1.5rem, env(safe-area-inset-left)) 4rem max(1.5rem, env(safe-area-inset-right));
}

.hero {
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.hero-lead {
  color: var(--muted);
  max-width: 52ch;
  margin: 0;
  font-size: 1rem;
}

.flow-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.stepper {
  margin-bottom: 1.75rem;
}

.stepper-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.stepper-item.is-current {
  color: var(--text);
}

.stepper-item.is-done {
  color: var(--accent);
}

.stepper-num {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
}

.stepper-item.is-current .stepper-num {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.stepper-item.is-done .stepper-num {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.mix-form .panel {
  animation: fadeIn 0.25s ease;
}

.mix-form .panel.is-hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.panel-desc {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0 0 1.25rem;
}

.field-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

select,
textarea,
input[type="text"] {
  font-family: var(--font);
  font-size: 0.9375rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

select:focus,
textarea:focus,
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.checkbox input {
  margin-top: 0.2rem;
}

.guarantee-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 1rem;
}

.guarantee-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.guarantee-meta code {
  font-size: 0.8125rem;
  color: var(--accent);
}

.guarantee-body {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--muted);
  white-space: pre-wrap;
  font-family: ui-monospace, monospace;
  margin-bottom: 1rem;
}

.guarantee-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
}

.copy-row input {
  flex: 1;
  min-width: 0;
}

.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
}

.status-tracker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.25rem 0;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.status-step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.status-step .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  flex-shrink: 0;
}

.status-step.is-active {
  color: var(--text);
  font-weight: 500;
}

.status-step.is-active .dot {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.status-step.is-done {
  color: var(--accent);
}

.status-step.is-done .dot {
  background: var(--accent);
}

.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d50d0f, #b91c1c);
  transition: width 0.5s ease;
}

.session-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.session-note code {
  color: var(--text);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.btn {
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn.primary {
  background: var(--accent);
  color: var(--bg);
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn.secondary:hover {
  border-color: var(--muted);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-weight: 500;
}

.btn.ghost:hover {
  color: var(--text);
}

.btn.small {
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
}

.info-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 3rem;
}

.info-grid article {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.info-grid h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.info-grid p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem max(1.5rem, env(safe-area-inset-left)) 3rem max(1.5rem, env(safe-area-inset-right));
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.field-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.usd-amount-field {
  margin-bottom: 1.25rem;
}

.usd-input-wrap {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.usd-input-wrap:focus-within {
  border-color: rgba(213, 13, 15, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.usd-input-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.65rem 0 0.85rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid var(--border);
}

.usd-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.85rem 1rem !important;
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: transparent !important;
  color: var(--text);
}

.usd-input:focus {
  outline: none !important;
}

.usd-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.trace-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  max-height: 220px;
  overflow-y: auto;
}

.trace-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.trace-list li {
  margin-bottom: 0.45rem;
}

.trace-meta {
  color: var(--text);
  font-weight: 500;
}

.status-tracker.has-failed .status-step.is-active .dot {
  background: var(--danger);
  box-shadow: none;
}

.content-section {
  margin-top: 3rem;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border);
}

.content-section-title {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  line-height: 1.25;
}

.content-lead {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 1.5rem;
  max-width: 68ch;
}

.seo-prose a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(213, 13, 15, 0.35);
  transition: color 0.15s, border-color 0.15s;
}

.seo-prose a:hover {
  color: #f87171;
  border-bottom-color: rgba(248, 113, 113, 0.5);
}

.content-columns {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .content-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.content-columns h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.content-columns p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.65;
}

.content-cta {
  margin: 0;
  padding-top: 0.5rem;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg) !important;
  border: none;
  border-bottom: none !important;
  text-decoration: none !important;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-sm);
  transition: filter 0.15s;
}

.btn-cta:hover {
  filter: brightness(1.06);
  color: var(--bg) !important;
}

.site-footer--seo {
  text-align: center;
}

.site-footer--seo p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer--seo a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: color 0.15s, border-color 0.15s;
}

.site-footer--seo a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.footer-sep {
  margin: 0 0.5rem;
  opacity: 0.45;
}

@media (max-width: 767px) {
  .main {
    padding: 1.75rem max(1rem, env(safe-area-inset-left)) 2.5rem max(1rem, env(safe-area-inset-right));
  }

  .hero {
    margin-bottom: 1.75rem;
  }

  .flow-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius);
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .copy-row {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-row .btn {
    width: 100%;
  }

  .guarantee-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .guarantee-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .guarantee-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .usd-input {
    font-size: clamp(1.05rem, 4.5vw, 1.35rem);
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }

  .stepper-list {
    gap: 0.4rem 0.65rem;
  }

  .stepper-item {
    font-size: 0.75rem;
  }

  .panel-title {
    font-size: 1.1rem;
  }

  .panel-desc {
    font-size: 0.875rem;
  }

  .content-section {
    margin-top: 2rem;
    padding: 1.25rem 0 0.25rem;
  }

  .site-footer {
    padding: 1.5rem max(1rem, env(safe-area-inset-left)) 2.25rem max(1rem, env(safe-area-inset-right));
  }

  .info-grid {
    grid-template-columns: 1fr;
    margin-top: 2rem;
  }

  .trace-box {
    max-height: min(220px, 40vh);
  }
}

@media (max-width: 380px) {
  .stepper-num {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bar {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }

  .nav-backdrop {
    transition: none;
  }

  .mix-form .panel {
    animation: none;
  }
}
