:root {
  color-scheme: light;
  --paper: #eef3f6;
  --paper-deep: #dfe8ed;
  --ink: #112332;
  --muted: #637482;
  --line: #bccad2;
  --white: #f9fcfd;
  --blue: #315efb;
  --blue-dark: #173ac8;
  --aqua: #00a69d;
  --coral: #ee684c;
  --shadow: 0 24px 70px rgba(38, 65, 82, 0.13);
  --radius: 22px;
  font-family: "Aptos", "Segoe UI Variable", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(49, 94, 251, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 94, 251, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.ambient {
  position: fixed;
  inset: -20vh -20vw auto auto;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 109, 255, 0.13), transparent 66%);
  pointer-events: none;
  z-index: -1;
}

.topbar {
  height: 74px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 750 13px/1 "Arial Narrow", "Segoe UI", sans-serif;
  letter-spacing: 0.18em;
  text-decoration: none;
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 8px 8px 8px 2px;
  font: 800 14px/1 ui-monospace, "Cascadia Code", monospace;
  letter-spacing: -0.08em;
}

.runtime {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 650 11px/1 ui-monospace, "Cascadia Code", monospace;
  letter-spacing: 0.04em;
}

.runtime-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #95a4ad;
  box-shadow: 0 0 0 4px rgba(149, 164, 173, 0.14);
}

