/* Z5 Unlimited site — palette matches desktop app (Consolas + slate/cyan) */

:root {
  --z5-base: #0e1014;
  --z5-surf: #12151c;
  --z5-elev: #161a22;
  --z5-line: #262c38;
  --z5-txt: #d2dae4;
  --z5-sec: #96a2b2;
  --z5-mut: #5f6c7d;
  --z5-cyan: #78c8ff;
  --z5-green: #82dc9a;
  --z5-amber: #e6be6e;
  --z5-red: #f06e6e;
  --font-mono: Consolas, "Cascadia Mono", "Lucida Console", monospace;

  --bg: var(--z5-base);
  --panel: var(--z5-surf);
  --line: var(--z5-line);
  --text: var(--z5-txt);
  --muted: var(--z5-sec);
  --blue: var(--z5-cyan);
  --green: var(--z5-green);
  --red: var(--z5-red);
  --radius: 4px;
  --inv-bg: var(--z5-base);
  --inv-line: var(--z5-line);
  --inv-blue: var(--z5-cyan);
  --inv-text: var(--z5-txt);
  --inv-muted: var(--z5-mut);
  --inv-green: var(--z5-green);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
iframe {
  max-width: 100%;
  height: auto;
}

body.z5-site {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--z5-base);
}

/* Vertical shell — header, nav bar, full-width content (no side-by-side columns) */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: var(--z5-surf);
  position: sticky;
  top: 0;
  z-index: 140;
  flex-shrink: 0;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}

.site-header__logo {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: block;
}

.site-header__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-header__text strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--z5-txt);
  line-height: 1.2;
}

.site-header__text small {
  font-size: 10px;
  color: var(--z5-mut);
}

.site-header__page {
  flex: 1 1 100%;
  order: 3;
  min-width: 0;
  padding-top: 2px;
}

.site-header__title {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--z5-txt);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 16px;
  background: var(--z5-surf);
  z-index: 130;
}

.rail-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.rail-drawer-head__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--z5-mut);
}

.rail-close {
  padding: 6px 10px;
  min-width: 40px;
  min-height: 40px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: var(--z5-sec);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-item:hover {
  color: var(--z5-txt);
  border-color: var(--z5-line);
  background: var(--z5-elev);
}

.nav-item.active {
  color: var(--z5-cyan);
  border-color: rgba(120, 200, 255, 0.45);
  background: rgba(120, 200, 255, 0.1);
}

.nav-item__ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 12px;
  color: var(--z5-cyan);
  background: rgba(120, 200, 255, 0.08);
  border: 1px solid var(--z5-line);
}

.nav-item.active .nav-item__ico {
  color: var(--z5-txt);
  border-color: rgba(120, 200, 255, 0.5);
  background: rgba(120, 200, 255, 0.18);
}

.nav-item__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-item__label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.nav-item__hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(200, 220, 240, 0.45);
  line-height: 1.25;
}

.nav-item.active .nav-item__hint {
  color: rgba(200, 220, 240, 0.62);
}

.rail-spacer {
  flex: 1;
  min-height: 12px;
}

.status-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 24, 0.65);
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 8, 14, 0.75);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-backdrop[hidden] {
  display: block;
  opacity: 0;
  pointer-events: none;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  flex-shrink: 0;
  order: -1;
}

.sidebar-toggle__label {
  font-size: 11px;
  font-weight: 700;
}

.topbar-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--inv-blue);
  box-shadow: 0 0 10px var(--inv-blue);
}

.dot.warn {
  background: #ffb347;
  box-shadow: 0 0 10px #ffb347;
}

.rail-foot {
  font-size: 11px;
  line-height: 1.4;
  word-break: break-all;
}

.rail-foot a {
  text-decoration: none;
}

.rail-foot a:hover {
  color: var(--z5-cyan);
}

.workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 14px 16px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.app-content {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.app-content--home {
  max-width: 720px;
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  color: var(--z5-mut);
}

.top-lede {
  margin: 0;
  max-width: 52ch;
  font-size: 15px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.page {
  animation: fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page-head {
  margin-bottom: 18px;
}

.page-head h2 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.page-lede {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.page-loader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 26, 0.6);
  color: var(--muted);
  font-size: 14px;
}

.page-loader[hidden] {
  display: none;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--inv-blue);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ov-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ov-metric {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12, 22, 38, 0.9), rgba(6, 10, 18, 0.85));
  transition: border-color 0.25s, transform 0.25s;
}

.ov-metric:hover {
  border-color: var(--inv-blue-dim);
  transform: translateY(-2px);
}

.ov-metric span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ov-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-weight: 700;
  color: var(--inv-blue);
}

/* License serial — blurred until revealed */
.ov-metric--license .ov-license-secret {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  font-size: clamp(13px, 2.2vw, 20px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--inv-blue);
  cursor: pointer;
  letter-spacing: 0.03em;
}

