:root {
  --ink: #0f172a;
  --muted: #536179;
  --line: #d7dfec;
  --soft: #f4f7fb;
  --white: #ffffff;
  --navy: #101828;
  --blue: #2f6fed;
  --blue-soft: #e9f1ff;
  --green: #12865f;
  --green-soft: #e8f8f1;
  --amber: #b7791f;
  --amber-soft: #fff7e6;
  --red: #b42318;
  --red-soft: #fff0ed;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(16, 24, 40, 0.96);
  color: var(--white);
  backdrop-filter: blur(14px);
}

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

.brand {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #d7dfec;
  font-size: 0.93rem;
  font-weight: 700;
}

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

.hero {
  background:
    linear-gradient(135deg, rgba(47, 111, 237, 0.14), transparent 36%),
    linear-gradient(180deg, #101828 0%, #18243a 100%);
  color: var(--white);
  padding: 74px 0 64px;
}

.open-hero {
  background:
    linear-gradient(135deg, rgba(47, 111, 237, 0.13), transparent 34%),
    linear-gradient(180deg, #101828 0%, #17243b 100%);
  color: var(--white);
  padding: 54px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 48px;
  align-items: center;
}

.open-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.6fr);
  gap: 34px;
  align-items: center;
}

.hero-copy h1 {
  max-width: 740px;
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.open-hero h1 {
  max-width: 760px;
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.open-hero p {
  max-width: 720px;
  margin: 0;
  color: #d8e1ef;
  font-size: 1.05rem;
}

.hero-copy p {
  max-width: 690px;
  margin: 0;
  color: #d8e1ef;
  font-size: 1.08rem;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 12px;
  color: #8fb4ff;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
  padding: 11px 16px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.button-quiet {
  border-color: #cbd5e1;
  background: var(--white);
  color: var(--ink);
}

.hero .button-quiet {
  border-color: rgba(255, 255, 255, 0.26);
  background: transparent;
  color: var(--white);
}

.button-small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.primary-wide {
  width: 100%;
  margin-top: 2px;
}

.hero-visual {
  min-width: 0;
}

.hero-art {
  display: block;
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
}

.open-flow-art svg {
  display: block;
  width: 100%;
  max-width: 430px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.2);
}

.line-card,
.line-green {
  fill: none;
  stroke-width: 4;
}

.line-card {
  stroke: rgba(255, 255, 255, 0.34);
}

.line-muted,
.line-blue,
.line-amber {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.line-muted {
  stroke: rgba(255, 255, 255, 0.32);
}

.line-blue {
  stroke: #8fb4ff;
}

.line-amber {
  stroke: #ffc96f;
}

.line-green {
  stroke: #6ee7b7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-label {
  fill: #dbe6f7;
  font-size: 15px;
  font-weight: 800;
}

.line-route {
  fill: none;
  stroke: #8fb4ff;
  stroke-dasharray: 9 10;
  stroke-linecap: round;
  stroke-width: 5;
  animation: routeDash 1.2s linear infinite;
}

.line-route-amber {
  stroke: #ffc96f;
  animation-duration: 1.5s;
}

.moving-dot {
  fill: #8fb4ff;
  filter: drop-shadow(0 0 10px rgba(143, 180, 255, 0.9));
}

.moving-dot-amber {
  fill: #ffc96f;
  filter: drop-shadow(0 0 10px rgba(255, 201, 111, 0.92));
}

.notice {
  padding: 18px 0 0;
}

.notice-box {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid #f5d58a;
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: #744210;
  padding: 13px 16px;
}

.recipient-section,
.manual-section,
.demo-section,
.proof-section {
  padding: 56px 0;
}

.recipient-section {
  background: #eef4ff;
}

.manual-section {
  padding-top: 0;
  background: #eef4ff;
}

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.panel,
.recipient-panel,
.manual-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 24px;
}

.panel h2,
.recipient-panel h2,
.manual-panel h2,
.proof-grid h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.panel-copy,
.recipient-panel > div:first-child p,
.manual-header p,
.result-card p,
.proof-cards p {
  color: var(--muted);
}

.demo-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

fieldset {
  display: grid;
  gap: 13px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

legend {
  padding: 0 8px;
  color: var(--blue);
  font-size: 0.83rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-note {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

label {
  display: grid;
  gap: 7px;
  color: #24324a;
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.party-grid,
.result-grid,
.recipient-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.party-card,
.result-card,
.artifact-box,
.receipt-box,
.plaintext-card,
.locked-box,
.inspect-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 16px;
}

.party-card {
  display: grid;
  gap: 12px;
}

.manual-panel {
  display: grid;
  gap: 18px;
}

.manual-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.manual-header p {
  max-width: 760px;
  margin: 0;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.artifact-box {
  display: grid;
  gap: 12px;
}

.artifact-box-token {
  border-color: #b8e4d3;
  background: var(--green-soft);
}

.file-row input {
  padding: 9px;
}

.artifact-box textarea {
  min-height: 220px;
  resize: vertical;
}

.manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.manual-output pre {
  max-height: 360px;
}

.party-card > span,
.result-card > span,
.artifact-box > span,
.receipt-box > span,
.plaintext-card > span {
  display: block;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.party-card strong,
.result-card strong,
.artifact-box strong {
  display: block;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.25;
}

.party-card-token,
.result-card-token,
#recipient-token-card.is-unlocked {
  border-color: #b8e4d3;
  background: var(--green-soft);
}

.party-card-token > span,
.result-card-token > span,
#recipient-token-card.is-unlocked > span,
.artifact-box-token > span {
  color: var(--green);
}

.run-panel {
  position: sticky;
  top: 92px;
}

.runner {
  display: grid;
  gap: 12px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.runner li {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 13px;
}

.runner li > span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: var(--white);
}

.runner li.is-running > span {
  border-top-color: var(--blue);
  animation: spin 850ms linear infinite;
}

.runner li.is-complete {
  border-color: #b8e4d3;
  background: var(--green-soft);
}

.runner li.is-complete > span {
  border-color: var(--green);
  background: var(--green);
}

.runner li.is-complete > span::after {
  content: "";
  width: 8px;
  height: 14px;
  border: solid var(--white);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.runner li.is-error {
  border-color: #ffb4a8;
  background: var(--red-soft);
}

.status-line {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--muted);
  font-weight: 750;
  padding: 12px 14px;
}

.status-line.is-running {
  border-color: #b9cffd;
  background: var(--blue-soft);
  color: #1f4db5;
}

.status-line.is-success {
  border-color: #b8e4d3;
  background: var(--green-soft);
  color: var(--green);
}

.status-line.is-error {
  border-color: #ffb4a8;
  background: var(--red-soft);
  color: var(--red);
}

.result-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.result-card {
  display: grid;
  gap: 10px;
}

.result-card p {
  margin: 0;
  font-size: 0.92rem;
}

.delivery-status {
  border-left: 3px solid var(--blue);
  background: #f8fbff;
  color: #24324a;
  padding: 8px 10px;
}

pre,
textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

pre {
  max-height: 280px;
  overflow: auto;
  margin: 10px 0 0;
  border-radius: 6px;
  background: #0b1220;
  color: #dbeafe;
  padding: 14px;
  font-size: 0.84rem;
  white-space: pre-wrap;
}

.recipient-panel {
  display: grid;
  gap: 18px;
}

.locked-box {
  border-color: #ffb4a8;
  background: var(--red-soft);
  color: #7a271a;
}

.locked-box strong {
  display: block;
  margin-bottom: 4px;
}

.locked-box p,
.plaintext-card p {
  margin: 0;
}

.inspect-box summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 850;
}

.inspect-box textarea {
  min-height: 220px;
  margin-top: 12px;
  resize: vertical;
}

.proof-section {
  background: var(--white);
}

.proof-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 36px;
  align-items: start;
}

.proof-cards {
  display: grid;
  gap: 14px;
}

.proof-cards article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 18px;
}

.proof-cards span {
  color: var(--blue);
  font-weight: 900;
}

.proof-cards h3 {
  margin: 5px 0 6px;
  font-size: 1.08rem;
}

.proof-cards p {
  margin: 0;
}

.site-footer {
  border-top: 1px solid #1f2937;
  background: var(--navy);
  color: #cbd5e1;
  padding: 22px 0;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.footer-row p {
  margin: 0;
}

@keyframes routeDash {
  to {
    stroke-dashoffset: -38;
  }
}

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

@media (max-width: 980px) {
  .hero-grid,
  .open-hero-grid,
  .demo-grid,
  .proof-grid {
    grid-template-columns: 1fr;
  }

  .hero-art {
    margin-left: 0;
  }

  .open-flow-art svg {
    margin-left: 0;
  }

  .run-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1120px);
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
  }

  .nav-links {
    width: 100%;
    gap: 14px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .hero {
    padding: 48px 0;
  }

  .open-hero {
    padding: 42px 0;
  }

  .hero-copy h1 {
    font-size: 2.25rem;
  }

  .open-hero h1 {
    font-size: 2.1rem;
  }

  .party-grid,
  .result-grid,
  .recipient-grid,
  .manual-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .recipient-panel,
  .manual-panel {
    padding: 18px;
  }

  .notice-box {
    align-items: flex-start;
    flex-direction: column;
  }
}

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