.runtime.ready .runtime-dot { background: var(--aqua); box-shadow: 0 0 0 4px rgba(0, 166, 157, 0.14); }
.runtime.warning .runtime-dot { background: #e79b2d; box-shadow: 0 0 0 4px rgba(231, 155, 45, 0.14); }

main { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

.hero {
  min-height: 470px;
  padding: 82px 0 70px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  align-items: end;
  gap: 70px;
}

.eyebrow, .section-index {
  margin: 0 0 18px;
  color: var(--blue);
  font: 700 11px/1 ui-monospace, "Cascadia Code", monospace;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  max-width: 780px;
  font: 760 clamp(48px, 6.4vw, 88px)/0.97 "Arial Narrow", "Segoe UI Variable", sans-serif;
  letter-spacing: -0.055em;
}

h1 span { color: var(--blue); }

.lede {
  max-width: 680px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.route-machine {
  overflow: hidden;
  background: var(--ink);
  color: #dce8ee;
  border-radius: 5px 22px 5px 22px;
  box-shadow: var(--shadow);
  font-family: ui-monospace, "Cascadia Code", monospace;
}

.route-head, .route-result {
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8195a4;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.route-head { border-bottom: 1px solid #2d414f; }
.live-label { display: flex; align-items: center; gap: 6px; color: #80d9c9; }
.live-label i { width: 5px; height: 5px; background: #40d4bb; border-radius: 50%; }

.route-line {
  position: relative;
  padding: 44px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  gap: 7px;
  align-items: center;
  font-size: 9px;
  white-space: nowrap;
}

.route-line b { height: 1px; background: #425766; }
.route-active { color: #6d8cff; }
.packet {
  position: absolute;
  left: 18%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-radius: 50%;
  background: #7390ff;
  box-shadow: 0 0 13px #7390ff;
  animation: packet 3.2s cubic-bezier(.7, 0, .3, 1) infinite;
}

@keyframes packet { 0%, 8% { left: 17%; opacity: 0; } 16% { opacity: 1; } 46%, 72% { left: 45%; opacity: 1; } 82%, 100% { left: 45%; opacity: 0; } }

.route-result { background: #182e3e; border-top: 1px solid #2d414f; }
.route-result span { color: #79dcca; }
.route-result strong { color: #c7d4db; font-weight: 500; letter-spacing: 0; }
.route-result em { color: white; font-style: normal; font-size: 16px; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 18px;
  align-items: start;
}

.publish-card, .test-note {
  background: rgba(249, 252, 253, 0.94);
  border: 1px solid rgba(177, 194, 204, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 14px 42px rgba(44, 67, 82, 0.07);
}

.publish-card { padding: 34px; }
.test-note { padding: 38px; background: var(--ink); color: white; border-color: var(--ink); border-radius: 5px var(--radius) 5px var(--radius); }
.test-note h2 { max-width: 330px; font-size: 40px; line-height: 1.02; }
.test-note > p:not(.section-index) { margin: 24px 0 34px; color: #a9bac5; font-size: 13px; line-height: 1.75; }
.test-note dl { margin: 0; border-top: 1px solid #36505f; }
.test-note dl div { padding: 17px 0; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid #36505f; }
.test-note dt { color: #7f95a3; font: 600 10px/1.4 ui-monospace, monospace; letter-spacing: .08em; }
.test-note dd { margin: 0; color: #dbe8ee; text-align: right; font: 650 11px/1.4 ui-monospace, monospace; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 30px; }
.section-heading.compact { padding: 0 12px; margin-bottom: 22px; }
.section-heading .section-index { margin-bottom: 10px; }
h2 { margin: 0; font-size: 28px; line-height: 1.1; letter-spacing: -0.035em; }
.limit-note { padding: 7px 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font: 650 10px/1 ui-monospace, monospace; }

.field-label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.field-help { margin: 8px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.url-composer {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 16px;
  border: 1px solid #aebec8;
  border-radius: 12px;
  background: white;
  box-shadow: inset 0 1px 0 rgba(17, 35, 50, .03);
  font: 600 14px/1 ui-monospace, "Cascadia Code", monospace;
}

.url-composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 94, 251, 0.12); }
.url-composer span { color: #768894; }
.url-composer input { min-width: 80px; flex: 1; border: 0; outline: 0; background: transparent; color: var(--blue); font-weight: 750; }
.url-composer input::placeholder { color: #a8b4bc; }

.dropzone {
  min-height: 126px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px dashed #9cabb5;
  border-radius: 16px;
  background: #f5f9fb;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}

.dropzone:hover, .dropzone.dragging { border-color: var(--blue); background: #edf2ff; transform: translateY(-1px); }
.dropzone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.dropzone:focus-within { outline: 3px solid rgba(49, 94, 251, 0.18); outline-offset: 2px; }
.drop-icon { flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center; color: var(--blue); background: white; border: 1px solid #c6d1d8; border-radius: 12px; }
.drop-icon svg, .publish-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 6px; }
.drop-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.drop-copy small { color: var(--muted); font-size: 11px; }
.choose-label { color: var(--blue); font-size: 12px; font-weight: 700; }

.check-row { margin: 20px 0 24px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.check-row input { position: absolute; opacity: 0; }
.check-box { width: 19px; height: 19px; border: 1px solid #9aaab4; border-radius: 5px; background: white; }
.check-row input:checked + .check-box { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 4px white; }
.check-row input:focus-visible + .check-box { outline: 3px solid rgba(49, 94, 251, .18); outline-offset: 2px; }
.check-row > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.check-row strong { font-size: 12px; }
.check-row small { color: var(--muted); font-size: 10px; }

.publish-button {
  width: 100%;
  height: 56px;
  margin-top: 4px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  border: 0;
  border-radius: 13px;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(49, 94, 251, .23);
  cursor: pointer;
  font-weight: 750;
  transition: background .2s, transform .2s;
}

.publish-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.publish-button:disabled { cursor: wait; opacity: .65; transform: none; }
.publish-button svg { transition: transform .2s; }
.publish-button:hover svg { transform: translateX(3px); }

.notice { margin-top: 16px; padding: 13px 15px; border-radius: 10px; background: #e5f7f3; color: #08766f; font-size: 12px; line-height: 1.55; }
.notice.error { background: #fff0ed; color: #aa3522; }
.notice a { color: inherit; font-weight: 800; }

.how-it-works {
  margin: 94px 0 80px;
  padding: 48px 0;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 80px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.how-it-works h2 { font-size: clamp(30px, 3.5vw, 48px); line-height: 1.08; }
.flow-list { margin: 0; padding: 0; list-style: none; }
.flow-list li { padding: 21px 0; display: grid; grid-template-columns: 50px 1fr; border-bottom: 1px solid #c8d4da; }
.flow-list li:first-child { padding-top: 0; }
.flow-list li:last-child { border-bottom: 0; }
.flow-list > li > span { color: var(--blue); font: 700 11px/1.4 ui-monospace, monospace; }
.flow-list strong { display: block; margin-bottom: 6px; font-size: 15px; }
.flow-list p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

footer { max-width: 1240px; margin: 0 auto; padding: 0 28px 28px; display: flex; justify-content: space-between; color: #7b8c96; font: 650 9px/1 ui-monospace, monospace; letter-spacing: .12em; }

button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(49, 94, 251, .24); outline-offset: 2px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 42px; padding-top: 62px; }
  .route-machine { max-width: 520px; }
  .workspace { grid-template-columns: 1fr; }
  .how-it-works { grid-template-columns: 1fr; gap: 45px; }
}

@media (max-width: 600px) {
  .topbar, main, footer { padding-left: 18px; padding-right: 18px; }
  .topbar { height: 64px; }
  .runtime span:last-child { display: none; }
  .hero { min-height: 0; padding: 52px 0; }
  h1 { font-size: 48px; }
  .lede { font-size: 15px; }
  .route-line { padding: 38px 14px; font-size: 7px; }
  .publish-card { padding: 26px 20px; }
  .test-note { padding: 30px 24px; }
  .url-composer { padding: 0 12px; font-size: 11px; }
  .dropzone { align-items: flex-start; flex-wrap: wrap; }
  .choose-label { width: 100%; padding-left: 64px; }
  .how-it-works { margin-top: 70px; }
  footer { gap: 16px; flex-direction: column; }
}

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