:root {
  color-scheme: dark;
  --bg: #060511;
  --bg-deep: #0b0820;
  --panel: rgba(18, 16, 35, 0.82);
  --panel-strong: rgba(28, 23, 48, 0.94);
  --line: rgba(255, 255, 255, 0.14);
  --text: #fff8ff;
  --muted: #bbb3ce;
  --pink: #ff4fb8;
  --pink-hot: #ff2f9a;
  --pink-soft: #ffb6df;
  --mint: #54f0c1;
  --gold: #ffd166;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 70% 12%, rgba(255, 79, 184, 0.22), transparent 25rem),
    radial-gradient(circle at 20% 88%, rgba(84, 240, 193, 0.13), transparent 28rem),
    linear-gradient(180deg, #05040d 0%, #120b30 58%, #070710 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 182, 223, 0.75) 0 1px, transparent 1.5px);
  background-position:
    0 0,
    26px 44px;
  background-size:
    148px 132px,
    212px 196px;
  opacity: 0.28;
  animation: starDrift 18s linear infinite;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  min-height: 48px;
}

.brand,
.nav-links,
.hero-actions,
.button-row,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand,
.nav a,
.hero-actions a {
  color: var(--text);
  text-decoration: none;
}

.brand {
  font-size: 19px;
  font-weight: 800;
}

.brand-mark {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.98), rgba(255, 182, 223, 0.86) 33%, transparent 34%),
    linear-gradient(145deg, #ff5fc0, #ff2f9a 58%, #9bffde);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 32px rgba(255, 79, 184, 0.52);
  color: #170715;
  overflow: hidden;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.logo-eye {
  fill: rgba(255, 255, 255, 0.94);
  stroke: #240719;
  stroke-width: 2;
}

.logo-ledger {
  fill: #ff2f9a;
}

.logo-core {
  fill: #10131a;
}

.logo-spark {
  fill: none;
  stroke: #10131a;
  stroke-width: 2.8;
  stroke-linecap: round;
}

.nav-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nav-links {
  color: var(--muted);
  font-size: 14px;
}

.nav-links a {
  color: var(--muted);
}

.nav-action,
.wallet-action,
.primary-link,
.secondary-link,
button {
  min-height: 46px;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 120ms ease,
    filter 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.nav-action,
.primary-link,
button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, var(--pink), var(--pink-hot));
  color: white;
  font-weight: 750;
  box-shadow: 0 14px 34px rgba(255, 47, 154, 0.26);
}

.wallet-action {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  box-shadow: none;
}

.wallet-action.is-connected {
  border-color: rgba(84, 240, 193, 0.62);
  background: rgba(84, 240, 193, 0.13);
  color: #dffff5;
}

.danger-action {
  border-color: rgba(255, 209, 102, 0.5);
  background: rgba(255, 209, 102, 0.1);
  color: #ffe6a3;
  box-shadow: none;
}

.secondary-link {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-weight: 700;
}

button {
  width: max-content;
}

button:hover,
.primary-link:hover,
.wallet-action:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button:active,
.primary-link:active,
.wallet-action:active,
.secondary-link:active {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.96);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(84, 240, 193, 0.75);
  outline-offset: 3px;
}

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

