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

:root {
  --ink: #11121a;
  --muted: #696b79;
  --line: #dedfe7;
  --paper: #fbfaf7;
  --white: #fff;
  --violet: #7357f6;
  --violet-dark: #5c42df;
  --mint: #a9f5d0;
  --shadow: 0 28px 80px rgba(35, 27, 78, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 16%, rgba(169,245,208,.32), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgba(115,87,246,.13), transparent 26rem),
    var(--paper);
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }

.nav {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: -.7px; }
.brand > span:last-child > span { color: var(--violet); }
.brand-mark { width: 28px; height: 28px; position: relative; display: inline-block; }
.brand-mark i { width: 12px; height: 12px; position: absolute; border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); }
.brand-mark i:nth-child(1) { left: 0; top: 8px; }
.brand-mark i:nth-child(2) { right: 0; top: 0; border-color: var(--violet); }
.brand-mark i:nth-child(3) { right: 0; bottom: 0; border-color: var(--violet); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; left: 11px; width: 7px; height: 2px; background: var(--ink); transform-origin: left; }
.brand-mark::before { top: 11px; transform: rotate(-30deg); }
.brand-mark::after { top: 16px; transform: rotate(30deg); }
.github-link { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; background: rgba(255,255,255,.68); font-size: 14px; font-weight: 700; transition: .2s ease; }
.github-link:hover { transform: translateY(-1px); border-color: #b7b8c4; background: var(--white); }
.github-link svg, .input-wrap svg { width: 19px; height: 19px; fill: currentColor; }
.nav-actions { display: flex; align-items: center; gap: 9px; }

.hero { text-align: center; padding: 92px 0 82px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: "DM Mono", monospace; color: #565865; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.eyebrow span { width: 8px; height: 8px; border-radius: 50%; background: #18b979; box-shadow: 0 0 0 5px rgba(24,185,121,.12); }
h1 { margin: 24px auto 22px; max-width: 880px; font-size: clamp(52px, 7.2vw, 92px); line-height: .99; letter-spacing: -.065em; font-weight: 800; }
h1 em { color: var(--violet); font-style: normal; }
.lede { max-width: 670px; margin: 0 auto; color: var(--muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.65; }

.repo-form { max-width: 840px; margin: 42px auto 0; }
.input-wrap { height: 72px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 8px 8px 22px; background: var(--white); border: 1px solid #d7d5e2; border-radius: 17px; box-shadow: 0 16px 50px rgba(39,32,77,.11); transition: .2s ease; }
.input-wrap:focus-within { border-color: var(--violet); box-shadow: 0 18px 60px rgba(93,66,223,.17), 0 0 0 4px rgba(115,87,246,.08); }
.input-wrap svg { color: #747682; flex: none; }
.input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-family: "DM Mono", monospace; font-size: 15px; }
.input-wrap input::placeholder { color: #a0a1ab; }
.input-wrap button, .primary-button { border: 0; border-radius: 11px; color: white; background: var(--violet); padding: 16px 20px; font-weight: 800; cursor: pointer; white-space: nowrap; transition: .2s ease; }
.input-wrap button:hover, .primary-button:hover { background: var(--violet-dark); transform: translateY(-1px); }
.input-wrap button:disabled { opacity: .65; cursor: wait; transform: none; }
.input-wrap button span { margin-left: 8px; font-size: 18px; }
.form-error { color: #ba2638; min-height: 22px; margin: 10px 0 0; font-size: 14px; }
.theme-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 2px 8px 15px; padding: 0; border: 0; text-align: left; }
.theme-picker legend { width: 100%; margin-bottom: 8px; color: #777985; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.theme-option { min-width: 0; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card { min-height: 76px; position: relative; display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #dcdae5; border-radius: 12px; background: rgba(255,255,255,.72); transition: .18s ease; }
.theme-card > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.theme-card strong { color: #292a35; font-size: 13px; }
.theme-card small { overflow: hidden; color: #858692; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.theme-card em { position: absolute; right: 9px; top: 7px; color: var(--violet-dark); font-size: 8px; font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.theme-option input:checked + .theme-card { border-color: var(--violet); background: #f7f5ff; box-shadow: 0 0 0 3px rgba(115,87,246,.08); }
.theme-option input:focus-visible + .theme-card { outline: 2px solid var(--violet); outline-offset: 2px; }
.theme-preview { height: 50px; position: relative; display: flex; align-items: center; justify-content: space-between; padding: 0 5px; border-radius: 7px; background-color: #fff; background-image: radial-gradient(#dedce8 .7px, transparent .7px); background-size: 7px 7px; }
.theme-preview i { width: 28px; height: 24px; display: grid; place-items: center; border: 1.5px solid #6751de; border-radius: 6px; color: #6751de; background: white; font-size: 8px; font-style: normal; font-weight: 800; }
.theme-preview b { width: 20px; height: 1.5px; position: relative; background: #454653; }
.theme-preview b::after { content: ""; position: absolute; right: -1px; top: -3px; border-width: 4px 0 4px 5px; border-style: solid; border-color: transparent transparent transparent #454653; }
.icon-preview i { transform: rotate(-1deg); box-shadow: 1px 1px 0 rgba(30,25,62,.12); }
.brand-preview i:first-child { border-color: #087ea4; color: #087ea4; border-radius: 50%; }
.brand-preview i:last-child { border-color: #ff9900; color: #ff9900; font-size: 7px; }
.classic-preview i { border-color: #8a8c97; border-radius: 3px; color: transparent; }
.private-panel { margin: 2px 8px 0; color: #666875; text-align: left; font-size: 12px; }
.private-panel summary { width: max-content; display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 700; }
.private-panel summary::marker { display: none; }
.private-panel .lock-mark { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 6px; color: var(--violet); background: #eeeaff; font-size: 8px; transform: rotate(45deg); }
.pat-guide { margin-top: 12px; padding: 15px; border: 1px solid #dedbe9; border-radius: 12px; background: rgba(246,244,255,.72); }
.pat-guide-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pat-guide-head > div { display: flex; flex-direction: column; gap: 2px; }
.pat-guide-head strong { color: #292a35; font-size: 13px; }
.pat-guide-head span { color: #898a94; font-size: 10px; }
.pat-guide-head a { padding: 8px 10px; border-radius: 8px; color: white; background: var(--violet); font-weight: 800; white-space: nowrap; }
.pat-guide-head a:hover { background: var(--violet-dark); }
.pat-guide ol { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 14px 0 0; padding: 0; list-style: none; }
.pat-guide li { min-height: 62px; display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 8px; padding: 10px; border: 1px solid #e3e0ee; border-radius: 9px; background: rgba(255,255,255,.8); line-height: 1.45; }
.pat-guide li > b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--violet-dark); background: #ebe7ff; font-family: "DM Mono", monospace; font-size: 10px; }
.pat-guide code { color: #4f3bc3; font-family: "DM Mono", monospace; font-size: 10px; }
.token-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 12px; }
.token-input { min-height: 44px; display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid #d8d7df; border-radius: 10px; background: white; overflow: hidden; }
.token-input:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(115,87,246,.08); }
.token-input input { min-width: 0; padding: 11px 13px; border: 0; outline: 0; background: transparent; font-family: "DM Mono", monospace; font-size: 13px; }
.token-input button { height: 30px; margin-right: 7px; padding: 0 9px; border: 0; border-radius: 7px; color: #666875; background: #f2f2f5; cursor: pointer; font-size: 11px; font-weight: 750; }
.token-ready { color: #797a85; font-weight: 700; white-space: nowrap; }
.private-panel > p { margin: 8px 0 0; color: #858691; line-height: 1.5; }

.progress-card { max-width: 840px; margin: 20px auto 0; padding: 18px 20px; text-align: left; border: 1px solid #dedbe9; background: rgba(255,255,255,.86); border-radius: 14px; box-shadow: 0 16px 45px rgba(45,37,84,.08); }
.progress-head, .progress-head > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress-head strong { font-size: 14px; }
.progress-head > span { font-family: "DM Mono", monospace; color: var(--violet); font-size: 13px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #d9d1ff; border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { height: 7px; margin: 14px 0 9px; border-radius: 99px; background: #eceaf2; overflow: hidden; }
.progress-track span { display: block; width: 5%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), #9f8aff); transition: width .45s ease; }
.progress-card p { margin: 0; color: var(--muted); font-size: 12px; }
.trust-row { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 9px 22px; color: #737580; font-size: 12px; }
.trust-row i { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 4px; border-radius: 50%; color: #087a50; background: #dff8ec; font-style: normal; font-weight: 800; }

.demo { padding: 28px 0 120px; }
.demo-window { overflow: hidden; border: 1px solid #d8d7df; border-radius: 19px; background: #fff; box-shadow: var(--shadow); transform: perspective(1400px) rotateX(1.2deg); }
.window-bar { height: 47px; display: flex; align-items: center; gap: 7px; padding: 0 16px; border-bottom: 1px solid #e7e6eb; background: #f7f7f8; }
.window-bar > span { width: 10px; height: 10px; border-radius: 50%; background: #d0d1d6; }
.window-bar > span:first-child { background: #ff6b64; }
.window-bar > span:nth-child(2) { background: #ffca56; }
.window-bar > span:nth-child(3) { background: #5dd488; }
.window-bar small { margin: auto; transform: translateX(-20px); color: #888993; font-family: "DM Mono", monospace; }
.diagram-sample { height: 410px; position: relative; overflow: hidden; background-color: #fff; background-image: radial-gradient(#d8d9de 1px, transparent 1px); background-size: 18px 18px; }
.sample-group { position: absolute; left: 31%; right: 4%; top: 52px; bottom: 38px; border: 2px dashed #c7c1e6; border-radius: 18px; background: rgba(247,245,255,.7); }
.sample-group > label { position: absolute; top: 15px; left: 20px; color: #645c8b; font-size: 13px; font-weight: 800; }
.sample-node { width: 155px; height: 82px; position: absolute; z-index: 2; display: grid; place-content: center; gap: 3px; border: 2px solid #343643; border-radius: 13px; background: white; box-shadow: 4px 5px 0 rgba(17,18,26,.08); text-align: center; }
.sample-node b { font-size: 15px; }
.sample-node small { color: #777985; }
.user-node { left: 6%; top: 164px; border-color: #343643; }
.web-node { left: 8%; top: 122px; border-color: #7357f6; }
.api-node { left: 39%; top: 122px; border-color: #2681d8; }
.db-node { right: 5%; top: 122px; border-color: #16a16b; border-radius: 50% / 18%; }
.sample-arrow { position: absolute; z-index: 1; color: #6d6f7c; font-family: "DM Mono", monospace; font-size: 11px; white-space: nowrap; }
.sample-arrow span { margin-left: 7px; color: #343643; font-size: 30px; vertical-align: -3px; }
.arrow-one { left: 22%; top: 184px; }
.arrow-two { left: 30%; top: 144px; }
.arrow-three { left: 63%; top: 144px; }
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 50px; padding: 55px 28px 0; }
.steps article { position: relative; padding-left: 50px; }
.steps article > span { position: absolute; left: 0; top: 1px; color: var(--violet); font-family: "DM Mono", monospace; font-size: 13px; }
.steps h2 { margin: 0 0 7px; font-size: 17px; letter-spacing: -.02em; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
footer { min-height: 80px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #7a7b85; font-size: 13px; }
footer a:hover { color: var(--violet); }

.editor-body { height: 100vh; overflow: hidden; background: #f4f4f6; }
.editor-nav { height: 64px; display: grid; grid-template-columns: 230px 1fr auto; align-items: center; gap: 20px; padding: 0 18px; border-bottom: 1px solid #d9dae0; background: #fff; }
.editor-title { min-width: 0; display: flex; flex-direction: column; text-align: center; }
.editor-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.editor-title span { color: #777985; font-size: 11px; }
.editor-actions { display: flex; align-items: center; gap: 9px; }
.secondary-button, .primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 9px; padding: 9px 13px; font-size: 12px; }
.secondary-button { border: 1px solid #d8d9df; background: #fff; color: #343642; font-weight: 700; cursor: pointer; }
.secondary-button:hover { background: #f7f7f8; }
.editor-main { height: calc(100vh - 64px); position: relative; }
#drawio-frame { width: 100%; height: 100%; display: block; border: 0; background: #fff; }
.editor-error { position: absolute; z-index: 5; top: 20px; left: 50%; transform: translateX(-50%); max-width: 560px; padding: 13px 18px; color: #84202d; background: #fff0f1; border: 1px solid #f0b4bc; border-radius: 9px; box-shadow: 0 10px 30px rgba(80,20,30,.15); font-size: 13px; }

@media (max-width: 780px) {
  .hero { padding-top: 62px; }
  h1 { letter-spacing: -.05em; }
  .input-wrap { height: auto; grid-template-columns: auto 1fr; padding: 16px; }
  .input-wrap button { grid-column: 1 / -1; width: 100%; }
  .github-link { display: inline-flex; font-size: 12px; padding: 8px 10px; }
  .token-row { grid-template-columns: 1fr; }
  .theme-picker { grid-template-columns: 1fr; }
  .pat-guide-head { align-items: flex-start; flex-direction: column; }
  .pat-guide ol { grid-template-columns: 1fr; }
  .diagram-sample { height: 330px; transform-origin: top left; }
  .sample-group { left: 28%; right: -25%; transform: scale(.78); transform-origin: left center; }
  .user-node { left: 3%; transform: scale(.8); transform-origin: left center; }
  .arrow-one { left: 20%; }
  .steps { grid-template-columns: 1fr; gap: 28px; padding-inline: 5px; }
  .editor-nav { grid-template-columns: auto 1fr; }
  .editor-actions { grid-column: 1 / -1; position: absolute; right: 8px; bottom: 8px; z-index: 5; }
  .editor-title { text-align: right; }
  .editor-nav { height: 58px; }
  .editor-main { height: calc(100vh - 58px); }
  .secondary-button { display: none; }
}

[hidden] { display: none !important; }
.hero { padding-top: 48px; padding-bottom: 36px; }
h1 { font-size: clamp(42px, 6vw, 76px); line-height: 1.08; }
.privacy-note { max-width: 800px; margin: 20px auto 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.style-panel { margin: 8px 8px 18px; text-align: left; }
.style-panel summary { cursor: pointer; color: #595b69; font-size: 14px; font-weight: 700; }
.style-panel .theme-picker { margin-top: 14px; }
.instant-examples { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 24px auto 0; font-size: 14px; }
.instant-examples > span { width: 100%; color: var(--muted); }
.instant-examples a { padding: 10px 14px; background: white; border: 1px solid var(--line); border-radius: 9px; color: var(--violet-dark); font-weight: 700; }
.real-preview { display: block; background: white; padding: 20px; }
.real-preview img { display: block; width: 100%; height: auto; }
.example-caption { color: var(--muted); font-size: 14px; line-height: 1.6; }
.example-caption a, .limitations a { color: var(--violet-dark); text-decoration: underline; }
.limitations { margin-top: 44px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; }
.limitations h2 { font-size: 20px; margin-top: 0; }
.limitations p { color: var(--muted); font-size: 16px; line-height: 1.7; }
.example-notice { position: absolute; top: 0; left: 0; right: 0; padding: 9px 16px; background: #f1efff; color: #403664; border-bottom: 1px solid #d3cbed; font-size: 13px; z-index: 4; line-height: 1.5; }
.editor-main { display: flex; flex-direction: column; }
.example-notice { position: static; flex: none; }
#drawio-frame { flex: 1; min-height: 0; height: auto; }
.editor-actions .github-link { font-size: 12px; }
@media (max-width: 780px) {
  .hero { padding-top: 32px; }
  .nav { height: 68px; }
  .brand { font-size: 16px; }
  .theme-card { min-height: 60px; }
  .real-preview { padding: 6px; }
  .editor-main { padding-bottom: 52px; }
  .editor-actions { max-width: calc(100vw - 16px); flex-wrap: wrap; }
  .editor-title { font-size: 12px; }
  .instant-examples a { flex: 1 1 150px; }
}
