:root {
  --ink: #171713;
  --muted-ink: #68675f;
  --faint-ink: #a5a297;
  --paper: #f7f4ea;
  --paper-deep: #eee9dc;
  --ground: #d8d4c8;
  --signal: #ff4b2b;
  --acid: #d7ff37;
  --blue: #1556d8;
  --safe: #267a4b;
  --line: rgba(23, 23, 19, 0.18);
  --shadow: 10px 12px 0 rgba(23, 23, 19, 0.12);
  --font-display: "Bodoni 72", "Songti SC", "STSong", serif;
  --font-ui: "Avenir Next Condensed", "DIN Condensed", "PingFang SC", sans-serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--ground);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-ui);
  background:
    linear-gradient(rgba(23, 23, 19, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 19, 0.045) 1px, transparent 1px),
    var(--ground);
  background-size: 28px 28px;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.page-grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

body > .site-header,
body > main,
body > footer {
  transition: filter 0.55s ease, opacity 0.55s ease, transform 0.55s ease;
}

body.is-gated {
  overflow: hidden;
}

body.is-gated > .site-header,
body.is-gated > main,
body.is-gated > footer {
  opacity: 0.36;
  filter: blur(10px) saturate(0.35);
  pointer-events: none;
  transform: scale(0.985);
  user-select: none;
}

.lead-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  overflow-y: auto;
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
  background:
    linear-gradient(rgba(23, 23, 19, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 19, 0.08) 1px, transparent 1px),
    rgba(216, 212, 200, 0.9);
  background-size: 34px 34px;
  backdrop-filter: blur(16px);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.lead-gate[hidden] {
  display: none;
}