button.is-busy {
  background: linear-gradient(180deg, #ffd166, #ff9f1c);
  color: #150813;
  box-shadow: 0 14px 34px rgba(255, 209, 102, 0.22);
}

button.is-done {
  border-color: rgba(84, 240, 193, 0.7);
  background: linear-gradient(180deg, #54f0c1, #21b88c);
  color: #06130f;
  box-shadow: 0 14px 34px rgba(84, 240, 193, 0.2);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: 36px;
  align-items: center;
  min-height: 520px;
  padding: 52px 0 34px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--pink-soft);
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 0 26px rgba(255, 79, 184, 0.62);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 680px;
  font-size: clamp(58px, 8vw, 106px);
  line-height: 0.88;
  letter-spacing: 0;
  text-wrap: balance;
}

h2 {
  margin-bottom: 16px;
  font-size: 19px;
}

.lede {
  max-width: 560px;
  margin-top: 20px;
  color: #f4e9f7;
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  flex-wrap: wrap;
  margin-top: 28px;
}

.status {
  width: min(100%, 460px);
  margin-top: 22px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(8, 6, 19, 0.72);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.oracle-visual {
  position: relative;
  min-height: 430px;
  animation: floatIn 900ms ease both;
}

.terminal {
  position: absolute;
  right: 8%;
  top: 64px;
  width: min(410px, 86%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  background: #0b0b12;
  box-shadow:
    0 34px 80px rgba(0, 0, 0, 0.5),
    0 0 0 8px rgba(255, 79, 184, 0.15);
  overflow: hidden;
  transform: rotate(0.8deg);
  animation: terminalFloat 5.6s ease-in-out infinite;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  height: 28px;
  align-items: center;
  padding: 0 12px;
  background: linear-gradient(90deg, var(--pink), #ffa4d8);
}

.terminal-bar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
  opacity: 0.86;
}

.terminal pre {
  min-height: 242px;
  margin: 0;
  padding: 22px;
  color: #f8f2ff;
  font-size: 14px;
  line-height: 1.62;
}

.terminal code {
  color: var(--mint);
}

.mascot {
  position: absolute;
  top: 18px;
  right: 32%;
  width: 78px;
  height: 108px;
  animation: bob 4.8s ease-in-out infinite;
}

.mascot-head,
.mascot-body,
.orbit,
.badge {
  position: absolute;
}

.mascot-head {
  left: 19px;
  top: 36px;
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 44% 44%;
  background: linear-gradient(180deg, #ffc3e7, var(--pink));
  box-shadow: inset 0 -8px 0 rgba(54, 11, 47, 0.16);
}

.mascot-head::before {
  content: "";
  position: absolute;
  left: 6px;
  top: -37px;
  width: 30px;
  height: 48px;
  border-radius: 50% 50% 12px 12px;
  background: linear-gradient(180deg, #ffc3e7, var(--pink));
  clip-path: polygon(50% 0, 100% 88%, 50% 100%, 0 88%);
}

.mascot-body {
  left: 14px;
  bottom: 0;
  width: 52px;
  height: 40px;
  border-radius: 46% 46% 22% 22%;
  background: #ff8dcb;
}

.orbit {
  border: 14px solid #ff8dcb;
  border-top-color: transparent;
  border-left-color: rgba(255, 141, 203, 0.5);
  border-radius: 50%;
  filter: drop-shadow(0 0 18px rgba(255, 79, 184, 0.38));
  animation: orbitPulse 4.8s ease-in-out infinite;
}

.orbit-one {
  width: 420px;
  height: 250px;
  right: 36px;
  top: 110px;
  transform: rotate(-24deg);
}

.orbit-two {
  width: 360px;
  height: 210px;
  right: -8px;
  top: 146px;
  transform: rotate(28deg);
}

.badge {
  right: 0;
  bottom: 62px;
  padding: 10px 20px;
  border: 3px solid var(--pink);
  border-radius: 9px;
  background: white;
  color: #150813;
  font-size: 24px;
  font-weight: 900;
  transform: rotate(-6deg);
  animation: badgeSlide 760ms 240ms ease both;
}

.metrics,
.workspace,
.output-grid {
  display: grid;
  gap: 14px;
}

.metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 4px;
}

.metrics div,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.metrics div:hover,
.panel:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 79, 184, 0.42);
  box-shadow: 0 30px 80px rgba(255, 47, 154, 0.12);
}

.metrics div {
  min-height: 96px;
  padding: 18px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  color: white;
  font-size: 24px;
}

.workspace {
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.panel {
  padding: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

select option {
  background: #151024;
}

.button-row {
  flex-wrap: wrap;
  margin-top: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.expense-list-panel {
  grid-column: 1 / -1;
}

.expense-list {
  display: grid;
  gap: 10px;
}

.expense-list p {
  color: var(--muted);
  line-height: 1.55;
}

.expense-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.expense-item-details {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.expense-item-details strong,
.expense-item-details span {
  overflow-wrap: anywhere;
}

.expense-item-details span {
  color: var(--muted);
  font-size: 13px;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  box-shadow: none;
}

.compact-action {
  min-height: 38px;
  padding: 8px 12px;
  flex: 0 0 auto;
}

.output-grid {
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.45fr);
  margin-top: 14px;
}

#warnings {
  min-height: 170px;
  margin: 0;
  padding-left: 20px;
  color: var(--pink-soft);
}

#warnings li + li {
  margin-top: 8px;
}

.result-box {
  min-height: 210px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.36);
  color: #f8f2ff;
}

.result-box h3 {
  margin: 0 0 12px;
  font-size: 21px;
}

.result-box ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.technical-details {
  margin-top: 12px;
  color: var(--muted);
}

.technical-details summary {
  cursor: pointer;
  font-size: 13px;
}

.technical-details pre {
  min-height: 180px;
  max-height: 360px;
  margin-top: 10px;
}

pre {
  min-height: 340px;
  max-height: 560px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.54);
  color: #e3fff7;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .nav-links {
    display: none;
  }

  .hero,
  .workspace,
  .output-grid {
    grid-template-columns: 1fr;
  }

  .oracle-visual {
    min-height: 380px;
  }

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

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 22px, 1180px);
  }

  .hero {
    min-height: 0;
    padding-top: 34px;
  }

  h1 {
    font-size: 58px;
  }

  .metrics,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .oracle-visual {
    min-height: 330px;
  }

  .terminal {
    right: 0;
    width: 96%;
  }
}

@keyframes starDrift {
  from {
    background-position:
      0 0,
      26px 44px;
  }
  to {
    background-position:
      148px 132px,
      238px 240px;
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes terminalFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0.8deg);
  }
  50% {
    transform: translateY(-14px) rotate(-1.2deg);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes orbitPulse {
  0%,
  100% {
    opacity: 0.86;
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 28px rgba(255, 79, 184, 0.55));
  }
}

@keyframes badgeSlide {
  from {
    opacity: 0;
    transform: translateX(34px) rotate(-6deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(-6deg);
  }
}

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