/* Cryios Labs — app dashboard (labs.cryios.com) */

:root {
  --bg: #0A0B0F;
  --side: #0C0D12;
  --surface-1: #0F1117;
  --surface-2: #12141A;
  --surface-3: #1A1D26;
  --hover-dark: #262B38;
  --border: #1F232D;
  --border-2: #2A2E3A;
  --border-node: #232838;
  --ink: #F5F7FA;
  --ink-2: #C9CED9;
  --muted: #A0A7B8;
  --muted-2: #8A90A0;
  --faint: #5A6172;
  --brand: #0052FF;
  --brand-2: #2F6BFF;
  --brand-soft: #7FA6FF;
  --brand-deep: #0F1E40;
  --brand-line: #1F3A80;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Layout */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; animation: pageIn .4s ease-out both; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 22px 16px; background: var(--side); border-right: 1px solid var(--border); overflow-y: auto; scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-weight: 700; font-size: 17px; }
.side-pill { font-size: 10px; font-weight: 700; letter-spacing: .8px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--brand-line); color: var(--brand-soft); }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { padding: 0 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; color: var(--faint); }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; font-size: 14px; color: var(--muted); transition: background-color .2s ease, color .2s ease; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.is-active { background: var(--surface-3); color: var(--ink); }
.side-link .side-end { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }

/* Badges */
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge--live { background: var(--brand-deep); color: var(--brand-soft); }

/* Main column */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 16px 32px; background: rgba(10,11,15,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); align-items: center; justify-content: center; cursor: pointer; }
.search { position: relative; flex: 1 1 auto; max-width: 440px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input { width: 100%; height: 42px; padding: 0 44px 0 40px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-1); color: var(--ink); font: inherit; font-size: 14px; transition: border-color .2s ease; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--brand-2); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; color: var(--faint); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer; transition: background-color .3s ease, transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--light { background: #FFFFFF; color: var(--bg); }
.btn--light:hover { background: #DCE3F0; box-shadow: 0 8px 24px rgba(255,255,255,.08); }
.btn--dark { background: var(--surface-3); color: var(--ink); }
.btn--dark:hover { background: var(--hover-dark); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.btn--lg { font-size: 16px; padding: 14px 26px; }

/* Content */
.content { width: 100%; max-width: 1180px; padding: 40px 32px 72px; display: flex; flex-direction: column; gap: 32px; }
.page-head h1 { font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -1px; }
.page-head p { margin-top: 10px; max-width: 620px; font-size: 16px; line-height: 25px; color: var(--muted); }

/* Featured */
.featured { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 36px; border-radius: 28px; background: radial-gradient(ellipse 60% 90% at 85% 50%, rgba(0,82,255,.22), transparent 70%), var(--surface-1); border: 1px solid var(--border-node); overflow: hidden; }
.featured__label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--brand-soft); }
.featured h2 { margin-top: 12px; font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -.6px; }
.title-with-logo { display: flex; align-items: center; gap: 12px; }
.tool .title-with-logo { gap: 8px; }
.featured p { margin-top: 12px; font-size: 16px; line-height: 25px; color: var(--muted); max-width: 440px; }
.featured .actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }

/* Deployer window mock */
.window { width: 100%; max-width: 460px; justify-self: end; border-radius: 20px; background: var(--bg); border: 1px solid var(--border-node); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.window-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.window-url { margin-left: auto; font-size: 12px; color: var(--faint); }
.window-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv span:first-child { color: var(--muted-2); }
.addr-box { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.addr-label { font-size: 12px; color: var(--muted-2); }
.addr { margin-top: 8px; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.addr b { font-weight: 500; color: var(--brand-2); }
.caret { color: var(--brand-2); animation: caret 1s steps(1) infinite; }
.mock-btn { display: block; padding: 11px; border-radius: 999px; background: var(--brand); color: #FFFFFF; font-size: 13px; font-weight: 600; text-align: center; transition: background-color .25s ease, box-shadow .25s ease; }
a.mock-btn:hover { background: var(--brand-2); box-shadow: 0 8px 28px rgba(0,82,255,.35); }
.kv--input { align-items: center; cursor: text; }
.prefix-field { display: inline-flex; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-2); transition: border-color .2s ease, box-shadow .2s ease; }
.prefix-field:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(47,107,255,.18); }
.prefix-field.is-invalid { border-color: #E5484D; box-shadow: 0 0 0 3px rgba(229,72,77,.15); }
.prefix-0x { font-size: 13px; color: var(--faint); }
.prefix-field input { width: 6.2ch; padding: 0; border: 0; background: transparent; color: var(--brand-soft); font-size: 13px; text-align: left; outline: none; }
.prefix-hint { margin-top: -4px; font-size: 12px; color: var(--faint); text-align: right; transition: color .2s ease; }
.prefix-hint.is-error { color: #FF8589; }
.preview-tag { margin-left: 6px; font-size: 10px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-2); color: var(--faint); }
.addr.is-scrambling span[data-addr-rest] { color: var(--muted-2); }

/* Toolbar: filters */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.toolbar h2 { font-size: 22px; font-weight: 700; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.tab .count { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.tab[aria-pressed="true"] .count { color: var(--brand-soft); }

/* Tool cards */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tool { display: flex; flex-direction: column; min-height: 340px; padding: 24px; border-radius: 24px; background: var(--surface-1); border: 1px solid var(--border); transition: border-color .25s ease, background-color .25s ease; scroll-margin-top: 100px; }
.tool:hover { border-color: #24407F; background: #11141C; }
.tool[hidden] { display: none; }
.tool__visual { flex: 1; min-height: 140px; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 20px; overflow: hidden; }
.tool__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool h3 { font-size: 20px; font-weight: 700; }
.tool p { margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--muted); }
.tool__foot { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; }
.tool__state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot--live { background: #2BC48A; box-shadow: 0 0 0 4px rgba(43,196,138,.12); }
.dot--beta { background: var(--brand-soft); }
.tool__link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand-soft); transition: color .2s ease; }
.tool__link:hover { color: #FFFFFF; }

/* Visual: mini prefix */
.mini-addr { font-family: var(--mono); font-size: 15px; color: var(--ink-2); }
.mini-addr b { font-weight: 500; color: var(--brand-2); }

/* Visual: channel */
.channel { display: flex; align-items: center; width: 100%; padding: 0 20px; }
.channel-node { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-node); display: flex; align-items: center; justify-content: center; }
.channel-line { position: relative; flex: 1; height: 2px; margin: 0 10px; background: linear-gradient(90deg, var(--brand-line), var(--brand), var(--brand-line)); }
.flow-dot { position: absolute; top: 50%; left: 0; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 10px rgba(47,107,255,.9); animation: flow 1.1s linear infinite; }
.flow-dot--2 { animation-delay: .37s; }
.flow-dot--3 { animation-delay: .74s; }

/* Visual: orbit */
.orbit-wrap { position: relative; width: 100px; height: 100px; }
.ring { position: absolute; border-radius: 50%; }
.ring--outer { inset: 0; border: 1px solid var(--border-node); }
.ring--mid { inset: 18px; border: 1px dashed var(--border-2); }
.ring--core { inset: 38px; background: var(--brand-deep); border: 1px solid var(--brand); box-shadow: 0 0 26px rgba(0,82,255,.4); }
.orbit { position: absolute; inset: 0; animation: orbit 6s linear infinite; }
.orbit--slow { inset: 18px; animation: orbit 11s linear infinite reverse; }
.orbit-dot { position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 10px rgba(47,107,255,.9); }
.orbit--slow .orbit-dot { top: auto; bottom: -3px; width: 6px; height: 6px; margin-left: -3px; background: var(--brand-soft); box-shadow: none; }

/* Empty state */
.empty { padding: 48px 24px; border-radius: 24px; border: 1px dashed var(--border-2); text-align: center; color: var(--muted); font-size: 15px; }
.empty[hidden] { display: none; }

/* Footer */
.app-footer { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 24px 32px; border-top: 1px solid var(--border); font-size: 13px; color: var(--faint); }
.app-footer nav { display: flex; gap: 20px; }
.app-footer a:hover { color: var(--ink); }

/* Mobile drawer backdrop */
.backdrop { display: none; }

/* Keyframes */
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes flow { 0% { left: 0%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes caret { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .app, .orbit, .caret { animation: none; }
  .flow-dot { display: none; }
  .btn:hover, .btn:active { transform: none; }
}

/* Tablet */
@media (max-width: 1080px) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { grid-template-columns: minmax(0, 1fr); }
  .window { justify-self: stretch; max-width: none; }
}

/* Phones and small tablets: sidebar becomes a drawer */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 280px; height: auto; transform: translateX(-100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
  .app.nav-open .sidebar { transform: none; }
  .backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
  .app.nav-open .backdrop { opacity: 1; visibility: visible; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .search kbd { display: none; }
  .topbar-actions .btn { padding: 10px 14px; }
  .content { padding: 28px 16px 56px; gap: 24px; }
  .page-head h1 { font-size: 32px; line-height: 38px; }
  .featured { padding: 24px; border-radius: 22px; }
  .featured h2 { font-size: 26px; line-height: 32px; }
  .featured .actions .btn { flex: 1 1 100%; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .tool { min-height: 0; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .tabs { width: 100%; overflow-x: auto; }
  .app-footer { padding: 20px 16px; }
}
@media (max-width: 420px) {
  .topbar-actions .btn span { display: none; }
}