.lead-gate.is-complete {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-geometry {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.gate-geometry > span {
  position: absolute;
  top: -0.16em;
  left: -0.08em;
  color: rgba(23, 23, 19, 0.055);
  font-family: var(--font-display);
  font-size: clamp(200px, 38vw, 610px);
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.12em;
}

.gate-geometry > i {
  position: absolute;
  right: 7vw;
  bottom: -19vh;
  width: min(38vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(23, 23, 19, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(23, 23, 19, 0.035),
    0 0 0 72px rgba(23, 23, 19, 0.025);
}

.gate-geometry > b {
  position: absolute;
  right: -45px;
  top: 50%;
  color: rgba(23, 23, 19, 0.35);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.22em;
  transform: rotate(90deg);
}

.gate-card {
  position: relative;
  width: min(1040px, 100%);
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 14px 16px 0 rgba(23, 23, 19, 0.16);
  animation: gate-arrive 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lead-gate.is-complete .gate-card {
  opacity: 0;
  transform: translateY(-22px) rotate(-0.4deg);
  transition: opacity 0.35s ease, transform 0.45s ease;
}

.gate-head {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3vw, 38px);
  border-bottom: 1px solid var(--ink);
}

.gate-brand .brand-mark {
  width: 34px;
  height: 34px;
}

.gate-brand .brand-mark svg {
  width: 25px;
}

.gate-access-code {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.gate-access-code i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--safe);
  box-shadow: 0 0 0 5px rgba(38, 122, 75, 0.12);
  animation: pulse 2s infinite;
}

.gate-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
}

.gate-copy {
  position: relative;
  min-height: 460px;
  padding: clamp(38px, 5vw, 68px);
  overflow: hidden;
  color: var(--paper);
  background: var(--ink);
}

.gate-copy::after {
  position: absolute;
  right: -56px;
  bottom: -72px;
  width: 210px;
  aspect-ratio: 1;
  border: 22px solid rgba(215, 255, 55, 0.1);
  border-radius: 50%;
  content: "";
}

.gate-copy .eyebrow {
  color: var(--acid);
}

.gate-copy h2 {
  position: relative;
  z-index: 1;
  margin: 32px 0 24px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.gate-copy h2 em {
  color: var(--acid);
  font-weight: 400;
}

.gate-copy > p:not(.eyebrow) {
  max-width: 340px;
  margin: 0;
  color: rgba(247, 244, 234, 0.62);
  font-size: 12px;
  line-height: 1.75;
}

.gate-capabilities {
  position: absolute;
  z-index: 1;
  right: clamp(34px, 5vw, 64px);
  bottom: 42px;
  left: clamp(34px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(247, 244, 234, 0.18);
  list-style: none;
}

.gate-capabilities li {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px 8px 0 0;
  color: rgba(247, 244, 234, 0.72);
  font-size: 9px;
}

.gate-capabilities span {
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 800;
}

.lead-form {
  display: grid;
  align-content: center;
  grid-template-columns: 1fr 1fr;
  gap: 22px 16px;
  padding: clamp(34px, 5vw, 66px);
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(23, 23, 19, 0.025) 48% 52%, transparent 52%)
      0 0 / 13px 13px,
    var(--paper);
}

.lead-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
}

.lead-field-wide {
  grid-column: 1 / -1;
}

.lead-field > span {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.lead-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(23, 23, 19, 0.38);
  border-radius: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.34);
  appearance: none;
  font-size: 12px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.lead-field input::placeholder {
  color: rgba(23, 23, 19, 0.34);
}

.lead-field input:hover {
  border-color: rgba(23, 23, 19, 0.7);
}

.lead-field input:focus {
  border-color: var(--ink);
  outline: 0;
  background: #fffdf7;
  box-shadow: 4px 4px 0 rgba(23, 23, 19, 0.1);
}

.lead-field input:user-invalid {
  border-color: var(--signal);
}

.lead-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gate-submit {
  grid-column: 1 / -1;
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--acid);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 5px 5px 0 rgba(23, 23, 19, 0.13);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.gate-submit svg {
  width: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.gate-submit:hover:not(:disabled) {
  color: var(--acid);
  background: var(--ink);
  box-shadow: 7px 7px 0 rgba(255, 75, 43, 0.24);
  transform: translate(-2px, -2px);
}

.gate-submit:hover:not(:disabled) svg {
  transform: translateX(4px);
}

.gate-submit:disabled {
  cursor: wait;
  opacity: 0.82;
}

.gate-submit-loading {
  display: none;
  align-items: flex-end;
  gap: 4px;
}

.gate-submit-loading i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: loading-dot 0.8s infinite alternate;
}

.gate-submit-loading i:nth-child(2) {
  animation-delay: 0.16s;
}

.gate-submit-loading i:nth-child(3) {
  animation-delay: 0.32s;
}

.gate-submit.is-loading .gate-submit-default,
.gate-submit.is-loading svg {
  display: none;
}

.gate-submit.is-loading .gate-submit-loading {
  display: flex;
}

.gate-status {
  grid-column: 1 / -1;
  min-height: 16px;
  margin: -8px 0 0;
  color: var(--muted-ink);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0.06em;
}

.gate-status[data-state="error"] {
  color: var(--signal);
}

.gate-status[data-state="success"] {
  color: var(--safe);
  font-weight: 800;
}

.gate-foot {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3vw, 38px);
  border-top: 1px solid var(--ink);
  color: var(--muted-ink);
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.1em;
}

.site-header {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 82px;
  padding: 0 clamp(22px, 4vw, 68px);
  border-bottom: 1px solid var(--ink);
  background: rgba(216, 212, 200, 0.9);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--ink);
  transform: rotate(-4deg);
}

.brand-mark svg {
  width: 29px;
  fill: none;
  stroke: var(--acid);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.brand-name span {
  padding: 0 2px;
  color: var(--signal);
}

.system-state,
.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.system-state {
  padding: 8px 13px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--safe);
  box-shadow: 0 0 0 0 rgba(38, 122, 75, 0.35);
  animation: pulse 2.2s infinite;
}

