@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #08111f;
  --surface: #0e1a2a;
  --surface-raised: #132238;
  --line: rgba(165, 190, 225, 0.13);
  --muted: #8d9bb2;
  --text: #eef4ff;
  --cyan: #66e4e6;
  --blue: #8496ff;
  --green: #6de0b0;
  --mono: "DM Mono", Consolas, monospace;
  --sans: "DM Sans", "Segoe UI", sans-serif;
  --display: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 71% 8%, rgba(35, 83, 133, 0.18), transparent 34rem),
    radial-gradient(ellipse at 12% 48%, rgba(30, 82, 108, 0.1), transparent 34rem),
    var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.page-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.topbar { height: 82px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 800 17px var(--display); text-decoration: none; letter-spacing: -0.5px; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(102, 228, 230, .45); border-radius: 10px; color: var(--cyan); font-size: 15px; }
.network-badges { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.badge { min-height: 26px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border-radius: 999px; font: 500 10px var(--mono); letter-spacing: .06em; }
.badge-beta { color: #ffd18a; border: 1px solid rgba(255, 190, 102, .3); background: rgba(255, 179, 71, .08); }
.badge-network { color: var(--green); border: 1px solid rgba(109, 224, 176, .25); background: rgba(109, 224, 176, .06); }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(109, 224, 176, .8); }

.button { min-height: 42px; display: inline-flex; justify-content: center; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 700; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-quiet { padding: 0 15px; color: #d7e4f7; border-color: var(--line); background: rgba(255,255,255,.025); font-size: 12px; }
.button-quiet:hover:not(:disabled) { background: rgba(255,255,255,.07); border-color: rgba(165,190,225,.3); }

.hero { position: relative; min-height: 360px; display: flex; align-items: center; overflow: hidden; }
.hero-copy { position: relative; z-index: 1; width: min(600px, 70%); padding: 52px 0 44px; }
.eyebrow { margin: 0 0 14px; color: #91a1bb; font: 500 10px var(--mono); letter-spacing: .16em; }
.eyebrow-line { display: inline-block; width: 22px; height: 1px; margin: 0 8px 3px 0; background: var(--cyan); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 17px; font: 800 clamp(44px, 6.5vw, 72px)/1.04 var(--display); letter-spacing: -4px; }
.gradient-text { color: transparent; background: linear-gradient(95deg, var(--cyan), #98b3ff 82%); background-clip: text; -webkit-background-clip: text; }
.hero-description { max-width: 450px; margin-bottom: 21px; color: #a6b3c8; font-size: 15px; line-height: 1.75; }
.hero-footnote { display: flex; align-items: center; gap: 8px; color: #77869e; font-size: 11px; }
.orbit-icon { color: var(--cyan); font-size: 17px; }
.orbit-art { position: absolute; width: 390px; height: 320px; right: 12px; top: 21px; opacity: .86; }
.planet { position: absolute; width: 130px; height: 130px; left: 140px; top: 93px; border-radius: 50%; background: radial-gradient(circle at 34% 29%, #77e7e2 0, #3e8da5 23%, #1c3c6b 63%, #132344 100%); box-shadow: inset -17px -12px 25px rgba(2, 8, 24, .65), 0 0 68px rgba(71, 151, 196, .2); }
.orbit { position: absolute; border: 1px solid rgba(124, 191, 225, .27); border-radius: 50%; transform: rotate(-24deg); }
.orbit-one { width: 320px; height: 120px; left: 44px; top: 96px; }
.orbit-two { width: 250px; height: 210px; left: 78px; top: 47px; transform: rotate(38deg); border-color: rgba(131, 151, 255, .18); }
.orbit-star { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.star-one { top: 87px; left: 84px; }.star-two { right: 32px; top: 169px; width: 4px; height: 4px; }.star-three { right: 102px; top: 45px; width: 3px; height: 3px; background: #d8c6ff; }

.workspace, .response-section { max-width: 790px; margin: 0 auto; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 8px; }
h2 { margin-bottom: 0; font: 700 22px var(--display); letter-spacing: -.7px; }
.fee-pill { display: grid; gap: 3px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); text-align: right; }
.fee-pill span { color: var(--muted); font-size: 10px; }
.fee-pill strong { color: var(--cyan); font: 500 13px var(--mono); }
.request-card, .response-card { border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, rgba(17, 31, 50, .96), rgba(11, 23, 39, .96)); box-shadow: 0 20px 60px rgba(0,0,0,.12); }
.request-card { padding: 23px; }
.field-label { display: block; margin-bottom: 9px; color: #c9d6e8; font-size: 12px; font-weight: 600; }
textarea { width: 100%; color: var(--text); border: 1px solid rgba(160, 185, 218, .17); border-radius: 9px; background: rgba(4, 12, 23, .55); transition: border-color .18s ease, box-shadow .18s ease; }
textarea { min-height: 99px; padding: 15px; resize: vertical; font-size: 15px; line-height: 1.6; }
textarea::placeholder, input::placeholder { color: #66758d; }
textarea:focus, input:focus { border-color: rgba(102, 228, 230, .65); outline: none; box-shadow: 0 0 0 3px rgba(102, 228, 230, .08); }
.input-meta { display: flex; justify-content: space-between; gap: 12px; margin: 8px 1px 17px; color: #75849b; font-size: 10px; }
.input-meta span:last-child { font-family: var(--mono); white-space: nowrap; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 12px; border: 1px solid rgba(255, 189, 101, .14); border-radius: 9px; background: rgba(255, 189, 101, .04); }
.privacy-note p { margin: 0; color: #b1a991; font-size: 10px; line-height: 1.6; }
.info-icon { flex: 0 0 15px; width: 15px; height: 15px; display: grid; place-items: center; border: 1px solid rgba(255, 205, 132, .5); border-radius: 50%; color: #ffd18a; font: 500 10px var(--mono); }
.button-primary { width: 100%; min-height: 50px; padding: 0 18px; color: #06121d; background: linear-gradient(100deg, #71e3d6, #a4d5fb); font-size: 13px; }
.button-primary:hover:not(:disabled) { box-shadow: 0 8px 28px rgba(88, 213, 210, .16); }
.button-caption { margin: 10px 0 0; color: #718198; text-align: center; font-size: 10px; }

.response-section { margin-top: 43px; }
.response-heading { align-items: center; }
.status-label { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: #91a1b7; font: 10px var(--mono); }
.response-card { min-height: 170px; padding: 22px; }
.empty-state { min-height: 124px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.empty-orbit { margin-bottom: 10px; color: #5c7395; font-size: 24px; }
.empty-state p { margin-bottom: 5px; color: #bdcbe0; font-size: 13px; }
.empty-state span:last-child { color: #718198; font-size: 10px; }
.result-copy { margin: 0 0 19px; color: #d9e7f7; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.transaction-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin: 0; padding-top: 15px; border-top: 1px solid var(--line); }
.transaction-details dt { margin-bottom: 7px; color: #73839c; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.transaction-details dd { overflow-wrap: anywhere; margin: 0; color: #b8c8dd; font: 10px var(--mono); }
.transaction-details a { color: var(--cyan); text-decoration: none; }
.transaction-details a:hover { text-decoration: underline; }

.status-label[data-state="pending"] { color: var(--cyan); border-color: rgba(102, 228, 230, .28); }
.status-label[data-state="success"] { color: var(--green); border-color: rgba(109, 224, 176, .28); }
.status-label[data-state="warning"] { color: #ffb4b4; border-color: rgba(255, 119, 119, .28); }

.result-progress { margin: 0 0 18px; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(4, 12, 23, .4); }
.progress-stages { display: flex; flex-wrap: wrap; gap: 8px 0; margin: 0; padding: 0; list-style: none; }
.progress-stage { position: relative; display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-width: 92px; padding: 0 8px 0 0; color: #66778f; font: 500 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.progress-stage:not(:last-child)::after { content: ""; position: absolute; left: 18px; right: 6px; top: 7px; height: 1px; background: rgba(165, 190, 225, .16); }
.progress-stage-dot { width: 15px; height: 15px; border: 1px solid rgba(165, 190, 225, .28); border-radius: 50%; background: rgba(8, 17, 31, .9); box-shadow: 0 0 0 3px rgba(8, 17, 31, .9); z-index: 1; }
.progress-stage[data-state="done"] { color: var(--green); }
.progress-stage[data-state="done"] .progress-stage-dot { border-color: rgba(109, 224, 176, .7); background: var(--green); }
.progress-stage[data-state="current"] { color: var(--cyan); }
.progress-stage[data-state="current"] .progress-stage-dot { border-color: var(--cyan); background: rgba(102, 228, 230, .2); box-shadow: 0 0 0 3px rgba(8, 17, 31, .9), 0 0 10px rgba(102, 228, 230, .45); }
.progress-stage[data-state="error"] { color: #ff9a9a; }
.progress-stage[data-state="error"] .progress-stage-dot { border-color: #ff9a9a; background: #ff9a9a; }
.progress-live { display: flex; align-items: center; gap: 9px; margin: 12px 0 0; color: #d9e7f7; font-size: 12px; }
.progress-spinner { width: 12px; height: 12px; flex: 0 0 12px; border: 2px solid rgba(102, 228, 230, .22); border-top-color: var(--cyan); border-radius: 50%; animation: progress-spin .8s linear infinite; }
.progress-meta { margin: 7px 0 0; color: #718198; font: 9px var(--mono); }
.history-stage { margin: 0 0 8px; color: #91a1bb; font: 9px var(--mono); }

@keyframes progress-spin { to { transform: rotate(360deg); } }

.history-section { max-width: 790px; margin: 34px auto 0; }
.history-wallet { max-width: 55%; overflow-wrap: anywhere; color: #8293ac; font: 10px var(--mono); text-align: right; }
.history-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, rgba(17, 31, 50, .96), rgba(11, 23, 39, .96)); }
.history-storage-note { margin: 0; padding: 11px 16px; border-bottom: 1px solid var(--line); color: #ffd18a; font-size: 11px; }
.history-empty { margin: 0; padding: 24px; color: #718198; font-size: 12px; text-align: center; }
.history-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.history-entry { padding: 17px 19px; border-bottom: 1px solid var(--line); }
.history-entry:last-child { border-bottom: 0; }
.history-entry-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.history-status { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: #b7c5d9; font: 9px var(--mono); }
.history-status[data-state="completed"] { color: var(--green); border-color: rgba(109, 224, 176, .25); }
.history-status[data-state="failed"] { color: #ff9a9a; border-color: rgba(255, 119, 119, .25); }
.history-status[data-state="under_review"] { color: #ffd18a; border-color: rgba(255, 190, 102, .3); }
.history-date, .history-id { color: #718198; font: 9px var(--mono); }
.history-query { margin: 0 0 9px; color: #d9e7f7; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.history-id { margin: 0 0 7px; overflow-wrap: anywhere; }
.history-result { margin: 0 0 9px; padding: 9px 11px; border-left: 2px solid var(--line); color: #b7c5d9; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.history-transaction { color: var(--cyan); font-size: 10px; text-decoration: none; }
.history-transaction:hover { text-decoration: underline; }
.contract-strip { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: center; margin: 29px auto 0; padding: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contract-strip div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #8797ae; font-size: 10px; }
.contract-strip code { color: #687b96; font: 9px var(--mono); }
.contract-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.treasury-dot { background: #a598ff; }
.footer { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #68788f; font-size: 10px; }
.footer a { color: #8ea1bd; text-decoration: none; }.footer a:hover { color: var(--cyan); }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 32px, 560px); }
  .topbar { height: 70px; gap: 9px; }
  .brand { font-size: 15px; }.brand-mark { width: 27px; height: 27px; }
  .network-badges { gap: 5px; }.badge { padding: 0 7px; font-size: 8px; }
  .button-quiet { min-height: 36px; padding: 0 10px; font-size: 10px; }
  .hero { min-height: 325px; }
  .hero-copy { width: 100%; padding: 45px 0 35px; }
  h1 { font-size: clamp(47px, 13vw, 66px); letter-spacing: -3px; }
  .hero-description { max-width: 380px; font-size: 13px; }
  .orbit-art { right: -165px; top: 22px; opacity: .38; transform: scale(.85); }
  .request-card { padding: 17px; }
  .section-heading { align-items: center; }
  h2 { font-size: 19px; }
  .transaction-details { grid-template-columns: 1fr; }
  .progress-stage { min-width: 46%; padding-bottom: 8px; }
  .history-entry { padding: 15px; }
}

@media (max-width: 420px) {
  .network-badges { flex-direction: column; align-items: flex-start; }
  .badge { min-height: 21px; }
  .topbar { gap: 7px; }
  .hero { min-height: 305px; }
  .hero-footnote { align-items: flex-start; max-width: 300px; line-height: 1.5; }
  .input-meta { align-items: flex-start; font-size: 9px; }
  .contract-strip { justify-content: flex-start; }
  .contract-strip div { width: 100%; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 6px; padding: 14px 0; }
}

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