.ov-metric--license .ov-license-secret__text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  filter: blur(3px);
  opacity: 0.55;
  user-select: none;
  pointer-events: none;
  transition: filter 0.22s ease, opacity 0.22s ease;
}

.ov-metric--license .ov-license-secret.is-revealed .ov-license-secret__text {
  filter: none;
  opacity: 1;
  user-select: text;
}

.ov-metric--license .ov-license-secret::after {
  content: "hidden";
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  filter: none;
  opacity: 0.85;
}

.ov-metric--license .ov-license-secret.is-revealed::after {
  content: "visible";
  color: var(--ok);
}

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

.ov-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 26, 0.72);
  padding: 16px 18px;
}

.ov-panel-wide {
  grid-column: 1 / -1;
}

.ov-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ov-panel-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.ov-badge {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.ov-badge.ok {
  color: var(--inv-green);
  border-color: rgba(92, 255, 138, 0.35);
}

.ov-badge.warn {
  color: #ffb347;
  border-color: rgba(255, 179, 71, 0.35);
}

.ov-facts {
  margin: 0;
  display: grid;
  gap: 10px;
}

.ov-facts div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  font-size: 14px;
}

.ov-facts dt {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
}

.ov-facts dd {
  margin: 0;
  font-weight: 600;
}

.ov-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(12, 22, 38, 0.9);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 14px;
}

.ov-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1a6a9a, var(--inv-blue));
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ov-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ov-hint {
  margin: 14px 0 0;
  font-size: 14px;
}

.ov-hint.bad {
  color: var(--inv-red);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.bad {
  color: var(--inv-red);
}

button,
.solid,
.ghost {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

button:active {
  transform: scale(0.98);
}

.solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(120, 200, 255, 0.5);
  background: rgba(120, 200, 255, 0.14);
  color: var(--z5-txt);
  padding: 8px 14px;
  font-weight: 700;
  text-decoration: none;
}

.solid:hover {
  background: rgba(120, 200, 255, 0.22);
  border-color: var(--z5-cyan);
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--z5-elev);
  color: var(--z5-txt);
  padding: 8px 14px;
  font-weight: 700;
  text-decoration: none;
}

.ghost:hover {
  border-color: var(--z5-cyan);
  color: var(--z5-cyan);
}

.card-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--z5-surf);
  padding: 12px 14px;
}

.muted {
  color: var(--z5-sec);
}

.small {
  font-size: 11px;
}

.ghost.narrow,
.solid.narrow {
  padding: 8px 12px;
  font-size: 13px;
}

.search {
  border: 1px solid var(--line);
  background: rgba(8, 14, 26, 0.9);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
}

.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.page-enter {
  animation: fade-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Mobile / tablet: slide-over menu */
@media (max-width: 1023px) {
  .sidebar-backdrop {
    display: block;
  }

  body.sidebar-open {
    overflow: hidden;
    touch-action: none;
  }

  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 92vw);
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.5);
    border-right: 1px solid var(--line);
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  body.sidebar-open .rail {
    transform: translateX(0);
	z-index: 1000;
  }

  .rail-foot {
    margin-top: auto;
    padding-top: 12px;
  }
}

/* Desktop: horizontal nav strip under header (single column layout) */
@media (min-width: 1024px) {
  .sidebar-toggle,
  .sidebar-toggle__label,
  .rail-drawer-head,
  .rail-close {
    display: none !important;
  }

  .site-header__page {
    flex: 0 1 auto;
    order: 0;
    margin-left: auto;
    text-align: right;
    padding-top: 0;
  }

  .site-header__page .eyebrow {
    text-align: right;
  }

  .rail {
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 8px 18px 10px;
    border-bottom: 1px solid var(--line);
    transform: none;
    box-shadow: none;
    overflow: visible;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1;
    gap: 6px;
    padding: 0;
  }

  .nav-item {
    flex: 0 1 auto;
    padding: 6px 10px;
  }

  .nav-item__hint {
    display: none;
  }

  .rail-foot {
    margin: 0;
    padding: 0;
    font-size: 10px;
    white-space: nowrap;
  }

  .ov-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 8px 12px;
    gap: 8px;
  }

  .site-header__text small {
    display: none;
  }

  .site-header__page {
    order: 3;
  }

  .workspace {
    padding: 12px 12px 24px;
  }

  .sidebar-toggle__label {
    display: none;
  }

  .nav-item__hint {
    display: block;
  }

  .home-cta .btn,
  .home-cta .solid,
  .home-cta .ghost,
  .download-actions .solid,
  .download-actions .ghost,
  .download-license-form .solid,
  .guide-actions .solid,
  .guide-actions .ghost,
  .purchase-discord .solid,
  .purchase-binance .purchase-copy-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .site-header__logo {
    width: 32px;
    height: 32px;
  }

  .nav-item__ico {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rail,
  .sidebar-backdrop {
    transition: none;
  }
}