.state-divider {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.header-meta {
  justify-self: end;
  color: var(--muted-ink);
}

.header-share {
  color: var(--muted-ink);
  text-decoration: none;
  transition: color 180ms ease;
}

.header-share::before {
  margin-right: 10px;
  content: "×";
  color: var(--signal);
}

.header-share:hover {
  color: var(--ink);
}

.header-meta span + span::before {
  margin-right: 10px;
  content: "×";
  color: var(--signal);
}

main {
  width: min(1480px, calc(100% - clamp(28px, 6vw, 104px)));
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: 90px minmax(450px, 1fr) minmax(250px, 400px);
  gap: clamp(24px, 4vw, 72px);
  align-items: end;
  padding: clamp(52px, 7vw, 108px) 0 clamp(36px, 5vw, 68px);
}

.intro-index {
  align-self: start;
  padding-top: 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  writing-mode: vertical-rl;
}

.eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(54px, 7.2vw, 108px);
  font-weight: 500;
  letter-spacing: -0.085em;
  line-height: 0.92;
}

.intro h1 em {
  position: relative;
  font-weight: 500;
  color: var(--signal);
}

.intro h1 em::after {
  position: absolute;
  right: -22px;
  bottom: 5px;
  left: 2px;
  height: 8px;
  content: "";
  background: var(--acid);
  z-index: -1;
  transform: rotate(-1.2deg);
}

.intro-note {
  max-width: 360px;
  margin: 0 0 5px;
  padding-left: 22px;
  border-left: 3px solid var(--ink);
  color: var(--muted-ink);
  font-size: 14px;
  line-height: 1.9;
}

.workbench {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(330px, 0.75fr);
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(24px);
  animation: reveal-up 0.8s 0.18s cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
}

.workbench-label {
  position: absolute;
  top: 24px;
  left: -36px;
  display: flex;
  gap: 14px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  transform: rotate(-90deg) translateX(-100%);
  transform-origin: left top;
}

.canvas-panel {
  min-width: 0;
  border-right: 1px solid var(--ink);
}

.canvas-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--ink);
  background: rgba(247, 244, 234, 0.78);
}

.document-id,
.history-actions {
  display: flex;
  align-items: center;
}

.document-id {
  min-width: 0;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.document-id > span:last-child {
  max-width: min(24vw, 250px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--signal);
}

.live-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.history-actions {
  gap: 4px;
}

.icon-button,
.text-button,
.tool-button,
.ink-swatch {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: var(--muted-ink);
  font-size: 11px;
}

.icon-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:not(:disabled):hover {
  color: var(--ink);
  background: rgba(23, 23, 19, 0.06);
}

.icon-button:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.upload-button {
  margin-right: 6px;
  border: 1px solid rgba(23, 23, 19, 0.32);
  color: var(--ink);
}

.upload-button:not(:disabled):hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--acid);
}

.text-button {
  min-height: 34px;
  margin-left: 8px;
  padding: 0 11px;
  border-left: 1px solid var(--line);
  font-size: 11px;
}

.danger-hover:hover {
  color: var(--signal);
}

.drawing-layout {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
}

.tool-rail {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 9px;
  padding: 22px 11px;
  border-right: 1px solid var(--ink);
  background: var(--ground);
}

.tool-button {
  display: grid;
  width: 44px;
  height: 52px;
  place-items: center;
  gap: 2px;
  padding: 5px 0;
  border: 1px solid transparent;
  color: var(--muted-ink);
  font-size: 9px;
}

.tool-button svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-button:hover {
  border-color: var(--ink);
}

.tool-button.is-active {
  color: var(--paper);
  background: var(--ink);
}

.tool-separator {
  width: 26px;
  height: 1px;
  margin: 5px 0;
  background: rgba(23, 23, 19, 0.24);
}

.rail-caption {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
}

.paper-wrap {
  position: relative;
  min-width: 0;
  padding: clamp(20px, 3vw, 40px);
  background:
    radial-gradient(circle at center, rgba(23, 23, 19, 0.18) 1px, transparent 1.3px),
    var(--paper-deep);
  background-size: 18px 18px;
}

