/* =========================
   Global reset & variables
   ========================= */
:root {
  --bg-main: #0e1117;
  --bg-panel: #161b22;
  --bg-hover: #1f2633;

  --text-main: #e6edf3;
  --text-muted: #9aa4b2;

  --accent-primary: #58a6ff;
  --accent-secondary: #7ee787;
  --danger: #ff7b72;

  --border: #30363d;

  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

/* =========================
   Links & buttons
   ========================= */
a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn.primary {
  background-color: var(--accent-primary);
  color: #000;
}

.btn.primary:hover {
  background-color: #7cb8ff;
  transform: translateY(-1px);
}

.btn.secondary {
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn.secondary:hover {
  background-color: var(--bg-hover);
}

/* =========================
   Header
   ========================= */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  font-weight: 700;
  letter-spacing: 0.03em;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--text-main);
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--accent-primary);
}

/* =========================
   Landing page
   ========================= */
.landing {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.hero {
  margin-bottom: 4rem;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.subtitle {
  max-width: 600px;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* =========================
   Features
   ========================= */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feature {
  background-color: var(--bg-panel);
  padding: 1.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.feature h2 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.feature p {
  color: var(--text-muted);
}

/* =========================
   Status note
   ========================= */
.status-note {
  background-color: rgba(255, 123, 114, 0.08);
  border: 1px solid var(--danger);
  padding: 1.2rem;
  border-radius: var(--radius);
}

.status-note p {
  color: var(--text-main);
}

/* =========================
   Footer
   ========================= */
.site-footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background-color: var(--bg-panel);
}

.site-footer .muted {
  color: var(--text-muted);
}

.site-footer .small {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* =========================
   Responsive tweaks
   ========================= */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .site-header {
    flex-direction: column;
    gap: 1rem;
  }
}
/* =========================
   Header + Burger Menu
   ========================= */

.header-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-main);
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
}

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

/* Right side */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.login-link {
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  color: var(--text-main);
}

.login-link:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

/* Burger button */
.burger {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease;
}

.burger:active {
  transform: scale(0.96);
}

.burger.is-active {
  background: var(--bg-hover);
}

.burger-lines {
  width: 18px;
  height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger-lines span {
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

/* Turn into X when active */
.burger.is-active .burger-lines span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.burger.is-active .burger-lines span:nth-child(2) {
  opacity: 0;
}

.burger.is-active .burger-lines span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Slide-out menu container */
.menu {
  position: fixed;
  top: 0;
  right: 0;              /* was left: 0 */
  left: auto;            /* ensure left is not used */
  height: 100dvh;
  width: min(360px, 92vw);
  background: var(--bg-panel);
  border-left: 1px solid var(--border);   /* was border-right */
  border-right: none;
  transform: translateX(102%);            /* was -102% */
  transition: transform 0.22s ease;
  z-index: 1000;
}

.menu.is-open {
  transform: translateX(0);
}

.menu-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Menu header */
.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border);
}

.menu-title {
  font-weight: 800;
}

.menu-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  cursor: pointer;
}

.menu-close:hover {
  background: var(--bg-hover);
}

/* Menu list */
.menu-list {
  list-style: none;
  padding: 0.75rem;
  overflow: auto;
  flex: 1;
}

.menu-item {
  margin-bottom: 0.5rem;
}

.menu-cat,
.menu-link {
  width: 100%;
  text-align: right;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
}

.menu-link {
  text-decoration: none;
}

.menu-cat:hover,
.menu-link:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.chev {
  opacity: 0.8;
  transform: translateX(0);
  transition: transform 0.18s ease;
}

/* Submenu (fold-out on hover for desktop, click for mobile) */
.submenu {
  list-style: none;
  margin-top: 0.35rem;
  margin-right: 0.35rem;
  border-right: 1px solid var(--border);
  padding-right: 0.55rem;

  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease;
}

/* Desktop hover behavior */
@media (hover: hover) and (pointer: fine) {
  .has-submenu:hover .submenu {
    max-height: 400px;
  }
  .has-submenu:hover .chev {
    transform: translateX(2px);
  }
}

/* JS-driven open state */
.has-submenu.is-open .submenu {
  max-height: 400px;
}

.submenu li a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-align: right;
}

.submenu li a:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  text-decoration: none;
}

/* Menu footer hint */
.menu-foot {
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--border);
}

.menu-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Backdrop */
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 900;
}

/* Make header stay in normal flow (your header already has background/border) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 800;
}

/* =========================
   Interactive landing upgrades
   ========================= */

.hero-interactive {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: start;
}

.section-title {
  font-size: 1.35rem;
  margin: 1.2rem 0 0.7rem;
}

.expectations {
  margin-top: 1.6rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.expect-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  margin-right: 0.6rem;
  border: 1px solid var(--border);
}

.pill.ok {
  color: var(--accent-secondary);
}

.pill.soon {
  color: var(--text-muted);
}

.demo-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.demo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.demo-title {
  font-weight: 800;
}

.demo-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.demo-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.preview-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(255,255,255,0.02);
}

.preview-panel h3 {
  margin-bottom: 0.5rem;
}

.tiny {
  font-size: 0.9rem;
}

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

.status-row {
  display: grid;
  grid-template-columns: 1fr 16px 1fr;
  gap: 0.6rem;
  align-items: center;
  padding: 0.35rem 0;
}

.status-label {
  color: var(--text-muted);
}

.status-text {
  text-align: right;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.status-dot.ok { background: var(--accent-secondary); }
.status-dot.warn { background: #f2cc60; }
.status-dot.down { background: var(--danger); }
.status-dot.soon { background: #6b7280; }

.bits {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.45rem;
  margin: 0.7rem 0 0.9rem;
}

.bit {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0;
  font-weight: 900;
  cursor: pointer;
  background: transparent;
  color: var(--text-main);
  transition: transform 0.08s ease, background 0.2s ease;
}

.bit:active {
  transform: scale(0.98);
}

.bit.on {
  background: rgba(126, 231, 135, 0.15);
}

.bit.off {
  background: rgba(88, 166, 255, 0.08);
}

.binary-readout {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.readout-item {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  background: rgba(0,0,0,0.15);
}

.readout-label {
  color: var(--text-muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.btn.small {
  padding: 0.55rem 0.9rem;
}

.paths {
  margin-top: 2.2rem;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.8rem;
}

.path-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.9rem;
  padding: 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-main);
  text-decoration: none;
  transition: transform 0.12s ease, background 0.2s ease;
}

.path-card:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.path-icon {
  font-size: 1.6rem;
  display: grid;
  place-items: center;
}

.path-cta {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent-primary);
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero-interactive {
    grid-template-columns: 1fr;
  }
}
/* =========================
   Landing: Progress card
   ========================= */

.progress-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.progress-title {
  font-weight: 800;
}

.progress-source {
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.progress-body {
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  background: rgba(0,0,0,0.15);
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  transition: width 0.25s ease;
}

.progress-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
/* =========================
   Header auth buttons
   ========================= */

.auth {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.login-link.secondary {
  background: transparent;
}

.logout-btn {
  border: 1px solid var(--danger);
  color: var(--danger);
  background: transparent;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}

.logout-btn:hover {
  background: rgba(255, 123, 114, 0.12);
}
