:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #0b1220;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --border: #1f2937;
  --code: #020617;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.5;
}

/* ==================== LAYOUT ==================== */
.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px;
  width: 240px;
  transition: transform 0.3s ease;
}

@media (min-width: 901px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
}

/* Mobile Sidebar (Drawer) */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    width: 260px;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

/* ==================== SIDEBAR CONTENT ==================== */
.brand {
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

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

.nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav a:hover,
.nav a.active {
  background: var(--panel-2);
  color: var(--text);
}

/* ==================== MAIN CONTENT ==================== */
.main {
  padding: clamp(16px, 3vw, 32px) clamp(14px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ==================== HERO SECTION ==================== */
.hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kicker {
  font-size: clamp(1.1rem, 4vw, 2.1rem);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
}

.subtitle {
  font-size: clamp(0.92rem, 2.2vw, 1.05rem);
  color: var(--muted);
  max-width: 620px;
}

/* ==================== ACTIONS / BUTTONS ==================== */
.actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 18px;
  font-size: clamp(0.82rem, 1.8vw, 0.92rem);
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  border: none;
  color: white;
  font-weight: 600;
}

.btn.primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn.secondary:hover {
  background: var(--panel-2);
}

/* ==================== GRID & CARDS ==================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(14px, 2.5vw, 20px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card h2 {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  margin-bottom: 10px;
  color: var(--text);
}

/* ==================== ASCII LOGO ==================== */
.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.logo pre {
  text-align: center;
  font-size: clamp(0.55rem, 1.8vw, 0.75rem);
  line-height: 1.15;
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  overflow: hidden;
}

/* ==================== CODE BLOCKS ==================== */
pre {
  margin-top: 12px;
  padding: clamp(10px, 2vw, 16px);
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: clamp(0.78rem, 1.8vw, 0.9rem);
  overflow-x: auto;
  line-height: 1.4;
}

/* ==================== TOPBAR (MOBILE) ==================== */
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 40;
}

.menu-btn {
  font-size: 1.4rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

/* ==================== CLOSE BUTTON ==================== */
.close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  margin-bottom: 16px;
  cursor: pointer;
  align-self: flex-end;
}

/* ==================== OVERLAY ==================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 45;
  display: none;
}

.overlay.show {
  display: block;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

/* Extra Small Phones (< 400px) */
@media (max-width: 399px) {
  .main {
    padding: 14px 12px 28px;
  }
  
  h1 {
    font-size: 1.45rem;
  }
  
  .kicker {
    font-size: 0.95rem;
  }
  
  .actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Small Phones (400px - 600px) */
@media (min-width: 400px) and (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Tablets (601px - 900px) */
@media (min-width: 601px) and (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  
  .main {
    max-width: 720px;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

/* Desktop (901px+) */
@media (min-width: 901px) {
  .sidebar {
    width: 260px;
  }
  
  .main {
    padding: 32px 40px 48px;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .main {
    max-width: 1200px;
    padding: 40px 60px 60px;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* ==================== MOBILE GLOBAL RULES ==================== */
@media (max-width: 900px) {
  .topbar {
    display: flex;
  }

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

  .close-btn {
    display: block;
  }
}