.paper-clip {
  position: absolute;
  z-index: 2;
  top: 21px;
  left: 50%;
  width: 74px;
  height: 22px;
  border: 1px solid rgba(23, 23, 19, 0.3);
  background: rgba(216, 212, 200, 0.84);
  box-shadow: 1px 2px 4px rgba(23, 23, 19, 0.08);
  transform: translateX(-50%) rotate(-1.5deg);
}

.paper {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(23, 23, 19, 0.42);
  background: var(--paper);
  box-shadow: 4px 5px 0 rgba(23, 23, 19, 0.14);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.paper.is-dragging {
  border-color: var(--signal);
  box-shadow: 4px 5px 0 var(--signal);
}

#drawingCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

#drawingCanvas[data-tool="eraser"] {
  cursor: cell;
}

.canvas-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 11px;
  color: var(--faint-ink);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-2deg);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.canvas-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, -45%) rotate(-2deg);
}

.canvas-hint > svg {
  width: 62px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.canvas-hint > span:first-of-type {
  font-family: var(--font-display);
  font-size: 14px;
}

.canvas-hint .hint-divider {
  display: flex;
  align-items: center;
  width: 112px;
  gap: 8px;
  color: rgba(23, 23, 19, 0.35);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.canvas-hint .hint-divider::before,
.canvas-hint .hint-divider::after {
  height: 1px;
  flex: 1;
  content: "";
  background: rgba(23, 23, 19, 0.16);
}

.canvas-hint button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--acid);
  cursor: pointer;
  pointer-events: auto;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 3px 3px 0 rgba(23, 23, 19, 0.14);
  transform: rotate(1deg);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.canvas-hint button:hover {
  color: var(--paper);
  background: var(--ink);
  transform: rotate(0) translateY(-2px);
}

.canvas-hint button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.canvas-hint small {
  color: rgba(23, 23, 19, 0.42);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.drop-overlay {
  position: absolute;
  z-index: 6;
  inset: 10px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--signal);
  opacity: 0;
  color: var(--paper);
  background: rgba(23, 23, 19, 0.91);
  pointer-events: none;
  transform: scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.paper.is-dragging .drop-overlay {
  opacity: 1;
  transform: scale(1);
}

.drop-overlay > div {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.drop-overlay svg {
  width: 48px;
  margin-bottom: 5px;
  fill: none;
  stroke: var(--acid);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: upload-float 1.2s ease-in-out infinite alternate;
}

.drop-overlay strong {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.drop-overlay span {
  color: var(--faint-ink);
  font-size: 10px;
}

.paper-coordinate {
  position: absolute;
  z-index: 2;
  color: rgba(23, 23, 19, 0.3);
  font-family: var(--font-mono);
  font-size: 7px;
  pointer-events: none;
}

.paper-coordinate.top {
  top: 7px;
  right: 9px;
}

.paper-coordinate.bottom {
  bottom: 7px;
  left: 9px;
}

.scan-line {
  position: absolute;
  z-index: 3;
  top: -10%;
  right: 0;
  left: 0;
  height: 2px;
  opacity: 0;
  pointer-events: none;
  background: var(--signal);
  box-shadow: 0 0 0 1px rgba(255, 75, 43, 0.12), 0 8px 24px rgba(255, 75, 43, 0.35);
}

.scan-line.is-scanning {
  opacity: 1;
  animation: scan 1.5s cubic-bezier(0.55, 0, 0.35, 1) infinite;
}

.paper-caption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 13px;
  color: var(--muted-ink);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.canvas-controls {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  min-height: 76px;
  align-items: center;
  gap: 26px;
  padding: 12px 22px;
  border-top: 1px solid var(--ink);
  background: var(--paper);
}

.ink-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.ink-selector legend {
  float: left;
  margin-right: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.ink-swatch {
  position: relative;
  width: 22px;
  height: 22px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.ink-swatch::after {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  content: "";
  background: currentColor;
}

.ink-swatch.is-active {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink);
}

.ink-black {
  color: var(--ink);
}

.ink-blue {
  color: var(--blue);
}

.ink-red {
  color: var(--signal);
}

.stroke-control {
  display: grid;
  grid-template-columns: auto 1fr 48px;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.stroke-control input {
  width: 100%;
  height: 2px;
  appearance: none;
  background: var(--ink);
}

.stroke-control input::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  appearance: none;
  background: var(--signal);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: ew-resize;
}

.stroke-control output {
  text-align: right;
}

.api-route {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
  color: var(--muted-ink);
  font-family: var(--font-mono);
  font-size: 8px;
}

.api-route code {
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
}

.inspector {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: clamp(24px, 3vw, 42px);
  background: var(--ink);
  color: var(--paper);
}

.inspector::before {
  position: absolute;
  top: 0;
  right: 18px;
  width: 46px;
  height: 7px;
  content: "";
  background: var(--acid);
}

.inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.inspector .eyebrow {
  color: var(--faint-ink);
}

.inspector h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 500;
}

.sense-badge {
  padding: 6px 8px;
  border: 1px solid rgba(247, 244, 234, 0.35);
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.result-stage {
  padding: clamp(38px, 5vh, 64px) 0 28px;
  text-align: center;
}

.result-visual {
  position: relative;
  width: 184px;
  height: 184px;
  margin: 0 auto 25px;
}

.result-orbit {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
}

.orbit-track {
  stroke: rgba(247, 244, 234, 0.17);
  stroke-width: 1;
  stroke-dasharray: 2 7;
}

.orbit-progress {
  stroke: var(--acid);
  stroke-width: 3;
  stroke-linecap: square;
  stroke-dasharray: 477.5;
  stroke-dashoffset: 477.5;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), stroke 0.3s ease;
}

.orbit-ticks {
  stroke: rgba(247, 244, 234, 0.38);
  stroke-width: 1;
}

.result-symbol {
  position: absolute;
  inset: 27px;
  display: grid;
  place-items: center;
}

.result-symbol svg {
  position: absolute;
  width: 68px;
  fill: none;
  stroke: var(--paper);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.safe-symbol,
.risk-symbol,
.risk-score {
  opacity: 0;
  transform: scale(0.82);
}

.risk-score {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 39px;
  letter-spacing: -0.08em;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.result-stage[data-state="loading"] .idle-symbol {
  animation: orbit-spin 1.8s linear infinite;
}

.result-stage[data-state="safe"] .idle-symbol,
.result-stage[data-state="risk"] .idle-symbol,
.result-stage[data-state="error"] .idle-symbol {
  opacity: 0;
  transform: scale(0.82);
}

.result-stage[data-state="safe"] .safe-symbol {
  opacity: 1;
  stroke: var(--acid);
  transform: scale(1);
}

.result-stage[data-state="risk"] .risk-symbol,
.result-stage[data-state="error"] .risk-symbol {
  opacity: 1;
  stroke: var(--signal);
  transform: scale(1);
}

.result-stage[data-state="safe"] .risk-score,
.result-stage[data-state="risk"] .risk-score {
  opacity: 1;
  transform: translateY(42px) scale(1);
}

.result-stage[data-state="safe"] .safe-symbol,
.result-stage[data-state="risk"] .risk-symbol {
  transform: translateY(-13px);
}

.result-stage[data-state="risk"] .orbit-progress,
.result-stage[data-state="error"] .orbit-progress {
  stroke: var(--signal);
}

.result-copy {
  max-width: 310px;
  margin: 0 auto;
}

.result-kicker {
  margin: 0 0 10px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.result-stage[data-state="risk"] .result-kicker,
.result-stage[data-state="error"] .result-kicker {
  color: var(--signal);
}

.result-copy h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 500;
}

.result-copy > p:last-child {
  margin: 0;
  color: var(--faint-ink);
  font-size: 12px;
  line-height: 1.75;
}

.result-details {
  max-height: 190px;
  margin: -4px 0 24px;
  overflow-y: auto;
  border-top: 1px solid rgba(247, 244, 234, 0.2);
}

.detail-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(247, 244, 234, 0.13);
}

.detail-category {
  display: grid;
  width: 32px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(247, 244, 234, 0.3);
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 8px;
}

.detail-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
}

.detail-copy p {
  margin: 0;
  color: var(--faint-ink);
  font-size: 9px;
  line-height: 1.5;
}

.detail-risk {
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.audit-pipeline {
  position: relative;
  margin-top: auto;
  border-top: 1px solid rgba(247, 244, 234, 0.17);
  border-bottom: 1px solid rgba(247, 244, 234, 0.17);
  padding: 15px 0 13px;
}

.pipeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--faint-ink);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.pipeline-head output {
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.pipeline-meter {
  position: relative;
  height: 3px;
  overflow: hidden;
  margin-bottom: 9px;
  background: rgba(247, 244, 234, 0.13);
}

.pipeline-meter > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--acid);
  transition: width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease;
}

.pipeline-meter > b {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent 0,
    transparent 42%,
    rgba(247, 244, 234, 0.82) 50%,
    transparent 58%,
    transparent 100%
  );
  transform: translateX(-100%);
}

.audit-pipeline[data-state="loading"] .pipeline-meter > b {
  opacity: 0.45;
  animation: pipeline-scan 1.35s linear infinite;
}

.audit-pipeline[data-state="error"] .pipeline-meter > i {
  background: var(--signal);
}

.pipeline-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 25px 13px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 39px;
  padding: 5px 7px 5px 2px;
  color: rgba(247, 244, 234, 0.38);
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.pipeline-steps li::after {
  position: absolute;
  top: 100%;
  left: 32px;
  width: 1px;
  height: 10px;
  content: "";
  background: rgba(247, 244, 234, 0.16);
  transform: translateY(-5px);
}

.pipeline-steps li:last-child::after {
  display: none;
}

.step-index,
.step-status {
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.step-marker {
  display: grid;
  width: 12px;
  height: 12px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.step-marker i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.step-copy strong,
.step-copy small {
  display: block;
}

.step-copy strong {
  color: currentColor;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.step-copy small {
  margin-top: 2px;
  color: rgba(247, 244, 234, 0.32);
  font-size: 8px;
}

.pipeline-steps li.is-complete {
  color: rgba(215, 255, 55, 0.6);
}

.pipeline-steps li.is-complete .step-marker i {
  transform: scale(1);
}

.pipeline-steps li.is-complete .step-status {
  color: var(--acid);
}

.pipeline-steps li.is-active {
  color: var(--paper);
  background: rgba(247, 244, 234, 0.075);
  transform: translateX(4px);
}

.pipeline-steps li.is-active::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  content: "";
  background: var(--acid);
}

.pipeline-steps li.is-active .step-marker {
  color: var(--acid);
  box-shadow: 0 0 0 0 rgba(215, 255, 55, 0.35);
  animation: step-pulse 1.4s ease-out infinite;
}

.pipeline-steps li.is-active .step-marker i {
  transform: scale(1);
}

.pipeline-steps li.is-active .step-status {
  color: var(--acid);
}

.pipeline-steps li.is-error {
  color: var(--signal);
  background: rgba(255, 75, 43, 0.08);
}

.pipeline-steps li.is-error .step-marker i {
  transform: scale(1);
}

.pipeline-current {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin: 10px 0 0;
  padding: 7px 9px;
  color: var(--faint-ink);
  background: rgba(247, 244, 234, 0.055);
  font-size: 9px;
  line-height: 1.5;
}

.pipeline-current span {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(247, 244, 234, 0.28);
}

.audit-pipeline[data-state="loading"] .pipeline-current {
  color: var(--paper);
}

.audit-pipeline[data-state="loading"] .pipeline-current span {
  background: var(--acid);
  animation: current-blink 0.85s steps(2, end) infinite;
}

.audit-pipeline[data-state="complete"] .pipeline-current span {
  background: var(--acid);
}

.audit-pipeline[data-state="error"] .pipeline-current {
  color: var(--signal);
}

.audit-pipeline[data-state="error"] .pipeline-current span {
  background: var(--signal);
}

.trial-quota {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr);
  align-items: end;
  gap: 18px;
  margin-bottom: 15px;
  padding: 13px 0 14px;
  border-top: 1px solid rgba(247, 244, 234, 0.16);
  border-bottom: 1px solid rgba(247, 244, 234, 0.16);
}

.quota-copy > span {
  color: var(--faint-ink);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.quota-copy p {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0 0;
}

.quota-copy output {
  color: var(--acid);
  font-family: var(--font-display);
  font-size: 30px;
  font-style: italic;
  line-height: 0.8;
}

.quota-copy small {
  color: var(--faint-ink);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.quota-cells {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  padding-bottom: 3px;
}

.quota-cells i {
  height: 20px;
  border: 1px solid rgba(247, 244, 234, 0.13);
  background: rgba(247, 244, 234, 0.05);
  transform: skewX(-6deg);
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.quota-cells i.is-available {
  border-color: var(--acid);
  background: var(--acid);
}

.quota-cells i.is-consumed {
  transform: skewX(-6deg) scaleY(0.48);
}

.trial-quota[data-state="exhausted"] .quota-copy output {
  color: var(--signal);
}

.trial-quota[data-state="exhausted"] .quota-copy small {
  color: rgba(255, 75, 43, 0.72);
}

.submit-wrap {
  margin-top: 24px;
}

.submit-button {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  padding: 0 19px;
  border: 1px solid var(--acid);
  color: var(--ink);
  background: var(--acid);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.submit-button svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.submit-button:not(:disabled):hover {
  color: var(--acid);
  background: transparent;
  transform: translateY(-2px);
}

.submit-button:not(:disabled):hover svg {
  transform: translateX(4px);
}

.submit-button:disabled {
  border-color: rgba(247, 244, 234, 0.18);
  color: rgba(247, 244, 234, 0.34);
  background: rgba(247, 244, 234, 0.06);
  cursor: not-allowed;
}

.submit-loading {
  display: none;
  align-items: flex-end;
  gap: 4px;
}

.submit-loading i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: loading-dot 0.9s infinite alternate;
}

.submit-loading i:nth-child(2) {
  animation-delay: 0.2s;
}

.submit-loading i:nth-child(3) {
  animation-delay: 0.4s;
}

.submit-button.is-loading .submit-label,
.submit-button.is-loading svg {
  display: none;
}

.submit-button.is-loading .submit-loading {
  display: flex;
}

.submit-wrap > p {
  margin: 12px 0 0;
  color: var(--faint-ink);
  font-size: 9px;
  text-align: center;
}

.privacy-mark {
  margin-right: 5px;
  color: var(--acid);
}

footer {
  display: flex;
  width: min(1480px, calc(100% - clamp(28px, 6vw, 104px)));
  justify-content: space-between;
  gap: 30px;
  margin: 38px auto 0;
  padding: 18px 0 36px;
  color: var(--muted-ink);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

footer p {
  margin: 0;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 13px 17px;
  border: 1px solid var(--ink);
  color: var(--paper);
  background: var(--ink);
  box-shadow: 4px 5px 0 rgba(23, 23, 19, 0.18);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes gate-arrive {
  from {
    opacity: 0;
    transform: translateY(24px) rotate(0.5deg) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(38, 122, 75, 0.4);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(38, 122, 75, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(38, 122, 75, 0);
  }
}

@keyframes reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scan {
  from {
    top: -5%;
  }
  to {
    top: 105%;
  }
}

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

@keyframes loading-dot {
  to {
    transform: translateY(-5px);
  }
}

@keyframes pipeline-scan {
  to {
    transform: translateX(100%);
  }
}

@keyframes step-pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(215, 255, 55, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(215, 255, 55, 0);
  }
}

@keyframes current-blink {
  50% {
    opacity: 0.28;
  }
}

@keyframes upload-float {
  to {
    transform: translateY(-7px);
  }
}

@media (max-width: 1120px) {
  .header-meta {
    display: none;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .intro {
    grid-template-columns: 46px 1fr;
  }

  .intro-note {
    grid-column: 2;
  }

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

  .canvas-panel {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .inspector {
    display: grid;
    grid-template-columns: minmax(180px, 0.55fr) minmax(240px, 1fr);
    column-gap: 36px;
  }

  .inspector-head,
  .result-stage,
  .result-details {
    grid-column: 1;
  }

  .audit-pipeline,
  .submit-wrap {
    grid-column: 2;
  }

  .audit-pipeline {
    align-self: end;
    margin-top: 46px;
  }

  .submit-wrap {
    align-self: start;
  }

  .result-stage {
    padding-bottom: 8px;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 70px;
    padding: 0 18px;
  }

  .system-state {
    padding: 7px 9px;
  }

  .system-state .state-divider,
  .system-state span:last-child {
    display: none;
  }

  main,
  footer {
    width: calc(100% - 24px);
  }

  .intro {
    display: block;
    padding: 46px 8px 34px;
  }

  .intro-index {
    display: none;
  }

  .intro h1 {
    font-size: clamp(49px, 15vw, 74px);
  }

  .intro-note {
    margin-top: 28px;
  }

  .workbench-label {
    display: none;
  }

  .canvas-toolbar {
    min-height: 54px;
    padding: 0 12px;
  }

  .document-id > span:last-child,
  .icon-button span {
    display: none;
  }

  .icon-button {
    padding: 0 7px;
  }

  .upload-button {
    margin-right: 1px;
  }

  .text-button {
    margin-left: 2px;
    padding-right: 3px;
  }

  .drawing-layout {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .tool-rail {
    padding: 14px 4px;
  }

  .paper-wrap {
    padding: 19px 14px 21px;
  }

  .paper-clip,
  .paper-coordinate,
  .paper-caption span:last-child {
    display: none;
  }

  .paper-caption {
    justify-content: center;
  }

  .canvas-hint {
    gap: 8px;
  }

  .canvas-hint > svg,
  .canvas-hint > span:first-of-type,
  .canvas-hint .hint-divider {
    display: none;
  }

  .canvas-controls {
    grid-template-columns: 1fr;
    gap: 19px;
    padding: 18px;
  }

  .ink-selector {
    justify-content: center;
  }

  .api-route {
    display: none;
  }

  .inspector {
    display: flex;
    padding: 28px 22px;
  }

  .result-stage {
    padding-top: 34px;
  }

  .audit-pipeline {
    margin-top: 0;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .lead-gate {
    display: block;
    padding: 18px;
  }

  .gate-card {
    width: min(680px, 100%);
    margin: auto;
  }

  .gate-body {
    grid-template-columns: 1fr;
  }

  .gate-copy {
    min-height: 345px;
  }

  .gate-copy h2 {
    max-width: 520px;
  }
}

@media (max-width: 560px) {
  .lead-gate {
    padding: 9px;
  }

  .gate-head {
    min-height: 64px;
    padding: 0 17px;
  }

  .gate-access-code {
    font-size: 7px;
  }

  .gate-copy {
    min-height: auto;
    padding: 34px 24px 28px;
  }

  .gate-copy h2 {
    margin: 24px 0 18px;
    font-size: clamp(41px, 14vw, 58px);
  }

  .gate-copy > p:not(.eyebrow) {
    font-size: 11px;
  }

  .gate-capabilities {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    margin-top: 30px;
  }

  .lead-form {
    grid-template-columns: 1fr;
    gap: 17px;
    padding: 30px 23px 26px;
  }

  .lead-field-wide,
  .gate-submit,
  .gate-status {
    grid-column: 1;
  }

  .gate-foot {
    justify-content: center;
  }

  .gate-foot span:not(:first-child) {
    display: none;
  }

  .gate-geometry > b {
    display: none;
  }
}

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